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.

187 lines
7.2 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. {% if CurrentUserIsAdmin or user.is_staff %}
  117. {% trans "Channel ID" %}: {{ item.chanid }}<br />
  118. {% endif %}
  119. <a href="{{ item|chanurl:MumbleAccount }}" class="mumble">{% trans "Connect" %}</a>
  120. {% if item.description %}
  121. <fieldset>
  122. <legend>{% trans "Channel description" %}</legend>
  123. {{ item.description|safe }}
  124. </fieldset>
  125. {% endif %}
  126. </div>
  127. {% endif %}
  128. {% endfor %}
  129. {% endblock %}
  130. {% block HeadTag %}
  131. <script type="text/javascript">
  132. Ext.onReady( function(){
  133. Ext.get( 'mumble_registration' ).addClass( 'x-hide-display' );
  134. {% if Registered %}
  135. Ext.get( 'mumble_texture' ).addClass( 'x-hide-display' );
  136. {% endif %}
  137. {% if CurrentUserIsAdmin %}
  138. Ext.get( 'mumble_admin' ).addClass( 'x-hide-display' );
  139. {% endif %}
  140. var cardpanel = new Ext.Panel({
  141. renderTo: 'mumble_ext_container',
  142. layout: 'card',
  143. id: 'mumble_container',
  144. height: 570,
  145. activeItem: 0,
  146. border: false,
  147. items: [ {
  148. id: 'mumble_tabpanel',
  149. xtype: 'tabpanel',
  150. defaults: { autoheight: true },
  151. activeTab: {{ DisplayTab }},
  152. items: [
  153. { contentEl: 'mumble_motd', title: '{% trans "Server Info" %}', autoScroll: true },
  154. { contentEl: 'mumble_registration', title: '{% trans "Registration" %}', autoScroll: true },
  155. {% if CurrentUserIsAdmin %}
  156. { contentEl: 'mumble_admin', title: '{% trans "Administration" %}', autoScroll: true },
  157. {% endif %}
  158. {% if Registered %}
  159. { contentEl: 'mumble_texture', title: '{% trans "User Texture" %}', autoScroll: true },
  160. {% endif %}
  161. ]
  162. },
  163. {% for item in ChannelTable %}
  164. { contentEl: 'mumble_{{ item.id }}', id: 'carditem_{{ item.id }}' },
  165. {% endfor %}
  166. ],
  167. });
  168. Ext.get( 'link_server' ).on( 'click', function( event, target ){
  169. cardpanel.layout.setActiveItem( 'mumble_tabpanel' );
  170. event.preventDefault();
  171. });
  172. {% for item in ChannelTable %}
  173. Ext.get( 'link_{{ item.id }}' ).on( 'click', function( event, target ){
  174. cardpanel.layout.setActiveItem( 'carditem_{{ item.id }}' );
  175. event.preventDefault();
  176. });
  177. {% endfor %}
  178. } );
  179. </script>
  180. <meta http-equiv="refresh" content="300" />
  181. {% endblock %}