mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Pulse / performance range selector now also for tracks
This commit is contained in:
parent
360bc97610
commit
a908a5e6a3
@ -4,6 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Maloja - KEY_TRACKTITLE</title>
|
||||
<script src="javascript/rangeselect.js" async></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -29,11 +30,31 @@
|
||||
<tr>
|
||||
<td>
|
||||
<h2><a href='/pulse?KEY_SCROBBLELINK&step=year&trail=1'>Pulse</a></h2>
|
||||
KEY_PULSE
|
||||
<span onclick="showRange('pulse','days')" class="stat_selector_pulse selector_pulse_days">7 days</span>
|
||||
| <span onclick="showRange('pulse','weeks')" class="stat_selector_pulse selector_pulse_weeks">12 weeks</span>
|
||||
| <span onclick="showRange('pulse','months')" class="stat_selector_pulse selector_pulse_months" style="opacity:0.5;">12 months</span>
|
||||
| <span onclick="showRange('pulse','years')" class="stat_selector_pulse selector_pulse_years">10 years</span>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<span class="stat_module_pulse pulse_months">KEY_PULSE_MONTHS</span>
|
||||
<span class="stat_module_pulse pulse_days" style="display:none;">KEY_PULSE_DAYS</span>
|
||||
<span class="stat_module_pulse pulse_years" style="display:none;">KEY_PULSE_YEARS</span>
|
||||
<span class="stat_module_pulse pulse_weeks" style="display:none;">KEY_PULSE_WEEKS</span>
|
||||
</td>
|
||||
<td>
|
||||
<h2><a href='/performance?KEY_SCROBBLELINK&step=year&trail=1'>Performance</a></h2>
|
||||
KEY_PERFORMANCE
|
||||
<span onclick="showRange('pulse','days')" class="stat_selector_pulse selector_pulse_days">7 days</span>
|
||||
| <span onclick="showRange('pulse','weeks')" class="stat_selector_pulse selector_pulse_weeks">12 weeks</span>
|
||||
| <span onclick="showRange('pulse','months')" class="stat_selector_pulse selector_pulse_months" style="opacity:0.5;">12 months</span>
|
||||
| <span onclick="showRange('pulse','years')" class="stat_selector_pulse selector_pulse_years">10 years</span>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<span class="stat_module_pulse pulse_months">KEY_PERFORMANCE_MONTHS</span>
|
||||
<span class="stat_module_pulse pulse_days" style="display:none;">KEY_PERFORMANCE_DAYS</span>
|
||||
<span class="stat_module_pulse pulse_years" style="display:none;">KEY_PERFORMANCE_YEARS</span>
|
||||
<span class="stat_module_pulse pulse_weeks" style="display:none;">KEY_PERFORMANCE_WEEKS</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -1,5 +1,6 @@
|
||||
import urllib
|
||||
import database
|
||||
from malojatime import today,thisweek,thismonth,thisyear
|
||||
|
||||
|
||||
def instructions(keys):
|
||||
@ -40,6 +41,17 @@ def instructions(keys):
|
||||
html_pulse = module_pulse(track=track,step="year",stepn=1,trail=1)
|
||||
html_performance = module_performance(track=track,step="year",stepn=1,trail=1)
|
||||
|
||||
# pulse and rankings
|
||||
html_pulse_days = module_pulse(track=track,max_=7,since=today().next(-6),step="day",trail=1)
|
||||
html_pulse_weeks = module_pulse(track=track,max_=12,since=thisweek().next(-11),step="week",trail=1)
|
||||
html_pulse_months = module_pulse(track=track,max_=12,since=thismonth().next(-11),step="month",trail=1)
|
||||
html_pulse_years = module_pulse(track=track,max_=10,since=thisyear().next(-9),step="year",trail=1)
|
||||
|
||||
html_performance_days = module_performance(track=track,max_=7,since=today().next(-6),step="day",trail=1)
|
||||
html_performance_weeks = module_performance(track=track,max_=12,since=thisweek().next(-11),step="week",trail=1)
|
||||
html_performance_months = module_performance(track=track,max_=12,since=thismonth().next(-11),step="month",trail=1)
|
||||
html_performance_years = module_performance(track=track,max_=10,since=thisyear().next(-9),step="year",trail=1)
|
||||
|
||||
|
||||
replace = {
|
||||
"KEY_TRACKTITLE":track.get("title"),
|
||||
@ -50,8 +62,16 @@ def instructions(keys):
|
||||
"KEY_SCROBBLELINK":compose_querystring(keys),
|
||||
"KEY_MEDALS":html_medals,
|
||||
"KEY_SCROBBLELIST":html_scrobbles,
|
||||
"KEY_PULSE":html_pulse,
|
||||
"KEY_PERFORMANCE":html_performance
|
||||
# pulse
|
||||
"KEY_PULSE_MONTHS":html_pulse_months,
|
||||
"KEY_PULSE_YEARS":html_pulse_years,
|
||||
"KEY_PULSE_DAYS":html_pulse_days,
|
||||
"KEY_PULSE_WEEKS":html_pulse_weeks,
|
||||
# performance
|
||||
"KEY_PERFORMANCE_MONTHS":html_performance_months,
|
||||
"KEY_PERFORMANCE_YEARS":html_performance_years,
|
||||
"KEY_PERFORMANCE_DAYS":html_performance_days,
|
||||
"KEY_PERFORMANCE_WEEKS":html_performance_weeks,
|
||||
}
|
||||
|
||||
return (replace,pushresources)
|
||||
|
Loading…
Reference in New Issue
Block a user