From: Nick Retallack Date: Mon, 7 Dec 2009 02:31:22 +0000 (-0800) Subject: merged conflicting stuff. Added 'me' tag X-Git-Url: http://git.veekun.com/zzz-floof.git/commitdiff_plain/a6d7a53b0cc7a8f8629e8e1272a56d3c51179317?hp=36dba08534b4309de0e0746784e2a6c5bb854030 merged conflicting stuff. Added 'me' tag --- diff --git a/floof/lib/tags.py b/floof/lib/tags.py index 9bfdf04..d2adafc 100644 --- a/floof/lib/tags.py +++ b/floof/lib/tags.py @@ -2,6 +2,9 @@ from floof.model import Art, ArtUser, ArtUserType, Tag, TagText, User import elixir from dbhelpers import find_or_create import re + +from pylons import c + def parse(search_string): """Parses a search query, and returns a query object on Art. @@ -25,6 +28,8 @@ def parse(search_string): # This is a special tag; at the moment, by/for/of to indicate # related users prefix, tag = tag.split(':', 1) + if tag == 'me': + tag = c.user.name # XXX what to do if this fails? abort? return empty query? target_user = User.get_by(name=tag) diff --git a/floof/templates/users/view.mako b/floof/templates/users/view.mako index 5c2e8e6..3bff21a 100644 --- a/floof/templates/users/view.mako +++ b/floof/templates/users/view.mako @@ -21,8 +21,8 @@ ${h.form(url(controller='user_settings', action='rel_toggle', name=c.user.name.l % endif % endif -<%! from floof.lib.search import parse %> +<%! from floof.lib.tags import parse %> % for gallery in c.this_user.primary_page.galleries:

${gallery.string}

-${macros.thumbs(parse(gallery.string))} +${macros.thumbs(parse(gallery.search.string))} % endfor