diff --git a/PROJECT.org b/PROJECT.org index f0cf3b8..1421346 100644 --- a/PROJECT.org +++ b/PROJECT.org @@ -88,7 +88,7 @@ fetching and simple saving. *** Metadata sources **** Scraper -* Backlog [0/23] :vrobbler:project:personal: +* Backlog [1/24] :vrobbler:project:personal: ** TODO [#C] After transition to linux add curl_cffi as webpage scrapper again :webpages:metadata: ** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :bug:music:scrobbles: :PROPERTIES: @@ -605,6 +605,10 @@ independent of the email flow it was originally creatdd for ** TODO [#B] Is there way to create unique slugs for media instances :media_types: +** DONE [#B] Clean up trend templates :trends:templates: +:PROPERTIES: +:ID: 83237e2c-857b-47c9-c86c-32a5e3f1359d +:END: * Version 58.7 [2/2] ** DONE [#B] Split up chart page between tables and maloja :charts:templates: :PROPERTIES: diff --git a/vrobbler/apps/charts/views.py b/vrobbler/apps/charts/views.py index 9a88541..beb1831 100644 --- a/vrobbler/apps/charts/views.py +++ b/vrobbler/apps/charts/views.py @@ -447,9 +447,13 @@ class MalojaChartsView(ChartRecordView): context = super(ChartRecordView, self).get_context_data(**kwargs) user = self.request.user + if not user.is_authenticated: + context["maloja_charts"] = {} + context["chart_keys"] = {} + return context + now = timezone.now() - if user.is_authenticated: - now = now_user_timezone(user.profile) + now = now_user_timezone(user.profile) today = now.date() context["chart_keys"] = { diff --git a/vrobbler/apps/trends/templates/trends/_activity_distribution.html b/vrobbler/apps/trends/templates/trends/_activity_distribution.html index aa480d3..c086b60 100644 --- a/vrobbler/apps/trends/templates/trends/_activity_distribution.html +++ b/vrobbler/apps/trends/templates/trends/_activity_distribution.html @@ -1,45 +1,78 @@
Total scrobbles{% if current_period_label %} ({{ current_period_label }}){% endif %}: {{ data.total_count }}
-| Media Type | -Total | -Completed | -% | -Distribution | -
|---|---|---|---|---|
| {{ entry.media_type }} | -{{ entry.count }} | -{{ entry.completed }} | -{{ entry.pct }}% | -
- {% if max > 0 %}
-
-
-
- {% endif %}
- |
-
No activity data found.
{% endif %} diff --git a/vrobbler/apps/trends/templates/trends/_mood_distribution.html b/vrobbler/apps/trends/templates/trends/_mood_distribution.html index 78438cc..3231166 100644 --- a/vrobbler/apps/trends/templates/trends/_mood_distribution.html +++ b/vrobbler/apps/trends/templates/trends/_mood_distribution.html @@ -1,43 +1,74 @@Total mood check-ins{% if current_period_label %} ({{ current_period_label }}){% endif %}: {{ data.total }} · Positive: {{ data.positive_count }} · Negative: {{ data.negative_count }}
-| Mood | -Count | -Distribution | -
|---|---|---|
| {{ entry.mood }} | -{{ entry.count }} | -
- {% if max > 0 %}
-
-
-
- {% endif %}
- |
-
No mood distribution data found.
{% endif %} diff --git a/vrobbler/apps/trends/templates/trends/_mood_trajectory.html b/vrobbler/apps/trends/templates/trends/_mood_trajectory.html index 78ff5dc..ecbe15e 100644 --- a/vrobbler/apps/trends/templates/trends/_mood_trajectory.html +++ b/vrobbler/apps/trends/templates/trends/_mood_trajectory.html @@ -1,37 +1,105 @@| Date | -Avg Quality | -Check-ins | -Mood Bar | -
|---|---|---|---|
| {{ entry.date }} | -{{ entry.avg_quality }} | -{{ entry.count }} | -
-
-
-
- |
-
No mood check-in data found.
{% endif %} diff --git a/vrobbler/apps/trends/templates/trends/_peak_hours.html b/vrobbler/apps/trends/templates/trends/_peak_hours.html index 5385e96..eb4ea22 100644 --- a/vrobbler/apps/trends/templates/trends/_peak_hours.html +++ b/vrobbler/apps/trends/templates/trends/_peak_hours.html @@ -1,50 +1,90 @@| Hour | -Scrobbles | -Distribution | -
|---|---|---|
| - {% if entry.hour == 0 %} - 12 AM - {% elif entry.hour < 12 %} - {{ entry.hour }} AM - {% elif entry.hour == 12 %} - 12 PM - {% else %} - {{ entry.hour|add:"-12" }} PM - {% endif %} - | -{{ entry.count }} | -
- {% if max_count > 0 %}
-
-
-
- {% endif %}
- |
-
| + | Hour | +Scrobbles | +
|---|---|---|
| + + | ++ {% if entry.hour == 0 %} + 12 AM + {% elif entry.hour < 12 %} + {{ entry.hour }} AM + {% elif entry.hour == 12 %} + 12 PM + {% else %} + {{ entry.hour|add:"-12" }} PM + {% endif %} + | +{{ entry.count }} | +
No activity data found.
{% endif %} diff --git a/vrobbler/apps/trends/templates/trends/_time_of_day_categories.html b/vrobbler/apps/trends/templates/trends/_time_of_day_categories.html index a80a5de..31f0e25 100644 --- a/vrobbler/apps/trends/templates/trends/_time_of_day_categories.html +++ b/vrobbler/apps/trends/templates/trends/_time_of_day_categories.html @@ -1,31 +1,45 @@| Category | -Scrobbles | -% | -
|---|---|---|
| {{ info.label }} | -{{ info.count }} | -{{ info.pct }}% | -
| Total | -{{ data.total }} | -- |
| Media Type | -Recent ({{ current_period_label }}) | -Previous ({{ current_period_label }}) | -Change | -
|---|---|---|---|
| {{ mt }} | -{{ info.recent }} | -{{ info.previous }} | -- {% if info.change_pct > 0 %} - +{{ info.change_pct }}% - {% elif info.change_pct < 0 %} - {{ info.change_pct }}% - {% else %} - 0% - {% endif %} - | -
No trending data found.
- {% endif %} -No trending data found.
+