micro-sidebar 1.0.1__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.1.0.dist-info/METADATA +114 -0
- micro_sidebar-1.1.0.dist-info/RECORD +13 -0
- {micro_sidebar-1.0.1.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.1.dist-info/METADATA +0 -98
- micro_sidebar-1.0.1.dist-info/RECORD +0 -12
- {micro_sidebar-1.0.1.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.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: micro-sidebar
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A Reusable RTL Django Sidebar App
|
|
5
|
+
Home-page: https://github.com/debeski/micro-sidebar
|
|
6
|
+
Author: DeBeski
|
|
7
|
+
Author-email: DeBeski <debeski1@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/debeski/micro-sidebar
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Classifier: Framework :: Django :: 5
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: Django (>=5.1)
|
|
26
|
+
|
|
27
|
+
# Micro Sidebar - A Reusable RTL Django Sidebar App
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/micro-sidebar/)
|
|
30
|
+
|
|
31
|
+
**RTL** lightweight, reusable django app that provides a dynamic sidebar for your django projects.
|
|
32
|
+
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
- **Django**: >= 5.1
|
|
36
|
+
- **Bootstrap**: 5 (Required for consistent styling)
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
1. **Install:**
|
|
41
|
+
```bash
|
|
42
|
+
pip install micro-sidebar
|
|
43
|
+
# OR
|
|
44
|
+
pip install git+https://github.com/debeski/micro-sidebar.git
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
2. **Add to `INSTALLED_APPS`:**
|
|
48
|
+
In your `settings.py`:
|
|
49
|
+
```python
|
|
50
|
+
INSTALLED_APPS = [
|
|
51
|
+
...
|
|
52
|
+
'sidebar',
|
|
53
|
+
...
|
|
54
|
+
]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. **Configure URLs:**
|
|
58
|
+
In your project's `urls.py`:
|
|
59
|
+
```python
|
|
60
|
+
from django.urls import path, include
|
|
61
|
+
|
|
62
|
+
urlpatterns = [
|
|
63
|
+
...
|
|
64
|
+
path('sidebar/', include('sidebar.urls')),
|
|
65
|
+
...
|
|
66
|
+
]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Customization
|
|
70
|
+
|
|
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
|
+
```
|
|
98
|
+
|
|
99
|
+
### Positioning
|
|
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.
|
|
101
|
+
|
|
102
|
+
## RTL / LTR Support
|
|
103
|
+
This sidebar is primarily designed for **RTL (Right-to-Left)** interfaces (e.g., Arabic).
|
|
104
|
+
While it may theoretically work in LTR environments if standard Bootstrap files are used instead of RTL versions, this has **not been fully tested**.
|
|
105
|
+
> *Future updates are planned to support dynamic language switching between RTL and LTR.*
|
|
106
|
+
|
|
107
|
+
## Version History
|
|
108
|
+
|
|
109
|
+
| Version | Changes |
|
|
110
|
+
| :--- | :--- |
|
|
111
|
+
| **v1.0.0** | Initial Release. |
|
|
112
|
+
| **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
|
|
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,98 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: micro_sidebar
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: A reusable Django sidebar for Web Apps
|
|
5
|
-
Home-page: https://github.com/debeski/micro-sidebar
|
|
6
|
-
Author: DeBeski
|
|
7
|
-
Author-email: DeBeski <debeski1@gmail.com>
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Homepage, https://github.com/debeski/micro-sidebar
|
|
10
|
-
Classifier: Framework :: Django
|
|
11
|
-
Classifier: Framework :: Django :: 5
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
-
Classifier: Operating System :: OS Independent
|
|
22
|
-
Requires-Python: >=3.9
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
Requires-Dist: Django>=5.1
|
|
25
|
-
Dynamic: author
|
|
26
|
-
Dynamic: home-page
|
|
27
|
-
Dynamic: requires-python
|
|
28
|
-
|
|
29
|
-
# Micro Sidebar
|
|
30
|
-
|
|
31
|
-
A reusable Django sidebar app for Web Apps.
|
|
32
|
-
|
|
33
|
-
## Requirements
|
|
34
|
-
|
|
35
|
-
- **Django**: >= 5.1
|
|
36
|
-
- **Bootstrap**: 5 (Required for consistent styling)
|
|
37
|
-
|
|
38
|
-
## Installation
|
|
39
|
-
|
|
40
|
-
1. **Install the package:**
|
|
41
|
-
```bash
|
|
42
|
-
pip install micro-sidebar
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
2. **Add to `INSTALLED_APPS`:**
|
|
46
|
-
In your `settings.py`:
|
|
47
|
-
```python
|
|
48
|
-
INSTALLED_APPS = [
|
|
49
|
-
...
|
|
50
|
-
'sidebar',
|
|
51
|
-
...
|
|
52
|
-
]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
3. **Configure URLs:**
|
|
56
|
-
In your project's `urls.py`:
|
|
57
|
-
```python
|
|
58
|
-
from django.urls import path, include
|
|
59
|
-
|
|
60
|
-
urlpatterns = [
|
|
61
|
-
...
|
|
62
|
-
path('sidebar/', include('sidebar.urls')),
|
|
63
|
-
...
|
|
64
|
-
]
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
4. **Add to your Base Template:**
|
|
68
|
-
In your `base.html` (or equivalent), include the sidebar. It is designed to sit on the left (or right in RTL) 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
|
-
## Customization
|
|
89
|
-
|
|
90
|
-
### Overriding Content
|
|
91
|
-
The sidebar comes with a default template. To customize the links and content, create a file named `content.html` inside `templates/sidebar/` in your project's `templates` directory.
|
|
92
|
-
|
|
93
|
-
**Path:** `your_project/templates/sidebar/content.html`
|
|
94
|
-
|
|
95
|
-
The default sidebar logic expects specific classes like `.list-group-item` and `.accordion-item` for the collapsible features to work correctly with the provided JS.
|
|
96
|
-
|
|
97
|
-
### Positioning
|
|
98
|
-
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.
|
|
@@ -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.1.dist-info/METADATA,sha256=8qel9NqaW4TW5VmQOmtV4LzGqZ6VyBGsjlKmfF70RRI,3025
|
|
10
|
-
micro_sidebar-1.0.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
11
|
-
micro_sidebar-1.0.1.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
|
|
12
|
-
micro_sidebar-1.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|