Browse Source
Extify the server list, resize the main panels when the size of the browser window changes
Natenom/support-murmur-13-1446181288462
Extify the server list, resize the main panels when the size of the browser window changes
Natenom/support-murmur-13-1446181288462
Michael Ziegler
15 years ago
3 changed files with 161 additions and 27 deletions
-
117pyweb/mumble/templates/mumble/list.html
-
51pyweb/mumble/templates/mumble/mumble.html
-
20pyweb/mumble/views.py
@ -1,24 +1,105 @@ |
|||
{% extends "index.html" %} |
|||
{% comment %} |
|||
<!-- kate: space-indent on; indent-width 2; replace-tabs on; --> |
|||
<!-- kate: space-indent on; indent-width 4; replace-tabs on; --> |
|||
{% endcomment %} |
|||
{% load i18n %} |
|||
{% load mumble_extras %} |
|||
{% block Headline %} |
|||
Configured Mumble Servers |
|||
{% load i18n %} |
|||
{% block body %} |
|||
{% endblock %} |
|||
{% block Content %} |
|||
<div class="rahmen"> |
|||
<ul> |
|||
{% for mumble in MumbleObjects %} |
|||
{% if mumble.booted %} |
|||
<li><a href="{% url mumble.views.show mumble.id %}">{{ mumble.name }}</a></li> |
|||
{% else %} |
|||
<li>{{ mumble.name }} (offline)</li> |
|||
{% endif %} |
|||
{% empty %} |
|||
{% trans "No server instances have been configured yet." %} |
|||
{% endfor %} |
|||
</ul> |
|||
</div> |
|||
{% block HeadTag %} |
|||
<script type="text/javascript" src="/jsi18n/"></script> |
|||
<script type="text/javascript" src="/mumble/api/api.js"></script> |
|||
<script type="text/javascript" src="{{ MEDIA_URL }}/js/buttoniframewindow.js"></script> |
|||
<script type="text/javascript" src="{{ MEDIA_URL }}/js/loginout_buttons.js"></script> |
|||
<script type="text/javascript"> |
|||
Ext.onReady( function(){ |
|||
Ext.QuickTips.init(); |
|||
mainpanel = new Ext.Panel({ |
|||
renderTo: document.body, |
|||
height: 600, |
|||
layout: "border", |
|||
title: gettext("Mumble Servers"), |
|||
buttons: [ |
|||
{% if user.is_staff and ROSETTA_INSTALLED %} |
|||
{ |
|||
xtype: 'buttonIframeWindow', |
|||
text: gettext('Edit Translation'), |
|||
url: '{% url rosetta-home %}', |
|||
}, |
|||
{% endif %} |
|||
{% if user.is_staff %} |
|||
{ |
|||
xtype: 'buttonIframeWindow', |
|||
text: gettext('Administration'), |
|||
url: '{% url admin:app_list "mumble" %}', |
|||
}, |
|||
{% endif %} |
|||
{% if user.is_authenticated %} |
|||
new Ext.ux.ButtonLogout() |
|||
{% else %} |
|||
new Ext.ux.ButtonLogin() |
|||
{% endif %} |
|||
], |
|||
items: [{ |
|||
xtype: "listview", |
|||
title: gettext("Available servers"), |
|||
region: "west", |
|||
width: 350, |
|||
split: true, |
|||
singleSelect: true, |
|||
store: new Ext.data.DirectStore({ |
|||
directFn: MumbleList.servers, |
|||
fields: [ 'id', 'name' ], |
|||
autoLoad: true |
|||
}), |
|||
columns: [{ |
|||
header: gettext("Name"), |
|||
dataIndex: "name", |
|||
width: 1. |
|||
}], |
|||
listeners: { |
|||
dblclick: function(listview){ |
|||
selectedstuff = listview.getSelectedRecords(); |
|||
MumbleList.serverurl( selectedstuff[0].data.id, function(provider, response){ |
|||
window.location.href = response.result; |
|||
}); |
|||
}, |
|||
selectionchange: function(listview, nodes){ |
|||
selectedstuff = listview.getSelectedRecords(); |
|||
MumbleList.serverinfo( selectedstuff[0].data.id, function(provider, response){ |
|||
mainpanel.descrippanel.el.dom.innerHTML = String.format( |
|||
"<ul><li>Serveradresse: {0}</li><li>Version: {1}</li></ul>"+ |
|||
"<br /><fieldset><legend>Willkommensnachricht</legend>{2}</fieldset>", |
|||
response.result.connurl, |
|||
response.result.version, |
|||
response.result.motd |
|||
); |
|||
}); |
|||
} |
|||
}, |
|||
}, { |
|||
xtype: "panel", |
|||
region: "center", |
|||
title: gettext("Server overview"), |
|||
ref: 'descrippanel', |
|||
html: "here goez teh servur descripshun", |
|||
}], |
|||
}); |
|||
function updateLayout(){ |
|||
viewsize = { |
|||
width: Ext.lib.Dom.getViewWidth(), |
|||
height: Ext.lib.Dom.getViewHeight() |
|||
}; |
|||
mainpanel.setHeight( viewsize.height - 20 ); |
|||
mainpanel.setWidth( viewsize.width - 40 ); |
|||
} |
|||
updateLayout(); |
|||
Ext.EventManager.onWindowResize(updateLayout); |
|||
} ); |
|||
</script> |
|||
<style type="text/css"> |
|||
body { |
|||
padding: 20px 20px 0 20px; |
|||
} |
|||
</style> |
|||
{% endblock %} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue