comlib/templates/book.html

40 lines
3.4 KiB
HTML
Raw Normal View History

2023-12-16 10:00:19 +00:00
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
2023-12-17 03:23:28 +00:00
<div class="mx-width-1050 m-auto p-0-10 p-b-0">
2023-12-16 10:00:19 +00:00
<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 %}
<svg xmlns="http://www.w3.org/2000/svg" height="100%" width="100%" version="1.1" preserveAspectRatio="xMidYMid meet" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 600 900" style="fill: currentColor; position: absolute">
2023-12-17 03:23:28 +00:00
<rect y="5" width="590px" x="5" height="890px" style="fill: rgb(209 213 219);"></rect>
<polygon points="360,895 510,895 595,810 595,660" fill="#5BCEFA"/>
<polygon points="390,895 480,895 595,780 595,690" fill="#F5A9B8"/>
<polygon points="420,895 450,895 595,750 595,720" fill="#FFF"/>
<text y="946" x="-270" font-size="19" font-weight="bold" fill="black" transform="rotate(-45)" font-family="sans">Trans rights!</text>
<polygon points="5,130 5,200 330,5 220,5" fill="red"></polygon>
<text y="150" x="-20" transform="rotate(-31)" fill="#e5d579" font-weight="bold" font-size="20" font-family="sans">Comrades Library</text>
<rect y="5" width="590px" style="fill: none; stroke-width:5; stroke: currentColor" x="5" height="890px"/>
2023-12-16 10:00:19 +00:00
<text font-family="serif" font-weight="bold">
{% set name = this.title.split("? ")[0] %}
2023-12-17 03:23:28 +00:00
<tspan y="160" x="580" font-size="{{ 63 - name|length }}" style="text-anchor:end">{{ name }}</tspan>
<tspan y="200" x="575" font-size="25" style="text-anchor:end;font-style:italic;">{{ this.author }}</tspan>
{% if this.pub_date and this.publisher %}<tspan y="230" x="575" font-size="21" style="text-anchor:end">Published {{ this.pub_date }}, by {{ this.publisher }}</tspan>{% endif %}
<tspan y="880" x="15" font-size="18" style="text-anchor:start">https://comlib.encryptionin.space</tspan>
2023-12-16 10:00:19 +00:00
</text>
</svg>
{% endif %}
</div>
<p class="bold text-3xl">{{ this.title }}</p>
{% if this.subtitle %}<p class="subtitle">{{ this.subtitle }}</p>{% endif %}
<p>{% if this.publisher %}{{ this.publisher }}, {% endif %}{{ this.pub_date }}</p>
{% if this.author %}<p class="italics">{{ this.author }}</span>{% endif %}
<div class="mt-2">
{% if this.epub %}<p>Download EPUB:</p>{% for item in this.epub %}<p>{% set urls = item.split(", ") %}{% for url in urls %}{% if "https://" in url %}<a href="{{ url }}">{{ url.split('https://')[1].split('/')[0] }}</a>{% else %}<a href="/lib/epub/{{ url }}">comlib.encryptionin.space</a>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endfor %}{% endif %}
{% if this.orig %}<p {% if this.epub %}class="mt-1"{% endif %}>Download source PDF:</p>{% for item in this.orig %}<p>{% set urls = item.split(", ") %}{% for url in urls %}{% if "https://" in url %}<a href="{{ url }}">{{ url.split('https://')[1].split('/')[0] }}</a>{% elif "http://" in url %}<a href="{{ url }}">{{ url.split('http://')[1].split('/')[0] }}</a>{% else %}<a href="/lib/cache/{{ url }}">cached</a>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endfor %}{% endif %}
</div>
</div>
</div>
{% endblock %}