Procházet zdrojové kódy

[templates] Fix food templates and such

Colin Powell před 1 měsícem
rodič
revize
5cac1fe109

+ 33 - 0
vrobbler/templates/foods/food_detail.html

@@ -0,0 +1,33 @@
+{% extends "base_list.html" %}
+{% load static %}
+
+{% block title %}{{object.title}}{% endblock %}
+
+{% block lists %}
+<div class="row webpage">
+    <div class="webpage-metadata">
+      <p>{{object.description}}</p>
+    </div>
+</div>
+<div class="row">
+    <div class="col-md">
+        <h3>Last scrobbles</h3>
+        <div class="table-responsive">
+            <table class="table table-striped table-sm">
+            <thead>
+                <tr>
+                    <th scope="col">Date</th>
+                </tr>
+            </thead>
+            <tbody>
+                {% for scrobble in scrobbles.all %}
+                <tr>
+                        <td><a href={{scrobble.get_absolute_url}}>{{scrobble.local_timestamp}}</a></td>
+                </tr>
+                {% endfor %}
+            </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+{% endblock %}

+ 23 - 0
vrobbler/templates/foods/food_list.html

@@ -0,0 +1,23 @@
+{% extends "base_list.html" %}
+
+{% block title %}Foods{% endblock %}
+
+{% block head_extra %}
+<style>
+ dl { width: 210px; float:left; margin-right: 10px; }
+ dt a { color:white; text-decoration: none; font-size:smaller; }
+ img { height:200px; width: 200px; object-fit: cover; }
+ dd .right { float:right; }
+</style>
+{% endblock  %}
+
+{% block lists %}
+<div class="row">
+
+    <div class="col-md">
+        <div class="table-responsive">
+            {% include "_scrobblable_list.html" %}
+        </div>
+    </div>
+</div>
+{% endblock %}

+ 2 - 0
vrobbler/templates/scrobbles/scrobble_detail.html

@@ -12,7 +12,9 @@
 <h1>{{ object.media_obj }} - {{object.media_type}}</h1>
 
 <!-- Your existing detail page content -->
+{% if object.logdata.avg_seconds_per_page %}
 <p>Rate: {{object.logdata.avg_seconds_per_page}}s per page</p>
+{% endif %}
 
 <h2>Edit Log</h2>
 <form method="post" class="needs-validation" novalidate>

+ 1 - 1
vrobbler/templates/webpages/webpage_detail.html

@@ -53,7 +53,7 @@
             <tbody>
                 {% for scrobble in scrobbles.all %}
                 <tr>
-                    <td>{{scrobble.local_timestamp}}</td>
+                    <td><a href={{scrobble.get_absolute_url}}>{{scrobble.local_timestamp}}</a></td>
                 </tr>
                 {% endfor %}
             </tbody>