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.

163 lines
8.0 KiB

  1. {% extends "layout.html" %}
  2. {% block title %}Dota Noobs{% endblock %}
  3. {% block content %}
  4. <div class="uk-grid" data-uk-grid-margin>
  5. <div class="uk-width-large-1-2 uk-width-medium-1-1">
  6. <div class=" uk-panel uk-panel-space uk-panel-box">
  7. <h1 class="uk-panel-title">Who Are The Doobs!?</h1>
  8. <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>
  9. <div id="about-us-more">
  10. <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>
  11. <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>
  12. </div>
  13. <button class="uk-button uk-button-small uk-float-right" id="more">More <i class="uk-icon-angle-down"></i></button>
  14. <button class="uk-button uk-button-small uk-float-right" id="less">Less <i class="uk-icon-angle-up"></i></button>
  15. </div>
  16. </div>
  17. <div class="uk-width-large-1-2 uk-width-medium-1-1">
  18. <div class="uk-panel uk-panel-space uk-panel-box">
  19. <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>
  20. <h1 class="uk-panel-title">Our TeamSpeak Server</h1>
  21. <ul>
  22. <li>Current Users: {# active_doobs #}</li>
  23. <li>Unique Clients This Month: {# num_unique_clients(teamspeak_data) #}</li>
  24. </ul>
  25. <button class="uk-button" data-uk-modal="{target:'#tsviewer'}">Viewer</button>
  26. <a class="uk-button" href="{{ url_for('teamspeak') }}">Statistics</a>
  27. <hr class="uk-panel-divider" />
  28. <h1 class="uk-panel-title">Events</h1>
  29. {#
  30. {% if active_event %}
  31. <article class="uk-article">
  32. <h4>Right Now</h4>
  33. <a href="{{ url_for('event_summary', eventid=active_event._id) }}">{{ active_event.name }}</a>
  34. <p class="uk-article-meta">Ends at: {{ timestamp_to_js_date(active_event.end_time) }}</p>
  35. </article>
  36. {% endif %}
  37. {% if upcoming_event %}
  38. <article class="uk-article">
  39. <h4>Next Event</h4>
  40. <a href="{{ url_for('event_summary', eventid=upcoming_event._id) }}">{{ upcoming_event.name }}</a>
  41. <p class="uk-article-meta">Starts at: {{ timestamp_to_js_date(upcoming_event.start_time) }}</p>
  42. </article>
  43. {% else %}
  44. <em>No events planned for the near future. Suggest one on the forum!</em>
  45. {% endif %}
  46. #}
  47. <em>No events planned for the near future. Suggest one on the forum!</em>
  48. </div>
  49. <div id="tsviewer" class="uk-modal">
  50. <div class="uk-modal-dialog">
  51. <a class="uk-modal-close uk-close"></a>
  52. {# ts3_viewer() | safe #}
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="uk-grid" data-uk-grid-margin>
  58. <div class="uk-width-large-2-3 uk-width-medium-1-1">
  59. <div class="uk-panel uk-panel-space uk-panel-box uk-panel-header">
  60. <h1 class="uk-panel-title">News and Announcements</h1>
  61. {% for news in latest_news %}
  62. <article class="uk-article dn-news-article">
  63. <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>
  64. <p class="uk-article-meta">{{ news['date'] }}</p>
  65. <p>{{ news['text'] | shorten }}</p>
  66. </article>
  67. {% endfor %}
  68. </div>
  69. </div>
  70. <div class="uk-hidden-large uk-width-medium-1-1">
  71. <div class="uk-panel uk-panel-space uk-panel-box uk-panel-header">
  72. <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>
  73. <h1 class="uk-panel-title">Events</h1>
  74. {#
  75. {% if active_event %}
  76. <article class="uk-article">
  77. <h4>Right Now</h4>
  78. <a href="{{ url_for('event_summary', eventid=active_event._id) }}">{{ active_event.name }}</a>
  79. <p class="uk-article-meta">Ends at: {{ timestamp_to_js_date(active_event.end_time) }}</p>
  80. </article>
  81. {% endif %}
  82. {% if upcoming_event %}
  83. <article class="uk-article">
  84. <h4>Next Event</h4>
  85. <a href="{{ url_for('event_summary', eventid=upcoming_event._id) }}">{{ upcoming_event.name }}</a>
  86. <p class="uk-article-meta">Starts at: {{ timestamp_to_js_date(upcoming_event.start_time) }}</p>
  87. </article>
  88. {% else %}
  89. <em>No events planned for the near future. Suggest one on the forum!</em>
  90. {% endif %}
  91. #}
  92. <em>No events planned for the near future. Suggest one on the forum!</em>
  93. </div>
  94. </div>
  95. <div class="uk-width-large-1-3 uk-width-medium-1-1">
  96. <div class="uk-panel uk-panel-space uk-panel-box uk-panel-header">
  97. <h1 class="uk-panel-title">Live Streams</h1>
  98. <ul id="streams-online"></ul>
  99. <hr id="stream-divider" class="uk-article-divider" style="display:none;" />
  100. <ul id="streams-offline"></ul>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. {% endblock %}
  106. {% block pagescripts %}
  107. <script>
  108. $(document).ready(function() {
  109. // Add the streams
  110. var stream_url = "https://api.twitch.tv/kraken/streams/";
  111. var channels = ["dotanoobs", "bearhugdota", "kreejaffakree", "prettypenguins", "shaneomad"];
  112. for (var idx in channels) {
  113. $.getJSON(stream_url+channels[idx]+"?callback=?", function(data) {
  114. if (data.stream) {
  115. $('#streams-online').append("<article class='uk-article' id='" + data.stream.channel.name + "'>");
  116. var jquery_selector = '#'+data.stream.channel.name;
  117. $(jquery_selector).append("<a href='"+data.stream.channel.url+"'><h4>" + data.stream.channel.display_name + "</h4></a>")
  118. var span_text = "<p class='uk-article-meta'>";
  119. span_text = span_text + "Playing: " + data.stream.game + "<br />";
  120. span_text = span_text + "Viewers: " + data.stream.viewers + "<br />";
  121. span_text = span_text + "</p>";
  122. $(jquery_selector).append(span_text);
  123. $(jquery_selector).append("<img src='" + data.stream.preview.medium + "' />")
  124. $('#streams-online').append("</article>");
  125. $('#stream-divider').show();
  126. } else {
  127. $.getJSON(data._links.channel+"?callback=?", function(data) {
  128. $('#streams-offline').append("<article class='uk-article' id='" + data.name + "'>");
  129. $('#'+data.name).append("<a href='"+data.url+"'><h4>" + data.display_name + "</h4></a>");
  130. $('#'+data.name).append("<img src='" + data.logo + "' style='float: right;' width='62' height='62' /><br />");
  131. $('#'+data.name).append("<p class='uk-article-meta'><strong>Offline</strong></p>");
  132. $('#streams-offline').append("</div>");
  133. });
  134. }
  135. });
  136. }
  137. // Localize the events
  138. $('.date').each( function( index ) {
  139. var d = new Date($(this).text());
  140. $(this).text( d.toLocaleDateString() + ' @ ' + d.toLocaleTimeString() );
  141. });
  142. // About-us toggle
  143. $('#more,#less').click(function() {
  144. $('#more').toggle();
  145. $('#less').toggle();
  146. $('#about-us-more').toggle();
  147. });
  148. });
  149. </script>
  150. {% endblock %}