GithubHelp home page GithubHelp logo

farridav / django-jazzmin Goto Github PK

View Code? Open in Web Editor NEW
1.6K 37.0 276.0 21.72 MB

Jazzy theme for Django

Home Page: https://django-jazzmin.readthedocs.io

License: MIT License

Python 31.69% CSS 4.72% JavaScript 9.15% HTML 53.98% Makefile 0.46%
django dashboard theme admin jazzmin adminlte

django-jazzmin's People

Contributors

afvca avatar bryan-brancotte avatar dependabot[bot] avatar dhvcc avatar diesieben07 avatar dimastbk avatar ethemce avatar farridav avatar felixcheruiyot avatar fengyouchao avatar gkachru avatar hwalinga avatar jrdabrio avatar kainbacher avatar karimtayie avatar kristofgilicze avatar ktalik avatar lchojnacki avatar mathiaskowoll avatar matthewelwell avatar mpibpc-mroose avatar pacificgilly avatar prynstag avatar ramezissac avatar sacovo avatar saeedhmt avatar sourcedoctor avatar timobrembeck avatar tysonrv avatar wuyue92tree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-jazzmin's Issues

apps not shown

I have 5 apps installed in my project which are working fine for me in my Django admin. But i installed jazzmin admin everything is working fine for now but its shows me only 3 apps. further my other 2 apps name start with capital letter. i tried to rename them and check it again but it didn't resolve my issue.

Minor UI tweaks

  • Registration somehow needs checking ?
  • Check form errors on all pages
  • Clean up horizontal multi select, as seen in user detail view
  • Clean up datetime fields in changeform views
  • help text and validation text (field specific and form-wide) needs help, styling improvements

prepopulated_fields not working in new inlines added via the "Add another" link

We seem to be using the form-group class and django's code is based on form-row.
Overriding admin/js/prepopulate_init.js by this code fixes it:

(function($) {
    'use strict';
    var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
    $.each(fields, function(index, field) {
        $(
            '.empty-form .form-group.field-' + field.name +
            ', .empty-form.form-group .field-' + field.name +
            ', .empty-form .form-group .field-' + field.name
        ).addClass('prepopulated_field');
        $(field.id).data('dependency_list', field.dependency_list).prepopulate(
            field.dependency_ids, field.maxLength, field.allowUnicode
        );
    });
})(django.jQuery);

However, we might just want to use the form-row class to be compatible. I am using Django 2.2 currently, but I think Django is still using form-row in 3.1 as well.

Edit: If you want to test, use TabularInline as StackedInline prepopulate is broken in Django upstream. A patch is available though.

Enhancement: Jazz the Change Form Tabs

The implemented behavior is to add a tab called "General" if no fieldset , which might not always be relevant. I suggest if no fieldset, build the form right away (without tabs).

Also maybe there can be an option to skip the tabs and display the page in one unit .
(Example: An invoice model with invoice details )

Login Page Title Problem

problem
First of all, thank you very much for writing such an admin panel interface. Please do not stop the enhancements.

But the title does not appear on the login page. I would be very glad if you check. Achievements.

Jazz up the history page

The history page right now is functional, we could jazz it up, add icons for the types of actions, make it real jazzy yo

The change form -> formset -> empty form is visible and editable

Because the empty form is visible and editable
1- the extra forms in the tabular inline are +1
2- More importantly, as it's editable, when you add a new dynamic row , it comes up with the last row edited values and not the default.

Another observation
We can add {{ block.super }} in change_form.extrajs block.. this way any edits in the base_site are preserved.

Side menu does not display models in some cases

When a user does not have view_user permission, but overwrites has_xxxx_permission in UserAdmin, as follows:

@admin.register(User)
class UserAdmin(admin.ModelAdmin):
    def has_add_permission(self, request):
        return True

    def has_change_permission(self, request, obj=None):
        return True

    def has_view_permission(self, request, obj=None):
        return True

    def has_module_permission(self, request):
        return True

