django-mvp-layout 0.1.0__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.
- django_mvp_layout-0.1.0/.gitignore +67 -0
- django_mvp_layout-0.1.0/LICENSE +21 -0
- django_mvp_layout-0.1.0/PKG-INFO +135 -0
- django_mvp_layout-0.1.0/README.md +107 -0
- django_mvp_layout-0.1.0/mvp_layout/__init__.py +1 -0
- django_mvp_layout-0.1.0/mvp_layout/apps.py +19 -0
- django_mvp_layout-0.1.0/mvp_layout/locale/en/LC_MESSAGES/django.po +27 -0
- django_mvp_layout-0.1.0/mvp_layout/static/mvp_layout/layout.css +516 -0
- django_mvp_layout-0.1.0/mvp_layout/static/mvp_layout/layout.js +505 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/footer.html +4 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/header.html +4 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/index.html +15 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/page.html +5 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/sidebar.html +26 -0
- django_mvp_layout-0.1.0/mvp_layout/templates/cotton/layout/toggle.html +18 -0
- django_mvp_layout-0.1.0/mvp_layout/templatetags/__init__.py +1 -0
- django_mvp_layout-0.1.0/mvp_layout/templatetags/mvp_layout.py +295 -0
- django_mvp_layout-0.1.0/mvp_layout/view.py +136 -0
- django_mvp_layout-0.1.0/pyproject.toml +172 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Temporary and binary files
|
|
2
|
+
*~
|
|
3
|
+
*.ruff_cache
|
|
4
|
+
*.mypy_cache
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*.so
|
|
7
|
+
*.cfg
|
|
8
|
+
!.isort.cfg
|
|
9
|
+
!setup.cfg
|
|
10
|
+
*.orig
|
|
11
|
+
*.log
|
|
12
|
+
*.pot
|
|
13
|
+
**/__pycache__
|
|
14
|
+
.cache/*
|
|
15
|
+
.*.swp
|
|
16
|
+
*/.ipynb_checkpoints/*
|
|
17
|
+
.DS_Store
|
|
18
|
+
.vscode/
|
|
19
|
+
.github/instructions/
|
|
20
|
+
docs/api/
|
|
21
|
+
|
|
22
|
+
# Unittest and coverage
|
|
23
|
+
htmlcov
|
|
24
|
+
.coverage
|
|
25
|
+
.coverage.*
|
|
26
|
+
.tox
|
|
27
|
+
junit*.xml
|
|
28
|
+
coverage.xml
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
|
|
31
|
+
# Build and docs folder/files
|
|
32
|
+
build/*
|
|
33
|
+
dist/*
|
|
34
|
+
sdist/*
|
|
35
|
+
docs/_rst/*
|
|
36
|
+
docs/_build/*
|
|
37
|
+
cover/*
|
|
38
|
+
MANIFEST
|
|
39
|
+
|
|
40
|
+
# Per-project virtualenvs
|
|
41
|
+
.venv*/
|
|
42
|
+
.conda*/
|
|
43
|
+
.python-version
|
|
44
|
+
|
|
45
|
+
# Django stuff:
|
|
46
|
+
*.log
|
|
47
|
+
local_settings.py
|
|
48
|
+
db.sqlite3
|
|
49
|
+
db.sqlite3-journal
|
|
50
|
+
media/
|
|
51
|
+
/static/
|
|
52
|
+
/*.sqlite3
|
|
53
|
+
|
|
54
|
+
# */static/vendor/*
|
|
55
|
+
|
|
56
|
+
# Environments
|
|
57
|
+
.env
|
|
58
|
+
.venv
|
|
59
|
+
env/
|
|
60
|
+
venv/
|
|
61
|
+
ENV/
|
|
62
|
+
env.bak/
|
|
63
|
+
venv.bak/
|
|
64
|
+
|
|
65
|
+
dist
|
|
66
|
+
docs/reference/api/
|
|
67
|
+
node_modules/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Samuel Jennings
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: django-mvp-layout
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Page layouts arranged by a nine-letter layout code, with sidebars that open, close, collapse and nest
|
|
5
|
+
Project-URL: Homepage, https://github.com/django-mvp/django-mvp-layout
|
|
6
|
+
Project-URL: Repository, https://github.com/django-mvp/django-mvp-layout
|
|
7
|
+
Project-URL: Issues, https://github.com/django-mvp/django-mvp-layout/issues
|
|
8
|
+
Author-email: Samuel Jennings <samuel.scott.jennings@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: daisyui,django,django-cotton,django-mvp,layout,sidebar
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Framework :: Django
|
|
15
|
+
Classifier: Framework :: Django :: 5.2
|
|
16
|
+
Classifier: Framework :: Django :: 6.0
|
|
17
|
+
Classifier: Framework :: Django :: 6.1
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Natural Language :: English
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
24
|
+
Requires-Python: <4.0,>=3.12
|
|
25
|
+
Requires-Dist: django-cotton>=2.9
|
|
26
|
+
Requires-Dist: django>=5.2
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# django-mvp-layout
|
|
30
|
+
|
|
31
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/tests.yml)
|
|
32
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/build.yml)
|
|
33
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/publish.yml)
|
|
34
|
+
[](https://codecov.io/gh/django-mvp/django-mvp-layout)
|
|
35
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
36
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
37
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
38
|
+
[](https://github.com/django-mvp/django-mvp-layout/blob/main/LICENSE)
|
|
39
|
+
|
|
40
|
+
Page layouts arranged by a nine-letter layout code, with sidebars that open, close, collapse and nest
|
|
41
|
+
|
|
42
|
+
## Scope & philosophy
|
|
43
|
+
|
|
44
|
+
The package arranges a header, two sidebars, a page and a footer, and makes the sidebars behave:
|
|
45
|
+
they open and close, shrink to an icon rail, become drawers on a narrow layout, and remember their
|
|
46
|
+
state. A layout is a page or a box inside one, and it nests inside itself. The package renders markup
|
|
47
|
+
and ships one stylesheet and one script. It has no models, views, URLs or settings, and it leaves the
|
|
48
|
+
look of everything inside the areas to the host project.
|
|
49
|
+
|
|
50
|
+
When two designs conflict, the one that keeps a layout accessible and its markup readable wins over
|
|
51
|
+
the one with more options.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install django-mvp-layout
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then add it to `INSTALLED_APPS`, after `mvp`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
INSTALLED_APPS = [
|
|
63
|
+
# ...
|
|
64
|
+
"mvp",
|
|
65
|
+
"mvp_layout",
|
|
66
|
+
]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
A layout is written with Cotton components, or in a plain base template that the pages of your
|
|
72
|
+
project extend.
|
|
73
|
+
|
|
74
|
+
### With django-cotton
|
|
75
|
+
|
|
76
|
+
Load the stylesheet and script in the head, then write the layout:
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
{% load static %}
|
|
80
|
+
<link rel="stylesheet" href="{% static 'mvp_layout/layout.css' %}" />
|
|
81
|
+
<script src="{% static 'mvp_layout/layout.js' %}"></script>
|
|
82
|
+
|
|
83
|
+
<c-layout view="lHh LpR lff">
|
|
84
|
+
<c-layout.header><c-layout.toggle when="closed" /> My project</c-layout.header>
|
|
85
|
+
<c-layout.sidebar label="Navigation">…</c-layout.sidebar>
|
|
86
|
+
<c-layout.page tag="main">…</c-layout.page>
|
|
87
|
+
<c-layout.footer>…</c-layout.footer>
|
|
88
|
+
</c-layout>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### In a plain template
|
|
92
|
+
|
|
93
|
+
1. Copy
|
|
94
|
+
[`docs/examples/base.html`](https://github.com/django-mvp/django-mvp-layout/blob/main/docs/examples/base.html)
|
|
95
|
+
to your project's `templates/base.html`, and add
|
|
96
|
+
`django.template.context_processors.request` to your template settings.
|
|
97
|
+
2. Keep the three things the layout needs: `{% layout_attrs %}` on the root element,
|
|
98
|
+
`{% sidebar_attrs %}` on each sidebar, and the stylesheet and script in the head:
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
{% load static mvp_layout %}
|
|
102
|
+
<link rel="stylesheet" href="{% static 'mvp_layout/layout.css' %}" />
|
|
103
|
+
<script src="{% static 'mvp_layout/layout.js' %}"></script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. Extend it in a page, filling the `header`, `navigation`, `content`, `aside` and `footer` blocks.
|
|
107
|
+
|
|
108
|
+
The nine-letter code in `{% layout_attrs "hHh LpR fFf" %}` places the areas. The
|
|
109
|
+
[developer guide](https://github.com/django-mvp/django-mvp-layout/tree/main/docs/developer)
|
|
110
|
+
covers the code, the components, both tags, styling, right-to-left pages and `MvpLayout`, the script a page of your
|
|
111
|
+
own uses to open and close sidebars.
|
|
112
|
+
|
|
113
|
+
## Contributing
|
|
114
|
+
|
|
115
|
+
Standards for this repository live in
|
|
116
|
+
[CONSTITUTION.md](https://github.com/django-mvp/django-mvp-layout/blob/main/CONSTITUTION.md),
|
|
117
|
+
and the vocabulary to use in issues and commits lives in
|
|
118
|
+
[CONTEXT.md](https://github.com/django-mvp/django-mvp-layout/blob/main/CONTEXT.md).
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
uv sync
|
|
122
|
+
uv run pytest
|
|
123
|
+
uv run pre-commit install
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`demo/` is a Django project that shows the layouts in a browser while you work on this package,
|
|
127
|
+
with an overview, a playground, a nested-layouts page and a Without Cotton page:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
uv run python manage.py runserver
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
MIT. See [LICENSE](https://github.com/django-mvp/django-mvp-layout/blob/main/LICENSE).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# django-mvp-layout
|
|
2
|
+
|
|
3
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/tests.yml)
|
|
4
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/build.yml)
|
|
5
|
+
[](https://github.com/django-mvp/django-mvp-layout/actions/workflows/publish.yml)
|
|
6
|
+
[](https://codecov.io/gh/django-mvp/django-mvp-layout)
|
|
7
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
8
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
9
|
+
[](https://pypi.org/project/django-mvp-layout/)
|
|
10
|
+
[](https://github.com/django-mvp/django-mvp-layout/blob/main/LICENSE)
|
|
11
|
+
|
|
12
|
+
Page layouts arranged by a nine-letter layout code, with sidebars that open, close, collapse and nest
|
|
13
|
+
|
|
14
|
+
## Scope & philosophy
|
|
15
|
+
|
|
16
|
+
The package arranges a header, two sidebars, a page and a footer, and makes the sidebars behave:
|
|
17
|
+
they open and close, shrink to an icon rail, become drawers on a narrow layout, and remember their
|
|
18
|
+
state. A layout is a page or a box inside one, and it nests inside itself. The package renders markup
|
|
19
|
+
and ships one stylesheet and one script. It has no models, views, URLs or settings, and it leaves the
|
|
20
|
+
look of everything inside the areas to the host project.
|
|
21
|
+
|
|
22
|
+
When two designs conflict, the one that keeps a layout accessible and its markup readable wins over
|
|
23
|
+
the one with more options.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install django-mvp-layout
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then add it to `INSTALLED_APPS`, after `mvp`:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
INSTALLED_APPS = [
|
|
35
|
+
# ...
|
|
36
|
+
"mvp",
|
|
37
|
+
"mvp_layout",
|
|
38
|
+
]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
A layout is written with Cotton components, or in a plain base template that the pages of your
|
|
44
|
+
project extend.
|
|
45
|
+
|
|
46
|
+
### With django-cotton
|
|
47
|
+
|
|
48
|
+
Load the stylesheet and script in the head, then write the layout:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
{% load static %}
|
|
52
|
+
<link rel="stylesheet" href="{% static 'mvp_layout/layout.css' %}" />
|
|
53
|
+
<script src="{% static 'mvp_layout/layout.js' %}"></script>
|
|
54
|
+
|
|
55
|
+
<c-layout view="lHh LpR lff">
|
|
56
|
+
<c-layout.header><c-layout.toggle when="closed" /> My project</c-layout.header>
|
|
57
|
+
<c-layout.sidebar label="Navigation">…</c-layout.sidebar>
|
|
58
|
+
<c-layout.page tag="main">…</c-layout.page>
|
|
59
|
+
<c-layout.footer>…</c-layout.footer>
|
|
60
|
+
</c-layout>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### In a plain template
|
|
64
|
+
|
|
65
|
+
1. Copy
|
|
66
|
+
[`docs/examples/base.html`](https://github.com/django-mvp/django-mvp-layout/blob/main/docs/examples/base.html)
|
|
67
|
+
to your project's `templates/base.html`, and add
|
|
68
|
+
`django.template.context_processors.request` to your template settings.
|
|
69
|
+
2. Keep the three things the layout needs: `{% layout_attrs %}` on the root element,
|
|
70
|
+
`{% sidebar_attrs %}` on each sidebar, and the stylesheet and script in the head:
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
{% load static mvp_layout %}
|
|
74
|
+
<link rel="stylesheet" href="{% static 'mvp_layout/layout.css' %}" />
|
|
75
|
+
<script src="{% static 'mvp_layout/layout.js' %}"></script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
3. Extend it in a page, filling the `header`, `navigation`, `content`, `aside` and `footer` blocks.
|
|
79
|
+
|
|
80
|
+
The nine-letter code in `{% layout_attrs "hHh LpR fFf" %}` places the areas. The
|
|
81
|
+
[developer guide](https://github.com/django-mvp/django-mvp-layout/tree/main/docs/developer)
|
|
82
|
+
covers the code, the components, both tags, styling, right-to-left pages and `MvpLayout`, the script a page of your
|
|
83
|
+
own uses to open and close sidebars.
|
|
84
|
+
|
|
85
|
+
## Contributing
|
|
86
|
+
|
|
87
|
+
Standards for this repository live in
|
|
88
|
+
[CONSTITUTION.md](https://github.com/django-mvp/django-mvp-layout/blob/main/CONSTITUTION.md),
|
|
89
|
+
and the vocabulary to use in issues and commits lives in
|
|
90
|
+
[CONTEXT.md](https://github.com/django-mvp/django-mvp-layout/blob/main/CONTEXT.md).
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
uv sync
|
|
94
|
+
uv run pytest
|
|
95
|
+
uv run pre-commit install
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`demo/` is a Django project that shows the layouts in a browser while you work on this package,
|
|
99
|
+
with an overview, a playground, a nested-layouts page and a Without Cotton page:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
uv run python manage.py runserver
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT. See [LICENSE](https://github.com/django-mvp/django-mvp-layout/blob/main/LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""The Layout app for django-mvp."""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""App configuration for django-mvp-layout."""
|
|
2
|
+
|
|
3
|
+
from django.apps import AppConfig
|
|
4
|
+
from django.utils.translation import gettext_lazy as _
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MvpLayoutConfig(AppConfig):
|
|
8
|
+
"""What a project gets when it adds this package to INSTALLED_APPS.
|
|
9
|
+
|
|
10
|
+
The label is set explicitly rather than left to Django's default, which is
|
|
11
|
+
the last segment of the module path. Two installed apps whose paths end in
|
|
12
|
+
the same word collide on that default, and the error names neither of them
|
|
13
|
+
clearly.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
name = "mvp_layout"
|
|
17
|
+
label = "mvp_layout"
|
|
18
|
+
verbose_name = _("Layout")
|
|
19
|
+
default_auto_field = "django.db.models.BigAutoField"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
|
+
#
|
|
6
|
+
#, fuzzy
|
|
7
|
+
msgid ""
|
|
8
|
+
msgstr ""
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
|
11
|
+
"POT-Creation-Date: 2026-11-24 16:00+0100\n"
|
|
12
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
+
"Language: \n"
|
|
16
|
+
"MIME-Version: 1.0\n"
|
|
17
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
19
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
20
|
+
msgid "Layout"
|
|
21
|
+
msgstr ""
|
|
22
|
+
|
|
23
|
+
msgid "Right sidebar"
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
msgid "Left sidebar"
|
|
27
|
+
msgstr ""
|