add work overview pages
This commit is contained in:
parent
fba8cbdcc7
commit
3ef82c8024
9 changed files with 92 additions and 10 deletions
|
@ -1,12 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}{{ categorization.capitalize() }} - DLibrary{% endblock %}
|
||||
{% block body %}
|
||||
{% from 'utils.html' import root with context %}
|
||||
<h1 id="list-title"><a href="{{ root() }}">DLibrary</a> > <a href="{{ root() }}{{ categorization }}">{{ categorization.capitalize() }}</a></h1>
|
||||
{% from 'utils.html' import urlcat, root with context %}
|
||||
<h1 id="title"><a href="{{ root() }}">DLibrary</a> > <a href="{{ root() }}{{ categorization }}">{{ categorization.capitalize() }}</a></h1>
|
||||
{% include 'nav.html' %}
|
||||
<div class="card-listing">
|
||||
{% for cat in categories %}
|
||||
<div class="card category">
|
||||
<a href="{{ root() }}{{ categorization }}/{{ cat | replace('/', ' ') | urlencode }}/">
|
||||
<a href="{{ root() }}{{ categorization }}/{{ urlcat(cat) }}/">
|
||||
<div class="card-title">
|
||||
{{ cat }}
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{% extends 'base.html' %}
|
||||
{% block body %}
|
||||
{% from 'utils.html' import root with context %}
|
||||
<h1 id="list-title"><a href="{{ root() }}">DLibrary</a>{% if categorization %} > <a href="{{ root() }}{{ categorization }}">{{ categorization.capitalize() }}</a>{% endif %}{% if title %} > {{ title }}{% endif %}</h1>
|
||||
<div class="nav">{% for c in ['circles', 'authors', 'tags', 'series'] %}<div class="nav-item"><a href="{{ root() }}{{ c }}">{{ c.capitalize() }}</a></div>{% endfor %}</div>
|
||||
<h1 id="title"><a href="{{ root() }}">DLibrary</a>{% if categorization %} > <a href="{{ root() }}{{ categorization }}">{{ categorization.capitalize() }}</a>{% endif %}{% if title %} > {{ title }}{% endif %}</h1>
|
||||
{% include 'nav.html' %}
|
||||
<div class="card-listing">
|
||||
{% for work in works %}
|
||||
<div class="card">
|
||||
|
|
2
dlibrary/templates/nav.html
Normal file
2
dlibrary/templates/nav.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
{% from 'utils.html' import root with context %}
|
||||
<div class="nav">{% for c in ['circles', 'authors', 'tags', 'series'] %}<div class="nav-item"><a href="{{ root() }}{{ c }}">{{ c.capitalize() }}</a></div>{% endfor %}</div>
|
|
@ -1 +1,2 @@
|
|||
{% macro root() %}{% for i in range(depth) %}../{% endfor %}{% endmacro %}
|
||||
{% macro urlcat(s) %}{{ s | replace('/', ' ') | urlencode }}{% endmacro %}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<link rel="stylesheet" type="text/css" href="{{ root() }}static/viewer.css">
|
||||
<script>
|
||||
const WORK_ID = "{{ work['id'] }}";
|
||||
const ROOT = "{{ root() }}";
|
||||
</script>
|
||||
<script src="{{ root() }}static/viewer.js"></script>
|
||||
{% endblock %}
|
||||
|
|
40
dlibrary/templates/work.html
Normal file
40
dlibrary/templates/work.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
{% extends 'base.html' %}
|
||||
{% block body %}
|
||||
{% from 'utils.html' import urlcat, root with context %}
|
||||
<h1 id="title"><a href="{{ root() }}">DL</a> > {{ title }}</h1>
|
||||
<div class="work-container">
|
||||
<div class="work-preview">
|
||||
<a href="view/">
|
||||
<img src="{{ root() }}thumbnails/{{ work['id'] }}.jpg">
|
||||
</a>
|
||||
</div>
|
||||
<div class="work-info">
|
||||
<table>
|
||||
{% if work['circle'] %}
|
||||
<tr>
|
||||
<th>Circle</th>
|
||||
<td><a class="work-info-link" href="{{ root() }}circles/{{ urlcat(work['circle']) }}">{{ work['circle'] }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if work['authors'] %}
|
||||
<tr>
|
||||
<th>Authors</th>
|
||||
<td>{% for author in work['authors'] %}<a class="work-info-link" href="{{ root() }}authors/{{ urlcat(author) }}">{{ author }}</a> {% endfor %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if work['tags'] %}
|
||||
<tr>
|
||||
<th>Tags</th>
|
||||
<td>{% for tag in work['tags'] %}<a class="work-info-link" href="{{ root() }}tags/{{ urlcat(tag) }}">{{ tag }}</a> {% endfor %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if work['series'] %}
|
||||
<tr>
|
||||
<th>Series</th>
|
||||
<td><a class="work-info-link" href="{{ root() }}series/{{ urlcat(work['series']) }}">{{ work['series'] }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue