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 {
img { div {
display: none; aspect-ratio: 4/3;
max-width: 100%; img {
max-height: 100%; display: none;
object-fit: contain; //max-width: 100%;
max-height: 100%;
object-fit: cover;
}
img:first-child {
display: inherit
}
} }
img:first-child { figcaption {
display: inherit img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
} }
} }
} }
@ -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,9 +38,22 @@ 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>
<div class="featuring">
Featuring:
{{ film.data.featuring|default:''|join:', ' }}
</div>
</div> </div>
<div class="video-block"> <div class="video-block">
@ -65,9 +78,9 @@ body {
<a href="play/{{ item.id }}"> <a href="play/{{ item.id }}">
<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>
</div> </div>
@ -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

@ -33,11 +33,11 @@
<img src="https://archive.njp.ma/{{ item.id }}/480p.jpg"> <img src="https://archive.njp.ma/{{ item.id }}/480p.jpg">
{% endfor %} {% endfor %}
</div> </div>
<figcaption>
<img src="https://archive.njp.ma/{{ film.data.items.0.id }}/timeline64p.jpg">
</figcaption>
<figcaption> <figcaption>
{{ film.data.title | safe }} <img src="https://archive.njp.ma/{{ film.data.items.0.id }}/timeline64p.jpg">
</figcaption>
<figcaption>
{{ 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': [],