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.

134 lines
5.4 KiB

  1. {% extends "layout.html" %}
  2. {% block title %}Profile - {{ user.nickname }}{% endblock %}
  3. {% block content %}
  4. <div class="uk-grid" data-uk-grid-margin>
  5. <div class="uk-width-2-3">
  6. <h2 class="uk-float-left"><img class="" src="{{ user.avatar }}" />&nbsp;{{ user.nickname }}</h2>
  7. </div>
  8. <div id="profile_links" class="uk-width-1-3 uk-hidden-small uk-text-center">
  9. {% if user.public %}
  10. <div class="uk-button-group">
  11. <a class="uk-button" href="http://steamcommunity.com/profiles/{{ user.steam_id | safe }}">Steam</a>
  12. {% if user.forum_id %}
  13. <a class="uk-button" href="http://board.dotanoobs.com/?page=profile&id={{ user.forum_id | safe }}">Forum Profile</a>
  14. {% endif %}
  15. <a class="uk-button" href="http://dotabuff.com/search?q={{ user.steam_id }}">Dotabuff</a>
  16. </div>
  17. {% endif %}
  18. </div>
  19. <!--Main content area -->
  20. <div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel">
  21. {% if user.public %}
  22. {% if user.bio_text == None %}
  23. <em class="uk-text-danger">This user's profile bio is empty!</em>
  24. {% else %}
  25. <em class="uk-text-bold">{{ user.bio_text }}</em>
  26. {% endif %}
  27. {% else %}
  28. <em class="uk-text-danger">This user profile is set to private</em>
  29. {% endif %}
  30. {% if user.id == g.user.id %}&nbsp;<a href="{{ url_for('user_settings')}}"><i class="uk-icon-edit"></i></a>{% endif %}
  31. </div>
  32. <div id="profile_links" class="uk-width-1-3 uk-visible-small uk-text-center">
  33. {% if user.public %}
  34. <div class="uk-button-group">
  35. <a class="uk-button" href="http://steamcommunity.com/profiles/{{ user.steam_id | safe }}">Steam</a>
  36. {% if user.forum_id %}
  37. <a class="uk-button" href="http://board.dotanoobs.com/?page=profile&id={{ user.forum_id | safe }}">Forum Profile</a>
  38. {% endif %}
  39. <a class="uk-button" href="http://dotabuff.com/search?q={{ user.steam_id }}">Dotabuff</a>
  40. </div>
  41. {% endif %}
  42. </div>
  43. <!-- Side bar -->
  44. <div class="uk-width-large-1-3 uk-width-medium-1-1 uk-panel">
  45. {% if user.public %}
  46. <div class="uk-container-center uk-text-center">
  47. <span class="uk-text-bold">Current Hero</span><br/>
  48. <span class="uk-text-success uk-text-bold">
  49. {{ user.random_hero['localized_name'] }}
  50. ({{ user.random_heroes.completed | length + 1 }}
  51. /
  52. {{ total_hero_pool() - user.random_heroes.completed|length }})
  53. </span><br/>
  54. <a href={{ url_for('user_random_hero', userid=user.id) }}>
  55. <img src="{{ url_for('static', filename=hero_image_large(user.random_hero)) }}" class="dn-hero-icon" /><br/>
  56. <span>View A-Z Progress</span>
  57. </a>
  58. </div>
  59. <table class="uk-table uk-table-hover uk-table-condensed">
  60. <caption>{{ user.nickname }}</caption>
  61. <tbody class="uk-text-small">
  62. <tr>
  63. <td class="uk-width-4-10">TS Points</td>
  64. <td class="uk-width-6-10 uk-text-right">0</td>
  65. </tr>
  66. <tr>
  67. <td>Events Points</td>
  68. <td class="uk-text-right">0</td>
  69. </tr>
  70. <tr>
  71. <td>Forum Points</td>
  72. <td class="uk-text-right">0</td>
  73. </tr>
  74. <tr>
  75. <td>Last Seen</td>
  76. <td class="date uk-text-right">{{ user.last_seen | js_datetime }}</td>
  77. </tr>
  78. <tr>
  79. <td>Member Since</td>
  80. <td class="date uk-text-right">{{ user.created | js_datetime }}</td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. <button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}">View Winrate</button>
  85. {% endif %}
  86. </div>
  87. </div>
  88. <!-- Modal -->
  89. <div id="winrate_modal" class="uk-modal">
  90. <div class="uk-modal-dialog uk-modal-dialog-frameless uk-modal-dialog-large">
  91. <a class="uk-modal-close uk-close uk-close-alt"></a>
  92. </div>
  93. <div id="winrate_graph" class="uk-overflow-container"></div>
  94. </div>
  95. {% endblock %}
  96. {% block pagescripts %}
  97. <script src="http://code.highcharts.com/highcharts.js"></script>
  98. {% cache 60*700 %}
  99. <script>
  100. $('#winrate_modal').on({
  101. 'uk.modal.show': function(){
  102. Highcharts.charts[0].reflow();
  103. },
  104. });
  105. $(function () {
  106. $('#winrate_graph').highcharts({
  107. chart: { reflow: true },
  108. title: { text: "Win rate for {{ user.nickname }}" },
  109. subtitle: { text: "Over last {{ user.winrate_data['total_games'] }} games" },
  110. xAxis: {type: 'datetime', dateTimeLabelFormats:{
  111. month:'%m'
  112. }
  113. },
  114. yAxis: {min: 0.35, max: 0.90, plotLines: [{value:0, width:2, color:'#808080'}]},
  115. legend: {enabled: false},
  116. series: [
  117. {
  118. name: '{{ user.nickname }}',
  119. data: [
  120. {% for date_nums, windowed in user.winrate_data['data'] %}
  121. [({{ date_nums }} * 1000), parseFloat({{ windowed }}.toFixed(3))],
  122. {% endfor %}
  123. ]
  124. },
  125. ]
  126. });
  127. });
  128. </script>
  129. {% endcache %}
  130. {% endblock %}