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.

157 lines
5.5 KiB

16 years ago
16 years ago
16 years ago
16 years ago
  1. {% extends "index.htm" %}
  2. {% block headtags %}
  3. <meta http-equiv="refresh" content="30" />
  4. {% endblock %}
  5. {% block Headline %}
  6. {{ ServerObject.rootName }}
  7. {% endblock %}
  8. {% block LeftColumn %}
  9. {% include "mumble/content.htm" %}
  10. {% endblock %}
  11. {% block Content %}
  12. <noscript>
  13. <p>
  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. </p>
  19. </noscript>
  20. <div id="mumble_registration">
  21. {% if user.is_authenticated %}
  22. <h2>Server registration</h2>
  23. <form action="" method="post">
  24. {% if Registered %}
  25. You are registered on this server.<br />
  26. {% else %}
  27. You do not have an account on this server.<br />
  28. {% endif %}
  29. <table>
  30. {{ RegForm }}
  31. </table>
  32. <input type="hidden" name="mode" value="reg" />
  33. <input type="submit" />
  34. </form>
  35. {% else %}
  36. <p>You need to be <a href="/accounts/login">logged in</a> to be able to register an account on this Mumble server.</p>
  37. {% endif %}
  38. </div>
  39. {% if Registered %}
  40. <div id="mumble_texture">
  41. <h2>User Texture</h2>
  42. <p>
  43. You can upload an image that you would like to use as your user texture here.<br />
  44. Your current texture is:<br />
  45. <img src="/mumble/{{DBaseObject.id}}/texture.png" alt="user texture" /><br />
  46. Hint: The texture image <b>needs</b> to be 600x60 in size. If you upload an image with
  47. a different size, it will be resized accordingly.<br />
  48. </p>
  49. <form action="" method="post" enctype="multipart/form-data">
  50. <table>
  51. {{ TextureForm }}
  52. </table>
  53. <input type="hidden" name="mode" value="texture" />
  54. <input type="submit" />
  55. </form>
  56. </div>
  57. {% endif %}
  58. {% if CurrentUserIsAdmin %}
  59. <div id="mumble_admin">
  60. <h2>Server administration</h2>
  61. <form action="" method="post">
  62. <table>
  63. {{ AdminForm }}
  64. </table>
  65. <input type="hidden" name="mode" value="admin" />
  66. <input type="submit" />
  67. </form>
  68. </div>
  69. {% endif %}
  70. {% for item in ChannelTable %}
  71. {% if item.1.is_player %}
  72. <div id="mumble_{{ item.1.id }}" class="x-hide-display">
  73. <h2>Player {{ item.1.name }}</h2>
  74. <ul>
  75. <li>Online since {{item.1.onlinesince|time:"H:i"}}</li>
  76. <li>Authenticated: {% if item.1.isAuthed %}Yes{% else %}No{% endif %}</li>
  77. <li>Admin: {% if item.1.isAdmin %}Yes{% else %}No{% endif %}</li>
  78. <li>Muted: {% if item.1.muted %}Yes{% else %}No{% endif %}</li>
  79. <li>Deafened: {% if item.1.deafened %}Yes{% else %}No{% endif %}</li>
  80. <li>Self-Muted: {% if item.1.selfmuted %}Yes{% else %}No{% endif %}</li>
  81. <li>Self-Deafened: {% if item.1.selfdeafened %}Yes{% else %}No{% endif %}</li>
  82. </ul>
  83. {% if item.1.mumbleuser and item.1.mumbleuser.owner %}
  84. <h2>User {{ item.1.mumbleuser.owner.username|capfirst }}</h2>
  85. <ul>
  86. {% if item.1.mumbleuser.owner.first_name and item.1.mumbleuser.owner.last_name %}
  87. <li>Full Name: {{ item.1.mumbleuser.owner.first_name }} {{ item.1.mumbleuser.owner.last_name }}</li>
  88. {% endif %}
  89. <li>Admin: {% if item.1.mumbleuser.owner.is_staff %}Yes{% else %}No{% endif %}</li>
  90. <li>Sign-up date: {{ item.1.mumbleuser.owner.date_joined }}</li>
  91. </ul>
  92. {% endif %}
  93. </div>
  94. {% else %}
  95. <div id="mumble_{{ item.1.id }}" class="x-hide-display">
  96. <h2>Channel {{ item.1.name }}</h2>
  97. <a href="mumble://{% if mumbleAccount %}{{ mumbleAccount.name }}@{% endif %}{{ DBaseObject.addr }}/{% for chan in item.2 %}{{ chan|urlencode }}/{% endfor %}{{ item.1.name|urlencode }}" class="dingen">Connect</a>
  98. </div>
  99. {% endif %}
  100. {% endfor %}
  101. {% endblock %}
  102. {% block HeadTag %}
  103. <script type="text/javascript">
  104. Ext.onReady( function(){
  105. Ext.get( 'mumble_registration' ).addClass( 'x-hide-display' );
  106. {% if Registered %}
  107. Ext.get( 'mumble_texture' ).addClass( 'x-hide-display' );
  108. {% endif %}
  109. {% if CurrentUserIsAdmin %}
  110. Ext.get( 'mumble_admin' ).addClass( 'x-hide-display' );
  111. {% endif %}
  112. var cardpanel = new Ext.Panel({
  113. renderTo: 'col3_content',
  114. layout: 'card',
  115. id: 'mumble_container',
  116. height: 510,
  117. activeItem: 0,
  118. border: false,
  119. items: [ {
  120. id: 'mumble_tabpanel',
  121. xtype: 'tabpanel',
  122. defaults: { autoheight: true },
  123. activeTab: {{ DisplayTab }},
  124. items: [
  125. { contentEl: 'mumble_registration', title: 'Registration', autoScroll: true },
  126. {% if CurrentUserIsAdmin %}
  127. { contentEl: 'mumble_admin', title: 'Administration', autoScroll: true },
  128. {% endif %}
  129. {% if Registered %}
  130. { contentEl: 'mumble_texture', title: 'User Texture', autoScroll: true },
  131. {% endif %}
  132. ]
  133. },
  134. {% for item in ChannelTable %}
  135. { contentEl: 'mumble_{{ item.1.id }}', id: 'carditem_{{ item.1.id }}' },
  136. {% endfor %}
  137. ],
  138. });
  139. Ext.get( 'link_server' ).on( 'click', function( event, target ){
  140. cardpanel.layout.setActiveItem( 'mumble_tabpanel' );
  141. event.preventDefault();
  142. });
  143. {% for item in ChannelTable %}
  144. Ext.get( 'link_{{ item.1.id }}' ).on( 'click', function( event, target ){
  145. cardpanel.layout.setActiveItem( 'carditem_{{ item.1.id }}' );
  146. event.preventDefault();
  147. });
  148. {% endfor %}
  149. } );
  150. </script>
  151. {% endblock %}