comlib/templates/book.html

30 lines
2.1 KiB
HTML

{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
<main class="epub p-b-0">
<div class="p-1-5 mb-1 bg-light-grey rounded overflow-hidden">
<div class="float-right w25 aspect-64 ml-1 relative">
{% if this.image %}
<img style="position: absolute; max-width: 100%; max-height: 100%" src="{{ ("images/" + this.image)|asseturl }}">
{% else %}
{% include 'svg.html' %}
{% endif %}
</div>
<p class="bold text-3xl">{{ this.title }}</p>
{% if this.subtitle %}<p class="subtitle">{{ this.subtitle }}</p>{% endif %}
{% if this.author %}<p>{{ this.author }}</p>{% endif %}
<p class="italics">{% if this.publisher %}{{ this.publisher }}, {% endif %}{{ this.pub_date }}</p>
{% if this.length %}<p>Length: {{ this.length }}</p>{% endif %}
<div class="mt-2">
{% if this.epub %}<p>Download EPUB:</p><p><a href="/lib/epub/{{ this.epub }}">From Comrades Library</a></p>{% endif %}
{% if this.external %}{% for item in this.external %}<p><a href="{{ item }}">From {{ item.split('://')[1].split('/')[0] }}</a></p>{% endfor %}{% endif %}
{% if this.orig %}<p{% if this.epub %} class="mt-1"{% endif %}>Source used to create EPUB:</p>{% for item in this.orig %}<p>{% set urls = item.split(", ") %}{% for url in urls %}{% if "http" in url %}<a href="{{ url }}">{{ url.split('://')[1].split('/')[0] }}</a>{% else %}<a href="/lib/cache/{{ url }}">cached</a>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endfor %}{% endif %}
{% if this.html or this.prolewiki %}<p class="mt-1">Read online:</p>{% endif %}
{% if this.html %}<p><a href="/lib/html/{{ this.html }}/">On Comrades Library</a></p>{% endif %}
{% if this.prolewiki %}<p><a href="https://en.prolewiki.org/wiki/Library:{{ this.prolewiki }}">On ProleWiki</a></p>{% endif %}
{% if this.marxists %}<p><a href="{{ this.marxists }}">On marxists.org</a></p>{% endif %}
</div>
</div>
</main>
{% endblock %}