mv periodic back to cron, add winrate graphs
This commit is contained in:
1 parent
5d81c4fbe4
commit
73f7f9e567
14 files changed
+352
-92
No files matched your search
+96
-14
@@ -7,14 +7,16 @@
|
||||
<div class="uk-width-2-3">
|
||||
<h2 class="uk-float-left"><img class="" src="{{ user.avatar }}" /> {{ user.nickname }}</h2>
|
||||
</div>
|
||||
<div id="profile_links" class="uk-width-1-3 uk-text-center">
|
||||
<div class="uk-panel">
|
||||
{% if user.public %}
|
||||
<a href="http://steamcommunity.com/profiles/{{ user.steam_id | safe }}">Steam</a> |
|
||||
<a href="http://board.dotanoobs.com/?page=profile&id={{ user.id | safe }}">Forum Profile</a> |
|
||||
<a href="http://dotabuff.com/search?q={{ user.steam_id }}">Dotabuff</a>
|
||||
<div id="profile_links" class="uk-width-1-3 uk-hidden-small uk-text-center">
|
||||
{% if user.public %}
|
||||
<div class="uk-button-group">
|
||||
<a class="uk-button" href="http://steamcommunity.com/profiles/{{ user.steam_id | safe }}">Steam</a>
|
||||
{% if user.forum_id %}
|
||||
<a class="uk-button" href="http://board.dotanoobs.com/?page=profile&id={{ user.forum_id | safe }}">Forum Profile</a>
|
||||
{% endif %}
|
||||
<a class="uk-button" href="http://dotabuff.com/search?q={{ user.steam_id }}">Dotabuff</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!--Main content area -->
|
||||
<div class="uk-width-large-2-3 uk-width-medium-1-1 uk-panel">
|
||||
@@ -29,24 +31,104 @@
|
||||
{% endif %}
|
||||
{% if user.id == g.user.id %} <a href="{{ url_for('user_settings')}}"><i class="uk-icon-edit"></i></a>{% endif %}
|
||||
</div>
|
||||
<div id="profile_links" class="uk-width-1-3 uk-visible-small uk-text-center">
|
||||
{% if user.public %}
|
||||
<div class="uk-button-group">
|
||||
<a class="uk-button" href="http://steamcommunity.com/profiles/{{ user.steam_id | safe }}">Steam</a>
|
||||
{% if user.forum_id %}
|
||||
<a class="uk-button" href="http://board.dotanoobs.com/?page=profile&id={{ user.forum_id | safe }}">Forum Profile</a>
|
||||
{% endif %}
|
||||
<a class="uk-button" href="http://dotabuff.com/search?q={{ user.steam_id }}">Dotabuff</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- Side bar -->
|
||||
<div class="uk-width-large-1-3 uk-width-medium-1-1 uk-panel uk-panel-box uk-panel-box-secondary">
|
||||
<div class="uk-width-large-1-3 uk-width-medium-1-1 uk-panel">
|
||||
{% if user.public %}
|
||||
<div class="uk-container-center uk-text-center">
|
||||
<span class="uk-text-bold">Current Hero</span><br/>
|
||||
<span>{{ user.random_hero['localized_name'] }}</span><br/>
|
||||
<span class="uk-text-success uk-text-bold">
|
||||
{{ user.random_hero['localized_name'] }}
|
||||
({{ user.random_heroes.completed | length + 1 }}
|
||||
/
|
||||
{{ total_hero_pool() - user.random_heroes.completed|length }})
|
||||
</span><br/>
|
||||
<a href={{ url_for('user_random_hero', userid=user.id) }}>
|
||||
<img src="{{ url_for('static', filename=hero_image_large(user.random_hero)) }}" class="dn-hero-icon" /><br/>
|
||||
<span>View A-Z Progress</span>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="uk-list uk-list-space uk-list-striped uk-text-center uk-text-small">
|
||||
<li>Completed <span id='rands'>{{ user.random_heroes.completed | length }}</span> heroes in A-Z</li>
|
||||
<li>Has <span id='points_total'>0</span> doobs points</li>
|
||||
<li>Last seen at <span class='date'> {{ user.last_seen | js_datetime }}</span></li>
|
||||
<li>Doob since <span class='date'> {{ user.created | js_datetime }}</span></li>
|
||||
</ul>
|
||||
<table class="uk-table uk-table-hover uk-table-condensed">
|
||||
<caption>{{ user.nickname }}</caption>
|
||||
<tbody class="uk-text-small">
|
||||
<tr>
|
||||
<td class="uk-width-4-10">TS Points</td>
|
||||
<td class="uk-width-6-10 uk-text-right">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Events Points</td>
|
||||
<td class="uk-text-right">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Forum Points</td>
|
||||
<td class="uk-text-right">0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Seen</td>
|
||||
<td class="date uk-text-right">{{ user.last_seen | js_datetime }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Member Since</td>
|
||||
<td class="date uk-text-right">{{ user.created | js_datetime }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="uk-button uk-button-success uk-align-center" data-uk-modal="{target: '#winrate_modal'}">View Winrate</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div id="winrate_modal" class="uk-modal">
|
||||
<div class="uk-modal-dialog uk-modal-dialog-frameless uk-modal-dialog-large">
|
||||
<a class="uk-modal-close uk-close uk-close-alt"></a>
|
||||
</div>
|
||||
<div id="winrate_graph" class="uk-overflow-container"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagescripts %}
|
||||
<script src="http://code.highcharts.com/highcharts.js"></script>
|
||||
{% cache 60*700 %}
|
||||
<script>
|
||||
$('#winrate_modal').on({
|
||||
'uk.modal.show': function(){
|
||||
Highcharts.charts[0].reflow();
|
||||
},
|
||||
});
|
||||
$(function () {
|
||||
$('#winrate_graph').highcharts({
|
||||
chart: { reflow: true },
|
||||
title: { text: "Win rate for {{ user.nickname }}" },
|
||||
subtitle: { text: "Over last {{ user.winrate_data['total_games'] }} games" },
|
||||
xAxis: {type: 'datetime', dateTimeLabelFormats:{
|
||||
month:'%m'
|
||||
}
|
||||
},
|
||||
yAxis: {min: 0.35, max: 0.90, plotLines: [{value:0, width:2, color:'#808080'}]},
|
||||
legend: {enabled: false},
|
||||
series: [
|
||||
{
|
||||
name: '{{ user.nickname }}',
|
||||
data: [
|
||||
{% for date_nums, windowed in user.winrate_data['data'] %}
|
||||
[({{ date_nums }} * 1000), parseFloat({{ windowed }}.toFixed(3))],
|
||||
{% endfor %}
|
||||
]
|
||||
},
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user