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.

125 lines
5.2 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. <table class="uk-table uk-table-hover uk-table-condensed">
  47. <caption>{{ user.nickname }}</caption>
  48. <tbody class="uk-text-small">
  49. <tr>
  50. <td class="uk-width-4-10">TS Points</td>
  51. <td class="uk-width-6-10 uk-text-right">{{ user.points_from_ts3 }}</td>
  52. </tr>
  53. <tr>
  54. <td>Events Points</td>
  55. <td class="uk-text-right">{{ user.points_from_events }}</td>
  56. </tr>
  57. <tr>
  58. <td>Forum Points</td>
  59. <td class="uk-text-right">{{ user.points_from_forum }}</td>
  60. </tr>
  61. <tr>
  62. <td>Last Seen</td>
  63. <td class="date uk-text-right">{{ user.last_seen | js_datetime }}</td>
  64. </tr>
  65. <tr>
  66. <td>Member Since</td>
  67. <td class="date uk-text-right">{{ user.created | js_datetime }}</td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. {% if not user.winrate_data['data'] %}
  72. <h3 class="uk-text-warning">No data compiled, check back tomorrow!</h3>
  73. <button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}" disabled>View Winrate</button>
  74. {% else %}
  75. <button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}">View Winrate</button>
  76. {% endif %}
  77. {% endif %}
  78. </div>
  79. </div>
  80. <!-- Modal -->
  81. <div id="winrate_modal" class="uk-modal">
  82. <div class="uk-modal-dialog uk-modal-dialog-frameless uk-modal-dialog-large">
  83. <a class="uk-modal-close uk-close uk-close-alt"></a>
  84. </div>
  85. <div id="winrate_graph" class="uk-overflow-container"></div>
  86. </div>
  87. {% endblock %}
  88. {% block pagescripts %}
  89. {#<script src="http://code.highcharts.com/highcharts.js"></script>#}
  90. <script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.0.3/highcharts.js"></script>
  91. <script>
  92. $('#winrate_modal').on({
  93. 'uk.modal.show': function(){
  94. Highcharts.charts[0].reflow();
  95. },
  96. });
  97. $(function () {
  98. $('#winrate_graph').highcharts({
  99. chart: { reflow: true },
  100. title: { text: "Win rate for {{ user.nickname }}" },
  101. subtitle: { text: "Over last {{ user.winrate_data['total_games'] }} games" },
  102. xAxis: {type: 'datetime', dateTimeLabelFormats:{
  103. month:'%m'
  104. }
  105. },
  106. yAxis: {min: 0.35, max: 0.90, plotLines: [{value:0, width:2, color:'#808080'}]},
  107. legend: {enabled: false},
  108. series: [
  109. {
  110. name: '{{ user.nickname }}',
  111. data: [
  112. {% for date_nums, windowed in user.winrate_data['data'] %}
  113. [({{ date_nums }} * 1000), parseFloat({{ windowed }}.toFixed(3))],
  114. {% endfor %}
  115. ]
  116. },
  117. ]
  118. });
  119. });
  120. </script>
  121. {% endblock %}