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.

119 lines
4.7 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. {% endif %}
  72. </div>
  73. </div>
  74. <!-- Modal -->
  75. <div id="winrate_modal" class="uk-modal">
  76. <div class="uk-modal-dialog uk-modal-dialog-frameless uk-modal-dialog-large">
  77. <a class="uk-modal-close uk-close uk-close-alt"></a>
  78. </div>
  79. <div id="winrate_graph" class="uk-overflow-container"></div>
  80. </div>
  81. {% endblock %}
  82. {% block pagescripts %}
  83. {#<script src="http://code.highcharts.com/highcharts.js"></script>#}
  84. <script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.0.3/highcharts.js"></script>
  85. <script>
  86. $('#winrate_modal').on({
  87. 'uk.modal.show': function(){
  88. Highcharts.charts[0].reflow();
  89. },
  90. });
  91. $(function () {
  92. $('#winrate_graph').highcharts({
  93. chart: { reflow: true },
  94. title: { text: "Win rate for {{ user.nickname }}" },
  95. subtitle: { text: "Over last {{ user.winrate_data['total_games'] }} games" },
  96. xAxis: {type: 'datetime', dateTimeLabelFormats:{
  97. month:'%m'
  98. }
  99. },
  100. yAxis: {min: 0.35, max: 0.90, plotLines: [{value:0, width:2, color:'#808080'}]},
  101. legend: {enabled: false},
  102. series: [
  103. {
  104. name: '{{ user.nickname }}',
  105. data: [
  106. {% for date_nums, windowed in user.winrate_data['data'] %}
  107. [({{ date_nums }} * 1000), parseFloat({{ windowed }}.toFixed(3))],
  108. {% endfor %}
  109. ]
  110. },
  111. ]
  112. });
  113. });
  114. </script>
  115. {% endblock %}