merged with mine
authorNick Retallack <nickretallack@gmil.com>
Mon, 5 Oct 2009 17:44:08 +0000 (10:44 -0700)
committerNick Retallack <nickretallack@gmil.com>
Mon, 5 Oct 2009 17:44:08 +0000 (10:44 -0700)
1  2 
floof/config/routing.py
floof/templates/art/show.mako

diff --combined floof/config/routing.py
@@@ -22,7 -22,6 +22,7 @@@ def make_map()
  
      map.connect('/', controller='main', action='index')
  
 +    # User stuff
      map.connect('/account/login', controller='account', action='login')
      map.connect('/account/login_begin', controller='account', action='login_begin', **require_POST)
      map.connect('/account/login_finish', controller='account', action='login_finish')
      map.connect('/users', controller='users', action='list')
      map.connect('/users/{name}', controller='users', action='view')
  
 +    # Art stuff
 +    map.connect('/art/new', controller='art', action='new')
 +    map.connect('/art/upload', controller='art', action='upload')
 +    map.connect('/art/{id}', controller='art', action='show')
 +    map.connect('/art/{id}/tag', controller='art', action='tag')
 +
 +    map.connect('/tag/{id}/delete', controller='tag', action='delete')
 +
      map.connect('/search', controller='search', action='index')
  
+     # default routing is back so we can test stuff.
+     # please don't take it away until we have some more core features in.
+     map.connect('/{controller}/{action}')
+     map.connect('/{controller}/{action}/{id}')
      return map
@@@ -1,5 -1,7 +1,7 @@@
  <%inherit file="/base.mako" />
  
+ <%! from floof.model.art import Rating %>
  <h1>View Art</h1>
  
  ${h.form (h.url_for (controller='art', action='tag', id=c.art.id), multipart=True)}
@@@ -8,10 -10,18 +10,18 @@@ ${h.submit('submit', 'Tag!')
  ${h.end_form()}
  
  % for tag in c.art.tags:
 -<a href="${h.url_for (controller='tag', action='delete', id=tag.id)}">x</a> 
 -<a href="${h.url_for (controller='search', action='index')}?query=${tag}">${tag}</a>
 +<a href="${url(controller='tag', action='delete', id=tag.id)}">x</a>
 +<a href="${url(controller='search', action='index', query=tag)}">${tag}</a>
  % endfor
  
+ What do you think?
+ % for score,text in sorted(Rating.options.items()):
+ <a href="${h.url_for(controller='art', action='rate', id=c.art.id)}?score=${score}" \
+ % if c.your_score == score:
+ class="selected" \
+ % endif
+ >${text}</a> 
+ % endfor
  
  <img class="full" src="${c.art.get_path()}">