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.

89 lines
4.2 KiB

10 years ago
10 years ago
  1. {% extends "layout.html" %}
  2. {% block head %}
  3. <link rel="stylesheet" href="{{ url_for('static', filename='css/heropedia.css') }}" >
  4. {% endblock %}
  5. {% block title %} A-Z Challenge: {{ user.nickname }}{% endblock %}
  6. {% block content %}
  7. {% set taverns = heropedia() %}
  8. <h2 class="uk-text-center">{{ user.nickname }}'s A-Z Challenge</h2>
  9. <hr />
  10. <div class="uk-grid">
  11. <div class="uk-width-large-1-3 uk-width-medium-1-1 uk-panel uk-text-center uk-margin-bottom">
  12. <h3 class="uk-panel-title">Current Hero</h3>
  13. <h4 class="uk-text-bold uk-margin-remove">{{ user.random_hero['localized_name'] }}</h4>
  14. <img src="{{ url_for('static', filename=hero_image_large(user.random_hero)) }}" class="dn-hero-icon" />
  15. <p>
  16. <span id="heroes_completed">Heroes Completed: {{ user.random_heroes.completed | length }}</span><br/>
  17. <span id="heroes_left">Heroes Left: {{ total_hero_pool() - user.random_heroes.completed|length }}</span>
  18. </span>
  19. </p>
  20. {% if g.user and g.user.steam_id == user.steam_id %}
  21. <form action="{{ url_for('user_random_hero', userid=g.user.id) }}" method="post" id="random_form" class="uk-margin">
  22. <input type="checkbox" name="completed" id="completed_checkbox" style="display:none;">
  23. <input type="checkbox" name="skip" id="skip_checkbox" style="display:none;">
  24. <a class="uk-button uk-button-success" id="completed_button">Completed!</a>
  25. <a class="uk-button uk-button-primary" id="skip_button">Skip</a>
  26. </form>
  27. {% endif %}
  28. </div>
  29. <div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel uk-text-center uk-margin">
  30. {% if user.az_completions > 0 %}
  31. <div class="uk-badge uk-panel-badge uk-badge-notification uk-badge-success">x{{ user.az_completions }}</div>
  32. {% endif %}
  33. <h3 class="uk-panel-title">Completed</h3>
  34. {% for hero in user.random_heroes.completed %}
  35. <img src="{{ url_for('static', filename=hero_image_small(hero)) }}" class="dn-hero-icon" />
  36. {% endfor %}
  37. <br/><br/>
  38. <br/><br/>
  39. </div>
  40. <div class="uk-width-large-2-3 uk-width-medium-1-1 uk-container-center">
  41. <ul class="uk-tab" data-uk-tab="{connect:'#taverns'}">
  42. <li class="uk-active"><a href="">Strength</a></li>
  43. <li><a href="">Agility</a></li>
  44. <li><a href="">Intelligence</a></li>
  45. </ul>
  46. <ul id="taverns" class="uk-switcher uk-margin">
  47. <li><div class="uk-panel tavern">
  48. <label id="tavernStrength">Strength</label>
  49. {% for hero in taverns[0][1] + taverns[3][1] %}
  50. <img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" />
  51. {% endfor %}
  52. </div></li>
  53. <li><div class="uk-panel tavern">
  54. <label id="tavernAgility">Agility</label>
  55. {% for hero in taverns[1][1] + taverns[4][1] %}
  56. <img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" />
  57. {% endfor %}
  58. </div> </li>
  59. <li><div class="uk-panel tavern">
  60. <label id="tavernIntelligence">Intelligence</label>
  61. {% for hero in taverns[2][1] + taverns[5][1] %}
  62. <img class="{{hero['name'] in user.random_completed and 'filterUnmatchedHero' or 'filterMatchedHero' }}" id="{{ hero['name'] }}" src="{{ url_for('static', filename=hero_image_small(hero)) }}" />
  63. {% endfor %}
  64. </div> </li>
  65. </ul>
  66. </div>
  67. </div>
  68. {% endblock %}
  69. {% if g.user and g.user.id == user.id %}
  70. {% block pagescripts %}
  71. <script>
  72. $(document).ready(function() {
  73. $('#completed_button').click( function() {
  74. $('#completed_checkbox').attr('checked', true);
  75. $('#random_form').submit();
  76. });
  77. $('#skip_button').click( function() {
  78. $('#skip_checkbox').attr('checked', true);
  79. $('#random_form').submit();
  80. });
  81. });
  82. </script>
  83. {% endblock %}
  84. {% endif %}