hyper-admin 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyper_admin-1.0.0.dist-info/METADATA +366 -0
- hyper_admin-1.0.0.dist-info/RECORD +442 -0
- hyper_admin-1.0.0.dist-info/WHEEL +4 -0
- hyper_admin-1.0.0.dist-info/entry_points.txt +2 -0
- hyper_admin-1.0.0.dist-info/licenses/LICENSE +21 -0
- hyperadmin/__init__.py +52 -0
- hyperadmin/__main__.py +21 -0
- hyperadmin/adapters/__init__.py +28 -0
- hyperadmin/adapters/_estimate.py +33 -0
- hyperadmin/adapters/_filter_clause.py +9 -0
- hyperadmin/adapters/_occ.py +44 -0
- hyperadmin/adapters/_relation_loading.py +23 -0
- hyperadmin/adapters/_search.py +84 -0
- hyperadmin/adapters/filtering.py +86 -0
- hyperadmin/adapters/introspection.py +239 -0
- hyperadmin/adapters/registry.py +37 -0
- hyperadmin/adapters/schema.py +239 -0
- hyperadmin/adapters/sqlalchemy.py +423 -0
- hyperadmin/adapters/sqlmodel.py +650 -0
- hyperadmin/auth/__init__.py +156 -0
- hyperadmin/auth/_types.py +52 -0
- hyperadmin/auth/backend.py +37 -0
- hyperadmin/auth/bridge.py +351 -0
- hyperadmin/auth/exceptions.py +124 -0
- hyperadmin/auth/middleware.py +287 -0
- hyperadmin/auth/models.py +245 -0
- hyperadmin/auth/oauth/__init__.py +81 -0
- hyperadmin/auth/oauth/backend.py +611 -0
- hyperadmin/auth/oauth/providers.py +214 -0
- hyperadmin/auth/oauth/refresh.py +126 -0
- hyperadmin/auth/oauth/session.py +96 -0
- hyperadmin/auth/oauth/tokens.py +114 -0
- hyperadmin/auth/oauth/views.py +306 -0
- hyperadmin/auth/oauth/wiring.py +131 -0
- hyperadmin/auth/otp.py +189 -0
- hyperadmin/auth/permissions.py +232 -0
- hyperadmin/auth/session.py +81 -0
- hyperadmin/auth/session_middleware.py +164 -0
- hyperadmin/auth/token_handoff.py +452 -0
- hyperadmin/auth/user_cache.py +222 -0
- hyperadmin/auth/views.py +581 -0
- hyperadmin/core/__init__.py +76 -0
- hyperadmin/core/actions.py +151 -0
- hyperadmin/core/adapters.py +883 -0
- hyperadmin/core/app.py +1437 -0
- hyperadmin/core/auth.py +97 -0
- hyperadmin/core/bulk_results.py +28 -0
- hyperadmin/core/cache.py +68 -0
- hyperadmin/core/choices.py +38 -0
- hyperadmin/core/concurrency.py +107 -0
- hyperadmin/core/csrf.py +108 -0
- hyperadmin/core/discovery.py +161 -0
- hyperadmin/core/display.py +172 -0
- hyperadmin/core/fields.py +158 -0
- hyperadmin/core/fieldsets.py +22 -0
- hyperadmin/core/filtering.py +403 -0
- hyperadmin/core/filters_compat.py +78 -0
- hyperadmin/core/inlines.py +64 -0
- hyperadmin/core/introspection.py +280 -0
- hyperadmin/core/layouts.py +17 -0
- hyperadmin/core/lifecycle.py +278 -0
- hyperadmin/core/model.py +189 -0
- hyperadmin/core/navigation.py +354 -0
- hyperadmin/core/options.py +391 -0
- hyperadmin/core/palette.py +94 -0
- hyperadmin/core/panels.py +227 -0
- hyperadmin/core/plugin_wiring.py +205 -0
- hyperadmin/core/plugins.py +588 -0
- hyperadmin/core/primary_key.py +118 -0
- hyperadmin/core/rate_limit.py +90 -0
- hyperadmin/core/registry.py +129 -0
- hyperadmin/core/relation_loading.py +25 -0
- hyperadmin/core/schema.py +83 -0
- hyperadmin/core/sensitive.py +134 -0
- hyperadmin/core/settings.py +377 -0
- hyperadmin/core/storage_paths.py +54 -0
- hyperadmin/core/timezones.py +137 -0
- hyperadmin/core/uploads.py +16 -0
- hyperadmin/db.py +160 -0
- hyperadmin/discover.py +54 -0
- hyperadmin/filters/__init__.py +39 -0
- hyperadmin/filters/base.py +246 -0
- hyperadmin/filters/boolean.py +105 -0
- hyperadmin/filters/choice.py +74 -0
- hyperadmin/filters/date.py +265 -0
- hyperadmin/filters/relation.py +69 -0
- hyperadmin/filters/saved_views.py +203 -0
- hyperadmin/i18n/__init__.py +50 -0
- hyperadmin/i18n/loader.py +150 -0
- hyperadmin/i18n/middleware.py +159 -0
- hyperadmin/i18n/validation_messages.py +264 -0
- hyperadmin/loadtest/__init__.py +28 -0
- hyperadmin/loadtest/batch.py +263 -0
- hyperadmin/loadtest/checkpoint.py +168 -0
- hyperadmin/loadtest/generators/__init__.py +29 -0
- hyperadmin/loadtest/generators/auth.py +86 -0
- hyperadmin/loadtest/generators/erp.py +177 -0
- hyperadmin/loadtest/plan.py +189 -0
- hyperadmin/loadtest/pool.py +113 -0
- hyperadmin/loadtest/progress.py +150 -0
- hyperadmin/locale/ar/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/ar/LC_MESSAGES/messages.po +2139 -0
- hyperadmin/locale/de/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/de/LC_MESSAGES/messages.po +2114 -0
- hyperadmin/locale/en/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/en/LC_MESSAGES/messages.po +1780 -0
- hyperadmin/locale/es/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/es/LC_MESSAGES/messages.po +2094 -0
- hyperadmin/locale/fr/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/fr/LC_MESSAGES/messages.po +2100 -0
- hyperadmin/locale/he/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/he/LC_MESSAGES/messages.po +2076 -0
- hyperadmin/locale/hi/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/hi/LC_MESSAGES/messages.po +2084 -0
- hyperadmin/locale/id/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/id/LC_MESSAGES/messages.po +2071 -0
- hyperadmin/locale/it/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/it/LC_MESSAGES/messages.po +2098 -0
- hyperadmin/locale/ja/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/ja/LC_MESSAGES/messages.po +2049 -0
- hyperadmin/locale/ko/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/ko/LC_MESSAGES/messages.po +2049 -0
- hyperadmin/locale/nl/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/nl/LC_MESSAGES/messages.po +2100 -0
- hyperadmin/locale/pl/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/pl/LC_MESSAGES/messages.po +2112 -0
- hyperadmin/locale/pt_BR/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/pt_BR/LC_MESSAGES/messages.po +2098 -0
- hyperadmin/locale/ru/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/ru/LC_MESSAGES/messages.po +2112 -0
- hyperadmin/locale/th/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/th/LC_MESSAGES/messages.po +2065 -0
- hyperadmin/locale/tr/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/tr/LC_MESSAGES/messages.po +2084 -0
- hyperadmin/locale/uk/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/uk/LC_MESSAGES/messages.po +1889 -0
- hyperadmin/locale/vi/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/vi/LC_MESSAGES/messages.po +2063 -0
- hyperadmin/locale/zh_CN/LC_MESSAGES/messages.mo +0 -0
- hyperadmin/locale/zh_CN/LC_MESSAGES/messages.po +2049 -0
- hyperadmin/main.py +3 -0
- hyperadmin/management/__init__.py +0 -0
- hyperadmin/management/commands/__init__.py +0 -0
- hyperadmin/management/commands/createsuperuser.py +114 -0
- hyperadmin/management/commands/initdb.py +76 -0
- hyperadmin/management/commands/plugins.py +31 -0
- hyperadmin/management/commands/seed.py +125 -0
- hyperadmin/navigation/__init__.py +9 -0
- hyperadmin/navigation/pins.py +153 -0
- hyperadmin/panels/__init__.py +10 -0
- hyperadmin/panels/pdf.py +151 -0
- hyperadmin/permissions/__init__.py +59 -0
- hyperadmin/permissions/audit.py +109 -0
- hyperadmin/permissions/matrix.py +343 -0
- hyperadmin/permissions/object_rules.py +143 -0
- hyperadmin/realtime/__init__.py +51 -0
- hyperadmin/realtime/_debug.py +77 -0
- hyperadmin/realtime/config.py +124 -0
- hyperadmin/realtime/emitting.py +143 -0
- hyperadmin/realtime/events.py +107 -0
- hyperadmin/realtime/presence.py +193 -0
- hyperadmin/realtime/presence_redis.py +142 -0
- hyperadmin/realtime/pubsub.py +129 -0
- hyperadmin/realtime/pubsub_redis.py +159 -0
- hyperadmin/realtime/registry.py +102 -0
- hyperadmin/realtime/sse.py +82 -0
- hyperadmin/realtime/ws.py +477 -0
- hyperadmin/routing.py +680 -0
- hyperadmin/static/css/_accessibility.css +149 -0
- hyperadmin/static/css/_alerts.css +147 -0
- hyperadmin/static/css/_autocomplete.css +39 -0
- hyperadmin/static/css/_banner.css +118 -0
- hyperadmin/static/css/_buttons.css +241 -0
- hyperadmin/static/css/_card.css +86 -0
- hyperadmin/static/css/_dark-mode.css +232 -0
- hyperadmin/static/css/_fieldsets.css +71 -0
- hyperadmin/static/css/_filter.css +203 -0
- hyperadmin/static/css/_fonts.css +25 -0
- hyperadmin/static/css/_forms.css +862 -0
- hyperadmin/static/css/_inline-cell.css +222 -0
- hyperadmin/static/css/_inlines.css +160 -0
- hyperadmin/static/css/_layout.css +62 -0
- hyperadmin/static/css/_login.css +112 -0
- hyperadmin/static/css/_menu.css +156 -0
- hyperadmin/static/css/_navbar.css +299 -0
- hyperadmin/static/css/_page-header.css +139 -0
- hyperadmin/static/css/_pagination.css +125 -0
- hyperadmin/static/css/_palette.css +304 -0
- hyperadmin/static/css/_panels.css +174 -0
- hyperadmin/static/css/_permissions.css +547 -0
- hyperadmin/static/css/_pill.css +123 -0
- hyperadmin/static/css/_popover.css +170 -0
- hyperadmin/static/css/_popup.css +65 -0
- hyperadmin/static/css/_progress.css +161 -0
- hyperadmin/static/css/_realtime.css +78 -0
- hyperadmin/static/css/_reset.css +48 -0
- hyperadmin/static/css/_responsive.css +51 -0
- hyperadmin/static/css/_rtl.css +23 -0
- hyperadmin/static/css/_search.css +67 -0
- hyperadmin/static/css/_seg.css +95 -0
- hyperadmin/static/css/_sidebar.css +446 -0
- hyperadmin/static/css/_sticky.css +54 -0
- hyperadmin/static/css/_table.css +776 -0
- hyperadmin/static/css/_theme-terminal-type.css +92 -0
- hyperadmin/static/css/_theme-terminal.css +330 -0
- hyperadmin/static/css/_theme-toggle.css +46 -0
- hyperadmin/static/css/_tokens.css +232 -0
- hyperadmin/static/css/_utilities.css +133 -0
- hyperadmin/static/css/hyperadmin.css +58 -0
- hyperadmin/static/fonts/Inter-OFL.txt +93 -0
- hyperadmin/static/fonts/InterVariable.woff2 +0 -0
- hyperadmin/static/fonts/JetBrainsMono-OFL.txt +93 -0
- hyperadmin/static/fonts/JetBrainsMonoVariable.woff2 +0 -0
- hyperadmin/static/icons/arrow-down.svg +1 -0
- hyperadmin/static/icons/arrow-up.svg +1 -0
- hyperadmin/static/icons/bar-chart-3.svg +1 -0
- hyperadmin/static/icons/bell.svg +1 -0
- hyperadmin/static/icons/bookmark.svg +1 -0
- hyperadmin/static/icons/briefcase.svg +1 -0
- hyperadmin/static/icons/building-2.svg +1 -0
- hyperadmin/static/icons/calendar.svg +1 -0
- hyperadmin/static/icons/check.svg +1 -0
- hyperadmin/static/icons/chevron-down.svg +1 -0
- hyperadmin/static/icons/chevron-left.svg +1 -0
- hyperadmin/static/icons/chevron-right.svg +1 -0
- hyperadmin/static/icons/circle-check.svg +1 -0
- hyperadmin/static/icons/circle-help.svg +1 -0
- hyperadmin/static/icons/circle-x.svg +1 -0
- hyperadmin/static/icons/clock.svg +1 -0
- hyperadmin/static/icons/columns-3.svg +1 -0
- hyperadmin/static/icons/command.svg +1 -0
- hyperadmin/static/icons/copy.svg +1 -0
- hyperadmin/static/icons/credit-card.svg +1 -0
- hyperadmin/static/icons/database.svg +1 -0
- hyperadmin/static/icons/download.svg +1 -0
- hyperadmin/static/icons/ellipsis.svg +1 -0
- hyperadmin/static/icons/external-link.svg +1 -0
- hyperadmin/static/icons/eye.svg +1 -0
- hyperadmin/static/icons/file-text.svg +1 -0
- hyperadmin/static/icons/filter.svg +1 -0
- hyperadmin/static/icons/folder.svg +1 -0
- hyperadmin/static/icons/globe.svg +1 -0
- hyperadmin/static/icons/history.svg +1 -0
- hyperadmin/static/icons/home.svg +1 -0
- hyperadmin/static/icons/image.svg +1 -0
- hyperadmin/static/icons/info.svg +1 -0
- hyperadmin/static/icons/key-round.svg +1 -0
- hyperadmin/static/icons/layers.svg +1 -0
- hyperadmin/static/icons/layout-grid.svg +1 -0
- hyperadmin/static/icons/list-checks.svg +1 -0
- hyperadmin/static/icons/lock.svg +1 -0
- hyperadmin/static/icons/log-out.svg +1 -0
- hyperadmin/static/icons/mail.svg +1 -0
- hyperadmin/static/icons/map-pin.svg +1 -0
- hyperadmin/static/icons/menu.svg +1 -0
- hyperadmin/static/icons/moon.svg +1 -0
- hyperadmin/static/icons/package.svg +1 -0
- hyperadmin/static/icons/panel-left-close.svg +1 -0
- hyperadmin/static/icons/panel-left-open.svg +1 -0
- hyperadmin/static/icons/pencil.svg +1 -0
- hyperadmin/static/icons/pin-off.svg +1 -0
- hyperadmin/static/icons/pin.svg +1 -0
- hyperadmin/static/icons/plus.svg +1 -0
- hyperadmin/static/icons/receipt.svg +1 -0
- hyperadmin/static/icons/refresh-cw.svg +1 -0
- hyperadmin/static/icons/rotate-ccw.svg +1 -0
- hyperadmin/static/icons/search.svg +1 -0
- hyperadmin/static/icons/settings.svg +1 -0
- hyperadmin/static/icons/shield-check.svg +1 -0
- hyperadmin/static/icons/shopping-cart.svg +1 -0
- hyperadmin/static/icons/sliders-horizontal.svg +1 -0
- hyperadmin/static/icons/sparkles.svg +1 -0
- hyperadmin/static/icons/store.svg +1 -0
- hyperadmin/static/icons/sun.svg +1 -0
- hyperadmin/static/icons/tag.svg +1 -0
- hyperadmin/static/icons/trash-2.svg +1 -0
- hyperadmin/static/icons/triangle-alert.svg +1 -0
- hyperadmin/static/icons/truck.svg +1 -0
- hyperadmin/static/icons/upload.svg +1 -0
- hyperadmin/static/icons/user.svg +1 -0
- hyperadmin/static/icons/users.svg +1 -0
- hyperadmin/static/icons/wallet.svg +1 -0
- hyperadmin/static/icons/x.svg +1 -0
- hyperadmin/static/img/hyperadmin-favicon.svg +1 -0
- hyperadmin/static/img/hyperadmin-mark-mono.svg +1 -0
- hyperadmin/static/img/hyperadmin-mark.svg +1 -0
- hyperadmin/static/img/hyperadmin-wordmark-dark.svg +1 -0
- hyperadmin/static/img/hyperadmin-wordmark.svg +1 -0
- hyperadmin/static/img/terminal/hyperadmin-favicon-16.svg +1 -0
- hyperadmin/static/img/terminal/hyperadmin-favicon.svg +1 -0
- hyperadmin/static/img/terminal/hyperadmin-mark.svg +1 -0
- hyperadmin/static/img/terminal/hyperadmin-wordmark-dark.svg +1 -0
- hyperadmin/static/img/terminal/hyperadmin-wordmark.svg +1 -0
- hyperadmin/static/js/autocomplete.js +475 -0
- hyperadmin/static/js/confirm_delete.js +113 -0
- hyperadmin/static/js/error_summary.js +37 -0
- hyperadmin/static/js/form_guard.js +77 -0
- hyperadmin/static/js/inline_edit.js +97 -0
- hyperadmin/static/js/palette.js +292 -0
- hyperadmin/static/js/primitives.js +205 -0
- hyperadmin/static/js/realtime-status.js +515 -0
- hyperadmin/static/js/request_errors.js +85 -0
- hyperadmin/static/js/shortcuts.js +175 -0
- hyperadmin/static/js/sidebar.js +83 -0
- hyperadmin/static/js/vendor/LICENSE-alpinejs.txt +21 -0
- hyperadmin/static/js/vendor/LICENSE-htmx.txt +25 -0
- hyperadmin/static/js/vendor/alpinejs-3.17.4.min.js +21 -0
- hyperadmin/static/js/vendor/alpinejs-focus-3.17.4.min.js +18 -0
- hyperadmin/static/js/vendor/htmx-1.9.10.min.js +1 -0
- hyperadmin/templates/_base.html +161 -0
- hyperadmin/templates/_messages.html +11 -0
- hyperadmin/templates/_navbar.html +126 -0
- hyperadmin/templates/_sidebar.html +80 -0
- hyperadmin/templates/auth/mfa_challenge.html +75 -0
- hyperadmin/templates/auth/mfa_settings.html +110 -0
- hyperadmin/templates/auth/oauth_link_required.html +24 -0
- hyperadmin/templates/auth/oauth_settings.html +55 -0
- hyperadmin/templates/base.html +16 -0
- hyperadmin/templates/bulk_form.html +18 -0
- hyperadmin/templates/bulk_result.html +20 -0
- hyperadmin/templates/components/_icons.html +86 -0
- hyperadmin/templates/components/_macros.html +27 -0
- hyperadmin/templates/components/_nav.html +55 -0
- hyperadmin/templates/components/_row_access.html +26 -0
- hyperadmin/templates/components/banner.html +77 -0
- hyperadmin/templates/components/bulk_form.html +81 -0
- hyperadmin/templates/components/bulk_result.html +133 -0
- hyperadmin/templates/components/bulk_toolbar.html +63 -0
- hyperadmin/templates/components/command_palette.html +59 -0
- hyperadmin/templates/components/confirm_delete_dialog.html +26 -0
- hyperadmin/templates/components/conflict_dialog.html +42 -0
- hyperadmin/templates/components/csrf_reload_banner.html +20 -0
- hyperadmin/templates/components/error_summary.html +39 -0
- hyperadmin/templates/components/error_toast.html +18 -0
- hyperadmin/templates/components/fieldset.html +38 -0
- hyperadmin/templates/components/filter_bar.html +50 -0
- hyperadmin/templates/components/filter_sidebar.html +31 -0
- hyperadmin/templates/components/filters/boolean.html +10 -0
- hyperadmin/templates/components/filters/current_period.html +8 -0
- hyperadmin/templates/components/filters/date_range.html +26 -0
- hyperadmin/templates/components/filters/is_owner.html +8 -0
- hyperadmin/templates/components/filters/multi_choice.html +10 -0
- hyperadmin/templates/components/filters/multi_relation.html +20 -0
- hyperadmin/templates/components/filters/select.html +11 -0
- hyperadmin/templates/components/inline_cell.html +23 -0
- hyperadmin/templates/components/inline_cell_error.html +51 -0
- hyperadmin/templates/components/inline_cell_stale.html +20 -0
- hyperadmin/templates/components/inline_editor.html +85 -0
- hyperadmin/templates/components/inline_formset.html +34 -0
- hyperadmin/templates/components/inline_row.html +49 -0
- hyperadmin/templates/components/list_error.html +12 -0
- hyperadmin/templates/components/menu.html +74 -0
- hyperadmin/templates/components/nav_pinned.html +24 -0
- hyperadmin/templates/components/pagination.html +87 -0
- hyperadmin/templates/components/panel_document.html +19 -0
- hyperadmin/templates/components/panel_states.html +35 -0
- hyperadmin/templates/components/panel_tab_strip.html +31 -0
- hyperadmin/templates/components/pill.html +15 -0
- hyperadmin/templates/components/popover.html +59 -0
- hyperadmin/templates/components/presence_banner.html +28 -0
- hyperadmin/templates/components/progress.html +72 -0
- hyperadmin/templates/components/saved_views.html +61 -0
- hyperadmin/templates/components/search_input.html +19 -0
- hyperadmin/templates/components/seg.html +38 -0
- hyperadmin/templates/components/shortcuts_overlay.html +45 -0
- hyperadmin/templates/components/sortable_header.html +23 -0
- hyperadmin/templates/components/table.html +45 -0
- hyperadmin/templates/components/table_body.html +86 -0
- hyperadmin/templates/components/thumbnail.html +8 -0
- hyperadmin/templates/components/toast.html +36 -0
- hyperadmin/templates/components/tooltip.html +20 -0
- hyperadmin/templates/create.html +43 -0
- hyperadmin/templates/dashboard.html +8 -0
- hyperadmin/templates/detail.html +120 -0
- hyperadmin/templates/detail_layout.html +15 -0
- hyperadmin/templates/error.html +24 -0
- hyperadmin/templates/form_layout.html +26 -0
- hyperadmin/templates/list.html +5 -0
- hyperadmin/templates/list_layout.html +105 -0
- hyperadmin/templates/login.html +79 -0
- hyperadmin/templates/permissions/_banner.html +55 -0
- hyperadmin/templates/permissions/_diff_row.html +6 -0
- hyperadmin/templates/permissions/_group_gone.html +16 -0
- hyperadmin/templates/permissions/_macros.html +22 -0
- hyperadmin/templates/permissions/matrix.html +408 -0
- hyperadmin/templates/permissions/object_popover.html +95 -0
- hyperadmin/templates/update.html +69 -0
- hyperadmin/templates/widgets/autocomplete.html +100 -0
- hyperadmin/templates/widgets/checkbox_input.html +20 -0
- hyperadmin/templates/widgets/choices_options.html +3 -0
- hyperadmin/templates/widgets/date_input.html +13 -0
- hyperadmin/templates/widgets/datetime_input.html +18 -0
- hyperadmin/templates/widgets/encoded_textarea.html +4 -0
- hyperadmin/templates/widgets/file_input.html +15 -0
- hyperadmin/templates/widgets/float_input.html +12 -0
- hyperadmin/templates/widgets/image_input.html +108 -0
- hyperadmin/templates/widgets/multiselect_input.html +13 -0
- hyperadmin/templates/widgets/number_input.html +11 -0
- hyperadmin/templates/widgets/popup_form.html +64 -0
- hyperadmin/templates/widgets/relation_multiselect_input.html +36 -0
- hyperadmin/templates/widgets/relation_select_input.html +38 -0
- hyperadmin/templates/widgets/select_input.html +17 -0
- hyperadmin/templates/widgets/text_input.html +13 -0
- hyperadmin/templates/widgets/textarea.html +4 -0
- hyperadmin/uploads/__init__.py +44 -0
- hyperadmin/uploads/images.py +272 -0
- hyperadmin/uploads/storage.py +265 -0
- hyperadmin/uploads/validation.py +37 -0
- hyperadmin/views/__init__.py +3 -0
- hyperadmin/views/csrf.py +316 -0
- hyperadmin/views/dynamic/__init__.py +35 -0
- hyperadmin/views/dynamic/actions.py +264 -0
- hyperadmin/views/dynamic/base.py +576 -0
- hyperadmin/views/dynamic/concurrency.py +138 -0
- hyperadmin/views/dynamic/core.py +33 -0
- hyperadmin/views/dynamic/create.py +189 -0
- hyperadmin/views/dynamic/detail.py +231 -0
- hyperadmin/views/dynamic/files.py +233 -0
- hyperadmin/views/dynamic/form_data.py +162 -0
- hyperadmin/views/dynamic/helpers.py +151 -0
- hyperadmin/views/dynamic/inline.py +348 -0
- hyperadmin/views/dynamic/list_view.py +612 -0
- hyperadmin/views/dynamic/model_view.py +17 -0
- hyperadmin/views/dynamic/palette_search.py +78 -0
- hyperadmin/views/dynamic/relations.py +544 -0
- hyperadmin/views/dynamic/saved_views.py +159 -0
- hyperadmin/views/dynamic/update.py +313 -0
- hyperadmin/views/error_pages.py +46 -0
- hyperadmin/views/forms.py +1294 -0
- hyperadmin/views/htmx.py +53 -0
- hyperadmin/views/locale.py +113 -0
- hyperadmin/views/nav_pins.py +149 -0
- hyperadmin/views/navigation.py +143 -0
- hyperadmin/views/palette_context.py +91 -0
- hyperadmin/views/palette_search.py +103 -0
- hyperadmin/views/permissions_matrix.py +490 -0
- hyperadmin/views/rate_limit.py +87 -0
- hyperadmin/views/route.py +316 -0
- hyperadmin/views/static.py +138 -0
- hyperadmin/views/template_filters.py +305 -0
- hyperadmin/views/uploads.py +92 -0
- hyperadmin/views/urls.py +180 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{#- Per-row result of a completed bulk action (H3, v0.5.5) — design: BulkActionFlow.
|
|
2
|
+
|
|
3
|
+
Problems are listed first, then the done rows; above 20 rows the done rows
|
|
4
|
+
fold into a <details>. A fragment with HTMX (swapped into
|
|
5
|
+
``#bulk-result-region``), a page without it (``bulk_result.html``).
|
|
6
|
+
|
|
7
|
+
Context:
|
|
8
|
+
- action: ActionDef
|
|
9
|
+
- outcomes: list[BulkRowResult]
|
|
10
|
+
- bulk_endpoint_url: URL of the /bulk endpoint (for "Retry failures")
|
|
11
|
+
- failed_ids: list[str] — non-"ok" outcome keys, stringified with the
|
|
12
|
+
model's pk codec (``pk.to_str``)
|
|
13
|
+
- model_name: lowercase model name (optional) — record links and "Back to"
|
|
14
|
+
-#}
|
|
15
|
+
{%- from "components/_icons.html" import icon -%}
|
|
16
|
+
{%- set problems = outcomes|rejectattr('status', 'equalto', 'ok')|list -%}
|
|
17
|
+
{%- set done = outcomes|selectattr('status', 'equalto', 'ok')|list -%}
|
|
18
|
+
{%- set failed = outcomes|selectattr('status', 'equalto', 'failed')|list|length -%}
|
|
19
|
+
{%- set forbidden = outcomes|selectattr('status', 'equalto', 'forbidden')|list|length -%}
|
|
20
|
+
{%- set total = outcomes|length -%}
|
|
21
|
+
{%- set tone = 'ok' if not problems else ('mixed' if done else 'failed') -%}
|
|
22
|
+
{%- set fold = total > 20 and done|length > 0 -%}
|
|
23
|
+
{%- set words = {'ok': _("Done"), 'failed': _("Failed"), 'forbidden': _("Forbidden")} -%}
|
|
24
|
+
{%- set plain = {
|
|
25
|
+
'not found': _("Row not found. It may have been deleted after you selected it."),
|
|
26
|
+
'Database error': _("The row could not be loaded because of a database error. Check the server logs, then retry."),
|
|
27
|
+
'Action failed': _("The action failed on this row. Check the server logs, then retry."),
|
|
28
|
+
} -%}
|
|
29
|
+
{%- macro problem_sentence() -%}
|
|
30
|
+
{%- if failed and forbidden -%}
|
|
31
|
+
{% trans failed=failed, forbidden=forbidden %}{{ failed }} failed and {{ forbidden }} not allowed.{% endtrans %}
|
|
32
|
+
{%- elif failed -%}
|
|
33
|
+
{% trans failed=failed %}{{ failed }} failed.{% endtrans %}
|
|
34
|
+
{%- elif forbidden -%}
|
|
35
|
+
{% trans forbidden=forbidden %}{{ forbidden }} not allowed.{% endtrans %}
|
|
36
|
+
{%- endif -%}
|
|
37
|
+
{%- endmacro -%}
|
|
38
|
+
{%- macro result_row(outcome) -%}
|
|
39
|
+
<tr class="ha-table-row" data-testid="bulk-result-row">
|
|
40
|
+
<td class="ha-table-cell ha-bulk-result__key" data-label="{{ _('Row') }}">
|
|
41
|
+
{%- if model_name is defined -%}
|
|
42
|
+
<a href="{{ url_for(model_name|lower ~ '-detail', item_id=outcome.id) }}">{{ outcome.id }}</a>
|
|
43
|
+
{%- else -%}{{ outcome.id }}{%- endif -%}
|
|
44
|
+
</td>
|
|
45
|
+
<td class="ha-table-cell" data-label="{{ _('Result') }}">
|
|
46
|
+
<span class="ha-pill ha-bulk-status ha-bulk-status--{{ outcome.status }}"
|
|
47
|
+
data-testid="bulk-result-status-{{ outcome.id|ha_dom_token }}">{{ words[outcome.status] }}</span>
|
|
48
|
+
</td>
|
|
49
|
+
<td class="ha-table-cell" data-label="{{ _('What happened') }}">
|
|
50
|
+
{%- if outcome.detail -%}{{ plain.get(outcome.detail, outcome.detail) }}
|
|
51
|
+
{%- else -%}<span class="ha-null">—<span class="ha-sr-only">{{ _("no detail") }}</span></span>{%- endif -%}
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
{%- endmacro -%}
|
|
55
|
+
<section class="ha-bulk-result ha-bulk-result--{{ tone }}" data-testid="bulk-result"
|
|
56
|
+
aria-labelledby="bulk-result-headline">
|
|
57
|
+
<h2 class="ha-bulk-result__title">{{ action.label }}</h2>
|
|
58
|
+
|
|
59
|
+
<div class="ha-bulk-result__summary">
|
|
60
|
+
<p class="ha-bulk-result__headline" id="bulk-result-headline" role="status" data-testid="bulk-result-headline">
|
|
61
|
+
{%- if tone == 'ok' -%}{{ icon('circle-check') }}
|
|
62
|
+
{%- elif tone == 'mixed' -%}{{ icon('triangle-alert') }}
|
|
63
|
+
{%- else -%}{{ icon('circle-x') }}{%- endif -%}
|
|
64
|
+
<span>
|
|
65
|
+
{%- if total == 0 -%}
|
|
66
|
+
{{ _("No rows were selected.") }}
|
|
67
|
+
{%- elif tone == 'ok' -%}
|
|
68
|
+
{% trans count=total %}All {{ count }} rows done.{% endtrans %}
|
|
69
|
+
{%- elif tone == 'mixed' -%}
|
|
70
|
+
{% trans done=done|length, count=total %}{{ done }} of {{ count }} rows done.{% endtrans %} {{ problem_sentence() }}
|
|
71
|
+
{%- else -%}
|
|
72
|
+
{{ _("No rows done.") }} {{ problem_sentence() }}
|
|
73
|
+
{%- endif -%}
|
|
74
|
+
</span>
|
|
75
|
+
</p>
|
|
76
|
+
<ul class="ha-bulk-result__tally" aria-label="{{ _('Totals') }}" data-testid="bulk-result-tally">
|
|
77
|
+
<li><span class="ha-pill ha-bulk-status ha-bulk-status--ok">{{ words['ok'] }}</span><span class="ha-num">{{ done|length }}</span></li>
|
|
78
|
+
<li><span class="ha-pill ha-bulk-status ha-bulk-status--failed">{{ words['failed'] }}</span><span class="ha-num">{{ failed }}</span></li>
|
|
79
|
+
<li><span class="ha-pill ha-bulk-status ha-bulk-status--forbidden">{{ words['forbidden'] }}</span><span class="ha-num">{{ forbidden }}</span></li>
|
|
80
|
+
</ul>
|
|
81
|
+
{% if total -%}
|
|
82
|
+
<div class="ha-progress__segments" role="img"
|
|
83
|
+
aria-label="{% trans done=done|length, failed=failed, forbidden=forbidden %}{{ done }} done, {{ failed }} failed, {{ forbidden }} forbidden{% endtrans %}">
|
|
84
|
+
{%- if done %}<span class="is-done" style="flex: {{ done|length }}"></span>{% endif -%}
|
|
85
|
+
{%- if failed %}<span class="is-failed" style="flex: {{ failed }}"></span>{% endif -%}
|
|
86
|
+
{%- if forbidden %}<span class="is-forbidden" style="flex: {{ forbidden }}"></span>{% endif -%}
|
|
87
|
+
</div>
|
|
88
|
+
{%- endif %}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="ha-table-wrapper">
|
|
92
|
+
<table class="ha-table ha-bulk-result__table" aria-label="{{ _('Results per row') }}" data-testid="bulk-result-table">
|
|
93
|
+
<thead>
|
|
94
|
+
<tr class="ha-table-header">
|
|
95
|
+
<th class="ha-table-th" scope="col">{{ _("Row") }}</th>
|
|
96
|
+
<th class="ha-table-th" scope="col">{{ _("Result") }}</th>
|
|
97
|
+
<th class="ha-table-th" scope="col">{{ _("What happened") }}</th>
|
|
98
|
+
</tr>
|
|
99
|
+
</thead>
|
|
100
|
+
<tbody class="ha-table-body">
|
|
101
|
+
{%- for outcome in problems %}{{ result_row(outcome) }}{% endfor -%}
|
|
102
|
+
{%- if not fold %}{% for outcome in done %}{{ result_row(outcome) }}{% endfor %}{% endif -%}
|
|
103
|
+
</tbody>
|
|
104
|
+
</table>
|
|
105
|
+
{% if fold -%}
|
|
106
|
+
<details class="ha-bulk-result__more" data-testid="bulk-result-more">
|
|
107
|
+
<summary>{{ icon('chevron-right', 'ha-icon--sm ha-icon--mirror') }}{% trans count=done|length %}Show the {{ count }} done rows{% endtrans %}</summary>
|
|
108
|
+
<table class="ha-table ha-bulk-result__table" aria-label="{{ _('Done rows') }}">
|
|
109
|
+
<tbody class="ha-table-body">
|
|
110
|
+
{%- for outcome in done %}{{ result_row(outcome) }}{% endfor -%}
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
</details>
|
|
114
|
+
{%- endif %}
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="ha-bulk-result__actions">
|
|
118
|
+
{% if failed_ids -%}
|
|
119
|
+
<form method="post" action="{{ bulk_endpoint_url }}"
|
|
120
|
+
hx-post="{{ bulk_endpoint_url }}" hx-target="#bulk-result-region" hx-swap="innerHTML"
|
|
121
|
+
data-testid="bulk-retry-form" class="ha-bulk-retry">
|
|
122
|
+
{{ csrf_input() if csrf_input is defined }}
|
|
123
|
+
{% for pk in failed_ids %}<input type="hidden" name="ids" value="{{ pk }}" />{% endfor %}
|
|
124
|
+
<button type="submit" class="ha-btn"
|
|
125
|
+
data-testid="bulk-retry-link">{{ icon('rotate-ccw', 'ha-icon--sm') }}{% trans count=failed_ids|length %}Retry failures ({{ count }}){% endtrans %}</button>
|
|
126
|
+
</form>
|
|
127
|
+
{%- endif %}
|
|
128
|
+
{% if model_name is defined -%}
|
|
129
|
+
<a class="ha-btn ha-btn--primary" href="{{ url_for(model_name|lower ~ '-list') }}"
|
|
130
|
+
data-testid="bulk-back-link">{% trans name=verbose_name_plural|default(model_name|capitalize) %}Back to {{ name }}{% endtrans %}</a>
|
|
131
|
+
{%- endif %}
|
|
132
|
+
</div>
|
|
133
|
+
</section>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{#- Bulk bar for the list view (H3, v0.5.5) — design: BulkActionFlow.
|
|
2
|
+
|
|
3
|
+
Rendered only when ``bulk_actions`` (the ModelAdmin's ``bulk=True`` actions)
|
|
4
|
+
is non-empty. Row checkboxes join this form through ``form="bulk-action-form"``,
|
|
5
|
+
since they live inside the table, outside the form element.
|
|
6
|
+
|
|
7
|
+
The selected option's ``data-url`` is the bulk endpoint; htmx posts there.
|
|
8
|
+
A per-row result is swapped into ``#bulk-result-region``; a parameter form
|
|
9
|
+
is retargeted by the server into the ``#ha-popup-root`` dialog. Run with no
|
|
10
|
+
action chosen, or with no row checked for an action that requires one,
|
|
11
|
+
shows the inline warning instead of sending (the endpoint still answers
|
|
12
|
+
400 server-side). Alpine keeps the "N selected" count and clears the
|
|
13
|
+
selection; without JavaScript the bar is always shown and the count reads
|
|
14
|
+
"Select rows, then choose an action".
|
|
15
|
+
|
|
16
|
+
Context:
|
|
17
|
+
- bulk_actions: list[ActionDef] with ``bulk=True``
|
|
18
|
+
- model_name: the model class name (route names use ``model_name|lower``)
|
|
19
|
+
-#}
|
|
20
|
+
{%- from "components/_icons.html" import icon -%}
|
|
21
|
+
{#- The bar stays out of the way until a row is ticked, unless an action runs without a
|
|
22
|
+
selection (then it must stay reachable). Without JavaScript it is always shown. -#}
|
|
23
|
+
{%- set hide_when_empty = bulk_actions|selectattr('requires_selection')|list|length == bulk_actions|length -%}
|
|
24
|
+
<form id="bulk-action-form" class="ha-bulkbar" data-testid="bulk-bar"
|
|
25
|
+
aria-label="{{ _('Bulk actions') }}"
|
|
26
|
+
{%- if hide_when_empty %} x-bind:hidden="n === 0"{% endif %}
|
|
27
|
+
method="post"
|
|
28
|
+
action="{{- url_for(model_name|lower ~ '-bulk-action', action_name=bulk_actions[0].name) -}}"
|
|
29
|
+
hx-post="{{- url_for(model_name|lower ~ '-bulk-action', action_name=bulk_actions[0].name) -}}"
|
|
30
|
+
hx-target="#bulk-result-region"
|
|
31
|
+
hx-swap="innerHTML"
|
|
32
|
+
data-msg-choose="{{ _('Choose an action, then press Run.') }}"
|
|
33
|
+
data-msg-select="{{ _('Select at least one row, then press Run.') }}"
|
|
34
|
+
x-data="{ n: 0, count() { this.n = document.querySelectorAll('input[name=ids][form=bulk-action-form]:checked').length; } }"
|
|
35
|
+
x-init="count()"
|
|
36
|
+
x-on:change.document="count()"
|
|
37
|
+
hx-on::config-request="var option = this.elements['bulk-action'].selectedOptions[0]; var warning = this.querySelector('[data-testid=bulk-warning]'); var checked = document.querySelectorAll('input[name=ids][form=bulk-action-form]:checked').length; var message = ''; if (!option.value) { message = this.dataset.msgChoose; } else if (option.dataset.requiresSelection === 'true' && checked === 0) { message = this.dataset.msgSelect; } warning.querySelector('span').textContent = message; warning.hidden = !message; this.classList.toggle('ha-bulkbar--warn', !!message); if (message) { event.preventDefault(); return; } event.detail.path = option.dataset.url;">
|
|
38
|
+
{{ csrf_input() if csrf_input is defined }}
|
|
39
|
+
<span class="ha-bulkbar__count" aria-live="polite" data-testid="bulk-count"
|
|
40
|
+
data-selected="{{ _('selected') }}"
|
|
41
|
+
data-empty="{{ _('Select rows, then choose an action') }}"
|
|
42
|
+
x-text="n ? n + ' ' + $el.dataset.selected : $el.dataset.empty">{{ _("Select rows, then choose an action") }}</span>
|
|
43
|
+
<span class="ha-bulkbar__pick">
|
|
44
|
+
<label class="ha-sr-only" for="bulk-action-select">{{ _("Action for selected rows") }}</label>
|
|
45
|
+
<select id="bulk-action-select" name="bulk-action" class="ha-select"
|
|
46
|
+
data-testid="bulk-action-select"
|
|
47
|
+
onchange="var url = this.selectedOptions[0].dataset.url; if (url) { this.form.setAttribute('action', url); }">
|
|
48
|
+
<option value="">{{ _("Choose an action…") }}</option>
|
|
49
|
+
{%- for act in bulk_actions -%}
|
|
50
|
+
<option value="{{ act.name }}"
|
|
51
|
+
data-url="{{- url_for(model_name|lower ~ '-bulk-action', action_name=act.name) -}}"
|
|
52
|
+
data-requires-selection="{{ 'true' if act.requires_selection else 'false' }}">{{ act.label }}{% if act.form %}…{% endif %}</option>
|
|
53
|
+
{%- endfor -%}
|
|
54
|
+
</select>
|
|
55
|
+
<button type="submit" class="ha-btn ha-btn--sm ha-btn--primary" data-testid="bulk-run-btn">{{ _("Run") }}</button>
|
|
56
|
+
</span>
|
|
57
|
+
<button type="button" class="ha-btn ha-btn--sm ha-btn--ghost ha-bulkbar__end" data-testid="bulk-clear-btn"
|
|
58
|
+
x-on:click="document.querySelectorAll('input[name=ids][form=bulk-action-form], [data-testid=bulk-select-all]').forEach(function (box) { box.checked = false; }); count()">{{ _("Clear selection") }}</button>
|
|
59
|
+
<p class="ha-bulkbar__warn" role="alert" data-testid="bulk-warning" hidden>{{ icon('triangle-alert', 'ha-icon--sm') }}<span></span></p>
|
|
60
|
+
</form>
|
|
61
|
+
<div id="bulk-result-region" class="ha-bulk-result-region" aria-live="polite"
|
|
62
|
+
data-testid="bulk-result-region"
|
|
63
|
+
hx-on::after-swap="var root = document.getElementById('ha-popup-root'); if (root) { root.replaceChildren(); }"></div>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{#- Command palette (Cmd/Ctrl+K, st-v059-nav-04, docs/specs/navigation-and-list-ux.md).
|
|
2
|
+
|
|
3
|
+
A native <dialog> with the Combobox pattern: the input is role="combobox",
|
|
4
|
+
the results are a role="listbox" filled by static/js/palette.js from the
|
|
5
|
+
#ha-nav-data island. The island holds only what this user may open: the
|
|
6
|
+
nav tree is filtered by permission here, at render time, so forbidden models
|
|
7
|
+
never reach the page. Nothing renders without a signed-in user (login, MFA).
|
|
8
|
+
-#}
|
|
9
|
+
{%- from "components/_icons.html" import icon, icon_paths -%}
|
|
10
|
+
{#- Pins come from the sidebar's nav_pinned_items() global (pins story) when it exists. -#}
|
|
11
|
+
{%- set _pins = nav_pinned_items() if nav_pinned_items is defined else none -%}
|
|
12
|
+
{%- set _palette = ha_nav_palette(_pins) if ha_nav_palette is defined else none -%}
|
|
13
|
+
{%- if _palette is not none -%}
|
|
14
|
+
{%- set _labels = {
|
|
15
|
+
"pinned": _("Pinned"),
|
|
16
|
+
"recent": _("Recent"),
|
|
17
|
+
"models": _("Models"),
|
|
18
|
+
"pages": _("Pages"),
|
|
19
|
+
"records": _("Records"),
|
|
20
|
+
"results": _("%(count)s results", count="{n}"),
|
|
21
|
+
"none": _("No results"),
|
|
22
|
+
} -%}
|
|
23
|
+
<script type="application/json" id="ha-nav-data">{{ _palette|tojson }}</script>
|
|
24
|
+
<dialog id="ha-palette" class="ha-palette" data-testid="command-palette"
|
|
25
|
+
aria-label="{{ _('Search') }}" data-labels='{{ _labels|tojson }}'>
|
|
26
|
+
<div class="ha-combobox__control ha-palette__control">
|
|
27
|
+
{{ icon('search') }}
|
|
28
|
+
<input id="ha-palette-input" class="ha-input" type="text" role="combobox"
|
|
29
|
+
aria-expanded="true" aria-controls="ha-palette-list" aria-autocomplete="list"
|
|
30
|
+
autocomplete="off" spellcheck="false"
|
|
31
|
+
{%- if _palette.search_url %}
|
|
32
|
+
aria-label="{{ _('Search models, pages and records') }}"
|
|
33
|
+
placeholder="{{ _('Search models, pages and records…') }}"
|
|
34
|
+
{%- else %}
|
|
35
|
+
aria-label="{{ _('Search models and pages') }}"
|
|
36
|
+
placeholder="{{ _('Search models and pages…') }}"
|
|
37
|
+
{%- endif %}
|
|
38
|
+
data-testid="palette-input">
|
|
39
|
+
<span class="ha-combobox__tools"><kbd class="ha-kbd">Esc</kbd></span>
|
|
40
|
+
</div>
|
|
41
|
+
<div id="ha-palette-list" class="ha-listbox ha-palette__list" role="listbox"
|
|
42
|
+
aria-label="{{ _('Results') }}"></div>
|
|
43
|
+
<p class="ha-listbox__state ha-palette__empty" hidden>{{ _("No results") }}</p>
|
|
44
|
+
<p class="ha-sr-only" role="status" aria-live="polite" data-palette-status></p>
|
|
45
|
+
<div class="ha-listbox__foot ha-palette__foot" aria-hidden="true">
|
|
46
|
+
<span><kbd class="ha-kbd">↑</kbd> <kbd class="ha-kbd">↓</kbd> {{ _("move") }}</span>
|
|
47
|
+
<span><kbd class="ha-kbd">↵</kbd> {{ _("open") }}</span>
|
|
48
|
+
<span><kbd class="ha-kbd">⇧</kbd> <kbd class="ha-kbd">↵</kbd> {{ _("new") }}</span>
|
|
49
|
+
</div>
|
|
50
|
+
{#- One <symbol> per icon in use; palette.js draws rows with <use href="#ha-pi-…">. -#}
|
|
51
|
+
{%- set _icons = ["clock"] -%}
|
|
52
|
+
{%- for group in _palette.groups -%}{%- for item in group["items"] -%}
|
|
53
|
+
{%- if item.icon in icon_paths and item.icon not in _icons and _icons.append(item.icon) -%}{%- endif -%}
|
|
54
|
+
{%- endfor -%}{%- endfor %}
|
|
55
|
+
<svg class="ha-palette__sprite" width="0" height="0" hidden aria-hidden="true">
|
|
56
|
+
{%- for name in _icons %}<symbol id="ha-pi-{{ name }}" viewBox="0 0 24 24">{{ icon_paths[name] | safe }}</symbol>{% endfor -%}
|
|
57
|
+
</svg>
|
|
58
|
+
</dialog>
|
|
59
|
+
{%- endif -%}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{#- The one shared delete confirmation (st-v059-list-03; design: components/Dialog,
|
|
2
|
+
"Confirm destructive"). Included once by base.html; static/js/confirm_delete.js
|
|
3
|
+
opens it for any trigger carrying data-ha-confirm-delete="<delete url>" and
|
|
4
|
+
data-ha-label="<object name>", and sends the DELETE with htmx.ajax from inside
|
|
5
|
+
<body hx-headers>, so the CSRF header applies. The server's HX-Redirect reloads
|
|
6
|
+
the page; a refusal (403 / 404 / 409) arrives as the usual error toast.
|
|
7
|
+
|
|
8
|
+
data-title-template is the translated "Delete {name}?"; the script fills in the
|
|
9
|
+
object name as text. -#}
|
|
10
|
+
{%- from "components/_icons.html" import icon -%}
|
|
11
|
+
<dialog class="ha-dialog ha-confirm-delete" id="ha-confirm-delete" role="alertdialog"
|
|
12
|
+
aria-labelledby="ha-confirm-delete-title" aria-describedby="ha-confirm-delete-desc"
|
|
13
|
+
data-testid="dialog-confirm-delete"
|
|
14
|
+
data-title-template="{{ _('Delete %(name)s?', name='{name}') }}">
|
|
15
|
+
<div class="ha-dialog__head">
|
|
16
|
+
<span class="ha-dialog__glyph ha-dialog__glyph--danger" aria-hidden="true">{{ icon('trash-2') }}</span>
|
|
17
|
+
<div>
|
|
18
|
+
<h2 class="ha-dialog__title" id="ha-confirm-delete-title">{{ _("Delete this record?") }}</h2>
|
|
19
|
+
<p class="ha-dialog__lede" id="ha-confirm-delete-desc">{{ _("This cannot be undone.") }}</p>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="ha-dialog__foot">
|
|
23
|
+
<button type="button" class="ha-btn ha-btn-secondary" data-ha-confirm-cancel autofocus>{{ _("Cancel") }}</button>
|
|
24
|
+
<button type="button" class="ha-btn ha-btn--danger" data-ha-confirm-ok>{{ icon('trash-2') }}{{ _("Delete") }}</button>
|
|
25
|
+
</div>
|
|
26
|
+
</dialog>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{#- Optimistic-concurrency conflict (docs/specs/realtime-occ.md). Swapped into
|
|
2
|
+
#ha-occ-conflict on the edit page after a 409. "Override anyway" re-sends the
|
|
3
|
+
surrounding form with the row's current version; "Discard my edits" reloads a
|
|
4
|
+
fresh edit form. -#}
|
|
5
|
+
{%- from "components/_icons.html" import icon -%}
|
|
6
|
+
<div class="ha-dialog ha-occ-conflict" role="alertdialog" aria-labelledby="ha-occ-title"
|
|
7
|
+
data-testid="conflict-dialog">
|
|
8
|
+
<div class="ha-dialog__head">
|
|
9
|
+
<span class="ha-dialog__glyph ha-dialog__glyph--danger" aria-hidden="true">{{ icon('triangle-alert') }}</span>
|
|
10
|
+
<div>
|
|
11
|
+
<h2 class="ha-dialog__title" id="ha-occ-title">{{ _("This record was changed by someone else") }}</h2>
|
|
12
|
+
<p class="ha-dialog__lede">{{ _("Your changes were not saved. Compare them with the current values, then choose which to keep.") }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<table class="ha-table" data-testid="conflict-diff">
|
|
16
|
+
<thead>
|
|
17
|
+
<tr>
|
|
18
|
+
<th scope="col">{{ _("Field") }}</th>
|
|
19
|
+
<th scope="col">{{ _("Your edit") }}</th>
|
|
20
|
+
<th scope="col">{{ _("Current value") }}</th>
|
|
21
|
+
</tr>
|
|
22
|
+
</thead>
|
|
23
|
+
<tbody>
|
|
24
|
+
{%- for row in rows -%}
|
|
25
|
+
<tr{% if row.differs %} class="ha-occ-differs"{% endif %} data-testid="conflict-row-{{ row.name }}">
|
|
26
|
+
<th scope="row">{{ row.label }}</th>
|
|
27
|
+
<td data-testid="conflict-mine-{{ row.name }}">{{ row.mine|ha_display }}</td>
|
|
28
|
+
<td data-testid="conflict-current-{{ row.name }}">{{ row.current|ha_display }}</td>
|
|
29
|
+
</tr>
|
|
30
|
+
{%- endfor -%}
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
<div class="ha-dialog__foot">
|
|
34
|
+
<a class="ha-btn ha-btn-secondary" href="{{ edit_url }}" data-testid="conflict-discard">{{ _("Discard my edits") }}</a>
|
|
35
|
+
<button type="button" class="ha-btn ha-btn--danger" data-testid="conflict-override"
|
|
36
|
+
hx-put="{{ update_url }}"
|
|
37
|
+
hx-include="closest form"
|
|
38
|
+
hx-vals='{"__version": "{{ current_version }}"}'
|
|
39
|
+
hx-target="#{{ model_name|lower }}-form-body"
|
|
40
|
+
hx-swap="innerHTML">{{ _("Override anyway") }}</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{#- CSRF reload banner (BYOA SDD D.1): revealed by _base.html's htmx hook when a
|
|
2
|
+
request is refused with a 403 carrying X-HyperAdmin-CSRF (a stale token,
|
|
3
|
+
e.g. after the secret key rotated). Reloading issues a fresh token.
|
|
4
|
+
Its own region, not .ha-toast-container: that selector is the HX-Retarget
|
|
5
|
+
target for refused-request toasts (views/error_pages.py). -#}
|
|
6
|
+
{%- from "components/_icons.html" import icon -%}
|
|
7
|
+
<div class="ha-csrf-banner-region">
|
|
8
|
+
<div x-data="{ show: false }" x-show="show" x-cloak @ha-csrf-failed.window="show = true"
|
|
9
|
+
class="ha-toast ha-alert-warning" role="alert" data-testid="csrf-reload-banner">
|
|
10
|
+
{{ icon('triangle-alert') }}
|
|
11
|
+
<div class="ha-toast-body">
|
|
12
|
+
<strong class="ha-alert-title">{{ _("This page's security token is out of date") }}</strong>
|
|
13
|
+
<span>{{ _("Reload the page, then try again.") }}</span>
|
|
14
|
+
<div class="ha-toast-actions">
|
|
15
|
+
<button type="button" class="ha-btn ha-btn--primary ha-btn--sm" onclick="window.location.reload()">{{ _("Reload page") }}</button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<button type="button" @click="show = false" class="ha-toast-close" aria-label="{{ _('Close') }}">{{ icon('x', 'ha-icon-sm') }}</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{#- Lists every invalid field with a link that moves focus to it (st-ux-erp-06).
|
|
2
|
+
Needs `form`; inline formset rows with errors link to their first invalid
|
|
3
|
+
input, and errors keyed to no field (model validators) get a catch-all entry.
|
|
4
|
+
Renders nothing when the form has no errors. -#}
|
|
5
|
+
{%- set invalid = form.fields|selectattr("errors")|list -%}
|
|
6
|
+
{%- set ns = namespace(entries=[], known=[]) -%}
|
|
7
|
+
{%- for f in form.fields -%}{%- set ns.known = ns.known + [f.name] -%}{%- endfor -%}
|
|
8
|
+
{%- for f in invalid -%}
|
|
9
|
+
{%- set ns.entries = ns.entries + [("#" ~ f.name, f.label ~ ": " ~ (f.errors|first))] -%}
|
|
10
|
+
{%- endfor -%}
|
|
11
|
+
{%- for formset in inline_formsets|default([]) -%}
|
|
12
|
+
{%- for row in formset.rows if row.has_errors -%}
|
|
13
|
+
{%- set bad = row.fields|selectattr("errors")|list -%}
|
|
14
|
+
{%- if bad -%}
|
|
15
|
+
{%- set ns.entries = ns.entries + [("#" ~ formset.prefix ~ "-" ~ row.index ~ "-" ~ bad[0].name, formset.title ~ " #" ~ (row.index + 1) ~ " - " ~ bad[0].label ~ ": " ~ (bad[0].errors|first))] -%}
|
|
16
|
+
{%- else -%}
|
|
17
|
+
{%- set ns.entries = ns.entries + [("#inline-" ~ formset.prefix ~ "-row-" ~ row.index, formset.title ~ " #" ~ (row.index + 1) ~ (": " ~ (row.pk_errors|first) if row.pk_errors else ""))] -%}
|
|
18
|
+
{%- endif -%}
|
|
19
|
+
{%- endfor -%}
|
|
20
|
+
{%- endfor -%}
|
|
21
|
+
{%- for key, msgs in (errors|default({})).items() if key not in ns.known and msgs -%}
|
|
22
|
+
{%- set ns.entries = ns.entries + [(none, msgs if msgs is string else (msgs|first))] -%}
|
|
23
|
+
{%- endfor -%}
|
|
24
|
+
{%- if ns.entries -%}
|
|
25
|
+
<div class="ha-error-summary" role="alert" tabindex="-1" data-testid="error-summary">
|
|
26
|
+
<h2 class="ha-error-summary-title">
|
|
27
|
+
{%- trans count=ns.entries|length -%}
|
|
28
|
+
There is a problem with 1 field
|
|
29
|
+
{%- pluralize -%}
|
|
30
|
+
There are problems with {{ count }} fields
|
|
31
|
+
{%- endtrans -%}
|
|
32
|
+
</h2>
|
|
33
|
+
<ul>
|
|
34
|
+
{%- for href, text in ns.entries -%}
|
|
35
|
+
<li>{% if href %}<a href="{{ href }}" data-ha-error-link>{{ text }}</a>{% else %}{{ text }}{% endif %}</li>
|
|
36
|
+
{%- endfor -%}
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
{%- endif -%}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{#- Swapped into .ha-toast-container (HX-Retarget) when an HTMX request is refused. -#}
|
|
2
|
+
{%- from "components/_icons.html" import icon -%}
|
|
3
|
+
<div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 8000)"
|
|
4
|
+
class="ha-toast ha-alert-error" role="alert" data-testid="error-toast">
|
|
5
|
+
{{ icon('circle-x') }}
|
|
6
|
+
<div class="ha-toast-body">
|
|
7
|
+
<strong class="ha-alert-title">
|
|
8
|
+
{%- if status_code == 403 -%}{{ _("Permission denied") }}
|
|
9
|
+
{%- elif status_code == 404 -%}{{ _("Not found") }}
|
|
10
|
+
{%- else -%}{{ _("Action refused") }}{%- endif -%}
|
|
11
|
+
</strong>
|
|
12
|
+
<span>
|
|
13
|
+
{%- if status_code == 403 -%}{{ _("Your account doesn't have permission for this.") }}
|
|
14
|
+
{%- else -%}{{ detail }}{%- endif -%}
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
<button type="button" @click="show = false" class="ha-toast-close" aria-label="{{ _('Close') }}">{{ icon('x', 'ha-icon-sm') }}</button>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{#- Renders a single fieldset group with collapse/expand toggle.
|
|
2
|
+
Context variables:
|
|
3
|
+
- group: FieldsetGroup instance (name, fields, collapsed, description, slug)
|
|
4
|
+
- form: PydanticForm instance (for layout_css_class)
|
|
5
|
+
-#}
|
|
6
|
+
{%- from "components/_icons.html" import icon -%}
|
|
7
|
+
{%- if group.name -%}
|
|
8
|
+
<fieldset class="ha-fieldset" data-testid="fieldset-{{ group.slug }}"
|
|
9
|
+
x-data="{ open: {{ 'false' if group.collapsed else 'true' }} }">
|
|
10
|
+
<legend class="ha-fieldset-legend">
|
|
11
|
+
<button type="button"
|
|
12
|
+
class="ha-fieldset-toggle"
|
|
13
|
+
data-testid="fieldset-toggle-{{ group.slug }}"
|
|
14
|
+
@click="open = !open"
|
|
15
|
+
:aria-expanded="open">
|
|
16
|
+
<span class="ha-fieldset-arrow" :class="open && 'is-open'">{{ icon('chevron-right') }}</span>
|
|
17
|
+
{{ group.name }}
|
|
18
|
+
</button>
|
|
19
|
+
</legend>
|
|
20
|
+
{%- if group.description -%}
|
|
21
|
+
<p class="ha-fieldset-description" x-show="open">{{ group.description }}</p>
|
|
22
|
+
{%- endif -%}
|
|
23
|
+
<div x-show="open" class="{{ form.layout_css_class }}">
|
|
24
|
+
{%- for field in group.fields -%}
|
|
25
|
+
{%- set widget = field.widget -%}
|
|
26
|
+
{%- include field.widget.template_path -%}
|
|
27
|
+
{%- endfor -%}
|
|
28
|
+
</div>
|
|
29
|
+
</fieldset>
|
|
30
|
+
{%- else -%}
|
|
31
|
+
{#- Ungrouped fields (no fieldset header) -#}
|
|
32
|
+
<div class="{{ form.layout_css_class }}">
|
|
33
|
+
{%- for field in group.fields -%}
|
|
34
|
+
{%- set widget = field.widget -%}
|
|
35
|
+
{%- include field.widget.template_path -%}
|
|
36
|
+
{%- endfor -%}
|
|
37
|
+
</div>
|
|
38
|
+
{%- endif -%}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{%- from "components/_icons.html" import icon -%}
|
|
2
|
+
{%- if filter_metadata -%}
|
|
3
|
+
<div class="ha-filter-bar" data-testid="filter-bar" x-data="{ filtersOpen: {{ 'true' if active_filters else 'false' }} }">
|
|
4
|
+
<button type="button"
|
|
5
|
+
class="ha-filter-toggle"
|
|
6
|
+
@click="filtersOpen = !filtersOpen"
|
|
7
|
+
aria-controls="filter-content"
|
|
8
|
+
:aria-expanded="filtersOpen">
|
|
9
|
+
{{ icon('filter', 'ha-icon-sm') }}
|
|
10
|
+
{{ _("Filters") }}
|
|
11
|
+
{%- if active_filters %}<span class="ha-filter-count">{{ active_filters|length }}</span>{% endif %}
|
|
12
|
+
<span class="ha-filter-chevron" :class="filtersOpen ? 'ha-rotate--180' : 'ha-rotate--0'">{{ icon('chevron-down', 'ha-icon-sm') }}</span>
|
|
13
|
+
</button>
|
|
14
|
+
|
|
15
|
+
<div id="filter-content" class="ha-filter-content" x-show="filtersOpen" x-cloak>
|
|
16
|
+
<div class="ha-filter-container">
|
|
17
|
+
{%- for filter in filter_metadata -%}
|
|
18
|
+
<div class="ha-form-group ha-filter-group">
|
|
19
|
+
<label class="ha-label" for="filter-{{ filter.name }}">{{ filter.label }}</label>
|
|
20
|
+
<select id="filter-{{ filter.name }}"
|
|
21
|
+
name="filter_{{ filter.name }}"
|
|
22
|
+
class="ha-select"
|
|
23
|
+
data-testid="filter-{{ filter.name }}"
|
|
24
|
+
hx-get="{{- url_for(model_name|lower ~ '-list') -}}"
|
|
25
|
+
hx-target="#model-list"
|
|
26
|
+
hx-push-url="true"
|
|
27
|
+
hx-include="[name^='filter_'], [name='search'], [name='sort_by'], [name='sort_direction']">
|
|
28
|
+
<option value="">{{ _("Any") }}</option>
|
|
29
|
+
{%- for choice in filter.choices -%}
|
|
30
|
+
<option value="{{ choice.value }}" {% if active_filters.get(filter.name) == choice.value|string %}selected{% endif %}>
|
|
31
|
+
{{- choice.label -}}
|
|
32
|
+
</option>
|
|
33
|
+
{%- endfor -%}
|
|
34
|
+
</select>
|
|
35
|
+
</div>
|
|
36
|
+
{%- endfor -%}
|
|
37
|
+
|
|
38
|
+
<div class="ha-filter-clear">
|
|
39
|
+
<a href="{{- url_for(model_name|lower ~ '-list') }}?search={{ search_query }}&sort_by={{ sort_by }}&sort_direction={{ sort_direction -}}"
|
|
40
|
+
class="ha-btn-link"
|
|
41
|
+
hx-get="{{- url_for(model_name|lower ~ '-list') }}?search={{ search_query }}&sort_by={{ sort_by }}&sort_direction={{ sort_direction -}}"
|
|
42
|
+
hx-target="#model-list"
|
|
43
|
+
hx-push-url="true">
|
|
44
|
+
{{ _("Clear all filters") }}
|
|
45
|
+
</a>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
{%- endif -%}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{#- Filter sidebar (FilterSidebar design): the FilterBar form as a side panel.
|
|
2
|
+
Context: filter_groups (rendered partials), applied_filters, search_query,
|
|
3
|
+
plus the saved-views context. Applying swaps only the table body
|
|
4
|
+
(hx-target #model-list-body) and pushes the URL; without JavaScript the
|
|
5
|
+
form is a plain GET. -#}
|
|
6
|
+
{%- from "components/_icons.html" import icon -%}
|
|
7
|
+
{%- set list_url = url_for(model_name|lower ~ '-list') -%}
|
|
8
|
+
<aside id="filter-sidebar" class="ha-filterside" :class="{ 'is-open': filtersOpen }" aria-labelledby="filter-sidebar-t" data-testid="filter-sidebar">
|
|
9
|
+
<form method="get" action="{{ list_url }}" role="search" aria-labelledby="filter-sidebar-t" style="display:contents"
|
|
10
|
+
hx-get="{{ list_url }}" hx-target="#{{ list_body_id }}" hx-swap="outerHTML" hx-push-url="true">
|
|
11
|
+
{%- if search_query %}<input type="hidden" name="search" value="{{ search_query }}">{% endif %}
|
|
12
|
+
<div class="ha-filterside__head">
|
|
13
|
+
<h2 id="filter-sidebar-t">{{ icon('sliders-horizontal', 'ha-icon--sm') }}{{ _("Filters") }}{% if applied_filters %} <span class="ha-count" data-testid="filter-count">{{ applied_filters|length }}</span>{% endif %}</h2>
|
|
14
|
+
<a class="ha-btn ha-btn--sm ha-btn--ghost" href="{{ list_url }}" data-testid="filters-reset">{{ icon('rotate-ccw', 'ha-icon--sm') }}{{ _("Reset") }}</a>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="ha-filterside__body">
|
|
17
|
+
{%- include "components/saved_views.html" -%}
|
|
18
|
+
{%- for group in filter_groups %}{{ group.html }}{% endfor %}
|
|
19
|
+
</div>
|
|
20
|
+
<div class="ha-filterside__foot">
|
|
21
|
+
<a class="ha-btn ha-btn--sm ha-btn--ghost" href="{{ list_url }}" data-testid="filters-clear">{{ _("Clear all") }}</a>
|
|
22
|
+
<button class="ha-btn ha-btn-primary" type="submit" data-testid="filter-apply-btn">{{ _("Apply filters") }}</button>
|
|
23
|
+
</div>
|
|
24
|
+
</form>
|
|
25
|
+
{%- if saved_views_enabled %}
|
|
26
|
+
<form id="saved-view-save-form" method="post" action="{{ saved_views_url }}">
|
|
27
|
+
{{ csrf_input() if csrf_input is defined }}
|
|
28
|
+
<input type="hidden" name="querystring" value="{{ current_query }}">
|
|
29
|
+
</form>
|
|
30
|
+
{%- endif %}
|
|
31
|
+
</aside>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{#- BooleanFilter group: tri-state Any / Yes / No as real radios. -#}
|
|
2
|
+
{%- set f = filter.field -%}
|
|
3
|
+
<fieldset class="ha-filtergroup" data-testid="filter-{{ f }}">
|
|
4
|
+
<legend id="filter-{{ f }}-legend">{{ filter.title }}</legend>
|
|
5
|
+
<div class="ha-seg ha-seg--radio" role="radiogroup" aria-labelledby="filter-{{ f }}-legend">
|
|
6
|
+
<label><input type="radio" name="{{ f }}" value=""{% if state == "" %} checked{% endif %}>{{ _("Any") }}</label>
|
|
7
|
+
<label><input type="radio" name="{{ f }}" value="1"{% if state == "1" %} checked{% endif %}>{{ _("Yes") }}</label>
|
|
8
|
+
<label><input type="radio" name="{{ f }}" value="0"{% if state == "0" %} checked{% endif %}>{{ _("No") }}</label>
|
|
9
|
+
</div>
|
|
10
|
+
</fieldset>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{#- CurrentPeriodDefault hint: shown inside the date group while the default applies. -#}
|
|
2
|
+
{%- from "components/_icons.html" import icon -%}
|
|
3
|
+
{%- if active %}
|
|
4
|
+
<div class="ha-filter-hint" data-testid="filter-{{ filter.field }}-default" data-default-query="{{ default_query }}">
|
|
5
|
+
{{ icon('info', 'ha-icon--sm') }}
|
|
6
|
+
<p>{{ _("Showing %(period)s by default.", period=_(period_label)) }} <a href="{{ show_all_href }}">{{ _("Show all dates") }}</a></p>
|
|
7
|
+
</div>
|
|
8
|
+
{%- endif %}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{#- DateRangeFilter group: presets, From/To inputs, inline error (FilterSidebar design). -#}
|
|
2
|
+
{%- from "components/_icons.html" import icon -%}
|
|
3
|
+
{%- set f = filter.field -%}
|
|
4
|
+
<fieldset class="ha-filtergroup{% if error %} has-error{% endif %}" data-testid="filter-{{ f }}">
|
|
5
|
+
<legend>{{ filter.title }}{% if active %}<a class="ha-filtergroup__clear" href="{{ clear_href }}">{{ _("Clear") }}<span class="ha-sr-only"> {{ filter.title|lower }}</span></a>{% endif %}</legend>
|
|
6
|
+
{%- if presets %}
|
|
7
|
+
<div class="ha-presets" role="group" aria-label="{{ filter.title }}: {{ _('quick ranges') }}">
|
|
8
|
+
{%- for value, label in presets %}
|
|
9
|
+
<button type="submit" name="{{ f }}__preset" value="{{ value }}" aria-pressed="{{ 'true' if preset == value else 'false' }}">{{ _(label) }}</button>
|
|
10
|
+
{%- endfor %}
|
|
11
|
+
</div>
|
|
12
|
+
{%- endif %}
|
|
13
|
+
<div class="ha-daterange">
|
|
14
|
+
<div class="ha-field">
|
|
15
|
+
<label class="ha-label" for="filter-{{ f }}-gte">{{ _("From") }}</label>
|
|
16
|
+
<input class="ha-input" type="date" id="filter-{{ f }}-gte" name="{{ f }}__gte" value="{{ gte }}" data-testid="filter-{{ f }}-gte"{% if error %} aria-invalid="true" aria-describedby="filter-{{ filter.slug }}-error"{% endif %}>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="ha-field">
|
|
19
|
+
<label class="ha-label" for="filter-{{ f }}-lte">{{ _("To") }}</label>
|
|
20
|
+
<input class="ha-input" type="date" id="filter-{{ f }}-lte" name="{{ f }}__lte" value="{{ lte }}" data-testid="filter-{{ f }}-lte"{% if error %} aria-invalid="true" aria-describedby="filter-{{ filter.slug }}-error"{% endif %}>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
{%- if error %}
|
|
24
|
+
<p class="ha-errmsg" id="filter-{{ filter.slug }}-error" data-testid="filter-{{ filter.slug }}-error">{{ icon('circle-x', 'ha-icon--sm') }}{{ _(error) }}</p>
|
|
25
|
+
{%- endif %}
|
|
26
|
+
</fieldset>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{#- IsOwnerFilter group: the "Mine only" switch with a help line. -#}
|
|
2
|
+
<fieldset class="ha-filtergroup" data-testid="filter-is_owner-group">
|
|
3
|
+
<legend class="ha-sr-only">{{ _("Owner") }}</legend>
|
|
4
|
+
<label class="ha-switch"><input type="checkbox" role="switch" name="is_owner" value="1"{% if active %} checked{% endif %} data-testid="filter-is_owner">{{ _(filter.title) }}</label>
|
|
5
|
+
{%- if filter.help_text %}
|
|
6
|
+
<p class="ha-help">{{ _(filter.help_text) }}</p>
|
|
7
|
+
{%- endif %}
|
|
8
|
+
</fieldset>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{#- MultiChoiceFilter group: a checklist of fixed values. -#}
|
|
2
|
+
{%- set f = filter.field -%}
|
|
3
|
+
<fieldset class="ha-filtergroup" data-testid="filter-{{ f }}">
|
|
4
|
+
<legend>{{ filter.title }}{% if active %}<a class="ha-filtergroup__clear" href="{{ clear_href }}">{{ _("Clear") }}<span class="ha-sr-only"> {{ filter.title|lower }}</span></a>{% endif %}</legend>
|
|
5
|
+
<ul class="ha-checklist">
|
|
6
|
+
{%- for choice in choices %}
|
|
7
|
+
<li><label class="ha-check"><input type="checkbox" name="{{ f }}__in" value="{{ choice.value }}"{% if choice.selected %} checked{% endif %}>{{ choice.label }}</label></li>
|
|
8
|
+
{%- endfor %}
|
|
9
|
+
</ul>
|
|
10
|
+
</fieldset>
|