Add generic body_header with navigation bar

master
Felix Stupp 3 years ago
parent 03a97fc975
commit 70805c18de
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -8,7 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
<a href="/collection">&lt;- back to list</a>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<h2>Properties</h2>
<ul>

@ -8,7 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
<a href="/collection">&lt;- back to list</a>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<form method="post" action="/api/collection/extract">
{{ macros.hidden_redirect_back() }}

@ -8,6 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<table>
<tr>

@ -39,6 +39,13 @@
<input type="hidden" name="redirect" value="{{ url_for(request.endpoint, **request.view_args) }}{{ ('#' + fragment) if fragment else '' }}"/>
{% endmacro %}
{% macro no_input_post_form(uri, text, fragment="") -%}
<form class="form-single-button" method="POST" action="{{ uri }}">
{{ hidden_redirect_back(fragment=fragment) }}
<button>{{ text }}</button>
</form>
{%- endmacro %}
{% macro post_form(uri, key, val, text, fragment="") %}
<form class="form-single-button" method="POST" action="{{ uri }}">
{{ hidden_redirect_back(fragment=fragment) }}
@ -54,6 +61,29 @@
<a class="button" href="entertainment-decider:///player/play?{{ opts | encode_options }}">Play</a>
{%- endmacro -%}
{% macro _navigation() %}
{% set links = {
"Home": "/",
"Latest Media": "/media",
"All Collections": "/collection",
"Pinned Collections": "/collection/pinned",
"Show Old Variety": "/recommendations/simple/variety",
"BINGE": "/recommendations/simple/binge",
"Stats": "/stats",
"Tags": "/tag",
"Add Media": "/media/extract",
"Add Collection": "/collection/extract",
} %}
{% for name, uri in links.items() %}
<a class="button" href="{{ uri }}">{{ name }}</a>
{% endfor %}
{{ no_input_post_form("/api/refresh/collections", "Refresh Collections") }}
{%- endmacro %}
{% macro body_header() %}
{{ _navigation() }}
{%- endmacro %}
{% macro media_element_buttons(element) %}
{% set api_uri = "/api/media/" + element.id|string %}
{% set fragment = "media_element_" + element.id|string %}

@ -8,7 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
<a href="/media">&lt;- back to list</a>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<h2>Notes</h2>
<pre>{{ element.notes or "" }}</pre>

@ -8,7 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
<a href="/media">&lt;- back to list</a>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<form method="post" action="/api/media/extract">
{{ macros.hidden_redirect_back() }}

@ -8,6 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
{{ macros.media_table(media_list) }}
</body>

@ -8,6 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<ul>
<li>Persistent Value: {{ random_val }}</li>

@ -8,6 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<ul>
{% set cats = (

@ -8,6 +8,7 @@
{{ macros.shared_style() }}
</head>
<body>
{{ macros.body_header() }}
<h1>{{ title }}</h1>
<table>
<tr>

Loading…
Cancel
Save