Move registration app links to a separate module
This commit is contained in:
@@ -1,22 +1,15 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.dispatch import receiver
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from south.signals import post_migrate
|
||||
|
||||
from common import about_view, license_view
|
||||
from navigation.api import register_links
|
||||
|
||||
from .links import form_view
|
||||
from .models import RegistrationSingleton
|
||||
|
||||
|
||||
def is_not_registered(context):
|
||||
return RegistrationSingleton.registration_state() is False
|
||||
|
||||
|
||||
form_view = {'text': _('Registration'), 'view': 'form_view', 'famfam': 'telephone', 'condition': is_not_registered}
|
||||
|
||||
register_links(['form_view'], [about_view, license_view], menu_name='secondary_menu')
|
||||
register_links(['form_view', 'about_view', 'license_view'], [form_view], menu_name='secondary_menu')
|
||||
|
||||
|
||||
12
mayan/apps/registration/links.py
Normal file
12
mayan/apps/registration/links.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .models import RegistrationSingleton
|
||||
|
||||
|
||||
def is_not_registered(context):
|
||||
return RegistrationSingleton.registration_state() is False
|
||||
|
||||
|
||||
form_view = {'text': _('Registration'), 'view': 'form_view', 'famfam': 'telephone', 'condition': is_not_registered}
|
||||
Reference in New Issue
Block a user