thumbnail view: Add overlay to unconsidered media

- calling functions can define, if overlay or check for considerable is required
master
Felix Stupp 2 years ago
parent 4866901159
commit 688433d22a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -513,6 +513,7 @@ def list_media() -> ResponseReturnValue:
return render_template(
"media_list.htm",
media_list=common.limit_iter(media_list, 100),
check_considered=False,
)
@ -540,6 +541,7 @@ def list_long_media(seconds: int = 10 * 60) -> ResponseReturnValue:
return render_template(
"media_list.htm",
media_list=list(itertools.islice(media_list, 100)),
check_considered=False,
)
@ -572,6 +574,7 @@ def list_unsorted_media() -> ResponseReturnValue:
return render_template(
"media_list.htm",
media_list=media_list,
check_considered=True,
)

@ -112,6 +112,7 @@
<h2>Episodes</h2>
{{ macros.media_thumbnail_list(
links=media_links,
check_considered=True,
link_collection=False,
) }}
{% endif %}

@ -14,6 +14,7 @@
<h2>Episodes</h2>
{{ macros.media_thumbnail_list(
links=media_links,
check_considered=True,
link_collection=False,
) }}
</body>

@ -14,12 +14,14 @@
<h2>Began Videos</h2>
{{ macros.media_thumbnail_list(
elements=began_videos,
check_considered=True,
) }}
{% endif %}
<h2>From Pinned Collections</h2>
{% if links_from_pinned_collections %}
{{ macros.media_thumbnail_list(
links=links_from_pinned_collections,
check_considered=False,
link_collection=True,
) }}
{% else %}
@ -29,6 +31,7 @@
<h2>Latest Videos</h2>
{{ macros.media_thumbnail_list(
elements=media_list,
check_considered=False,
) }}
</body>
</html>

@ -134,7 +134,8 @@
z-index: 20;
}
.thumbnail_view > .overlay.watched,
.thumbnail_view > .overlay.ignored {
.thumbnail_view > .overlay.ignored,
.thumbnail_view > .overlay.not_considered {
opacity: 66%;
}
.thumbnail_view > .overlay.watched {
@ -143,6 +144,9 @@
.thumbnail_view > .overlay.ignored {
background-color: rgba(117, 0, 0, 0.7);
}
.thumbnail_view > .overlay.not_considered {
background-color: rgba(34, 34, 34, 0.7);
}
.thumbnail_view > .button_list {
display: inline-flex;
flex-wrap: nowrap;
@ -377,6 +381,7 @@
{% macro media_thumbnail_view(
element=None,
link=None,
check_considered=True,
link_collection=True,
) %}
{% set element = link.element if link else element %}
@ -409,6 +414,9 @@
<div class="overlay
{%- if element.watched %} watched
{%- elif element.ignored %} ignored
{%- elif (
check_considered and not element.can_considered
) %} not_considered
{%- endif -%}
"></div>
<div class="button_list">
@ -442,6 +450,7 @@
{% macro media_thumbnail_list(
elements=None,
links=None,
check_considered=True,
link_collection=True,
) %}
{%- set l = elements or links -%}
@ -451,6 +460,7 @@
{{ media_thumbnail_view(
element=o if not links else None,
link=o if links else None,
check_considered=False,
link_collection=link_collection,
) }}
{% endfor %}

@ -12,6 +12,7 @@
<h1>{{ title }}</h1>
{{ macros.media_thumbnail_list(
elements=media_list,
check_considered=check_considered|default(True),
) }}
</body>
</html>

@ -12,6 +12,7 @@
<h1>{{ title }}</h1>
{{ macros.media_thumbnail_list(
elements=media_list,
check_considered=False,
) }}
</body>
</html>

Loading…
Cancel
Save