diff options
Diffstat (limited to 'templates/_film_card.html')
| -rw-r--r-- | templates/_film_card.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/templates/_film_card.html b/templates/_film_card.html new file mode 100644 index 0000000..9fcd89b --- /dev/null +++ b/templates/_film_card.html @@ -0,0 +1,70 @@ +<article class="film-card"> + <a class="poster-frame" href="/films/{{ film.id }}" aria-label="{{ film.title }}"> + {% if film.poster_url %} + <img src="{{ film.poster_url }}" alt="{{ film.title }} poster"> + {% else %} + <span>{{ film.title[:1] }}</span> + {% endif %} + </a> + <div class="film-card-body"> + <div class="film-card-header"> + <div> + <h2><a href="/films/{{ film.id }}">{{ film.title }}</a></h2> + <p class="muted"> + {% if film.year %}{{ film.year }}{% endif %} + {% set directors = split_credit_names(film.director) %} + {% if directors %} + {% if film.year %} · {% endif %} + {% for director in directors %} + <a class="inline-link" href="{{ director_href(director) }}">{{ director }}</a>{% if not loop.last %}, {% endif %} + {% endfor %} + {% endif %} + </p> + </div> + {% if film.stars %} + <span class="rating">{% for _ in range(film.stars) %}✦{% endfor %}</span> + {% endif %} + </div> + + <div class="meta-row"> + <span>{{ film.shelf|title }}</span> + {% if film.date_watched %}<span>{{ film.date_watched }}</span>{% endif %} + {% if film.runtime %}<span>{{ film.runtime }} min</span>{% endif %} + {% if film.language %}<span>{{ film.language }}</span>{% endif %} + {% if film.rewatch %}<span>Rewatch</span>{% endif %} + </div> + + {% if film.context or film.how_found or film.watched_with %} + <div class="tag-row"> + {% if film.context %}<span>{{ film.context }}</span>{% endif %} + {% if film.how_found %}<span>{{ film.how_found }}</span>{% endif %} + {% if film.watched_with %}<span>With {{ film.watched_with }}</span>{% endif %} + </div> + {% endif %} + + {% if film.notes %} + <p class="notes-preview">{{ film.notes[:220] }}{% if film.notes|length > 220 %}...{% endif %}</p> + {% endif %} + + <div class="inline-actions"> + {% if film.shelf == 'queue' %} + <a class="small-button" href="/films/{{ film.id }}/edit?shelf=diary">Mark watched</a> + <form method="post" action="/films/{{ film.id }}/shelf/abandoned"> + <button class="secondary-button" type="submit">Abandon</button> + </form> + {% elif film.shelf == 'diary' %} + <form method="post" action="/films/{{ film.id }}/shelf/queue"> + <button class="secondary-button" type="submit">Move to queue</button> + </form> + <form method="post" action="/films/{{ film.id }}/shelf/abandoned"> + <button class="secondary-button" type="submit">Mark abandoned</button> + </form> + {% else %} + <a class="small-button" href="/films/{{ film.id }}/edit?shelf=diary">Mark watched</a> + <form method="post" action="/films/{{ film.id }}/shelf/queue"> + <button class="secondary-button" type="submit">Move to queue</button> + </form> + {% endif %} + </div> + </div> +</article> |
