From: Eevee Date: Mon, 7 Dec 2009 05:14:54 +0000 (-0800) Subject: Spruced up UI a little bit. X-Git-Url: http://git.veekun.com/zzz-floof.git/commitdiff_plain/b0ad3cb49cc07e32a24cc0119a05c7faf245ae19 Spruced up UI a little bit. 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. --- diff --git a/floof/controllers/account.py b/floof/controllers/account.py index b48dc25..6459791 100644 --- a/floof/controllers/account.py +++ b/floof/controllers/account.py @@ -79,6 +79,7 @@ class AccountController(BaseController): # 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('/') diff --git a/floof/lib/helpers.py b/floof/lib/helpers.py index 14f92d0..9fbfa7d 100644 --- a/floof/lib/helpers.py +++ b/floof/lib/helpers.py @@ -12,7 +12,8 @@ from pylons import config, url # 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() diff --git a/floof/public/layout.css b/floof/public/layout.css index 7a7308b..6f289a4 100644 --- a/floof/public/layout.css +++ b/floof/public/layout.css @@ -5,6 +5,8 @@ body { font-family: sans-serif; font-size: 12px; } #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; } diff --git a/floof/templates/account/register.mako b/floof/templates/account/register.mako index 2de23a4..70d64b0 100644 --- a/floof/templates/account/register.mako +++ b/floof/templates/account/register.mako @@ -4,7 +4,7 @@ ${h.form(url('register_finish'), method='POST')}
-
Username
+
Username—lowercase letters, digits, and hyphens only; no more than 20 characters
${h.text('username', value=c.username)}
${h.submit(None, 'Register')}
diff --git a/floof/templates/art/show.mako b/floof/templates/art/show.mako index 3ea3849..e13c295 100644 --- a/floof/templates/art/show.mako +++ b/floof/templates/art/show.mako @@ -5,19 +5,41 @@

Viewing Art

-% 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()} +
+ +
+ +

Tags

+ + + +% if c.user:

What do you think?

${h.form (h.url("rate_art", id=c.art.id), method="put")} % for score,text in sorted(Rating.options.items()): @@ -32,17 +54,4 @@ ${h.submit('score', text)} ${h.end_form()} % endif -

Relations

- - - - ${comments.comment_block(c.art.discussion.comments)} diff --git a/floof/templates/comments/lib.mako b/floof/templates/comments/lib.mako index e822a17..93fe086 100644 --- a/floof/templates/comments/lib.mako +++ b/floof/templates/comments/lib.mako @@ -1,5 +1,5 @@ <%def name="comment_block(comments)"> -

${len(comments)} comments

+

${len(comments)} comment${'' if len(comments) == 1 else 's'}

View all

Reply

${comment_thread(comments)}