]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/startup.py
OSQA-266
[osqa.git] / forum / startup.py
index d203ab2dfec0e0e8e0beb85008504566f772cb90..a5ae1dbbc1a2f6526c962dac7e80f21fbf8320b7 100644 (file)
@@ -3,7 +3,7 @@ import os
 sys.path.append(os.path.join(os.path.dirname(__file__),'markdownext'))
 
 
-from forum.modules import get_modules_script, ui
+from forum.modules import get_modules_script
 
 get_modules_script('settings')
 get_modules_script('startup')
@@ -11,55 +11,7 @@ get_modules_script('startup')
 
 import forum.badges
 import forum.subscriptions
-
-
-from django.utils.translation import ugettext as _
-from django.core.urlresolvers import reverse
-from forum.templatetags.extra_tags import get_score_badge
-from forum import settings
-
-
-ui.register(ui.HEADER_LINKS,
-            ui.Link(_('faq'), ui.Url('faq'), weight=400),
-            ui.Link(_('about'), ui.Url('about'), weight=300),
-
-            ui.Link(
-                    text=lambda u, c: u.is_authenticated() and _('logout') or _('login'),
-                    url=lambda u, c: u.is_authenticated() and reverse('logout') or reverse('auth_signin'),
-                    weight=200),
-
-            ui.Link(
-                    visibility=ui.Visibility.AUTHENTICATED,
-                    text=lambda u, c: u.username,
-                    url=lambda u, c: u.get_profile_url(),
-                    post_code=lambda u, c: get_score_badge(u),
-                    weight=100),
-
-            ui.Link(
-                    visibility=ui.Visibility.SUPERUSER,
-                    text=_('administration'),
-                    url=lambda u, c: reverse('admin_index'),
-                    weight=0)
-
-)
-
-class SupportLink(ui.Link):    
-    def can_render(self, context):
-        return bool(settings.SUPPORT_URL)
-
-
-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),
-                    weight=400),
-            SupportLink(_('support'), settings.SUPPORT_URL, attrs={'target': '_blank'}, weight=300),
-            ui.Link(_('privacy'), ui.Url('privacy'), weight=200),
-            ui.Link(_('faq'), ui.Url('faq'), weight=100),
-            ui.Link(_('about'), ui.Url('about'), weight=0),
-)
-
-
+import forum.registry