Skip to content

Commit

Permalink
Merge pull request #55 from farridav/farridav/bits_and_bobs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
farridav authored Jun 13, 2020
2 parents 566df7f + 624b5fd commit 6727a8b
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Python package
name: Build
on:
push:
branches: [master]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Upload Python Package
name: Deploy
on:
release:
types: [created]
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ See [Documentation](https://django-jazzmin.readthedocs.io/) or [Test App](./test
![login](docs/img/login.png)

## UI Customiser
![login](docs/img/ui_customiser.png)
![ui_customiser](docs/img/ui_customiser.png)

## Mobile layout
![mobile](docs/img/dashboard_mobile.png)

## Tablet layout
![tablet](docs/img/dashboard_tablet.png)

## Admin Docs (if installed)
![admin_docs](docs/img/admin_docs.png)

## Thanks
This was initially a Fork of https://github.com/wuyue92tree/django-adminlte-ui that we refactored so much we thought it
Expand Down
9 changes: 6 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ UI Customiser
~~~~~~~~~~~~~
.. image:: https://django-jazzmin.readthedocs.io/img/ui_customiser.png

Mobile/Tablet layouts
~~~~~~~~~~~~~~~~~~~~~
Mobile layout
~~~~~~~~~~~~~
.. image:: https://django-jazzmin.readthedocs.io/img/dashboard_mobile.png
.. image:: https://django-jazzmin.readthedocs.io/img/dashboard_table.png

Tablet layout
~~~~~~~~~~~~~
.. image:: https://django-jazzmin.readthedocs.io/img/dashboard_tablet.png

Admin Docs (if installed)
~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
17 changes: 11 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ JAZZMIN_SETTINGS = {
```

## Top menu

![Top Menu](./img/top_menu.png)

You can enable the top menu by specifying `'topmenu_links'` in your `JAZZMIN_SETTINGS`, this is a list made up of one of:

- app (creates a dropdown of modeladmin links)
Expand All @@ -107,9 +110,13 @@ The top menu can be styled with the UI Customiser (See below)
You can add links to the user menu on the top right of the screen using the `'usermenu_links'` settings key, the format
of these links is the same as with top menu (above), though submenus via 'app' are not currently supported and will not
be rendered.

![User Menu](./img/user_menu.png)

## Side menu

![Side Menu](./img/side_menu.png)

### How its generated

The side menu gets a list of all installed apps and their models that have admin classes, and creates a tree of apps and
Expand All @@ -134,18 +141,16 @@ Example:
# url name e.g `admin:index`, relative urls e.g `/admin/index` or absolute urls e.g `https://domain.com/admin/index`
'url': 'make_messages',
# any font-awesome icon, [see list here](https://www.fontawesomecheatsheet.com/font-awesome-cheatsheet-5x/) (optional)
# any font-awesome icon, see list here https://www.fontawesomecheatsheet.com/font-awesome-cheatsheet-5x/ (optional)
'icon': 'fa-comments',
# a list of permissions the user must have to see this link (optional)
'permissions': ['polls.view_poll']
}]
},

!!! note

The app list you generate for the side menu, is shared with the dashboard, so any changes you make to it, will be
reflected there
#### note
The app list you generate for the side menu, is shared with the dashboard, so any changes you make to it, will be reflected there

## UI Tweaks

Expand All @@ -172,4 +177,4 @@ custom CSS and/or JS file, just pass a relative path to your files e.g:
'custom_js': 'common/js/main.js'
```

Into your jazzmin settings (Ensure these files can be found by the static file finder), and the
Into your jazzmin settings (Ensure these files can be found by the static file finder)
18 changes: 13 additions & 5 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@

## Running the test project

python tests/test_app/manage.py migrate # Setup db tables etc.
python tests/test_app/manage.py seeder # Generate test data
python tests/test_app/manage.py runserver_plus # runs development server (with werkzeug debugger)
Setup db tables etc.

python tests/test_app/manage.py migrate

Generate test data

python tests/test_app/manage.py seeder

Run development server (with werkzeug debugger)

python tests/test_app/manage.py runserver_plus

## Running the tests
Tests are run via github actions on any pull request into `master`, and are written for use with the [pytest](https://docs.pytest.org/en/latest/)
framework, we should have good enough tests for you to base your own off of, though where we are lacking, or where we have
skeleton tests, feel free to contribute, but keep it clean, concise and simple, leave the magic to the wizards.

Run the test suite once with your current python interpreter and Django version using `pytest` or target an individual
test with `pytest -k my_test_name`
Run the test suite with your current python interpreter and Django version using `pytest` or target an individual test
with `pytest -k my_test_name`

Run against all supported Python and Django Versions using `tox`

Expand Down
Binary file modified docs/img/customise_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dashboard_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dashboard_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/detail_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/list_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/side_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/top_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/ui_customiser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/user_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ customise, including a built-in UI customizer
### UI Customiser
![UI Customiser](./img/ui_customiser.png)

### Mobile/Tablet layouts
### Mobile layout
![Admin docs](./img/dashboard_mobile.png)

### Tablet layout
![Admin docs](./img/dashboard_tablet.png)

### Admin docs (if installed)
Expand Down
2 changes: 1 addition & 1 deletion jazzmin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '2.1.1'
version = '2.1.2'
default_app_config = 'jazzmin.apps.JazzminConfig'
8 changes: 4 additions & 4 deletions jazzmin/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@
<a href="{% url 'admin:logout' %}" class="dropdown-item">
<i class="fas fa-users mr-2"></i> {% trans 'Log out' %}
</a>
<div class="dropdown-divider"></div>
{% if perms|can_view_self %}
<a href="{{ request.user|jazzy_admin_url }}" class="dropdown-item dropdown-footer">See Profile</a>
{% endif %}
{% get_user_menu user as user_menu %}
{% for link in user_menu %}
<div class="dropdown-divider"></div>
<a href="{{ link.url }}" class="dropdown-item" {% if link.new_window %}target="_blank"{% endif %}>
<i class="fas {% if link.icon %}{{ link.icon }}{% else %}fa-circle{% endif %} mr-2"></i> {% trans link.name %}
</a>
{% endfor %}
<div class="dropdown-divider"></div>
{% if perms|can_view_self %}
<a href="{{ request.user|jazzy_admin_url }}" class="dropdown-item dropdown-footer">See Profile</a>
{% endif %}
</div>
</li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions tests/test_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

if not os.getenv('FAIL_INVALID_TEMPLATE_VARS'):
os.environ.setdefault("WERKZEUG_DEBUG_PIN", "off")
INSTALLED_APPS.extend([
'debug_toolbar',
'django_extensions',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_jazzmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def test_user_menu(admin_user, client, settings):
assert parse_usermenu(response) == [
{'link': '/admin/password_change/', 'name': 'Change password'},
{'link': '/admin/logout/', 'name': 'Log out'},
{'link': '/admin/auth/user/{}/change/'.format(admin_user.pk), 'name': 'See Profile'},
{'link': '/admin/', 'name': 'Home'},
{'link': 'https://github.com/farridav/django-jazzmin/issues', 'name': 'Support'},
{'link': '/admin/auth/user/', 'name': 'Users'}
{'link': '/admin/auth/user/', 'name': 'Users'},
{'link': '/admin/auth/user/{}/change/'.format(admin_user.pk), 'name': 'See Profile'},
]

0 comments on commit 6727a8b

Please sign in to comment.