Browse Source

hide registration tab for unauthed users

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
c1b8b9ad97
  1. 143
      pyweb/mumble/templates/mumble/mumble.html

143
pyweb/mumble/templates/mumble/mumble.html

@ -106,85 +106,88 @@
items: [{ items: [{
title: gettext("Server info"), title: gettext("Server info"),
html: renderserverinfos( {{ ServerDict|safe }} ), html: renderserverinfos( {{ ServerDict|safe }} ),
}, {
title: gettext("Registration"),
xtype: "{{ RegForm|lower }}",
pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %},
labelWidth: 150,
baseParams: {serverid: {{MumbleServer.id}} },
}, },
{% if MumbleAccount %}
{% if IsAdmin %}
{% if user.is_authenticated %}
{ {
title: gettext("Administration"),
pk: {{ MumbleServer.id }},
title: gettext("Registration"),
xtype: "{{ RegForm|lower }}",
pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %},
labelWidth: 150, labelWidth: 150,
xtype: 'mumbleform',
baseParams: {serverid: {{MumbleServer.id}} },
}, },
{% endif %}
{
title: gettext("User texture"),
layout: "border",
items: [{
region: "north",
layout: "hbox",
height: 200,
{% if MumbleAccount %}
{% if IsAdmin %}
{
title: gettext("Administration"),
pk: {{ MumbleServer.id }},
labelWidth: 150,
xtype: 'mumbleform',
},
{% endif %}
{
title: gettext("User texture"),
layout: "border",
items: [{ items: [{
flex: 1,
region: "north",
layout: "hbox",
height: 200, height: 200,
title: gettext("Texture"),
html: String.format('<img src="{0}" alt="Avatar" id="img_avatar" />',
"{% url mumble.views.showTexture MumbleServer.id MumbleAccount.id %}"),
items: [{
flex: 1,
height: 200,
title: gettext("Texture"),
html: String.format('<img src="{0}" alt="Avatar" id="img_avatar" />',
"{% url mumble.views.showTexture MumbleServer.id MumbleAccount.id %}"),
}, {
flex: 1,
height: 200,
title: gettext("Gravatar"),
html: String.format('<img src="{0}" alt="grAvatar" />', "{{ MumbleAccount.gravatar }}"),
}],
}, { }, {
flex: 1,
height: 200,
title: gettext("Gravatar"),
html: String.format('<img src="{0}" alt="grAvatar" />', "{{ MumbleAccount.gravatar }}"),
region: "center",
xtype: "form",
labelWidth: 150,
fileUpload: true,
url: "{% url mumble.views.update_avatar MumbleAccount.id %}",
items: [{
name: "usegravatar",
fieldLabel: gettext("Use Gravatar"),
xtype: "checkbox",
}, {
name: "texturefile",
fieldLabel: gettext("Upload Avatar"),
xtype: "textfield",
inputType: "file",
}],
buttons: [{
text: gettext('Submit'),
handler: function(){
this.ownerCt.ownerCt.getForm().submit({
success: function(form, action){
var now = new Date();
var img = Ext.fly("img_avatar");
img.dom.src = String.format("{0}?_dc={1}",
"{% url mumble.views.showTexture MumbleServer.id MumbleAccount.id %}",
now.getTime()
);
}
});
},
}],
}], }],
}, {
region: "center",
xtype: "form",
labelWidth: 150,
fileUpload: true,
url: "{% url mumble.views.update_avatar MumbleAccount.id %}",
items: [{
name: "usegravatar",
fieldLabel: gettext("Use Gravatar"),
xtype: "checkbox",
},
{% if IsAdmin %}
{
xtype: "userEditorPanel",
server: {{ MumbleServer.id }}
}, { }, {
name: "texturefile",
fieldLabel: gettext("Upload Avatar"),
xtype: "textfield",
inputType: "file",
}],
buttons: [{
text: gettext('Submit'),
handler: function(){
this.ownerCt.ownerCt.getForm().submit({
success: function(form, action){
var now = new Date();
var img = Ext.fly("img_avatar");
img.dom.src = String.format("{0}?_dc={1}",
"{% url mumble.views.showTexture MumbleServer.id MumbleAccount.id %}",
now.getTime()
);
}
});
},
}],
}],
},
{% if IsAdmin %}
{
xtype: "userEditorPanel",
server: {{ MumbleServer.id }}
}, {
xtype: 'logViewerPanel',
server: {{ MumbleServer.id }}
}, {
xtype: 'banViewerPanel',
server: {{ MumbleServer.id }}
}
xtype: 'logViewerPanel',
server: {{ MumbleServer.id }}
}, {
xtype: 'banViewerPanel',
server: {{ MumbleServer.id }}
}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
], ],

Loading…
Cancel
Save