Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

177 lines
6.2 KiB

{% extends "index.htm" %}
{% load mumble_extras %}
{% block Headline %}
{{ DBaseObject.name }}
{% endblock %}
{% block LeftColumn %}
{{ DBaseObject|chanview:MumbleAccount }}
{% endblock %}
{% block Content %}
<noscript>
<p>
<b>Hint:</b><br />
This area is used to display additional information for each channel and player, but requires JavaScript to be
displayed correctly. You will not see the detail pages, but you can use all links and forms
that are displayed.
</p>
</noscript>
<div id="mumble_ext_container"></div>
<div id="mumble_motd" class="mumble-ext x-hide-display">
<ul>
<li>Server address: <a href="{{ DBaseObject.connecturl }}">{{ DBaseObject.connecturl }}</a></li>
{% if DBaseObject.url %}
<li>Website: {{ DBaseObject.url|urlize }}</li>
{% endif %}
<li>Server version: {{ DBaseObject.version.0 }}.{{ DBaseObject.version.1 }}.{{ DBaseObject.version.2 }}</li>
</ul>
<fieldset>
<legend>Welcome message</legend>
{{ DBaseObject.motd|safe }}
</fieldset>
</div>
<div id="mumble_registration" class="mumble-ext">
{% if user.is_authenticated %}
<h2>Server registration</h2>
<form action="" method="post">
{% if Registered %}
You are registered on this server.<br />
{% else %}
You do not have an account on this server.<br />
{% endif %}
<table>
{{ RegForm }}
</table>
<input type="hidden" name="mode" value="reg" />
<input type="submit" />
</form>
{% else %}
<p>You need to be <a href="/accounts/login?next=%2Fmumble%2F{{ DBaseObject.id }}">logged in</a> to be able to register an account on this Mumble server.</p>
{% endif %}
</div>
{% if Registered %}
<div id="mumble_texture" class="mumble-ext">
<h2>User Texture</h2>
<p>
You can upload an image that you would like to use as your user texture here.<br />
Your current texture is:<br />
<img src="/mumble/{{DBaseObject.id}}/texture.png" alt="user texture" /><br />
Hint: The texture image <b>needs</b> to be 600x60 in size. If you upload an image with
a different size, it will be resized accordingly.<br />
</p>
<form action="" method="post" enctype="multipart/form-data">
<table>
{{ TextureForm }}
</table>
<input type="hidden" name="mode" value="texture" />
<input type="submit" />
</form>
</div>
{% endif %}
{% if CurrentUserIsAdmin %}
<div id="mumble_admin" class="mumble-ext">
<h2>Server administration</h2>
<form action="" method="post">
<table>
{{ AdminForm }}
</table>
<input type="hidden" name="mode" value="admin" />
<input type="submit" />
</form>
</div>
{% endif %}
{% for item in ChannelTable %}
{% if item.is_player %}
<div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
<h2>Player {{ item.name }}</h2>
<ul>
<li>Online since {{item.onlinesince|time:"H:i"}}</li>
<li>Authenticated: {% if item.isAuthed %}Yes{% else %}No{% endif %}</li>
<li>Admin: {% if item.isAdmin %}Yes{% else %}No{% endif %}</li>
<li>Muted: {% if item.muted %}Yes{% else %}No{% endif %}</li>
<li>Deafened: {% if item.deafened %}Yes{% else %}No{% endif %}</li>
<li>Self-Muted: {% if item.selfmuted %}Yes{% else %}No{% endif %}</li>
<li>Self-Deafened: {% if item.selfdeafened %}Yes{% else %}No{% endif %}</li>
</ul>
{% if item.mumbleuser and item.mumbleuser.owner %}
<h2>User {{ item.mumbleuser.owner.username|capfirst }}</h2>
<ul>
{% if item.mumbleuser.owner.first_name and item.mumbleuser.owner.last_name %}
<li>Full Name: {{ item.mumbleuser.owner.first_name }} {{ item.mumbleuser.owner.last_name }}</li>
{% endif %}
<li>Admin: {% if item.mumbleuser.owner.is_staff %}Yes{% else %}No{% endif %}</li>
<li>Sign-up date: {{ item.mumbleuser.owner.date_joined }}</li>
</ul>
{% endif %}
</div>
{% else %}
<div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
<h2>Channel {{ item.name }}</h2>
<a href="{{ item|chanurl:MumbleAccount }}" class="mumble">Connect</a>
{% if item.description %}
<fieldset>
<legend>Channel description</legend>
{{ item.description|safe }}
</fieldset>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endblock %}
{% block HeadTag %}
<script type="text/javascript">
Ext.onReady( function(){
Ext.get( 'mumble_registration' ).addClass( 'x-hide-display' );
{% if Registered %}
Ext.get( 'mumble_texture' ).addClass( 'x-hide-display' );
{% endif %}
{% if CurrentUserIsAdmin %}
Ext.get( 'mumble_admin' ).addClass( 'x-hide-display' );
{% endif %}
var cardpanel = new Ext.Panel({
renderTo: 'mumble_ext_container',
layout: 'card',
id: 'mumble_container',
height: 570,
activeItem: 0,
border: false,
items: [ {
id: 'mumble_tabpanel',
xtype: 'tabpanel',
defaults: { autoheight: true },
activeTab: {{ DisplayTab }},
items: [
{ contentEl: 'mumble_motd', title: 'Server Info', autoScroll: true },
{ contentEl: 'mumble_registration', title: 'Registration', autoScroll: true },
{% if CurrentUserIsAdmin %}
{ contentEl: 'mumble_admin', title: 'Administration', autoScroll: true },
{% endif %}
{% if Registered %}
{ contentEl: 'mumble_texture', title: 'User Texture', autoScroll: true },
{% endif %}
]
},
{% for item in ChannelTable %}
{ contentEl: 'mumble_{{ item.id }}', id: 'carditem_{{ item.id }}' },
{% endfor %}
],
});
Ext.get( 'link_server' ).on( 'click', function( event, target ){
cardpanel.layout.setActiveItem( 'mumble_tabpanel' );
event.preventDefault();
});
{% for item in ChannelTable %}
Ext.get( 'link_{{ item.id }}' ).on( 'click', function( event, target ){
cardpanel.layout.setActiveItem( 'carditem_{{ item.id }}' );
event.preventDefault();
});
{% endfor %}
} );
</script>
<meta http-equiv="refresh" content="300" />
{% endblock %}