3 sys.path.append(os.path.join(os.path.dirname(__file__),'markdownext'))
6 from forum.modules import get_modules_script, ui
8 get_modules_script('settings')
9 get_modules_script('startup')
13 import forum.subscriptions
16 from django.utils.translation import ugettext as _
17 from django.core.urlresolvers import reverse
18 from forum.templatetags.extra_tags import get_score_badge
19 from forum import settings
22 ui.register(ui.HEADER_LINKS,
23 ui.Link(_('faq'), ui.Url('faq'), weight=400),
24 ui.Link(_('about'), ui.Url('about'), weight=300),
27 text=lambda u, c: u.is_authenticated() and _('logout') or _('login'),
28 url=lambda u, c: u.is_authenticated() and reverse('logout') or reverse('auth_signin'),
32 visibility=ui.Visibility.AUTHENTICATED,
33 text=lambda u, c: u.username,
34 url=lambda u, c: u.get_profile_url(),
35 post_code=lambda u, c: get_score_badge(u),
39 visibility=ui.Visibility.SUPERUSER,
40 text=_('administration'),
41 url=lambda u, c: reverse('admin_index'),
46 class SupportLink(ui.Link):
47 def can_render(self, context):
48 return bool(settings.SUPPORT_URL)
51 ui.register(ui.FOOTER_LINKS,
54 url=lambda u, c: settings.CONTACT_URL and settings.CONTACT_URL or "%s?next=%s" % (reverse('feedback'), c['request'].path),
56 SupportLink(_('support'), settings.SUPPORT_URL, attrs={'target': '_blank'}, weight=300),
57 ui.Link(_('privacy'), ui.Url('privacy'), weight=200),
58 ui.Link(_('faq'), ui.Url('faq'), weight=100),
59 ui.Link(_('about'), ui.Url('about'), weight=0),