Add app url namespacing to the common and main apps, fix missing namespace in the registration app, remove explict reverse_lazy for the LOGIN_URL and LOGIN_REDIRECT_URL these are expected to be views or URLs (failover)
This commit is contained in:
@@ -11,7 +11,7 @@ from .conf.settings import DISABLE_HOME_VIEW
|
||||
from .links import admin_site, diagnostics, maintenance_menu, sentry
|
||||
|
||||
if not DISABLE_HOME_VIEW:
|
||||
register_top_menu('home', link={'text': _(u'home'), 'view': 'home', 'famfam': 'house'}, position=0)
|
||||
register_top_menu('home', link={'text': _(u'home'), 'view': 'main:home', 'famfam': 'house'}, position=0)
|
||||
|
||||
if 'django.contrib.admin' in settings.INSTALLED_APPS:
|
||||
register_setup(admin_site)
|
||||
|
||||
@@ -5,7 +5,7 @@ def is_superuser(context):
|
||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
||||
|
||||
|
||||
maintenance_menu = {'text': _(u'maintenance'), 'view': 'maintenance_menu', 'famfam': 'wrench', 'icon': 'wrench.png'}
|
||||
diagnostics = {'text': _(u'diagnostics'), 'view': 'diagnostics', 'famfam': 'pill', 'icon': 'pill.png'}
|
||||
sentry = {'text': _(u'sentry'), 'view': 'sentry', 'famfam': 'bug', 'icon': 'bug.png', 'condition': is_superuser}
|
||||
maintenance_menu = {'text': _(u'maintenance'), 'view': 'main:maintenance_menu', 'famfam': 'wrench', 'icon': 'wrench.png'}
|
||||
diagnostics = {'text': _(u'diagnostics'), 'view': 'main:diagnostics', 'famfam': 'pill', 'icon': 'pill.png'}
|
||||
sentry = {'text': _(u'sentry'), 'view': 'main:sentry', 'famfam': 'bug', 'icon': 'bug.png', 'condition': is_superuser}
|
||||
admin_site = {'text': _(u'admin site'), 'view': 'admin:index', 'famfam': 'keyboard', 'icon': 'keyboard.png', 'condition': is_superuser}
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
{% else %}
|
||||
{% if not web_theme_hide_menus %}
|
||||
<div id="header">
|
||||
<h1><a href="{% url 'home' %}">{% project_name %}{% if debug %} {% trans "(DEBUG)" %}{% endif %} - {% registered_name %}</a></h1>
|
||||
<h1><a href="{% url 'main:home' %}">{% project_name %}{% if debug %} {% trans "(DEBUG)" %}{% endif %} - {% registered_name %}</a></h1>
|
||||
<div id="main-navigation">
|
||||
<ul class="wat-cf" style="width: 73%;">
|
||||
{% get_top_menu_links %}
|
||||
@@ -172,14 +172,14 @@
|
||||
{% trans 'Anonymous' %}
|
||||
{% else %}
|
||||
{{ user.get_full_name|default:user }}
|
||||
<a href="{% url 'current_user_details' %}" title="{% trans 'User details' %}"><span class="famfam active famfam-vcard"></span></a>
|
||||
<a href="{% url 'common:current_user_details' %}" title="{% trans 'User details' %}"><span class="famfam active famfam-vcard"></span></a>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
{% get_setting "MIDDLEWARE_CLASSES" as middleware_classes %}
|
||||
{% if 'django.middleware.locale.LocaleMiddleware' in middleware_classes %}
|
||||
<li>
|
||||
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
|
||||
<form action="{% url 'common:set_language' %}" method="post">{% csrf_token %}
|
||||
<select name="language" onchange="this.form.submit()">
|
||||
{% for lang in LANGUAGES %}
|
||||
<option value="{{ lang.0 }}" {% if lang.0 == LANGUAGE_CODE %}selected="selected"{% endif %}>{{ lang.0|language_name_local|capfirst }}</option>
|
||||
@@ -189,7 +189,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% get_setting "LOGIN_URL" as login_url %}
|
||||
<li><a class="logout" href="{% if not user.is_authenticated %}{% url 'login_view' %}?next=/{% else %}{% url 'logout_view' %}{% endif %}">{% if not user.is_authenticated %}{% trans 'Login' %}{% else %}{% trans 'Logout' %}{% endif %}</a></li>
|
||||
<li><a class="logout" href="{% if not user.is_authenticated %}{% url 'common:login_view' %}?next=/{% else %}{% url 'common:logout_view' %}{% endif %}">{% if not user.is_authenticated %}{% trans 'Login' %}{% else %}{% trans 'Logout' %}{% endif %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ from .conf.settings import DISABLE_HOME_VIEW
|
||||
|
||||
def home(request):
|
||||
if DISABLE_HOME_VIEW:
|
||||
return HttpResponseRedirect(reverse('document_list_recent'))
|
||||
return HttpResponseRedirect(reverse('documents:document_list_recent'))
|
||||
else:
|
||||
return render_to_response('main/home.html', {},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user