Skip to content

Add the Golden Times theme as a new selectable theme - #1664

Open
HyperCriSiS wants to merge 1 commit into
crocodilestick:mainfrom
HyperCriSiS:golden-times-theme
Open

HyperCriSiS wants to merge 1 commit into
crocodilestick:mainfrom
HyperCriSiS:golden-times-theme

Conversation

@HyperCriSiS

Copy link
Copy Markdown

Summary

This adds Golden Times, a dark theme built on the standard Bootstrap 3 templates without caliBlur, as a new selectable theme next to caliBlur. It uses theme id 2; the light theme (0) stays disabled as before.

Books

What it does:

  • A dark, warm palette with gold accents, applied consistently to the library, book details, Books List, editing, admin, tasks, search and the error pages.
  • Fixed top bar with the current page title, a back arrow, search and the account actions; fixed sidebar with collapsible Browse, Shelves and Magic Shelves sections and a plus button to create shelves.
  • Sorting and page navigation live in a band under the bar that stays visible while scrolling.
  • Cover grid with clean cards; covers open the book page directly, read books are marked on the cover.
  • Random picks appear as their own labeled row above the library.
  • Phone layout: the sidebar becomes a drawer, sorting and page navigation swipe horizontally, uploading sits behind a small plus menu.
  • Opt-in only: every change sits behind theme id 2. Existing users stay on caliBlur, which renders byte-identical output apart from blank lines; no template or script is removed.
More screenshots

Detail
Edit
Profile
Books List

Phone (390px):

Changes

  • cps/static/css/golden-times.css, cps/static/js/golden-times.js: the theme assets. The script only sets Isotope's transition duration to 0, moves the browse navigation into the drawer below 768px, drives the back arrow and the collapsible sections, and adds a folder upload trigger.
  • Templates: every change is a {% if g.current_theme == 2 %} branch; themes 0 and 1 render byte-identical output apart from blank lines (verified by rendering all list, grid, shelf, duplicates, error and table pages with the original and the patched templates). layout.html gets a small page_navigation macro so the band can render the pagination before the body.
  • cps/admin.py: g.current_theme honors 2; the light theme stays disabled and caliBlur stays the default.
  • cps/web.py, user_edit.html, config_view_edit.html: the theme selects offer Golden Times for users and as the admin default.
  • root/etc/s6-overlay/s6-rc.d/cwa-init/run: the start-up theme enforcement still moves theme 0 to caliBlur but leaves theme 2 alone, so the choice survives a restart (verified in the container). No database migration changes.

Testing

  • CWA 4.0.8 container (crocodilestick/calibre-web-automated:latest) with this branch's cps folder mounted: logged in, selected Golden Times in the profile, walked Books, Authors, Series, Books List, detail, edit metadata, Admin, Tasks, Search, Advanced Search, Profile and the 404 page at 1440 and 390 px. No JavaScript errors.
  • A Playwright fixture (rendering these templates against the sample library) checks first-paint stability, Isotope grid pitch, the sticky band, the drawer, the upload menu, the table pagination and the random section at 1440, 1920, 390 and 320 px.

The theme is maintained in the Calibre AIO Home Assistant add-on, where it has been in daily use. Happy to rename the aio- class prefix or split the template branches differently if you prefer.

Golden Times is a dark theme built on the standard Bootstrap 3 templates
without caliBlur. It ships as golden-times.css and golden-times.js and
as template branches on g.current_theme == 2: a fixed bar with the page
title and a history back arrow, collapsible sidebar sections with a plus
action for shelves, a sticky band that holds sorting and page navigation,
cover cards that open the book page, a details-based upload menu and a
styled error and shelf download page. The caliBlur and light theme
templates render unchanged.

Users pick it in their profile, admins as the default theme; caliBlur
remains the default and the light theme stays disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant