micro-sidebar 1.0.2__py3-none-any.whl → 1.1.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.
- micro_sidebar-1.1.0.dist-info/LICENSE +21 -0
- {micro_sidebar-1.0.2.dist-info → micro_sidebar-1.1.0.dist-info}/METADATA +41 -38
- micro_sidebar-1.1.0.dist-info/RECORD +13 -0
- {micro_sidebar-1.0.2.dist-info → micro_sidebar-1.1.0.dist-info}/WHEEL +1 -1
- sidebar/templates/sidebar/{content.html → main.html} +7 -5
- micro_sidebar-1.0.2.dist-info/RECORD +0 -12
- {micro_sidebar-1.0.2.dist-info → micro_sidebar-1.1.0.dist-info}/top_level.txt +0 -0
- /sidebar/static/sidebar/{style.css → sidebar.css} +0 -0
- /sidebar/static/sidebar/{js/sidebar.js → sidebar.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 DeBeski
|
|
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.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 1.0
|
|
4
|
-
Summary: A
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: micro-sidebar
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A Reusable RTL Django Sidebar App
|
|
5
5
|
Home-page: https://github.com/debeski/micro-sidebar
|
|
6
6
|
Author: DeBeski
|
|
7
7
|
Author-email: DeBeski <debeski1@gmail.com>
|
|
@@ -21,14 +21,14 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
21
21
|
Classifier: Operating System :: OS Independent
|
|
22
22
|
Requires-Python: >=3.9
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Dynamic: home-page
|
|
27
|
-
Dynamic: requires-python
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: Django (>=5.1)
|
|
28
26
|
|
|
29
|
-
# Micro Sidebar
|
|
27
|
+
# Micro Sidebar - A Reusable RTL Django Sidebar App
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
[](https://pypi.org/project/micro-sidebar/)
|
|
30
|
+
|
|
31
|
+
**RTL** lightweight, reusable django app that provides a dynamic sidebar for your django projects.
|
|
32
32
|
|
|
33
33
|
## Requirements
|
|
34
34
|
|
|
@@ -37,9 +37,11 @@ A reusable RTL Django sidebar app for Web Apps.
|
|
|
37
37
|
|
|
38
38
|
## Installation
|
|
39
39
|
|
|
40
|
-
1. **Install
|
|
40
|
+
1. **Install:**
|
|
41
41
|
```bash
|
|
42
42
|
pip install micro-sidebar
|
|
43
|
+
# OR
|
|
44
|
+
pip install git+https://github.com/debeski/micro-sidebar.git
|
|
43
45
|
```
|
|
44
46
|
|
|
45
47
|
2. **Add to `INSTALLED_APPS`:**
|
|
@@ -64,35 +66,35 @@ A reusable RTL Django sidebar app for Web Apps.
|
|
|
64
66
|
]
|
|
65
67
|
```
|
|
66
68
|
|
|
67
|
-
4. **Add to your Base Template:**
|
|
68
|
-
In your `base.html` (or equivalent), include the sidebar. It is designed to sit to the right of your main content.
|
|
69
|
-
|
|
70
|
-
Example structure using Flexbox:
|
|
71
|
-
```html
|
|
72
|
-
<body>
|
|
73
|
-
<div class="d-flex">
|
|
74
|
-
<!-- Sidebar -->
|
|
75
|
-
{% include "sidebar/content.html" %}
|
|
76
|
-
|
|
77
|
-
<!-- Main Content -->
|
|
78
|
-
<div class="flex-grow-1">
|
|
79
|
-
{% block content %}{% endblock %}
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<!-- Bootstrap JS (Required) -->
|
|
84
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
85
|
-
</body>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
69
|
## Customization
|
|
89
70
|
|
|
90
|
-
###
|
|
91
|
-
The sidebar
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
### Override Default Menu
|
|
72
|
+
The sidebar uses a block-based template system. To define your own menu items:
|
|
73
|
+
|
|
74
|
+
1. Create a new template (e.g., `templates/sidebar_menu.html`).
|
|
75
|
+
2. Extend `sidebar/main.html`.
|
|
76
|
+
3. Override the `{% block items %}`.
|
|
77
|
+
|
|
78
|
+
**Example `sidebar_menu.html`:**
|
|
79
|
+
```html
|
|
80
|
+
{% extends "sidebar/main.html" %}
|
|
81
|
+
|
|
82
|
+
{% block items %}
|
|
83
|
+
<a href="{% url 'home' %}" class="list-group-item list-group-item-action">
|
|
84
|
+
<i class="bi bi-house me-2" style="font-size: 24px;"></i>
|
|
85
|
+
<span>Home</span>
|
|
86
|
+
</a>
|
|
87
|
+
<a href="{% url 'settings' %}" class="list-group-item list-group-item-action">
|
|
88
|
+
<i class="bi bi-gear me-2" style="font-size: 24px;"></i>
|
|
89
|
+
<span>Settings</span>
|
|
90
|
+
</a>
|
|
91
|
+
{% endblock %}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Then, include your custom template in `base.html`:
|
|
95
|
+
```html
|
|
96
|
+
{% include "sidebar_menu.html" %}
|
|
97
|
+
```
|
|
96
98
|
|
|
97
99
|
### Positioning
|
|
98
100
|
The sidebar is sticky by default. If your app has a top navigation bar (titlebar), the sidebar will automatically adjust its position below it on small screens. If no titlebar is detected, it will stick to the top of the viewport.
|
|
@@ -109,3 +111,4 @@ While it may theoretically work in LTR environments if standard Bootstrap files
|
|
|
109
111
|
| **v1.0.0** | Initial Release. |
|
|
110
112
|
| **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
|
|
111
113
|
| **v1.0.2** | Improved documentation clarity and added usage instructions. |
|
|
114
|
+
| **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
sidebar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
sidebar/apps.py,sha256=4UjKXHoBGKRLxpC9AY6eaq8YZx8unirUz_8u-IrlfVQ,145
|
|
3
|
+
sidebar/urls.py,sha256=UL_9e1RLNMxZXkah65m7GRU1dbViZRGeNPBIiSZpOYg,142
|
|
4
|
+
sidebar/views.py,sha256=MebyJ1ZiylSOPESXFkkQ8QTg-ClrkJn-oYLN6KrcgiM,418
|
|
5
|
+
sidebar/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
sidebar/static/sidebar/sidebar.css,sha256=aEbc4yPFaQBpMoYnJi575u077pHzej7FLFP8kgRnfBk,2105
|
|
7
|
+
sidebar/static/sidebar/sidebar.js,sha256=jLspMcoRDpsw_KpIegGwSL-FRi_uz_8pQ95zDXMnTZ0,6221
|
|
8
|
+
sidebar/templates/sidebar/main.html,sha256=8dhxllfL40advQ6z2UlqH_wf3Nnf7ilexukoG7VQoek,1363
|
|
9
|
+
micro_sidebar-1.1.0.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
|
|
10
|
+
micro_sidebar-1.1.0.dist-info/METADATA,sha256=nlAXd6VHbs4FwddvAZmSxP_0SP6JgACUygmByl3J_mw,3639
|
|
11
|
+
micro_sidebar-1.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
12
|
+
micro_sidebar-1.1.0.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
|
|
13
|
+
micro_sidebar-1.1.0.dist-info/RECORD,,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% load static %}
|
|
2
|
-
<link rel="stylesheet" href="{% static 'sidebar/
|
|
3
|
-
<script src="{% static 'sidebar/
|
|
2
|
+
<link rel="stylesheet" href="{% static 'sidebar/sidebar.css' %}">
|
|
3
|
+
<script src="{% static 'sidebar/sidebar.js' %}" nonce="{{ request.csp_nonce }}" defer></script>
|
|
4
4
|
<!-- Ghost Sidebar for small screens layout stability -->
|
|
5
5
|
<div class="sidebar-ghost"></div>
|
|
6
6
|
|
|
@@ -10,15 +10,16 @@
|
|
|
10
10
|
data-toggle-url="{% url 'toggle_sidebar' %}"
|
|
11
11
|
data-session-collapsed="{{ request.session.sidebarCollapsed|yesno:'true,false' }}">
|
|
12
12
|
<div class="list-group flex-shrink-0">
|
|
13
|
+
{% block items %}
|
|
13
14
|
|
|
14
15
|
<!-- DEFAULT CONTENT / INSTRUCTIONS -->
|
|
15
16
|
<div class="p-3 text-center text-muted">
|
|
16
17
|
<i class="bi bi-info-circle mb-2" style="font-size: 24px;"></i>
|
|
17
18
|
<p class="small">
|
|
18
19
|
<strong>Default Sidebar</strong><br>
|
|
19
|
-
To customize this menu, create a
|
|
20
|
-
<code>
|
|
21
|
-
|
|
20
|
+
To customize this menu, create a template extending:<br>
|
|
21
|
+
<code>sidebar/main.html</code><br>
|
|
22
|
+
and override the <code>items</code> block.
|
|
22
23
|
</p>
|
|
23
24
|
</div>
|
|
24
25
|
|
|
@@ -27,5 +28,6 @@
|
|
|
27
28
|
<span>Example Home</span>
|
|
28
29
|
</a>
|
|
29
30
|
|
|
31
|
+
{% endblock %}
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
sidebar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
sidebar/apps.py,sha256=4UjKXHoBGKRLxpC9AY6eaq8YZx8unirUz_8u-IrlfVQ,145
|
|
3
|
-
sidebar/urls.py,sha256=UL_9e1RLNMxZXkah65m7GRU1dbViZRGeNPBIiSZpOYg,142
|
|
4
|
-
sidebar/views.py,sha256=MebyJ1ZiylSOPESXFkkQ8QTg-ClrkJn-oYLN6KrcgiM,418
|
|
5
|
-
sidebar/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
sidebar/static/sidebar/style.css,sha256=aEbc4yPFaQBpMoYnJi575u077pHzej7FLFP8kgRnfBk,2105
|
|
7
|
-
sidebar/static/sidebar/js/sidebar.js,sha256=jLspMcoRDpsw_KpIegGwSL-FRi_uz_8pQ95zDXMnTZ0,6221
|
|
8
|
-
sidebar/templates/sidebar/content.html,sha256=hSqgzvuWZRxlUN1-zC-Oovppd_rbnCylxQmfRdGIbhY,1298
|
|
9
|
-
micro_sidebar-1.0.2.dist-info/METADATA,sha256=fctkEC7TQqt0tDm2oAQzXalyb058WNMLWtoLA-gwJH4,3607
|
|
10
|
-
micro_sidebar-1.0.2.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
11
|
-
micro_sidebar-1.0.2.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
|
|
12
|
-
micro_sidebar-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|