Add chart view when not auth'd
This commit is contained in:
@ -117,9 +117,11 @@ class RecentScrobbleList(ListView):
|
||||
"year": list(live_charts(**track, chart_period="year")),
|
||||
"all": list(live_charts(**track)),
|
||||
}
|
||||
data["counts"] = scrobble_counts(user)
|
||||
else:
|
||||
data["weekly_data"] = week_of_scrobbles()
|
||||
data["counts"] = scrobble_counts()
|
||||
|
||||
# data["weekly_data"] = week_of_scrobbles(user=user)
|
||||
data["counts"] = scrobble_counts(user)
|
||||
data["imdb_form"] = ScrobbleForm
|
||||
data["export_form"] = ExportScrobbleForm
|
||||
return data
|
||||
|
||||
@ -78,8 +78,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if show_chart %}
|
||||
<canvas class="my-4 w-100" id="myChart" width="900" height="150"></canvas>
|
||||
{% if not user.is_authenticated %}
|
||||
<p>Today <b>{{counts.today}}</b> | This Week <b>{{counts.week}}</b> | This Month <b>{{counts.month}}</b> | This Year <b>{{counts.year}}</b> | All Time <b>{{counts.alltime}}</b></p>
|
||||
<canvas class="my-4 w-100" id="myChart" width="900" height="300"></canvas>
|
||||
{% endif %}
|
||||
|
||||
<div class="container">
|
||||
@ -434,8 +435,7 @@
|
||||
|
||||
<div class="row">
|
||||
<h2>Last Scrobbles</h2>
|
||||
<p>Today <b>{{counts.today}}</b> | This Week <b>{{counts.week}}</b> | This Month <b>{{counts.month}}</b> |
|
||||
This Year <b>{{counts.year}}</b> | All Time <b>{{counts.alltime}}</b></p>
|
||||
<p>Today <b>{{counts.today}}</b> | This Week <b>{{counts.week}}</b> | This Month <b>{{counts.month}}</b> | This Year <b>{{counts.year}}</b> | All Time <b>{{counts.alltime}}</b></p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
@ -670,7 +670,7 @@
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: false
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user