more data

This commit is contained in:
j 2021-11-22 10:20:10 +01:00
parent de78084b29
commit 490c712689
4 changed files with 54 additions and 17 deletions

View file

@ -28,14 +28,24 @@
font-size: 20px; font-size: 20px;
} }
figure { figure {
div {
aspect-ratio: 4/3;
img { img {
display: none; display: none;
//max-width: 100%;
max-height: 100%;
object-fit: cover;
}
img:first-child {
display: inherit
}
}
figcaption {
img {
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
object-fit: contain; object-fit: contain;
} }
img:first-child {
display: inherit
} }
} }
} }
@ -232,6 +242,10 @@ main > .film {
.film-play-padma { .film-play-padma {
font-family: "wrong font"; font-family: "wrong font";
a {
color: #ddd;
text-decoration: none;
}
} }
.film-play-spacer { .film-play-spacer {

View file

@ -38,8 +38,21 @@ body {
<h1> <h1>
<span class="font-bold">{{ film.data.title | safe }}</span> <span class="font-bold">{{ film.data.title | safe }}</span>
</h1> </h1>
<div class="date">
{{ film.data.date | safe }}
</div>
<div class="country">
{{ film.data.country|default:''|join:', ' }}
</div>
<div class="type">
{{ film.data.type|default:''|join:', ' }}
</div>
<div class="details"> <div class="details">
{{ film.data.description|default:'' }} {{ film.data.description|default:''|safe }}
</div>
<div class="featuring">
Featuring:
{{ film.data.featuring|default:''|join:', ' }}
</div> </div>
</div> </div>
@ -66,7 +79,7 @@ body {
<figure> <figure>
<img src="https://archive.njp.ma/{{ item.id }}/480p.jpg"> <img src="https://archive.njp.ma/{{ item.id }}/480p.jpg">
<figcaption> <figcaption>
{{ item.title | safe }} {{ item.title | safe }} ({{item.date | safe }})
</figcaption> </figcaption>
</figure> </figure>
</a> </a>
@ -83,7 +96,6 @@ body {
<div class="text"> <div class="text">
<a href="{{ text.get_absolute_url }}"> <a href="{{ text.get_absolute_url }}">
{{ text.title | safe }}<br> {{ text.title | safe }}<br>
{{ text.byline | striptags }}
</a> </a>
</div> </div>
{% endfor %} {% endfor %}

View file

@ -37,7 +37,7 @@
<img src="https://archive.njp.ma/{{ film.data.items.0.id }}/timeline64p.jpg"> <img src="https://archive.njp.ma/{{ film.data.items.0.id }}/timeline64p.jpg">
</figcaption> </figcaption>
<figcaption> <figcaption>
{{ film.data.title | safe }} {{ film.data.title | safe }} ({{ film.data.date|safe}})
</figcaption> </figcaption>
</figure> </figure>
</a> </a>

View file

@ -25,18 +25,29 @@ class Command(BaseCommand):
}, },
'keys': [ 'keys': [
'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location', 'id', 'title', 'director', 'summary', 'source', 'sourcedescription', 'date', 'location',
'country', 'type',
'duration', 'featuring', 'cinematographer', 'duration', 'featuring', 'cinematographer',
'hue', 'saturation', 'lightness', 'hue', 'saturation', 'lightness',
'folder', 'folderdescription' 'folder', 'folderdescription', 'rightslevel'
], ],
'sort': [{'key': 'duration', 'operator': '-'}],
'range': [0, 1000] 'range': [0, 1000]
} }
folders = {} folders = {}
for item in api.find(**query)['data']['items']: for item in api.find(**query)['data']['items']:
if item['rightslevel'] > 0:
continue
if isinstance(item['folder'], list):
print(item['id'])
if item['folder'] not in folders: if item['folder'] not in folders:
description = item['folderdescription'] or item['summary'] description = item['folderdescription'] or item['summary']
folders[item['folder']] = { folders[item['folder']] = {
'title': item['folder'], 'title': item['folder'],
'date': item['date'],
'country': item['country'],
'featuring': item['featuring'],
'type': item['type'],
'description': description, 'description': description,
'url': api.url.replace('/api/', '/grid/folder==' + escape(item['folder'])), 'url': api.url.replace('/api/', '/grid/folder==' + escape(item['folder'])),
'items': [], 'items': [],