farridav / django-jazzmin Goto Github PK
View Code? Open in Web Editor NEWJazzy theme for Django
Home Page: https://django-jazzmin.readthedocs.io
License: MIT License
Jazzy theme for Django
Home Page: https://django-jazzmin.readthedocs.io
License: MIT License
This is because we have a url reversal to auth_user
..
It does look a bit dull at the moment:
We could use something like bootstrap duallistbox for this one, which can be found here:
https://adminlte.io/themes/v3/pages/forms/advanced.html
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.
https://ibb.co/26yQP9M
The installed app not loaded django 3.1
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.
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 )
The history page right now is functional, we could jazz it up, add icons for the types of actions, make it real jazzy yo
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.
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.
Allow use of themes, configurable by settings, See Right hand side user menu on https://adminlte.io/themes/v3/index3.html for theming possiblities
carousel
collapsible
horizontal_tabs
vertical_tabs
does not work properly when settings.LANGUAGE_CODE
is set to Chinese, Japanese and other non-Latin alphabet languages. slugify
filter does not support unicode.
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.
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
.
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 ..
the selects within the detail view should also be using select2 (like with the list filters)
It'd be just grand if we allow people to easily add detail level admin actions e.g "Save and Send"
Usually this is done by overriding the tools template, but I'm sure we can make this easier, and jazzier
The select2 js and css can't be loaded. I've posted a PR for this. #119
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.
Specifying filter_vertical seems to break the UI. Please see the screenshot.
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;
}
This project is awesome but still missing some of the configurations features. like fixed navbar and fixed sidebar as will as fixed footer. Sticky section for action button somethings like this.
Sticky Section for event in calendar page
Hi, guys!
Congratulations for the project!
I have one question: how do i install the Admin Docs?
investigate if this is worth doing
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
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 work because the submit button is not inside the encapsulating <form>
We need to move the submit button inside the form somehow..
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 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
.
TabularInline
does not display the "add another {model}" link even if it has add permission.
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
The admin docs site is currently a mess, it needs love
https://docs.djangoproject.com/en/3.0/ref/contrib/admin/admindocs/,
See http://localhost:8000/admin/doc/
Also, ensure the link is present in menus if the app is installed..
When a detail view has fieldsets, and there's a field level error, the page reloads and doesn't show the user where the error is.
It should display the tab with the field that has the error
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?
There are some CSS rules in django.css that are far too broad, and break the styling of any other 3rd party HTML
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"]
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.
Make configurables in theme as per options in user menu (See far right user menu here https://adminlte.io/themes/v3/index3.html)
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.
How to stop this behaviour? please let me know. I am stuck in my Project
Allow for top menu, implementation as in https://adminlte.io/themes/v3/pages/layout/top-nav.html
Control via settings
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.
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)
Allow for custom links in user menu, possibly redesign, see Social Widgets in https://adminlte.io/themes/v3/pages/widgets.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.