Logging in now produces a flash message. Flash box is styled.
Registration mentions constraints on usernames.
Art view page has the art at the top, and relations are merged with
tags.
# Remember who's logged in, and we're good to go
session['user_id'] = user.id
session.save()
# Remember who's logged in, and we're good to go
session['user_id'] = user.id
session.save()
+ h.flash(u'You are now logged in.')
# XXX send me where I came from
redirect('/')
# XXX send me where I came from
redirect('/')
# Scaffolding helper imports
from webhelpers.html.tags import *
# Scaffolding helper imports
from webhelpers.html.tags import *
-from webhelpers.html import literal
+from webhelpers.html.tools import *
+from webhelpers.html import HTML, literal
from webhelpers.pylonslib import Flash
import sqlalchemy.types as types
flash = Flash()
from webhelpers.pylonslib import Flash
import sqlalchemy.types as types
flash = Flash()
#header #user { float: right; }
#header #user form p { margin: 0; }
#header #user { float: right; }
#header #user form p { margin: 0; }
+#flash-messages { margin: 1em; padding: 1em; border: 3px double #c0c0c0; }
+
#body { padding: 1em; }
#footer { padding: 1em; background: #c0c0c0; }
#body { padding: 1em; }
#footer { padding: 1em; background: #c0c0c0; }
${h.form(url('register_finish'), method='POST')}
<dl class="form">
${h.form(url('register_finish'), method='POST')}
<dl class="form">
+ <dt>Username—lowercase letters, digits, and hyphens only; no more than 20 characters</dt>
<dd>${h.text('username', value=c.username)}</dd>
<dd>${h.submit(None, 'Register')}</dd>
<dd>${h.text('username', value=c.username)}</dd>
<dd>${h.submit(None, 'Register')}</dd>
-% if c.user:
-${h.form (h.url("art_tags", art_id=c.art.id))}
-Add Some Tags: ${h.text('tags')}
-${h.submit('submit', 'Tag!')}
-${h.end_form()}
+<div>
+ <img class="full" src="${h.storage_url('art/medium', c.art.hash)}">
+</div>
+
+<h2>Tags</h2>
+<ul>
+## Relations
+% for label, relations in (('Artist', c.art.artists), \
+ ('Recipient', c.art.recipients), \
+ ('Participant', c.art.participants)):
+ % for user in relations:
+ <li>${label}: <a href="${h.url('user_page', name=user.name)}">${user.name}</a>
+ % endfor
+% endfor
% for tag in c.art.tags:
${h.form(h.url("art_tag", art_id=c.art.id, id=tag.id), method="delete")}
% for tag in c.art.tags:
${h.form(h.url("art_tag", art_id=c.art.id, id=tag.id), method="delete")}
-${h.submit('delete', 'X')}
+${h.HTML.input(type='image', src='/icons/overlay/tag--minus.png', alt='[Remove]')}
<a href="${url(controller='search', action='index', query=tag)}">${tag}</a>
${h.end_form()}
% endfor
<a href="${url(controller='search', action='index', query=tag)}">${tag}</a>
${h.end_form()}
% endfor
+% if c.user:
+${h.form(h.url("art_tags", art_id=c.art.id))}
+<p>
+ ${h.image('/icons/overlay/tag--plus.png', '')}
+ ${h.text('tags')} ${h.submit(None, 'Add tags!')}
+</p>
+${h.end_form()}
+% endif
+</ul>
+
+
+% if c.user:
<h2>What do you think?</h2>
${h.form (h.url("rate_art", id=c.art.id), method="put")}
% for score,text in sorted(Rating.options.items()):
<h2>What do you think?</h2>
${h.form (h.url("rate_art", id=c.art.id), method="put")}
% for score,text in sorted(Rating.options.items()):
-<h2>Relations</h2>
-<ul>
-% for label, relations in (('Artist', c.art.artists), \
- ('Recipient', c.art.recipients), \
- ('Participant', c.art.participants)):
-% for user in relations:
-<li>${label}: <a href="${h.url('user_page', name=user.name)}">${user.name}</a>
-% endfor
-% endfor
-</ul>
-
-<img class="full" src="${h.storage_url('art/medium', c.art.hash)}">
-
${comments.comment_block(c.art.discussion.comments)}
${comments.comment_block(c.art.discussion.comments)}
<%def name="comment_block(comments)">
<%def name="comment_block(comments)">
-<h1>${len(comments)} comments</h1>
+<h1>${len(comments)} comment${'' if len(comments) == 1 else 's'}</h1>
<p><a href="${url(controller='comments', action='thread', owner_url=h.get_comment_owner_url(**c.route))}">View all</a></p>
<p><a href="${url(controller='comments', action='reply', owner_url=h.get_comment_owner_url(**c.route))}">Reply</a></p>
${comment_thread(comments)}
<p><a href="${url(controller='comments', action='thread', owner_url=h.get_comment_owner_url(**c.route))}">View all</a></p>
<p><a href="${url(controller='comments', action='reply', owner_url=h.get_comment_owner_url(**c.route))}">Reply</a></p>
${comment_thread(comments)}