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.

138 lines
5.8 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">{{ user.points_from_ts3 }}</td>
  65. </tr>
  66. <tr>
  67. <td>Events Points</td>
  68. <td class="uk-text-right">{{ user.points_from_events }}</td>
  69. </tr>
  70. <tr>
  71. <td>Forum Points</td>
  72. <td class="uk-text-right">{{ user.points_from_forum }}</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. {% if not user.winrate_data['data'] %}
  85. <h3 class="uk-text-warning">No data compiled, check back tomorrow!</h3>
  86. <button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}" disabled>View Winrate</button>
  87. {% else %}
  88. <button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}">View Winrate</button>
  89. {% endif %}
  90. {% endif %}
  91. </div>
  92. </div>
  93. <!-- Modal -->
  94. <div id="winrate_modal" class="uk-modal">
  95. <div class="uk-modal-dialog uk-modal-dialog-frameless uk-modal-dialog-large">
  96. <a class="uk-modal-close uk-close uk-close-alt"></a>
  97. </div>
  98. <div id="winrate_graph" class="uk-overflow-container"></div>
  99. </div>
  100. {% endblock %}
  101. {% block pagescripts %}
  102. {#<script src="http://code.highcharts.com/highcharts.js"></script>#}
  103. <script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.0.3/highcharts.js"></script>
  104. <script>
  105. $('#winrate_modal').on({
  106. 'uk.modal.show': function(){
  107. Highcharts.charts[0].reflow();
  108. },
  109. });
  110. $(function () {
  111. $('#winrate_graph').highcharts({
  112. chart: { reflow: true },
  113. title: { text: "Win rate for {{ user.nickname }}" },
  114. subtitle: { text: "Over last {{ user.winrate_data['total_games'] }} games" },
  115. xAxis: {type: 'datetime', dateTimeLabelFormats:{
  116. month:'%m'
  117. }
  118. },
  119. yAxis: {min: 0.35, max: 0.90, plotLines: [{value:0, width:2, color:'#808080'}]},
  120. legend: {enabled: false},
  121. series: [
  122. {
  123. name: '{{ user.nickname }}',
  124. data: [
  125. {% for date_nums, windowed in user.winrate_data['data'] %}
  126. [({{ date_nums }} * 1000), parseFloat({{ windowed }}.toFixed(3))],
  127. {% endfor %}
  128. ]
  129. },
  130. ]
  131. });
  132. });
  133. </script>
  134. {% endblock %}