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.

184 lines
7.1 KiB

16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
  1. {% extends "index.htm" %}
  2. {% load mumble_extras %}
  3. {% load i18n %}
  4. {% block Headline %}
  5. {{ DBaseObject.name }}
  6. {% endblock %}
  7. {% block LeftColumn %}
  8. {{ DBaseObject|chanview:MumbleAccount }}
  9. {% endblock %}
  10. {% block Content %}
  11. <noscript>
  12. <p>
  13. {% blocktrans %}
  14. <b>Hint:</b><br />
  15. This area is used to display additional information for each channel and player, but requires JavaScript to be
  16. displayed correctly. You will not see the detail pages, but you can use all links and forms
  17. that are displayed.
  18. {% endblocktrans %}
  19. </p>
  20. </noscript>
  21. <div id="mumble_ext_container"></div>
  22. <div id="mumble_motd" class="mumble-ext x-hide-display">
  23. <ul>
  24. <li>{% trans "Server Address" %}: <a href="{{ DBaseObject.connecturl }}">{{ DBaseObject.connecturl }}</a></li>
  25. {% if DBaseObject.url %}
  26. <li>{% trans "Website" %}: {{ DBaseObject.url|urlize }}</li>
  27. {% endif %}
  28. <li>{% trans "Server version" %}: {{ DBaseObject.version.0 }}.{{ DBaseObject.version.1 }}.{{ DBaseObject.version.2 }}</li>
  29. </ul>
  30. <fieldset>
  31. <legend>{% trans "Welcome message" %}</legend>
  32. {{ DBaseObject.motd|safe }}
  33. </fieldset>
  34. </div>
  35. <div id="mumble_registration" class="mumble-ext">
  36. {% if user.is_authenticated %}
  37. <h2>{% trans "Server registration" %}</h2>
  38. <form action="" method="post">
  39. {% if Registered %}
  40. {% trans "You are registered on this server" %}.<br />
  41. {% else %}
  42. {% trans "You do not have an account on this server" %}.<br />
  43. {% endif %}
  44. <table>
  45. {{ RegForm }}
  46. </table>
  47. <input type="hidden" name="mode" value="reg" />
  48. <input type="submit" />
  49. </form>
  50. {% else %}
  51. {% blocktrans with DBaseObject.id as serverid %}
  52. <p>You need to be <a href="/accounts/login?next=%2Fmumble%2F{{ serverid }}">logged in</a> to be able to register an account on this Mumble server.</p>
  53. {% endblocktrans %}
  54. {% endif %}
  55. </div>
  56. {% if Registered %}
  57. <div id="mumble_texture" class="mumble-ext">
  58. <h2>{% trans "User Texture" %}</h2>
  59. <p>
  60. {% blocktrans with DBaseObject.id as serverid %}
  61. You can upload an image that you would like to use as your user texture here.<br />
  62. Your current texture is:<br />
  63. <img src="/mumble/{{serverid}}/texture.png" alt="user texture" /><br />
  64. Hint: The texture image <b>needs</b> to be 600x60 in size. If you upload an image with
  65. a different size, it will be resized accordingly.<br />
  66. {% endblocktrans %}
  67. </p>
  68. <form action="" method="post" enctype="multipart/form-data">
  69. <table>
  70. {{ TextureForm }}
  71. </table>
  72. <input type="hidden" name="mode" value="texture" />
  73. <input type="submit" />
  74. </form>
  75. </div>
  76. {% endif %}
  77. {% if CurrentUserIsAdmin %}
  78. <div id="mumble_admin" class="mumble-ext">
  79. <h2>{% trans "Server administration" %}</h2>
  80. <form action="" method="post">
  81. <table>
  82. {{ AdminForm }}
  83. </table>
  84. <input type="hidden" name="mode" value="admin" />
  85. <input type="submit" />
  86. </form>
  87. </div>
  88. {% endif %}
  89. {% for item in ChannelTable %}
  90. {% if item.is_player %}
  91. <div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
  92. <h2>{% trans "Player" %} {{ item.name }}</h2>
  93. <ul>
  94. <li>{% trans "Online since" %} {{item.onlinesince|time:"H:i"}}</li>
  95. <li>{% blocktrans with item.isAuthed|yesno:_("yes,no") as authed %}Authenticated: {{ authed }}{% endblocktrans %}</li>
  96. <li>{% blocktrans with item.isAdmin|yesno:_("yes,no") as admin %}Admin: {{ admin }}{% endblocktrans %}</li>
  97. <li>{% blocktrans with item.muted|yesno:_("yes,no") as muted %}Muted: {{ muted }}{% endblocktrans %}</li>
  98. <li>{% blocktrans with item.deafened|yesno:_("yes,no") as deafened %}Deafened: {{ deafened }}{% endblocktrans %}</li>
  99. <li>{% blocktrans with item.selfmuted|yesno:_("yes,no") as selfmuted %}Muted by self: {{ selfmuted }}{% endblocktrans %}</li>
  100. <li>{% blocktrans with item.selfdeafened|yesno:_("yes,no") as selfdeafened %}Deafened by self: {{ selfdeafened }}{% endblocktrans %}</li>
  101. </ul>
  102. {% if item.mumbleuser and item.mumbleuser.owner %}
  103. <h2>{% trans "User" %} {{ item.mumbleuser.owner.username|capfirst }}</h2>
  104. <ul>
  105. {% if item.mumbleuser.owner.first_name and item.mumbleuser.owner.last_name %}
  106. <li>{% trans "Full Name" %}: {{ item.mumbleuser.owner.first_name }} {{ item.mumbleuser.owner.last_name }}</li>
  107. {% endif %}
  108. <li>{% trans "Admin" %}: {% if item.mumbleuser.owner.is_staff %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</li>
  109. <li>{% trans "Sign-up date" %}: {{ item.mumbleuser.owner.date_joined }}</li>
  110. </ul>
  111. {% endif %}
  112. </div>
  113. {% else %}
  114. <div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
  115. <h2>{% trans "Channel" %} {{ item.name }}</h2>
  116. <a href="{{ item|chanurl:MumbleAccount }}" class="mumble">{% trans "Connect" %}</a>
  117. {% if item.description %}
  118. <fieldset>
  119. <legend>{% trans "Channel description" %}</legend>
  120. {{ item.description|safe }}
  121. </fieldset>
  122. {% endif %}
  123. </div>
  124. {% endif %}
  125. {% endfor %}
  126. {% endblock %}
  127. {% block HeadTag %}
  128. <script type="text/javascript">
  129. Ext.onReady( function(){
  130. Ext.get( 'mumble_registration' ).addClass( 'x-hide-display' );
  131. {% if Registered %}
  132. Ext.get( 'mumble_texture' ).addClass( 'x-hide-display' );
  133. {% endif %}
  134. {% if CurrentUserIsAdmin %}
  135. Ext.get( 'mumble_admin' ).addClass( 'x-hide-display' );
  136. {% endif %}
  137. var cardpanel = new Ext.Panel({
  138. renderTo: 'mumble_ext_container',
  139. layout: 'card',
  140. id: 'mumble_container',
  141. height: 570,
  142. activeItem: 0,
  143. border: false,
  144. items: [ {
  145. id: 'mumble_tabpanel',
  146. xtype: 'tabpanel',
  147. defaults: { autoheight: true },
  148. activeTab: {{ DisplayTab }},
  149. items: [
  150. { contentEl: 'mumble_motd', title: '{% trans "Server Info" %}', autoScroll: true },
  151. { contentEl: 'mumble_registration', title: '{% trans "Registration" %}', autoScroll: true },
  152. {% if CurrentUserIsAdmin %}
  153. { contentEl: 'mumble_admin', title: '{% trans "Administration" %}', autoScroll: true },
  154. {% endif %}
  155. {% if Registered %}
  156. { contentEl: 'mumble_texture', title: '{% trans "User Texture" %}', autoScroll: true },
  157. {% endif %}
  158. ]
  159. },
  160. {% for item in ChannelTable %}
  161. { contentEl: 'mumble_{{ item.id }}', id: 'carditem_{{ item.id }}' },
  162. {% endfor %}
  163. ],
  164. });
  165. Ext.get( 'link_server' ).on( 'click', function( event, target ){
  166. cardpanel.layout.setActiveItem( 'mumble_tabpanel' );
  167. event.preventDefault();
  168. });
  169. {% for item in ChannelTable %}
  170. Ext.get( 'link_{{ item.id }}' ).on( 'click', function( event, target ){
  171. cardpanel.layout.setActiveItem( 'carditem_{{ item.id }}' );
  172. event.preventDefault();
  173. });
  174. {% endfor %}
  175. } );
  176. </script>
  177. <meta http-equiv="refresh" content="300" />
  178. {% endblock %}