Add board and video games to index

This commit is contained in:
2023-06-06 11:55:45 -04:00
parent 6d841167ea
commit 9e38798f44
2 changed files with 75 additions and 0 deletions

View File

@ -91,6 +91,14 @@ class RecentScrobbleList(ListView):
sport_event__isnull=False
).order_by("-timestamp")[:15]
data["videogame_scrobble_list"] = completed_for_user.filter(
video_game__isnull=False
).order_by("-timestamp")[:15]
data["boardgame_scrobble_list"] = completed_for_user.filter(
board_game__isnull=False
).order_by("-timestamp")[:15]
data["active_imports"] = AudioScrobblerTSVImport.objects.filter(
processing_started__isnull=False,
processed_finished__isnull=True,

View File

@ -451,6 +451,14 @@
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#latest-sports"
type="button" role="tab" aria-controls="profile" aria-selected="false">Sports</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#latest-videogames"
type="button" role="tab" aria-controls="profile" aria-selected="false">Video Games</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#latest-boardgames"
type="button" role="tab" aria-controls="profile" aria-selected="false">Board Games</button>
</li>
</ul>
<div class="tab-content" id="myTabContent2">
@ -560,6 +568,65 @@
</table>
</div>
</div>
<div class="tab-pane fade show" id="latest-videogames" role="tabpanel"
aria-labelledby="latest-videogames-tab">
<h2>Latest Video Games</h2>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Cover</th>
<th scope="col">Title</th>
<th scope="col">Score</th>
</tr>
</thead>
<tbody>
{% for scrobble in videogame_scrobble_list %}
<tr>
<td>{{scrobble.timestamp|naturaltime}}</td>
{% if scrobble.videogame_screenshot %}
<td><a href="{{scrobble.media_obj.get_absolute_url}}"><img src="{{scrobble.videogame_screenshot.url}}" width=25 height=25 style="border:1px solid black;" /></aa></td>
{% else %}
<td><a href="{{scrobble.media_obj.get_absolute_url}}"><img src="{{scrobble.media_obj.primary_image_url}}" width=25 height=25 style="border:1px solid black;" /></aa></td>
{% endif %}
<td>{{scrobble.media_obj.title}}</td>
<td>{{scrobble.media_obj.hltb_score}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="tab-pane fade show" id="latest-boardgames" role="tabpanel"
aria-labelledby="latest-boardgames-tab">
<h2>Latest Board Games</h2>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Cover</th>
<th scope="col">Title</th>
<th scope="col">Rating</th>
</tr>
</thead>
<tbody>
{% for scrobble in boardgame_scrobble_list %}
<tr>
<td>{{scrobble.timestamp|naturaltime}}</td>
<td><a href="{{scrobble.media_obj.get_absolute_url}}"><img src="{{scrobble.media_obj.primary_image_url}}" width=25 height=25 style="border:1px solid black;" /></aa></td>
<td>{{scrobble.media_obj.title}}</td>
<td>{{scrobble.media_obj.rating}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
</div>