hyperflask 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {hyperflask-0.2.0 → hyperflask-0.2.2}/PKG-INFO +8 -7
- {hyperflask-0.2.0 → hyperflask-0.2.2}/pyproject.toml +13 -8
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/__init__.py +1 -1
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/app.py +2 -0
- hyperflask-0.2.2/src/hyperflask/model.py +46 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/app.css +7 -1
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/app.js +1 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Avatar.html +9 -9
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Drawer.html +7 -7
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/DrawerSide.html +7 -7
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/forms.html +1 -1
- hyperflask-0.2.2/src/hyperflask/ui/layout.html +49 -0
- hyperflask-0.2.2/src/hyperflask/ui/sse.html +6 -0
- hyperflask-0.2.0/src/hyperflask/ui/sse.html +0 -6
- {hyperflask-0.2.0 → hyperflask-0.2.2}/README.md +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/__main__.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/cli.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/components/__init__.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/components/alpine.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/components/core.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/components/jsx.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/components/webcomponent.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/factory.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/forms/__init__.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/forms/fields.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/forms/widgets.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/layouts/email.mjml +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/layouts/web.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/page_helpers.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/reactivity.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/alpine.js +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/react.js +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/reactive.js +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/stimulus.js +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/static/translations.js +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Accordion.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/AccordionPanel.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Alert.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/AvatarGroup.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Badge.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Breadcrumbs.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/BreadcrumbsItem.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Button.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Card.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/CardActions.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/CardTitle.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/ChatBubble.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Checkbox.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/CollapsibleSubMenu.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Countdown.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Divider.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/DrawerContent.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Dropdown.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/DropdownItem.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Fieldset.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/FieldsetLegend.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/FileInput.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Filter.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/FilterItem.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Footer.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/FooterLink.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/FooterNav.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Indicator.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Input.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/InputLabel.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Join.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Kbd.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Label.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/LabeledCheckbox.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/LabeledToggle.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Link.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/List.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/ListItem.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Loading.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Menu.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/MenuItem.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/MenuTitle.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Modal.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/ModalAction.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/ModalTitle.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Navbar.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Pagination.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/PaginationNext.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/PaginationPage.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/PaginationPrev.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Progress.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/README.md +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Radio.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Range.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Rating.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Select.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Stack.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Stat.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Stats.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Step.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Steps.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/SubMenu.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Swap.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Tab.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Table.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Tabs.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Textarea.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Toast.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Toggle.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/daisyui/Tooltip.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/flash.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/icons.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/ui/modal.html +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/__init__.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/html.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/htmx.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/markdown.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/models.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/page_actions.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/request.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/s3.py +0 -0
- {hyperflask-0.2.0 → hyperflask-0.2.2}/src/hyperflask/utils/tokens.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperflask
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Full stack web framework
|
|
5
5
|
Author: Maxime Bouroumeau-Fuseau
|
|
6
6
|
Author-email: Maxime Bouroumeau-Fuseau <maxime.bouroumeau@gmail.com>
|
|
@@ -10,7 +10,7 @@ Requires-Dist: flask-assets-pipeline~=0.6
|
|
|
10
10
|
Requires-Dist: flask-babel-hyper~=5.1
|
|
11
11
|
Requires-Dist: flask-collections~=0.2
|
|
12
12
|
Requires-Dist: flask-configurator~=0.1
|
|
13
|
-
Requires-Dist: flask-debugtoolbar~=0.
|
|
13
|
+
Requires-Dist: flask-debugtoolbar~=0.16
|
|
14
14
|
Requires-Dist: flask-dramatiq~=0.6
|
|
15
15
|
Requires-Dist: flask-file-routes~=0.2
|
|
16
16
|
Requires-Dist: flask-files~=0.2
|
|
@@ -22,15 +22,16 @@ Requires-Dist: flask-super-macros~=0.1
|
|
|
22
22
|
Requires-Dist: flask-talisman~=1.1
|
|
23
23
|
Requires-Dist: flask-wtf~=1.2
|
|
24
24
|
Requires-Dist: frozen-flask~=1.0
|
|
25
|
-
Requires-Dist: gunicorn~=
|
|
26
|
-
Requires-Dist: honcho~=
|
|
27
|
-
Requires-Dist: html-sanitizer~=2.
|
|
25
|
+
Requires-Dist: gunicorn~=23.0
|
|
26
|
+
Requires-Dist: honcho~=2.0
|
|
27
|
+
Requires-Dist: html-sanitizer~=2.6
|
|
28
28
|
Requires-Dist: htmx-flask~=0.1
|
|
29
|
-
Requires-Dist: jinja2-fragments~=1.
|
|
29
|
+
Requires-Dist: jinja2-fragments~=1.9
|
|
30
30
|
Requires-Dist: jinja-layout~=0.4
|
|
31
31
|
Requires-Dist: jinja-wtforms~=0.2
|
|
32
|
-
Requires-Dist: periodiq~=0.
|
|
32
|
+
Requires-Dist: periodiq~=0.13
|
|
33
33
|
Requires-Dist: python-slugify~=8.0.4
|
|
34
|
+
Requires-Dist: redis~=6.4
|
|
34
35
|
Requires-Python: >=3.10
|
|
35
36
|
Project-URL: Repository, https://github.com/hyperflask/hyperflask
|
|
36
37
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "hyperflask"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Full stack web framework"
|
|
5
5
|
authors = [
|
|
6
6
|
{"name" = "Maxime Bouroumeau-Fuseau", email = "maxime.bouroumeau@gmail.com"}
|
|
@@ -14,7 +14,7 @@ dependencies = [
|
|
|
14
14
|
"flask-babel-hyper ~=5.1",
|
|
15
15
|
"flask-collections ~=0.2",
|
|
16
16
|
"flask-configurator ~=0.1",
|
|
17
|
-
"flask-debugtoolbar ~=0.
|
|
17
|
+
"flask-debugtoolbar ~=0.16",
|
|
18
18
|
"flask-dramatiq ~=0.6",
|
|
19
19
|
"flask-file-routes ~=0.2",
|
|
20
20
|
"flask-files ~=0.2",
|
|
@@ -28,17 +28,22 @@ dependencies = [
|
|
|
28
28
|
"flask-wtf ~=1.2",
|
|
29
29
|
"frozen-flask ~=1.0",
|
|
30
30
|
#"dramatiq-sqlite ~=0.1"
|
|
31
|
-
"gunicorn ~=
|
|
32
|
-
"honcho ~=
|
|
33
|
-
"html-sanitizer ~=2.
|
|
31
|
+
"gunicorn ~=23.0",
|
|
32
|
+
"honcho ~=2.0",
|
|
33
|
+
"html-sanitizer ~=2.6",
|
|
34
34
|
"htmx-flask ~=0.1",
|
|
35
|
-
"jinja2-fragments ~=1.
|
|
35
|
+
"jinja2-fragments ~=1.9",
|
|
36
36
|
"jinja-layout ~=0.4",
|
|
37
37
|
"jinja-wtforms ~=0.2",
|
|
38
|
-
"periodiq ~=0.
|
|
39
|
-
"python-slugify ~=8.0.4"
|
|
38
|
+
"periodiq ~=0.13",
|
|
39
|
+
"python-slugify ~=8.0.4",
|
|
40
|
+
"redis ~=6.4"
|
|
40
41
|
]
|
|
41
42
|
|
|
43
|
+
[tool.uv.sources]
|
|
44
|
+
flask-dramatiq = { git = "https://gitlab.com/bersace/flask-dramatiq" }
|
|
45
|
+
periodiq = { git = "https://gitlab.com/bersace/periodiq" }
|
|
46
|
+
|
|
42
47
|
[project.urls]
|
|
43
48
|
Repository = "https://github.com/hyperflask/hyperflask"
|
|
44
49
|
|
|
@@ -7,7 +7,7 @@ from flask_babel import gettext, _, pgettext, _p, ngettext, _n, npgettext, _np,
|
|
|
7
7
|
from flask_file_routes import page
|
|
8
8
|
from flask_files import save_file, validate_file
|
|
9
9
|
from flask_mailman_templates import send_mail
|
|
10
|
-
from flask_mercure_sse import publish_signal
|
|
10
|
+
from flask_mercure_sse import publish_signal, mercure_publish
|
|
11
11
|
|
|
12
12
|
# useful exports from 3rd party libs
|
|
13
13
|
from htmx_flask import request, make_response
|
|
@@ -34,6 +34,7 @@ from .utils.html import sanitize_html, nl2br
|
|
|
34
34
|
from .utils.models import File as SQLFileType
|
|
35
35
|
from .components import discover_components, register_components
|
|
36
36
|
from .components.jsx import ReactAdapter
|
|
37
|
+
from .model import Model
|
|
37
38
|
from . import page_helpers
|
|
38
39
|
# others
|
|
39
40
|
from jinja_super_macros.registry import FileLoader
|
|
@@ -180,6 +181,7 @@ class Hyperflask(Flask):
|
|
|
180
181
|
|
|
181
182
|
SQLTemplate.eval_globals.update(app=self)
|
|
182
183
|
self.db = FlaskSQLORM(self, database_uri=database_uri, migrations_folder=migrations_folder)
|
|
184
|
+
self.db.Model = Model
|
|
183
185
|
self.db.File = SQLFileType
|
|
184
186
|
|
|
185
187
|
def relative_import_name(self, name):
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from flask_sqlorm import Model as BaseModel
|
|
2
|
+
from flask import current_app
|
|
3
|
+
from sqlorm.resultset import CompositeResultSet
|
|
4
|
+
from markupsafe import Markup
|
|
5
|
+
import abc
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ModelResultSet(CompositeResultSet):
|
|
9
|
+
def __str__(self):
|
|
10
|
+
return Markup("".join([str(item) for item in self]))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ModelMercureTopic:
|
|
14
|
+
def __init__(self, topic=None, topic_per_obj=True):
|
|
15
|
+
self.topic = topic
|
|
16
|
+
self.topic_per_obj = topic_per_obj
|
|
17
|
+
|
|
18
|
+
def __get__(self, instance, owner):
|
|
19
|
+
if instance and self.topic_per_obj:
|
|
20
|
+
if isinstance(self.topic_per_obj, str):
|
|
21
|
+
id = getattr(instance, self.topic_per_obj)
|
|
22
|
+
else:
|
|
23
|
+
id = owner.__mapper__.get_primary_key(instance)
|
|
24
|
+
return f"{self.topic or owner.__name__}/{id}"
|
|
25
|
+
return self.topic or owner.__name__
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Model(BaseModel, abc.ABC):
|
|
29
|
+
__resultset_class__ = ModelResultSet
|
|
30
|
+
__macro__ = None
|
|
31
|
+
__mercure_sse_topic__ = ModelMercureTopic()
|
|
32
|
+
|
|
33
|
+
def __mercure_sse_data__(self):
|
|
34
|
+
return str(self)
|
|
35
|
+
|
|
36
|
+
def __str__(self):
|
|
37
|
+
if not self.__macro__:
|
|
38
|
+
return repr(self)
|
|
39
|
+
|
|
40
|
+
macro = self.__macro__
|
|
41
|
+
prop = "obj"
|
|
42
|
+
if "(" in macro:
|
|
43
|
+
macro, prop = macro.rstrip(")").rsplit("(")
|
|
44
|
+
|
|
45
|
+
props = {prop: self} if prop else {}
|
|
46
|
+
return Markup(current_app.macros[macro](**props))
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{% macro Avatar(src=None, placeholder=None, placeholder_text_size=
|
|
2
|
-
<div class="avatar {% if placeholder %} avatar-placeholder{% endif %} {% if presence == "online" %} avatar-online{% endif %} {% if presence == "offline" %} avatar-offline{% endif %} {% if indicator %} indicator{% endif %}
|
|
3
|
-
|
|
1
|
+
{% macro Avatar(src=None, placeholder=None, placeholder_text_size="md", alt=None, rounded=True, size=12, mask=None, presence=None, indicator=None, indicator_color=None, indicator_position_x=None, indicator_position_y=None) -%}
|
|
2
|
+
<div class="avatar {% if placeholder %} avatar-placeholder{% endif %} {% if presence == "online" %} avatar-online{% endif %} {% if presence == "offline" %} avatar-offline{% endif %} {% if indicator %} indicator{% endif %}">
|
|
3
|
+
|
|
4
4
|
{% if not indicator %}{% else %}<span class="indicator-item badge {% if indicator_color == "primary" %} badge-primary{% endif %} {% if indicator_color == "secondary" %} badge-secondary{% endif %} {% if indicator_color == "accent" %} badge-accent{% endif %} {% if indicator_color == "neutral" %} badge-neutral{% endif %} {% if indicator_color == "success" %} badge-success{% endif %} {% if indicator_color == "warning" %} badge-warning{% endif %} {% if indicator_color == "info" %} badge-info{% endif %} {% if indicator_color == "error" %} badge-error{% endif %} {% if indicator_position_x == "start" %} indicator-start{% endif %} {% if indicator_position_x == "center" %} indicator-center{% endif %} {% if indicator_position_x == "end" %} indicator-end{% endif %} {% if indicator_position_y == "top" %} indicator-top{% endif %} {% if indicator_position_y == "middle" %} indicator-middle{% endif %} {% if indicator_position_y == "bottom" %} indicator-bottom{% endif %}">
|
|
5
5
|
{% if indicator %}{{indicator}}{% else %}
|
|
6
6
|
{% endif %}</span>{% endif %}
|
|
7
|
-
|
|
8
|
-
<div class="{% if placeholder %}bg-neutral text-neutral-content{% endif %} {% if rounded %}
|
|
7
|
+
|
|
8
|
+
<div class="{% if placeholder %}bg-neutral text-neutral-content{% endif %} {% if rounded %} rounded-full{% endif %} {% if size %} w-{{size}}{% endif %} {% if mask == "squircle" %} mask mask-squircle{% endif %} {% if mask == "heart" %} mask mask-heart{% endif %} {% if mask == "hexagon" %} mask mask-hexagon{% endif %} {% if mask == "hexagon-2" %} mask mask-hexagon-2{% endif %} {% if mask == "decagon" %} mask mask-decagon{% endif %} {% if mask == "pentagon" %} mask mask-pentagon{% endif %} {% if mask == "diamond" %} mask mask-diamond{% endif %} {% if mask == "square" %} mask mask-square{% endif %} {% if mask == "circle" %} mask mask-circle{% endif %} {% if mask == "star" %} mask mask-star{% endif %} {% if mask == "star-2" %} mask mask-star-2{% endif %} {% if mask == "triangle" %} mask mask-triangle{% endif %} {% if mask == "triangle-2" %} mask mask-triangle-2{% endif %} {% if mask == "triangle-3" %} mask mask-triangle-3{% endif %} {% if mask == "triangle-4" %} mask mask-triangle-4{% endif %} {% if mask == "half-1" %} mask mask-half-1{% endif %} {% if mask == "half-2" %} mask mask-half-2{% endif %} {{kwargs.pop('class', '')}}" {{ html_attrs(kwargs) }}>
|
|
9
9
|
{% if placeholder %}<span class="text-{{placeholder_text_size}}">{{placeholder}}</span>{% else %}
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
<img {% if src %}src="{{src}}"{% endif %} {% if alt %}alt="{{alt}}"{% endif %}>
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
{% endif %}</div>
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
</div>
|
|
16
|
-
{%- endmacro %}
|
|
16
|
+
{%- endmacro %}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{% macro Drawer(
|
|
1
|
+
{% macro Drawer(drawer_id="drawer1", open=False, responsive=None, end=False) -%}
|
|
2
2
|
<div class="drawer {% if open %} drawer-open{% endif %} {% if responsive == "xs" %} xs:drawer-open{% endif %} {% if responsive == "sm" %} sm:drawer-open{% endif %} {% if responsive == "md" %} md:drawer-open{% endif %} {% if responsive == "lg" %} lg:drawer-open{% endif %} {% if responsive == "xl" %} xl:drawer-open{% endif %} {% if end %} drawer-end{% endif %} {{kwargs.pop('class', '')}}" {{ html_attrs(kwargs) }}>
|
|
3
|
-
|
|
4
|
-
<input type="checkbox" class="drawer-toggle" {% if
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
<input type="checkbox" class="drawer-toggle" {% if drawer_id %}id="{{drawer_id}}"{% endif %}>
|
|
5
|
+
|
|
6
6
|
{{ caller() if caller else "" }}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
9
|
</div>
|
|
10
|
-
{%- endmacro %}
|
|
10
|
+
{%- endmacro %}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{% macro DrawerSide(
|
|
1
|
+
{% macro DrawerSide(drawer_id="drawer1") -%}
|
|
2
2
|
<div class="drawer-side {{kwargs.pop('class', '')}}" {{ html_attrs(kwargs) }}>
|
|
3
|
-
|
|
4
|
-
<label aria-label="close sidebar" class="drawer-overlay" {% if
|
|
3
|
+
|
|
4
|
+
<label aria-label="close sidebar" class="drawer-overlay" {% if drawer_id %}for="{{drawer_id}}"{% endif %}>
|
|
5
5
|
</label>
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
{{ caller() if caller else "" }}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
|
|
10
10
|
</div>
|
|
11
|
-
{%- endmacro %}
|
|
11
|
+
{%- endmacro %}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
{%- endmacro %}
|
|
26
26
|
|
|
27
27
|
{% macro FormField(field=None, label=None) -%}
|
|
28
|
-
<{Label}>{{label or field.label}}</{Label}>
|
|
28
|
+
{% if label or field.label %}<{Label}>{{label or field.label}}</{Label}>{% endif %}
|
|
29
29
|
{{field if field else caller()}}
|
|
30
30
|
{%- endmacro %}
|
|
31
31
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
{% macro AppUI() -%}
|
|
3
|
+
{%- set inner = caller() -%}
|
|
4
|
+
{%- set responsive = kwargs.pop('responsive', 'md') -%}
|
|
5
|
+
<{Drawer id="app" drawer_id="app-drawer" responsive=responsive **kwargs }>
|
|
6
|
+
{{inner}}
|
|
7
|
+
</{}>
|
|
8
|
+
{%- endmacro %}
|
|
9
|
+
|
|
10
|
+
{% macro Viewport(overflow=True) -%}
|
|
11
|
+
{%- set inner = caller() -%}
|
|
12
|
+
<{DrawerContent id="viewport" class=html_class({"overflow-auto": overflow}, "flex flex-col max-h-screen", kwargs.pop('class', '')) **kwargs }>
|
|
13
|
+
{{inner}}
|
|
14
|
+
</{}>
|
|
15
|
+
{%- endmacro %}
|
|
16
|
+
|
|
17
|
+
{% macro Sidebar() -%}
|
|
18
|
+
{%- set inner = caller() -%}
|
|
19
|
+
<{DrawerSide id="sidebar" drawer_id="app-drawer" class=html_class("min-w-[250px] bg-base-200", kwargs.pop('class', None)) **kwargs }>
|
|
20
|
+
<div class="flex flex-col h-full w-full" id="sidebar-content">
|
|
21
|
+
{{inner}}
|
|
22
|
+
</div>
|
|
23
|
+
</{}>
|
|
24
|
+
{%- endmacro %}
|
|
25
|
+
|
|
26
|
+
{% macro HBox() -%}
|
|
27
|
+
{%- set inner = caller() -%}
|
|
28
|
+
<{div class=html_class("flex gap-4 items-start", kwargs.pop('class', None)) **kwargs }>
|
|
29
|
+
{{ inner }}
|
|
30
|
+
</{}>
|
|
31
|
+
{%- endmacro %}
|
|
32
|
+
|
|
33
|
+
{% macro VBox() -%}
|
|
34
|
+
{%- set inner = caller() -%}
|
|
35
|
+
<{div class=html_class("flex flex-col gap-4", kwargs.pop('class', None)) **kwargs }>
|
|
36
|
+
{{ inner }}
|
|
37
|
+
</{}>
|
|
38
|
+
{%- endmacro %}
|
|
39
|
+
|
|
40
|
+
{% macro CenterBox() -%}
|
|
41
|
+
{%- set inner = caller() -%}
|
|
42
|
+
<{div class=html_class("flex justify-center items-center h-full", kwargs.pop('class', None)) **kwargs }>
|
|
43
|
+
{{ inner }}
|
|
44
|
+
</{}>
|
|
45
|
+
{%- endmacro %}
|
|
46
|
+
|
|
47
|
+
{% macro Spacer() -%}
|
|
48
|
+
<{div class=html_class("grow", kwargs.pop('class', None)) **kwargs }></{}>
|
|
49
|
+
{%- endmacro %}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
{% macro MercureStream(topic, private=True, hx_swap="beforeend", type="message") -%}
|
|
3
|
+
<div hx-ext="sse" sse-connect="{{mercure_authentified_hub_url(topic) if private else mercure_hub_url(topic)}}" sse-swap="{{type}}" hx-swap="{{hx_swap}}" {{html_attrs(**kwargs)}}>
|
|
4
|
+
{{ caller() }}
|
|
5
|
+
</div>
|
|
6
|
+
{%- endmacro %}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
{% macro MercureStream(topic, private=True, hx_swap="beforeend") -%}
|
|
3
|
-
<div hx-ext="sse" sse-connect="{{mercure_authentified_hub_url(topic) if private else mercure_hub_url(topic)}}" hx-swap="{{hx_swap}}" {{html_attrs(**kwargs)}}>
|
|
4
|
-
{{ caller() }}
|
|
5
|
-
</div>
|
|
6
|
-
{%- endmacro %}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|