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.

65 lines
2.7 KiB

  1. {% extends "layout.html" %}
  2. {% block title %}Dota Noobs - Community{% endblock %}
  3. {% block content %}
  4. <img id="biglogo" src="{{ url_for('static', filename='img/biglogo.png') }}">
  5. <div class="panel" style="margin-left: 5em; margin-right: 5em">
  6. <h2>Welcome to the Doobs Community!</h2>
  7. <div class='panel'>
  8. <p class="left">
  9. This part of our site is dedicated to our members. If you're interested in contributing to the page, let one of the admins know!
  10. </p>
  11. <p class="left">
  12. On this page you'll find content created by the members of the Doobs community. There's a link to some custom items builds people have put together (cough...Gambit...cough), an archive of past Doobs inhouses as well as some games that members have cast/analyzed, as well as a blog that focuses on anything and everything DotA, pub or pro, you'll find something about it on the blog.
  13. </p>
  14. <p class="left">
  15. All in all, this is a page for our members, if you want something that you don't see, let us know and we'll take care of it!
  16. </p>
  17. </div>
  18. </div>
  19. <div class="panel clickable" style="margin-right: 5em; margin-left: 5em;" data-href="http://www.youtube.com/user/DotaNoobsVods?feature=watch">
  20. <h2>Video Archive</h2>
  21. <ul id="videos">
  22. </ul>
  23. </div>
  24. <div class="panel" style="margin-left: 5em; margin-right: 5em;">
  25. <h2>Latest Posts</h2>
  26. {% for post in latest_posts %}
  27. <div class="panel clickable" data-href="{{ post['url'] }}">
  28. <h3 style="float: left">{{ post['title'] }}</h3>
  29. <div class="date" style="float: right">{{ timestamp_to_js_date(post['date']) }}</div>
  30. <div style="clear: both; float: left">by {{ post['user'] }}</div>
  31. </div>
  32. {% endfor %}
  33. </div>
  34. <script>
  35. $(document).ready(function() {
  36. // Add the video archive
  37. var youtube_url = "http://gdata.youtube.com/feeds/users/DotaNoobsVods/uploads?alt=json-in-script&orderby=published&max-results=3&callback=?"
  38. $.getJSON(youtube_url, function(data) {
  39. for (var idx in data.feed.entry) {
  40. var entry = data.feed.entry[idx];
  41. console.log(entry);
  42. $('#videos').append("<div class='panel horizontal clickable' style='max-width: 25%; float: left; overflow: hidden;' id='video-" + idx + "' data-href='" + entry.link[0].href + "'>");
  43. var jquery_selector = '#video-' + idx;
  44. $(jquery_selector).append('<h3>' + entry.title['$t'] + '</h3>');
  45. $(jquery_selector).append('<img style="width: 90%;" src="' + entry['media$group']['media$thumbnail'][0].url + '">');
  46. setup_clickable(jquery_selector);
  47. $('#videos').append("</div>");
  48. }
  49. });
  50. // Localize the events
  51. $('.date').each( function( index ) {
  52. var d = new Date($(this).text());
  53. $(this).text( d.toLocaleDateString() + ' @ ' + d.toLocaleTimeString() );
  54. });
  55. });
  56. </script>
  57. {% endblock %}