Side menu still does not display user.

When fielsets has only one fieldset, carousel, horizontal_tabs, verical_tabs will not be displayed

When fielsets has only one fieldset, carousel, horizontal_tabs, verical_tabs will not be displayed

For example:

fieldsets = (
    ('Tab1', {
        'fields': (
            'id',
        ),
    }),
)

Tab1 will not display.

Override get_fieldsets

This also affects get_fieldsets. Only when fieldsets are set and contain more than one fieldset, the fieldsets returned by the overridden get_fieldsets will be displayed correctly.

Case 1

# fieldsets is not set
def get_fieldsets(self, request, obj=None):
    return (
        (_('Tab3'), {
            'fields': (
                'id',
            ),
        }),
    )

Tab3 will not display.

Case 2:

fieldsets = (
    ('Tab1', {
        'fields': (
            'id',
        ),
    }),
)

def get_fieldsets(self, request, obj=None):
    return (
        (_('Tab3'), {
            'fields': (
                'id',
            ),
        }),
    )

Tab3 will not display.

Case 3

fieldsets = (
    ('Tab1', {
        'fields': (
            'id',
        ),
    }),
    (_('Tab2'), {
        'fields': (
            'release_channel',
        ),
    }),
)

def get_fieldsets(self, request, obj=None):
    return (
        (_('Tab3'), {
            'fields': (
                'id',
            ),
        }),
    )

Tab3 will be displayed correctly.

In other words, if get_fieldsets is overridden, in order to be displayed correctly, fieldsets must be set, and there must be at least two fieldset.

Jazz up the delete overview page

When you go to delete an item within the admin, you get a list of all related models in nested unordered lists.

This page is a perfect candidate for jazzing up ..

Installation crashes my app

After installing the app, I get "can't pickle module objects" as an error.
The error is located in "lib/python3.6/site-packages/jazzmin/templates/admin/base.html" at line 133.

filter_vertical not responsive when used within inlines

Specifying filter_vertical seems to break the UI. Please see the screenshot.

filter_vertical

I'm able to fix it by including the following custom css:

.stacked, .stacked select, .stacked .selector-available, .stacked .selector-chosen {
    width: 100%;
}

.stacked {
    float: left;
    flex-direction: column;
    display:flex;
}

.stacked select {
    height: 10.1em;
}

.stacked ul.selector-chooser {
    width: 56px;
    height: 26px;
    padding: 0 2px;
    margin: 15px auto;
    transform: none;
}

.stacked .selector-chooser li {
    float: left;
    padding: 3px;
    width: 26px;
}

.stacked .selector-add {
    background-position: 0 -40px;
}

.stacked .selector-remove {
    background-position: 0 0;
}

.stacked .selector-add, .stacked .selector-remove {
    background-size: 20px auto;
    height: 22px;
}

Admin for proxy models doesn't show up

You can add same model multiple times to the admin site but subclassing them as proxy models.
It works on the default django admin but proxy models doesn't show up on jazzmin

Menu items not marked as active when in detail views

When your in the detail view for a given model, the menu item on top or left is not set to active.

We should change this to highlight the links to the model admin, and optionally highlight the app name somehow too.

Editable inlines do not submit

Editable inlines do not work because the submit button is not inside the encapsulating <form>

We need to move the submit button inside the form somehow..

UI customizer does not show up in the admin page

Hey! I have tried using the UI customizer however it does not seem to be working.

