micro-sidebar 1.0.0__py3-none-any.whl → 1.0.1__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.
@@ -0,0 +1,98 @@
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.
@@ -4,9 +4,9 @@ sidebar/urls.py,sha256=UL_9e1RLNMxZXkah65m7GRU1dbViZRGeNPBIiSZpOYg,142
4
4
  sidebar/views.py,sha256=MebyJ1ZiylSOPESXFkkQ8QTg-ClrkJn-oYLN6KrcgiM,418
5
5
  sidebar/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  sidebar/static/sidebar/style.css,sha256=aEbc4yPFaQBpMoYnJi575u077pHzej7FLFP8kgRnfBk,2105
7
- sidebar/static/sidebar/js/sidebar.js,sha256=EHQOsJWujpoV7A3K5WAwGx1nIV_oNh5yQ4tM3-PrbsI,5930
7
+ sidebar/static/sidebar/js/sidebar.js,sha256=jLspMcoRDpsw_KpIegGwSL-FRi_uz_8pQ95zDXMnTZ0,6221
8
8
  sidebar/templates/sidebar/content.html,sha256=hSqgzvuWZRxlUN1-zC-Oovppd_rbnCylxQmfRdGIbhY,1298
9
- micro_sidebar-1.0.0.dist-info/METADATA,sha256=zdEyRYYTjtmcMfj4TGMkqPQe6j-vUE2dE0shwBpTq0w,1412
10
- micro_sidebar-1.0.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
11
- micro_sidebar-1.0.0.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
12
- micro_sidebar-1.0.0.dist-info/RECORD,,
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,,
@@ -30,8 +30,15 @@ document.addEventListener("DOMContentLoaded", function () {
30
30
  initializeTooltips();
31
31
 
32
32
  // Dynamic positioning to anchor to titlebar
33
- sidebar.style.top = titlebarHeight + 'px';
34
- sidebar.style.height = (window.innerHeight - titlebarHeight) + 'px';
33
+ // Dynamic positioning to anchor to titlebar
34
+ if (titlebarHeight > 0) {
35
+ sidebar.style.top = titlebarHeight + 'px';
36
+ sidebar.style.height = (window.innerHeight - titlebarHeight) + 'px';
37
+ } else {
38
+ // Failsafe: Stick to top if no titlebar
39
+ sidebar.style.top = '0px';
40
+ sidebar.style.height = '100vh';
41
+ }
35
42
  } else {
36
43
  // Reset styles for large screens to let CSS take over (sticky)
37
44
  sidebar.style.top = '';
@@ -1,40 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: micro_sidebar
3
- Version: 1.0.0
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.
32
-
33
- ## Installation
34
-
35
- 1. Add `sidebar` to your `INSTALLED_APPS` setting.
36
- 2. Include the URLconf in your project urls.py:
37
- ```python
38
- path('sidebar/', include('sidebar.urls')),
39
- ```
40
- 3. Override the content by creating `templates/sidebar/content.html` in your project. See `sidebar/templates/sidebar/example_content.html` for a starting point.