Move fastext nav to page top, fix Settings header, add working search
All checks were successful
Deploy / deploy (push) Successful in 23s

- Fastext colour keys now lead every page but the index, since they're
  the only nav those pages carry; the index keeps them as its closing
  row since its own body is already the full nav.
- Settings page was missing page="settings" in its render_template
  call, so its header silently fell back to "P100 Index".
- Library's search form posted a q param the route never read; it now
  filters the cached Sonarr/Radarr lists and shows matching tiles.
- Discover gained a search bar that queries Ombi (already in front of
  TMDB/TVDB) and lets you add a result straight to Radarr/Sonarr,
  showing "Held" instead of a button for anything already in library.
- Fixed the Add button's success check, which read d.ok against a
  response that actually sets d.success — it reported FAILED even
  when the add worked.
This commit is contained in:
Barely Removable 2026-08-30 08:26:47 -07:00
parent 08491c0c9b
commit abaccaaacd
6 changed files with 172 additions and 16 deletions

View file

@ -45,19 +45,28 @@ provenance.
<span class="tt-head-clock" id="head-clock"></span>
</header>
<main class="tt-page">
{% block content %}{% endblock %}
</main>
{#- Fastext: the four coloured keys. Each page names its own four, so the
keys always point somewhere useful from where you are. -#}
<nav class="fastext" aria-label="Fastext">
keys always point somewhere useful from where you are. On the index
it stays the closing row, under Now Showing/Just Added, since the
index's own body already is the full nav. Everywhere else it leads,
right under the header, since it's the only nav those pages carry. -#}
{% set fastext_nav %}
<nav class="fastext{{ '' if page == 'home' else ' fastext-top' }}" aria-label="Fastext">
{% for cls, key, num, label, href in fastext %}
<a class="{{ cls }}" href="{{ request.script_root }}{{ href }}" data-key="{{ key }}">
<span>{{ num }} {{ label }}</span>
</a>
{% endfor %}
</nav>
{% endset %}
{% if page != 'home' %}{{ fastext_nav }}{% endif %}
<main class="tt-page">
{% block content %}{% endblock %}
</main>
{% if page == 'home' %}{{ fastext_nav }}{% endif %}
<footer class="tt-foot">
<span>MEDIA CENTRE</span>

View file

@ -1,11 +1,40 @@
{% extends "_shell.html" %}
{% from "_macros.html" import tile %}
{% from "_macros.html" import tile, service_error %}
{% block title %}P103 Discover{% endblock %}
{% block content %}
<h1 class="tt-dh bloom tt-masthead">DISCOVER</h1>
<p class="tt-empty">Popular right now, with anything already in library filtered out.</p>
{#- Search sits at the top for the same reason it does on Library: a
title in mind is the common case. This one asks Ombi, which already
sits in front of TheMovieDB/TVDB, then lets you add straight to
Radarr/Sonarr from the result. -#}
<form class="tt-search" action="{{ request.script_root }}/discover" method="get" role="search">
<label class="visually-hidden" for="q">Search Ombi for a title</label>
<input class="tt-input" type="search" id="q" name="q" value="{{ q }}"
placeholder="SEARCH TO ADD" autocomplete="off" spellcheck="false">
<button class="tt-btn" type="submit">Search</button>
</form>
{% if search %}
<div class="tt-field">
<span>Results</span>
<span class="tt-field-meta">&ldquo;{{ q }}&rdquo;</span>
</div>
{% if search.status != 'ok' %}
{{ service_error('Ombi', search.error) }}
{% elif search.results %}
<div class="tt-tiles">
{% for it in search.results %}
{{ tile(it.title, it.kind ~ (' · Held' if it.held else ''), it.poster, it.year, ('' if it.held else '+ Add'), it.target) }}
{% endfor %}
</div>
{% else %}
<p class="tt-empty">No matches for &ldquo;{{ q }}&rdquo;.</p>
{% endif %}
{% endif %}
<div class="tt-field">
<span>Films</span>
<span class="tt-field-meta">{{ rt_movies | length }} not in library</span>

View file

@ -14,6 +14,22 @@
<button class="tt-btn" type="submit">Search</button>
</form>
{% if search_results is not none %}
<div class="tt-field">
<span>Results</span>
<span class="tt-field-meta">{{ search_results | length }} match{{ 'es' if search_results | length != 1 else '' }}</span>
</div>
{% if search_results %}
<div class="tt-tiles">
{% for it in search_results %}
{{ tile(it.title, it.kind, it.poster, it.year) }}
{% endfor %}
</div>
{% else %}
<p class="tt-empty">No matches for &ldquo;{{ q }}&rdquo;.</p>
{% endif %}
{% endif %}
<div class="tt-field">
<span>Holdings</span>
<span class="tt-field-meta">
@ -55,7 +71,7 @@
{{ service_error('Radarr', radarr.error) }}
{% endif %}
{% if recently_added %}
{% if not q and recently_added %}
<div class="tt-field"><span>Newest In</span></div>
<div class="tt-tiles">
{% for it in recently_added %}