`
JAZZMIN_SETTINGS = {
'show_ui_builder': True,
# title of the window
'site_title': 'Nobo CRM Systems',

# Title on the login screen
'site_header': 'Nobo Administration',

# Welcome text on the login screen
'welcome_sign': 'Welcome',

# Copyright on the footer
'copyright': 'Nobo Ltd',

# The model admin to search from the search bar, search bar omitted if excluded
'search_model': 'auth.User',

# Field name on user model that contains avatar image
'user_avatar': None,

# Links to put along the top menu
'topmenu_links': [

    # Url that gets reversed (Permissions can be added)
    {'name': 'Home',  'url': 'admin:index', 'permissions': ['auth.view_user']},

    # external url that opens in a new window (Permissions can be added)
    {'name': 'Support', 'url': 'https://github.com/farridav/django-jazzmin/issues', 'new_window': True},

    # model admin to link to (Permissions checked against model)
    {'model': 'auth.User'},

    # App with dropdown menu to all its models pages (Permissions checked against models)
    {'app': 'sales'},
],

# Whether to display the side menu
'show_sidebar': False,

# Whether to aut expand the menu
'navigation_expanded': True,

# Hide these apps when generating side menu e.g (auth)
'hide_apps': ['river'],

# Hide these models when generating side menu (e.g auth.user)
'hide_models': [],

# Custom icons per model in the side menu See https://www.fontawesomecheatsheet.com/font-awesome-cheatsheet-5x/
# for a list of icon classes
'icons': {
    'auth.user': 'fa-user',
}

}`

This is my code

TabularInline does not display the last data and missing "add another {model}" link

1. When a TabularInline does not have add permission, the last inline data will not be displayed.

Example:

class AnswerInline(admin.TabularInline):
    extra = 0
    model = Answer

    def has_add_permission(self, request, obj=None):
        return False


@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
    inlines = (AnswerInline,)

If a question has two answers, but only the first answer will be displayed in QuestionAdmin.

2. Missing "add another {model}" link

TabularInline does not display the "add another {model}" link even if it has add permission.

Cant use existing DOM id's for admin fieldsets

Because the element id's for tabs on the admin detail views are created from the fieldset name with no prefix/suffix, naming a fieldset with "content" will result in a <div class="tab pane" id="content"

This causes the tab to not work and can have wild and unpredictable consequences, we should ensure that all generated class name or ids are prefixed or suffixed, to avoid clashing

Responsive UI

Hello thanks so much for your hardwork , it has made my django admin look more modern and 'jazzy'. Apart from that , i have been fiddling around with it and realize that certain portions of the template is not responsive , for example , the breadcrumb will overlap with the 'dashboard' title when changed to mobile mode and in the 'ipad' mode the actions menu seems cluttered. Is there a way to override these?

Test suite

  • start/finish test suite
  • choose a python version to start support from
  • choose a django version to start support from (Add to tox)

django.css rules too broad/generic

There are some CSS rules in django.css that are far too broad, and break the styling of any other 3rd party HTML

eg. Django debug toolbar :
Screenshot_2020-06-28 Site administration OrderMe Admin

We need to go through all of the CSS rules in that file, remove the useless ones, and explicitly target elements we have introduced with the others, no more input[type="checkbox"]

Add option to skip tabs for InlineModelAdmin

Hello !

I propose an enhancement that adds an option to jazzmin settings to skip creating the tabs for inline formsets.. and display them flat in the same page. An invoice is a typical use case for this.

Ideally this should be per each InlineModelAdmin , but as this can be tricky, let's start with a global On/Off option.

I'll submit a PR.

Enhancement: Template tag and base template to render custom forms in the admin

While we can add links in the sidebar, top-menu to custom forms in the admin, a lot of work needs to be done to match the overall look of jazzmin.

A base template for custom forms to derive form and a template tag for render any form in jazzmin style would be great -- something like django-bootstrap4.

Using django-bootstrap4 directly causes some problems as bootstrap gets included twice (when we extend from jazzmin base.html) and it does not take on any of the jazzmin ui customizations.

Want to contribute

Actaully I want to contribute in this project, but i didn't know how to start. Can you please help me to contribute in this project.

Lock down demo user/app more, avoid trolling

It seems someone had changed the password for the demo, stopping other people from logging in,

Make the reset command more belt and braces, and tighten up the admin user (dont use superuser)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.