From 8a5486fb2c8c611e0da51aa45831270834273abe Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 18 Aug 2025 20:28:43 -0400 Subject: [PATCH] [templates] Remove sidebar, add dashboard links --- vrobbler/apps/webpages/models.py | 4 +- vrobbler/apps/webpages/urls.py | 6 +- vrobbler/apps/webpages/views.py | 2 +- vrobbler/templates/base.html | 77 ------------------- vrobbler/templates/books/book_detail.html | 2 +- .../templates/scrobbles/_last_scrobbles.html | 44 ++++++++--- .../templates/scrobbles/scrobble_list.html | 8 ++ vrobbler/templates/tasks/task_detail.html | 4 +- 8 files changed, 50 insertions(+), 97 deletions(-) diff --git a/vrobbler/apps/webpages/models.py b/vrobbler/apps/webpages/models.py index 84d9e43..28fcbcf 100644 --- a/vrobbler/apps/webpages/models.py +++ b/vrobbler/apps/webpages/models.py @@ -67,10 +67,10 @@ class WebPage(ScrobblableMixin): self.save(update_fields=["extract"]) def get_absolute_url(self): - return reverse("webpages:webpage-detail", kwargs={"slug": self.uuid}) + return reverse("webpages:webpage_detail", kwargs={"slug": self.uuid}) def get_read_url(self): - return reverse("webpages:webpage-read", kwargs={"slug": self.uuid}) + return reverse("webpages:webpage_read", kwargs={"slug": self.uuid}) @property def estimated_time_to_read_in_seconds(self): diff --git a/vrobbler/apps/webpages/urls.py b/vrobbler/apps/webpages/urls.py index e5b155d..3c771bf 100644 --- a/vrobbler/apps/webpages/urls.py +++ b/vrobbler/apps/webpages/urls.py @@ -5,15 +5,15 @@ app_name = "webpages" urlpatterns = [ - path("webpages/", views.WebPageListView.as_view(), name="webpage-list"), + path("webpages/", views.WebPageListView.as_view(), name="webpage_list"), path( "webpages//", views.WebPageDetailView.as_view(), - name="webpage-detail", + name="webpage_detail", ), path( "webpage//read/", views.WebPageReadView.as_view(), - name="webpage-read", + name="webpage_read", ), ] diff --git a/vrobbler/apps/webpages/views.py b/vrobbler/apps/webpages/views.py index 5a3fac7..62056d5 100644 --- a/vrobbler/apps/webpages/views.py +++ b/vrobbler/apps/webpages/views.py @@ -32,7 +32,7 @@ class WebPageReadView( if latest_scrobble.played_to_completion: redirect( reverse( - "webpages:webpage-detail", kwargs={"slug": webpage.uuid} + "webpages:webpage_detail", kwargs={"slug": webpage.uuid} ) ) return super().get(*args, **kwargs) diff --git a/vrobbler/templates/base.html b/vrobbler/templates/base.html index f900288..a1aa285 100644 --- a/vrobbler/templates/base.html +++ b/vrobbler/templates/base.html @@ -208,85 +208,8 @@ {% endfor %} {% endif %} - {% block extra_nav %} {% endblock %} -
{% if now_playing_list and user.is_authenticated %}
    diff --git a/vrobbler/templates/books/book_detail.html b/vrobbler/templates/books/book_detail.html index dd82988..2002565 100644 --- a/vrobbler/templates/books/book_detail.html +++ b/vrobbler/templates/books/book_detail.html @@ -45,7 +45,7 @@ {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %} {{scrobble.local_timestamp}} - {% if scrobble.long_play_complete == True %}Yes{% endif %} + {% if scrobble.logdata.long_play_complete == True %}Yes{% endif %} {% if scrobble.in_progress %}Now reading{% else %}{{scrobble.session_pages_read}}{% endif %} {% for author in scrobble.book.authors.all %}{{author}}{% if not forloop.last %}, {% endif %}{% endfor %} diff --git a/vrobbler/templates/scrobbles/_last_scrobbles.html b/vrobbler/templates/scrobbles/_last_scrobbles.html index 5be8c44..ed703b9 100644 --- a/vrobbler/templates/scrobbles/_last_scrobbles.html +++ b/vrobbler/templates/scrobbles/_last_scrobbles.html @@ -7,62 +7,78 @@
    +

    Tracks

    {% if Track %} -

    Music

    {% with scrobbles=Track count=Track_count time=Track_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} + No tracks today {% endif %}
    +

    Tasks

    {% if Task %} -

    Latest tasks

    {% with scrobbles=Task count=Task_count time=Task_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No tasks today

    {% endif %} +

    Videos

    {% if Video %} -

    Videos

    {% with scrobbles=Video count=Video_count time=Video_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No videos today

    {% endif %} +

    Web pages

    {% if WebPage %} -

    Web pages

    {% with scrobbles=WebPage count=WebPage_count time=WebPage_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else%} +

    No web page read today

    {% endif %} +

    Sport events

    {% if SportEvent %} -

    Sports

    {% with scrobbles=SportEvent count=SportEvent_count time=SportEvent_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No sports today

    {% endif %} +

    Podcasts

    {% if PodcastEpisode %} -

    Latest podcasts

    {% with scrobbles=PodcastEpisode count=PodcastEpisode_count time=PodcastEpisode_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No podcasts today

    {% endif %} +

    Video games

    {% if VideoGame %} -

    Video games

    {% with scrobbles=VideoGame count=VideoGame_count time=VideoGame_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No video games today

    {% endif %} +

    Board games

    {% if BoardGame %} -

    Board games

    {% with scrobbles=BoardGame count=BoardGame_count time=BoardGame_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No board games today

    {% endif %} {% if Beer %} @@ -72,25 +88,31 @@ {% endwith %} {% endif %} +

    Brick sets

    {% if BrickSet %} -

    Brick sets

    {% with scrobbles=BrickSet count=BrickSet_count time=BrickSet_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No brick sets today

    {% endif %} +

    Puzzles

    {% if Puzzle %} -

    Puzzles

    {% with scrobbles=Puzzle count=Puzzle_count time=Puzzle_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No puzzles today

    {% endif %} +

    Books

    {% if Book %} -

    Books

    {% with scrobbles=Book count=Book_count time=Book_time %} {% include "scrobbles/_scrobble_table.html" %} {% endwith %} + {% else %} +

    No books today

    {% endif %}
    diff --git a/vrobbler/templates/scrobbles/scrobble_list.html b/vrobbler/templates/scrobbles/scrobble_list.html index 66f56ef..4065894 100644 --- a/vrobbler/templates/scrobbles/scrobble_list.html +++ b/vrobbler/templates/scrobbles/scrobble_list.html @@ -56,6 +56,14 @@

    {% if date %}{{date|naturaltime}}{% else %}{{title}}{% endif %}

    {% if user.is_authenticated %} +
    +
    + +
    +
    {% if user.profile.lastfm_username and not user.profile.lastfm_auto_import %}
    diff --git a/vrobbler/templates/tasks/task_detail.html b/vrobbler/templates/tasks/task_detail.html index ea29461..fdc3333 100644 --- a/vrobbler/templates/tasks/task_detail.html +++ b/vrobbler/templates/tasks/task_detail.html @@ -54,7 +54,7 @@ Date - Description + Title Notes Source @@ -63,7 +63,7 @@ {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %} {{scrobble.local_timestamp}} - {{scrobble.logdata.description}} + {{scrobble.logdata.title}} {{scrobble.logdata.notes_as_str|safe}} {{scrobble.source}}