3ea3849c5800981831fb2199ecd721e982d929fd
[zzz-floof.git] / floof / templates / art / show.mako
1 <%inherit file="/base.mako" />
2 <%namespace name="comments" file="/comments/lib.mako" />
3
4 <%! from floof.model import Rating %>
5
6 <h1>Viewing Art</h1>
7
8 % if c.user:
9 ${h.form (h.url("art_tags", art_id=c.art.id))}
10 Add Some Tags: ${h.text('tags')}
11 ${h.submit('submit', 'Tag!')}
12 ${h.end_form()}
13
14 % for tag in c.art.tags:
15 ${h.form(h.url("art_tag", art_id=c.art.id, id=tag.id), method="delete")}
16 ${h.submit('delete', 'X')}
17 <a href="${url(controller='search', action='index', query=tag)}">${tag}</a>
18 ${h.end_form()}
19 % endfor
20
21 <h2>What do you think?</h2>
22 ${h.form (h.url("rate_art", id=c.art.id), method="put")}
23 % for score,text in sorted(Rating.options.items()):
24
25 % if c.your_score == score:
26 ${h.submit('score', text, class_="selected")}
27 % else:
28 ${h.submit('score', text)}
29 % endif
30
31 % endfor
32 ${h.end_form()}
33 % endif
34
35 <h2>Relations</h2>
36 <ul>
37 % for label, relations in (('Artist', c.art.artists), \
38                                ('Recipient', c.art.recipients), \
39                                ('Participant', c.art.participants)):
40 % for user in relations:
41 <li>${label}: <a href="${h.url('user_page', name=user.name)}">${user.name}</a>
42 % endfor
43 % endfor
44 </ul>
45
46 <img class="full" src="${h.storage_url('art/medium', c.art.hash)}">
47
48 ${comments.comment_block(c.art.discussion.comments)}