No description
  • Python 62.1%
  • HTML 18.4%
  • CSS 11.6%
  • JavaScript 7%
  • Mako 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-08 12:47:49 +01:00
src chore: release splent_io/splent_feature_slider to v0.4.1 2026-11-08 12:47:49 +01:00
.gitignore fix: ship the compiled translations, so a released feature is actually translated 2026-07-30 18:15:10 +02:00
COPYING License under LGPL-3.0-or-later 2026-10-11 11:48:18 +02:00
COPYING.LESSER License under LGPL-3.0-or-later 2026-10-11 11:48:18 +02:00
MANIFEST.in feat: seed the homepage hero slideshow from the old site 2026-08-12 16:37:41 +02:00
pyproject.toml chore: release splent_io/splent_feature_slider to v0.4.1 2026-11-08 12:47:49 +01:00
README.md docs: say the carousel opens to everyone, signed in or not 2026-10-21 03:09:43 +02:00

splent_feature_slider

The slider feature of a SPLENT product line.

A SPLENT feature is a Python package that a product composes with others: its models, routes, services, templates and hooks are registered when the product starts. What this feature provides and requires is listed in the [tool.splent.contract] section of pyproject.toml, which splent feature:contract --write keeps in sync with the source.

What it does

A carousel of slides above the page content, rendered through the layout.hero hook. Each slide points at an image of the media library and can carry a title, a caption and a link. Only active slides with an image are shown.

The panel manages the slides at /admin/slider, where they are added, edited and deleted. Where the carousel appears, autoplay, the interval, the shade behind the caption and the caption colour are settings, edited in the settings panel at /admin/settings/slider.

Access

The screens under /admin/slider open for the accounts whose role is admin or staff, the same pair the admin dashboard lets in. Any other signed-in account gets 403 and does not see the Slider link in the sidebar, and an anonymous visitor is sent to log in. The carousel stays open to everyone, signed in or not. Its settings at /admin/settings/slider belong to the settings panel, which opens to admins only.

There is no setting for these roles, and a refinement cannot replace the views that check them, because it may add routes to this feature but never replace one of its own. Another feature can decide for these screens with an access policy registered for the prefix slider.admin (register_access_policy, splent_framework 1.20.0). The framework asks the policy before the roles. It answers True to let an account in, False to refuse it, or None to leave the decision to the roles, and the sidebar link follows the same answer. That is the way to let a group of accounts manage only this section, for example the people who look after the homepage, without giving them a panel role. The policy does not open the carousel settings, which stay with the settings panel. See Access control.

Without such a feature, give the person's account the staff role. Staff opens every panel screen that asks for PANEL_ROLES, not only this one, so a person who should manage nothing but the slides needs a policy instead.

splent feature:auth set-role someone@example.com staff

Use it in a product

splent feature:add splent_feature_slider

Develop

splent feature:test splent_feature_slider
splent feature:contract splent_feature_slider

Release

splent feature:release splent_feature_slider --dry-run --bump patch
splent feature:release splent_feature_slider

The first command rehearses the release and changes nothing. The second publishes it to the git forge and to PyPI, and a PyPI version is permanent.