1 {% extends "documents/base.html" %}
4 {% load build_absolute_uri from fnp_common %}
7 {% block titleextra %}{% trans "Cover image" %}{% endblock %}
10 <h1>{% trans "Cover image" %}</h1>
12 <div class="col-md-5">
19 <form method="post" enctype="multipart/form-data">
22 <table class='editable'><tbody>
23 {% bootstrap_form form %}
26 <button type="submit" class="btn btn-primary">{% trans "Change" %}</button>
30 {% if editable %}</form>{% endif %}
34 <div class="col-md-7">
35 {% with perc=object.cut_percentages %}
36 <a href="{{ object.use_file.url }}" style="position: relative; display: block; width: {{ perc.width }}px; height: {{ perc.height }}px;">
37 {% thumbnail object.file perc.th as th %}
38 <img src="{{ th.url }}" />
41 <div style="background: black; opacity: .5; display: block; position: absolute; top:0; left: 0; right: 0; height: {{ perc.top }}%"></div>
42 <div style="background: black; opacity: .5; display: block; position: absolute; bottom:0; left: 0; right: 0; height: {{ perc.bottom }}%"></div>
43 <div style="background: black; opacity: .5; display: block; position: absolute; top: {{ perc.top }}%; bottom: {{ perc.bottom }}%; left: 0; width: {{ perc.left }}%"></div>
44 <div style="background: black; opacity: .5; display: block; position: absolute; top: {{ perc.top }}%; bottom: {{ perc.bottom }}%; right: 0; width: {{ perc.right }}%"></div>
48 <br/><a href="{{ object.source_url }}">{{ object.title }}</a> by {{ object.author }},
49 {% if object.license_url %}<a href="{{ object.license_url }}">{% endif %}
50 {{ object.license_name }}
51 {% if object.license_url %}</a>{% endif %}
53 {% if object.example %}
55 <img src="{{ object.example.url }}?{{ object.etag }}">
62 <textarea style="width:100%" rows="6" class="form-control mt-4" disabled>
63 <dc:relation.coverImage.url xmlns:dc="http://purl.org/dc/elements/1.1/">{{ object.use_file.url|build_absolute_uri:request }}</dc:relation.coverImage.url>
64 <dc:relation.coverImage.attribution xmlns:dc="http://purl.org/dc/elements/1.1/">{{ object.attribution }}</dc:relation.coverImage.attribution>
65 <dc:relation.coverImage.source xmlns:dc="http://purl.org/dc/elements/1.1/">{{ object.get_full_url }}</dc:relation.coverImage.source></textarea>
67 <div class="card mt-4">
68 <div class="card-header">
69 <h2>{% trans "Used in:" %}</h2>
71 <div class="card-body">
72 {% if object.book_set.exists %}
73 <ul style="list-style: none; padding: 0; display: flex; gap: 10px;">
74 {% for book in object.book_set.all %}
76 <a href="{{ book.get_absolute_url }}">
77 <img src="{{ book.cover.url }}?{{ object.etag }}" alt="{{ book }}">
81 <a href="{{ book.get_absolute_url }}" title="{{ book }}">
82 <img src="{{ book.cover.url }}?{{ object.etag }}" alt="{{ book }}">
88 <p>{% trans "None" %}</p>