Переглянути джерело

[bricksets] Add templates

Colin Powell 5 днів тому
батько
коміт
1cf50209a4

+ 56 - 0
vrobbler/templates/bricksets/brickset_detail.html

@@ -0,0 +1,56 @@
+{% extends "base_list.html" %}
+{% load mathfilters %}
+{% load static %}
+{% load naturalduration %}
+
+{% block title %}{{object.title}}{% endblock %}
+
+{% block lists %}
+
+<div class="row">
+
+    {% if object.cover%}
+    <p style="float:left; width:402px; padding:0; border: 1px solid #ccc">
+        <img src="{{object.cover.url}}" width=400 />
+    </p>
+    {% endif %}
+    <div style="float:left; width:600px; margin-left:10px; ">
+        {% if object.summary %}
+        <p>{{object.summary|safe|linebreaks|truncatewords:160}}</p>
+        <hr />
+        {% endif %}
+        <p style="float:right;">
+            <a href="{{object.openlibrary_link}}"><img src="{% static " images/openlibrary-logo.png" %}" width=35></a>
+            <a href="{{object.amazon_link}}"><img src="{% static " images/amazon-logo.png" %}" width=35></a>
+        </p>
+    </div>
+</div>
+<div class="row">
+    <p>{{scrobbles.count}} scrobbles</p>
+</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>
+                        <th scope="col">Completed</th>
+                        <th scope="col">Time</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    {% for scrobble in scrobbles.all|dictsortreversed:"timestamp" %}
+                    <tr>
+                        <td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></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>
+                    </tr>
+                    {% endfor %}
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+{% endblock %}

+ 23 - 0
vrobbler/templates/bricksets/brickset_list.html

@@ -0,0 +1,23 @@
+{% extends "base_list.html" %}
+
+{% block title %}Brick Sets{% 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 %}