DotaNoobs main site.
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.

167 lines
8.2 KiB

  1. {% extends "layout.html" %}
  2. {% block head %} <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/ts3_viewer.css') }}"> {% endblock %}
  3. {% block title %}Dota Noobs{% endblock %}
  4. {% block content %}
  5. {% cache 60*5 %}
  6. {% set teamspeak_data = get_teamspeak_window() %}
  7. <div class="uk-grid" data-uk-grid-margin>
  8. <div class="uk-width-large-1-2 uk-width-medium-1-1">
  9. <div class=" uk-panel uk-panel-space">
  10. <h1 class="uk-panel-title">Who Are The Doobs!?</h1>
  11. <p>Welcome to DotaNoobs! We are a community formed by a group of redditors in an effort to provide a fun and rage-free environment for Dota2 players of all skill levels to enjoy the game and learn from each other. We have a TeamSpeak server open to the public for voice communication; hopping into the server is the best way to get involved, so click on "Server" to the right to get started. </p>
  12. <div id="about-us-more">
  13. <p>Be sure to visit the forum board to keep in touch with the community even when not playing. Create an account, introduce yourself, and chat about all things DotA.</p>
  14. <p>There is a "Dota Noobs" chat room inside the game client, and a "DotaNoobs" guild to help organzie games outside of TeamSpeak. Ask an admin for an invite today!</p>
  15. </div>
  16. <button class="uk-button uk-button-small uk-float-right" id="more">More <i class="uk-icon-angle-down"></i></button>
  17. <button class="uk-button uk-button-small uk-float-right" id="less">Less <i class="uk-icon-angle-up"></i></button>
  18. </div>
  19. </div>
  20. <div class="uk-width-large-1-2 uk-width-medium-1-1">
  21. <div class="uk-panel uk-panel-space uk-panel-box">
  22. <a href="ts3server://voice.dotanoobs.com"><div class="uk-panel-badge uk-badge uk-badge-success"><i class="uk-icon-microphone"> Connect to Teamspeak</i></div></a>
  23. <h1 class="uk-panel-title">Our TeamSpeak Server</h1>
  24. <ul>
  25. <li>Current Users: {{ ts3_current_clients() }}</li>
  26. <li>Active Countries: {{ ts3_countries_active(teamspeak_data) }}</li>
  27. </ul>
  28. <button class="uk-button" data-uk-modal="{target:'#tsviewer'}">Viewer</button>
  29. <a class="uk-button" href="{{ url_for('teamspeak') }}">Statistics</a>
  30. <hr class="uk-panel-divider" />
  31. <h1 class="uk-panel-title">Events</h1>
  32. {#
  33. {% if active_event %}
  34. <article class="uk-article">
  35. <h4>Right Now</h4>
  36. <a href="{{ url_for('event_summary', eventid=active_event._id) }}">{{ active_event.name }}</a>
  37. <p class="uk-article-meta">Ends at: {{ timestamp_to_js_date(active_event.end_time) }}</p>
  38. </article>
  39. {% endif %}
  40. {% if upcoming_event %}
  41. <article class="uk-article">
  42. <h4>Next Event</h4>
  43. <a href="{{ url_for('event_summary', eventid=upcoming_event._id) }}">{{ upcoming_event.name }}</a>
  44. <p class="uk-article-meta">Starts at: {{ timestamp_to_js_date(upcoming_event.start_time) }}</p>
  45. </article>
  46. {% else %}
  47. <em>No events planned for the near future. Suggest one on the forum!</em>
  48. {% endif %}
  49. #}
  50. <em>No events planned for the near future. Suggest one on the forum!</em>
  51. </div>
  52. <div id="tsviewer" class="uk-modal">
  53. <div class="uk-modal-dialog">
  54. <a class="uk-modal-close uk-close"></a>
  55. {{ ts3_viewer() | safe }}
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="uk-grid" data-uk-grid-margin>
  61. <div class="uk-width-large-2-3 uk-width-medium-1-1">
  62. <div class="uk-panel uk-panel-space uk-panel-box uk-panel-header">
  63. <h1 class="uk-panel-title">News and Announcements</h1>
  64. {% for news in latest_news %}
  65. <article class="uk-article dn-news-article">
  66. <h4 class="uk-article-title uk-text-truncate" data-uk-tooltip="{pos:'bottom-right'}" title="{{ news['title'] }}"><a href="{{ news['url'] }}">{{ news['title'] }}</a></h4>
  67. <p class="uk-article-meta">{{ news['date'] }}</p>
  68. <p>{{ news['text'] | shorten }}</p>
  69. </article>
  70. {% endfor %}
  71. </div>
  72. </div>
  73. {#
  74. <div class="uk-hidden-large uk-width-medium-1-1">
  75. <div class="uk-panel uk-panel-space uk-panel-box uk-panel-header">
  76. <a href="{{ url_for('list_events') }}"><div class="uk-panel-badge uk-badge uk-badge-success"><i class="uk-icon-calendar"> View All Events</i></div></a>
  77. <h1 class="uk-panel-title">Events</h1>
  78. {% if active_event %}
  79. <article class="uk-article">
  80. <h4>Right Now</h4>
  81. <a href="{{ url_for('event_summary', eventid=active_event._id) }}">{{ active_event.name }}</a>
  82. <p class="uk-article-meta">Ends at: {{ timestamp_to_js_date(active_event.end_time) }}</p>
  83. </article>
  84. {% endif %}
  85. {% if upcoming_event %}
  86. <article class="uk-article">
  87. <h4>Next Event</h4>
  88. <a href="{{ url_for('event_summary', eventid=upcoming_event._id) }}">{{ upcoming_event.name }}</a>
  89. <p class="uk-article-meta">Starts at: {{ timestamp_to_js_date(upcoming_event.start_time) }}</p>
  90. </article>
  91. {% else %}
  92. <em>No events planned for the near future. Suggest one on the forum!</em>
  93. {% endif %}
  94. <em>No events planned for the near future. Suggest one on the forum!</em>
  95. </div>
  96. </div>
  97. #}
  98. <div class="uk-width-large-1-3 uk-width-medium-1-1">
  99. <div class="uk-panel uk-panel-space">
  100. <h1 class="uk-panel-title">Live Streams</h1>
  101. <ul id="streams-online"></ul>
  102. <hr id="stream-divider" class="uk-article-divider" style="display:none;" />
  103. <ul id="streams-offline"></ul>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. {% endcache %}
  109. {% endblock %}
  110. {% block pagescripts %}
  111. <script>
  112. $(document).ready(function() {
  113. {% cache 60*5 %}
  114. // Add the streams
  115. var stream_url = "https://api.twitch.tv/kraken/streams/";
  116. var channels = ["dotanoobs", "bearhugdota", "kreejaffakree", "prettypenguins", "shaneomad"];
  117. for (var idx in channels) {
  118. $.getJSON(stream_url+channels[idx]+"?callback=?", function(data) {
  119. if (data.stream) {
  120. $('#streams-online').append("<article class='uk-article' id='" + data.stream.channel.name + "'>");
  121. var jquery_selector = '#'+data.stream.channel.name;
  122. $(jquery_selector).append("<a href='"+data.stream.channel.url+"'><h4>" + data.stream.channel.display_name + "</h4></a>")
  123. var span_text = "<span class='uk-article-meta'>";
  124. span_text = span_text + "Playing: " + data.stream.game + "<br />";
  125. span_text = span_text + "Viewers: " + data.stream.viewers + "<br />";
  126. span_text = span_text + "</span>";
  127. $(jquery_selector).append(span_text);
  128. $(jquery_selector).append("<img src='" + data.stream.preview.medium + "' />")
  129. $('#streams-online').append("</article>");
  130. $('#stream-divider').show();
  131. } else {
  132. $.getJSON(data._links.channel+"?callback=?", function(data) {
  133. $('#streams-offline').append("<article class='uk-article' id='" + data.name + "'>");
  134. $('#'+data.name).append("<a href='"+data.url+"'><h4>" + data.display_name + "</h4></a>");
  135. //$('#'+data.name).append("<img src='" + data.logo + "' style='float: right;' width='62' height='62' /><br />");
  136. $('#'+data.name).append("<p class='uk-article-meta'><strong>Offline</strong></p>");
  137. $('#streams-offline').append("</div>");
  138. });
  139. }
  140. });
  141. }
  142. {% endcache %}
  143. // Localize the events
  144. $('.date').each( function( index ) {
  145. var d = new Date($(this).text());
  146. $(this).text( d.toLocaleDateString() + ' @ ' + d.toLocaleTimeString() );
  147. });
  148. // About-us toggle
  149. $('#more,#less').click(function() {
  150. $('#more').toggle();
  151. $('#less').toggle();
  152. $('#about-us-more').toggle();
  153. });
  154. });
  155. </script>
  156. {% endblock %}