[templates] Remove sidebar, add dashboard links
This commit is contained in:
@ -67,10 +67,10 @@ class WebPage(ScrobblableMixin):
|
|||||||
self.save(update_fields=["extract"])
|
self.save(update_fields=["extract"])
|
||||||
|
|
||||||
def get_absolute_url(self):
|
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):
|
def get_read_url(self):
|
||||||
return reverse("webpages:webpage-read", kwargs={"slug": self.uuid})
|
return reverse("webpages:webpage_read", kwargs={"slug": self.uuid})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def estimated_time_to_read_in_seconds(self):
|
def estimated_time_to_read_in_seconds(self):
|
||||||
|
|||||||
@ -5,15 +5,15 @@ app_name = "webpages"
|
|||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("webpages/", views.WebPageListView.as_view(), name="webpage-list"),
|
path("webpages/", views.WebPageListView.as_view(), name="webpage_list"),
|
||||||
path(
|
path(
|
||||||
"webpages/<slug:slug>/",
|
"webpages/<slug:slug>/",
|
||||||
views.WebPageDetailView.as_view(),
|
views.WebPageDetailView.as_view(),
|
||||||
name="webpage-detail",
|
name="webpage_detail",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"webpage/<slug:slug>/read/",
|
"webpage/<slug:slug>/read/",
|
||||||
views.WebPageReadView.as_view(),
|
views.WebPageReadView.as_view(),
|
||||||
name="webpage-read",
|
name="webpage_read",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class WebPageReadView(
|
|||||||
if latest_scrobble.played_to_completion:
|
if latest_scrobble.played_to_completion:
|
||||||
redirect(
|
redirect(
|
||||||
reverse(
|
reverse(
|
||||||
"webpages:webpage-detail", kwargs={"slug": webpage.uuid}
|
"webpages:webpage_detail", kwargs={"slug": webpage.uuid}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return super().get(*args, **kwargs)
|
return super().get(*args, **kwargs)
|
||||||
|
|||||||
@ -208,85 +208,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<ul class="nav flex-column">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" aria-current="page" href="/">
|
|
||||||
<span data-feather="music"></span>
|
|
||||||
Dashboard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% if user.is_authenticated %}
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" aria-current="page" href="/charts/">
|
|
||||||
<span data-feather="bar-chart"></span>
|
|
||||||
Charts
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" aria-current="page" href="/locations/">
|
|
||||||
<span data-feather="map"></span>
|
|
||||||
Locations
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/long-plays/">
|
|
||||||
<span data-feather="playv"></span>
|
|
||||||
Long plays
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/moods/">
|
|
||||||
<span data-feather="smiley"></span>
|
|
||||||
Moods
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/books/">
|
|
||||||
<span data-feather="book"></span>
|
|
||||||
Books
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/video-games/">
|
|
||||||
<span data-feather="video"></span>
|
|
||||||
Video games
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/board-games/">
|
|
||||||
<span data-feather="board"></span>
|
|
||||||
Board games
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/trails/">
|
|
||||||
<span data-feather="trail"></span>
|
|
||||||
Trails
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/beers/">
|
|
||||||
<span data-feather="beer"></span>
|
|
||||||
Beers
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/imports/">
|
|
||||||
<span data-feather="log"></span>
|
|
||||||
Imports
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/admin/">
|
|
||||||
<span data-feather="key"></span>
|
|
||||||
Admin
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
{% block extra_nav %}
|
{% block extra_nav %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<hr/>
|
|
||||||
|
|
||||||
{% if now_playing_list and user.is_authenticated %}
|
{% if now_playing_list and user.is_authenticated %}
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
{% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
|
{% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
|
<td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
|
||||||
<td>{% if scrobble.long_play_complete == True %}Yes{% endif %}</td>
|
<td>{% if scrobble.logdata.long_play_complete == True %}Yes{% endif %}</td>
|
||||||
<td>{% if scrobble.in_progress %}Now reading{% else %}{{scrobble.session_pages_read}}{% endif %}</td>
|
<td>{% if scrobble.in_progress %}Now reading{% else %}{{scrobble.session_pages_read}}{% endif %}</td>
|
||||||
<td>{% for author in scrobble.book.authors.all %}<a href="{{author.get_absolute_url}}">{{author}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
|
<td>{% for author in scrobble.book.authors.all %}<a href="{{author.get_absolute_url}}">{{author}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -7,62 +7,78 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md">
|
<div class="col-md">
|
||||||
|
<h3><a href="{% url 'music:tracks_list' %}">Tracks</a></h3>
|
||||||
{% if Track %}
|
{% if Track %}
|
||||||
<h2>Music</h2>
|
|
||||||
{% with scrobbles=Track count=Track_count time=Track_time %}
|
{% with scrobbles=Track count=Track_count time=Track_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
No tracks today
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md">
|
<div class="col-md">
|
||||||
|
|
||||||
|
<h3><a href="{% url 'tasks:task_list' %}">Tasks</a></h3>
|
||||||
{% if Task %}
|
{% if Task %}
|
||||||
<h2>Latest tasks</h2>
|
|
||||||
{% with scrobbles=Task count=Task_count time=Task_time %}
|
{% with scrobbles=Task count=Task_count time=Task_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No tasks today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'videos:movie_list' %}">Videos</a></h3>
|
||||||
{% if Video %}
|
{% if Video %}
|
||||||
<h2>Videos</h2>
|
|
||||||
{% with scrobbles=Video count=Video_count time=Video_time %}
|
{% with scrobbles=Video count=Video_count time=Video_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No videos today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'webpages:webpage_list' %}">Web pages</a></h3>
|
||||||
{% if WebPage %}
|
{% if WebPage %}
|
||||||
<h4>Web pages</h4>
|
|
||||||
{% with scrobbles=WebPage count=WebPage_count time=WebPage_time %}
|
{% with scrobbles=WebPage count=WebPage_count time=WebPage_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else%}
|
||||||
|
<p>No web page read today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'sports:event_list' %}">Sport events</a></h3>
|
||||||
{% if SportEvent %}
|
{% if SportEvent %}
|
||||||
<h2>Sports</h2>
|
|
||||||
{% with scrobbles=SportEvent count=SportEvent_count time=SportEvent_time %}
|
{% with scrobbles=SportEvent count=SportEvent_count time=SportEvent_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No sports today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'podcasts:podcast_list' %}">Podcasts</a></h3>
|
||||||
{% if PodcastEpisode %}
|
{% if PodcastEpisode %}
|
||||||
<h2>Latest podcasts</h2>
|
|
||||||
{% with scrobbles=PodcastEpisode count=PodcastEpisode_count time=PodcastEpisode_time %}
|
{% with scrobbles=PodcastEpisode count=PodcastEpisode_count time=PodcastEpisode_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No podcasts today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url "videogames:videogame_list" %}">Video games</a></h3>
|
||||||
{% if VideoGame %}
|
{% if VideoGame %}
|
||||||
<h4>Video games</h4>
|
|
||||||
{% with scrobbles=VideoGame count=VideoGame_count time=VideoGame_time %}
|
{% with scrobbles=VideoGame count=VideoGame_count time=VideoGame_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No video games today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url "boardgames:boardgame_list" %}">Board games</a></h3>
|
||||||
{% if BoardGame %}
|
{% if BoardGame %}
|
||||||
<h4>Board games</h4>
|
|
||||||
{% with scrobbles=BoardGame count=BoardGame_count time=BoardGame_time %}
|
{% with scrobbles=BoardGame count=BoardGame_count time=BoardGame_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No board games today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if Beer %}
|
{% if Beer %}
|
||||||
@ -72,25 +88,31 @@
|
|||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'bricksets:brickset_list' %}">Brick sets</a></h3>
|
||||||
{% if BrickSet %}
|
{% if BrickSet %}
|
||||||
<h4>Brick sets</h4>
|
|
||||||
{% with scrobbles=BrickSet count=BrickSet_count time=BrickSet_time %}
|
{% with scrobbles=BrickSet count=BrickSet_count time=BrickSet_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No brick sets today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'puzzles:puzzle_list' %}">Puzzles</aa></h3>
|
||||||
{% if Puzzle %}
|
{% if Puzzle %}
|
||||||
<h4>Puzzles</h4>
|
|
||||||
{% with scrobbles=Puzzle count=Puzzle_count time=Puzzle_time %}
|
{% with scrobbles=Puzzle count=Puzzle_count time=Puzzle_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No puzzles today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<h3><a href="{% url 'books:book_list' %}">Books</a></h3>
|
||||||
{% if Book %}
|
{% if Book %}
|
||||||
<h4>Books</h4>
|
|
||||||
{% with scrobbles=Book count=Book_count time=Book_time %}
|
{% with scrobbles=Book count=Book_count time=Book_time %}
|
||||||
{% include "scrobbles/_scrobble_table.html" %}
|
{% include "scrobbles/_scrobble_table.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
<p>No books today</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -56,6 +56,14 @@
|
|||||||
<h1 class="h2">{% if date %}{{date|naturaltime}}{% else %}{{title}}{% endif %}</h1>
|
<h1 class="h2">{% if date %}{{date|naturaltime}}{% else %}{{title}}{% endif %}</h1>
|
||||||
<div class="btn-toolbar mb-2 mb-md-0">
|
<div class="btn-toolbar mb-2 mb-md-0">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
|
<div class="btn-group me-2">
|
||||||
|
<form action="/admin/" method="get">
|
||||||
|
<button type="submit" class="btn btn-sm btn-outline-secondary">
|
||||||
|
<span data-feather="key"></span>
|
||||||
|
Admin
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<div class="btn-group me-2">
|
<div class="btn-group me-2">
|
||||||
{% if user.profile.lastfm_username and not user.profile.lastfm_auto_import %}
|
{% if user.profile.lastfm_username and not user.profile.lastfm_auto_import %}
|
||||||
<form action="{% url 'scrobbles:lastfm-import' %}" method="get">
|
<form action="{% url 'scrobbles:lastfm-import' %}" method="get">
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Date</th>
|
<th scope="col">Date</th>
|
||||||
<th scope="col">Description</th>
|
<th scope="col">Title</th>
|
||||||
<th scope="col">Notes</th>
|
<th scope="col">Notes</th>
|
||||||
<th scope="col">Source</th>
|
<th scope="col">Source</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
{% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
|
{% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
|
<td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
|
||||||
<td><a href="{{scrobble.get_media_source_url}}">{{scrobble.logdata.description}}</a></td>
|
<td><a href="{{scrobble.get_media_source_url}}">{{scrobble.logdata.title}}</a></td>
|
||||||
<td>{{scrobble.logdata.notes_as_str|safe}}</td>
|
<td>{{scrobble.logdata.notes_as_str|safe}}</td>
|
||||||
<td>{{scrobble.source}}</td>
|
<td>{{scrobble.source}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user