X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/d2410575d72f68d7777c4344600b1af75f2515c1..e28770970915d09e68ad5fc2d83d6ca007faf2ae:/forum/startup.py diff --git a/forum/startup.py b/forum/startup.py index 4d605c3..7f06bfb 100644 --- a/forum/startup.py +++ b/forum/startup.py @@ -2,8 +2,7 @@ import sys 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,47 +10,8 @@ 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 - - -ui.register_multi(ui.HEADER_LINKS, - ui.UiLinkObject(_('faq'), 'faq', weight=400), - ui.UiLinkObject(_('about'), 'about', weight=300), - - ui.UiLinkObject( - text=lambda c: c['request'].user.is_authenticated() and _('logout') or _('login'), - url=lambda c: c['request'].user.is_authenticated() and reverse('logout') or reverse('auth_signin'), - weight=200), - - ui.UiLinkObject( - user_level=ui.LoggedInUserUiObject(), - text=lambda c: c['request'].user.username, - url=lambda c: c['request'].user.get_profile_url(), - post_code=lambda c: get_score_badge(c['request'].user), - weight=100), - - ui.UiLinkObject( - user_level=ui.SuperuserUiObject(), - text=_('administration'), - url=lambda c: reverse('admin_index'), - weight=0) - -) - - -ui.register_multi(ui.PAGE_TOP_TABS, - ui.UiTopPageTabObject('questions', _('questions'), 'questions', weight=0), - ui.UiTopPageTabObject('tags', _('tags'), 'tags', weight=100), - ui.UiTopPageTabObject('users', _('users'), 'users', weight=200), - ui.UiTopPageTabObject('badges', _('badges'), 'badges', weight=300), - ui.UiTopPageTabObject('unanswered', _('unanswered questions'), 'unanswered', weight=400), -) - -#register.header_link(lambda c: (_('faq'), reverse('faq'))) +import forum.registry +get_modules_script('registry')