Skip to content

Commit 1dc4faa

Browse files
authored
Merge pull request #86 from jazzband/release/v2.0.0
Prepare release of django-simple-menu 2.0.0
2 parents 51be8d1 + accc532 commit 1dc4faa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1000
-758
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
2-
source = menu
2+
source = simple_menu
33
branch = 1
44

55
[report]
6-
omit = *migrations*,.tox/*,setup.py,*settings.py
6+
omit = *migrations*,.tox/*,setup.py,*settings.py,menu/*

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python-version: ['3.6', '3.7', '3.8', '3.9']
13-
django-version: ['2.2', '3.0', '3.1', 'main']
12+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
13+
django-version: ['3.2', '4.0', 'main']
1414

1515
steps:
1616
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
rev: 1.11.0
1616
hooks:
1717
- id: django-upgrade
18-
args: [--target-version, "2.2"]
18+
args: [--target-version, "3.2"]
1919
- repo: https://github.com/pre-commit/pygrep-hooks
2020
rev: v1.9.0
2121
hooks:

CHANGES

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
django-simple-menu changelog
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
Version 2.0.0 - Released ...
5-
- Dropped support for Django < 2.2
6-
- Dropped support for Python < 3.6
4+
upcoming: Version 2.0.0
5+
- BREAKING: dropped support for Python < 3.6
6+
- BREAKING: dropped support for Django < 3.2
7+
- DEPRECATION: the module is now called "simple_menu" instead of "menu" (#93)
8+
- BREAKING: when using "simple_menu", the Bootstrap templates are located
9+
inside the "simple_menu" subfolder
10+
- Moved CI to GitHub Actions (#67, #72)
11+
- Project is now a part of Jazzband (#54)
12+
- Updated the example app
713

814
Version 1.2.1 - Released May 1st, 2016
915
- Fixing sdist packaging

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ include LICENSE
33
include README.rst
44
include CHANGES
55
include AUTHORS
6+
recursive-include simple_menu/templates *
7+
recursive-include simple_menu/templatetags *
68
recursive-include menu/templates *
79
recursive-include menu/templatetags *
810
recursive-include docs *

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ and more.
4343
Quickstart
4444
----------
4545

46-
**Requirements:** Python 3.6+, Django 2.2+
46+
**Requirements:** Python 3.6+, Django 3.2+
4747

4848
1. Install the ``django-simple-menu`` package.
4949

50-
2. Add ``menu`` to your ``INSTALLED_APPS``.
50+
2. Add ``simple_menu`` to your ``INSTALLED_APPS``.
5151

5252
- please ensure that you have ``django.template.context_processors.request``
5353
listed under ``TEMPLATES[...]["OPTIONS"]["context_processors"]``.
5454

5555
3. Create ``menus.py`` inside each app you want to create a menu for and define
5656
said menus using the ``Menu`` and ``MenuItem`` classes you can import from
57-
the ``menu`` namespace.
57+
the ``simple_menu`` package.
5858

59-
4. In your templates, load the template tags (``{% load menu %}``) and call
60-
``{% generate_menu %}`` inside a block. Your context will be populated with
61-
a new object named ``menus``. You can now iterate over it to render your
59+
4. In your templates, load the template tags (``{% load simple_menu %}``) and
60+
call ``{% generate_menu %}`` inside a block. Your context will be populated
61+
with a new object named ``menus``. You can now iterate over it to render your
6262
menus.
6363

6464
To quickly see ``django-simple-menu`` in action, check out the

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import sys, os
1414

15-
from menu import __version__
15+
from simple_menu import __version__
1616

1717
# If extensions (or modules to document with autodoc) are in another directory,
1818
# add these directories to sys.path here. If the directory is relative to the

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Installing django-simple-menu
55

66
pip install django-simple-menu
77

8-
#. Add ``menu`` to your ``INSTALLED_APPS`` list in your settings
8+
#. Add ``simple_menu`` to your ``INSTALLED_APPS`` list in your settings
99

1010
#. ``django-simple-menu`` requires that the ``request`` object be available in
1111
the context when you call the ``{% generate_menu %}`` template tag. This

docs/usage.rst

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@ access from within your templates. This way you can have a menu for your main
99
navigation, another menu for logged in users, another menu for anonymous users,
1010
etc.
1111

12-
.. note::
13-
14-
Since we use the ``menu`` namespace you will get ``ImportError`` if you
15-
have any files named ``menu.py``, ensure you use a plural version:
16-
``menus.py``
17-
1812
To define your menus you need to create a file named ``menus.py`` inside of the
1913
app that you wish to hook menus up to. In the ``menus.py`` file you should
20-
import the ``Menu`` and ``MenuItem`` classes from the ``menu`` package::
14+
import the ``Menu`` and ``MenuItem`` classes from the ``simple_menu`` package::
2115

22-
from menu import Menu, MenuItem
16+
from simple_menu import Menu, MenuItem
2317

2418
The ``Menu`` class exposes a class method named ``add_item`` that accepts two
2519
arguments; the menu name you want to add to, and the ``MenuItem`` you're going
@@ -44,7 +38,8 @@ available in your templates. For example adding ``separator=True`` could be
4438
used to add separators to menus ``{% if item.separator %}<li
4539
class="divider"></li>{% endif %}``
4640

47-
For the full list of ``MenuItem`` options see the `menu __init__.py source file`_.
41+
For the full list of ``MenuItem`` options see the
42+
`simple_menu __init__.py source file`_.
4843

4944
Usage Example
5045
-------------
@@ -92,7 +87,7 @@ Once you have your menus defined you need to incorporate them into your
9287
templates. This is done through the ``generate_menu`` template tag::
9388

9489
{% extends "base.html" %}
95-
{% load menu %}
90+
{% load simple_menu %}
9691

9792
{% block content %}
9893
{% generate_menu %}
@@ -117,7 +112,7 @@ the following items will be set in the context for you.
117112

118113

119114
See the bootstrap-navbar.html file in the templates dir of the source code for
120-
an example that renders menus for the `Twitter Bootstrap Navbar Component`_.
115+
an example that renders menus for the `Bootstrap Navbar Component`_.
121116
You can use it like::
122117

123118
{% with menu=menus.main %}{% include "bootstrap-navbar.html" %}{% endwith %}
@@ -137,7 +132,7 @@ This assumes you have a ``utils`` package.
137132

138133
from django.core.urlresolvers import resolve
139134

140-
from menu import MenuItem
135+
from simple_menu import MenuItem
141136

142137

143138
class ViewMenuItem(MenuItem):
@@ -158,7 +153,7 @@ This assumes you have a ``utils`` package.
158153

159154
from utils.menus import ViewMenuItem
160155

161-
from menu import Menu, MenuItem
156+
from simple_menu import Menu, MenuItem
162157

163158
from django.core.urlresolvers import reverse
164159

@@ -175,5 +170,5 @@ This assumes you have a ``utils`` package.
175170
children=reports_children))
176171

177172

178-
.. _menu __init__.py source file: https://github.com/jazzband/django-simple-menu/blob/master/menu/__init__.py
179-
.. _Twitter Bootstrap Navbar Component: http://twitter.github.com/bootstrap/components.html#navbar
173+
.. _simple_menu __init__.py source file: https://github.com/jazzband/django-simple-menu/blob/master/simple_menu/__init__.py
174+
.. _Bootstrap Navbar Component: https://getbootstrap.com/docs/5.1/components/navbar/

example/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### Django ###
2+
db.sqlite3
3+
db.sqlite3-journal
4+
5+
# Environments
6+
.env
7+
.venv
8+
env/
9+
venv/
10+
ENV/
11+
env.bak/
12+
venv.bak/
13+
14+
# PyCharm
15+
.idea/
16+
17+
# Visual Studio Code
18+
.vscode/

0 commit comments

Comments
 (0)