]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/registry.py
OSQA-236, modifying the flagged content daily digest, now we count only the items...
[osqa.git] / forum / registry.py
index 6fad2f00d0f7fe04d56cc12487acfe11fde31136..aedf5b0d1b0e1dbcc4d773ff8a4d4c3a021cfb87 100644 (file)
@@ -1,11 +1,19 @@
-from forum.modules import ui
+from forum.modules import ui, get_modules_script
 from django.utils.translation import ugettext as _
 from django.core.urlresolvers import reverse
 from django.template.defaultfilters import slugify
+from django.template import get_templatetags_modules
 from forum.templatetags.extra_tags import get_score_badge
+from forum.utils.html import cleanup_urls
 from forum import settings
 
 
+modules_template_tags = get_modules_script('templatetags')
+django_template_tags = get_templatetags_modules()
+
+for m in modules_template_tags:
+    django_template_tags.append(m.__name__)
+
 ui.register(ui.HEADER_LINKS,
             ui.Link(_('faq'), ui.Url('faq'), weight=400),
             ui.Link(_('about'), ui.Url('about'), weight=300),
@@ -38,7 +46,7 @@ class SupportLink(ui.Link):
 ui.register(ui.FOOTER_LINKS,
             ui.Link(
                     text=_('contact'),
-                    url=lambda u, c: settings.CONTACT_URL and settings.CONTACT_URL or "%s?next=%s" % (reverse('feedback'), c['request'].path),
+                    url=lambda u, c: settings.CONTACT_URL and settings.CONTACT_URL or "%s?next=%s" % (reverse('feedback'), cleanup_urls( c['request'].path)),
                     weight=400),
             SupportLink(_('support'), settings.SUPPORT_URL, attrs={'target': '_blank'}, weight=300),
             ui.Link(_('privacy'), ui.Url('privacy'), weight=200),
@@ -73,6 +81,11 @@ ui.register(ui.USER_MENU,
                 span_attrs={'class': 'user-subscriptions'},
                 weight=200
             ),
+            ui.UserMenuItem(
+                label=_("other preferences"),
+                url=lambda u, c: reverse('user_preferences', kwargs={'id': c['user'].id, 'slug': slugify(c['user'].username)}),
+                weight=200
+            ),
             ModerationMenuGroup(_("Moderation tools"), items=(
                 ui.UserMenuItem(
                     label=lambda u, c: c['user'].is_suspended() and _("withdraw suspension") or _("suspend this user"),