Browse Source

add "register" button next to "login" if django-registration available

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
1a4e2ea101
  1. 2
      pyweb/mumble/templates/mumble/list.html
  2. 11
      pyweb/mumble/templates/mumble/mumble.html
  3. 2
      pyweb/processors.py
  4. 2
      pyweb/templates/index.html

2
pyweb/mumble/templates/mumble/list.html

@ -21,7 +21,7 @@
layout: "border", layout: "border",
title: gettext("Mumble Servers"), title: gettext("Mumble Servers"),
buttons: [ buttons: [
{% if user.is_staff and ROSETTA_INSTALLED %}
{% if user.is_staff and "rosetta" in INSTALLED_APPS %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Edit Translation'), text: gettext('Edit Translation'),

11
pyweb/mumble/templates/mumble/mumble.html

@ -35,14 +35,14 @@
height: 600, height: 600,
layout: "border", layout: "border",
tbar: [ { tbar: [ {
text: gettext("back"),
text: gettext("Back to the server list"),
xtype: "button", xtype: "button",
handler: function(){ handler: function(){
location.href = "{% url mumble.views.mumbles %}"; location.href = "{% url mumble.views.mumbles %}";
} }
} ], } ],
buttons: [ buttons: [
{% if user.is_staff and ROSETTA_INSTALLED %}
{% if user.is_staff and "rosetta" in INSTALLED_APPS %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Edit Translation'), text: gettext('Edit Translation'),
@ -59,6 +59,13 @@
{% if user.is_authenticated %} {% if user.is_authenticated %}
new Ext.ux.ButtonLogout() new Ext.ux.ButtonLogout()
{% else %} {% else %}
{% if 'registration' in INSTALLED_APPS %}
{
xtype: 'buttonIframeWindow',
text: gettext('Register'),
url: '{% url registration.views.register %}',
},
{% endif %}
new Ext.ux.ButtonLogin() new Ext.ux.ButtonLogin()
{% endif %} {% endif %}
], ],

2
pyweb/processors.py

@ -17,7 +17,7 @@
def installed_apps(request): def installed_apps(request):
from django.conf import settings from django.conf import settings
return { 'ROSETTA_INSTALLED': "rosetta" in settings.INSTALLED_APPS }
return { 'INSTALLED_APPS': settings.INSTALLED_APPS }
def mumble_version(request): def mumble_version(request):
from mumble import version_str from mumble import version_str

2
pyweb/templates/index.html

@ -31,7 +31,7 @@
{% endif %} {% endif %}
{% if user.is_staff %} {% if user.is_staff %}
<a href="{% url admin:index %}" target="_blank">{% trans "Administration" %}</a> | <a href="{% url admin:index %}" target="_blank">{% trans "Administration" %}</a> |
{% if ROSETTA_INSTALLED %}
{% if "rosetta" in INSTALLED_APPS %}
<a href="{% url rosetta.views.home %}" target="_blank">{% trans "Edit translations" %}</a> | <a href="{% url rosetta.views.home %}" target="_blank">{% trans "Edit translations" %}</a> |
{% endif %} {% endif %}
{% endif %} {% endif %}

Loading…
Cancel
Save