-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve admin UI and add extensible stylesheet #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_index_view_extra_css(self): | ||
css = ['treemodeladmin/css/index.css'] | ||
css.extend(self.index_view_extra_css) | ||
return css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one oddity: when I checked source, index.css is getting imported twice.
Adds a custom index.css stylesheet that brings treemodeladmin in line with Wagtail's admin UI styles. Also lets the user add their own stylesheets when extending TreeModelAdmin.
The index.html template already inherits the same basic block from modeladmin/index.html. https://github.com/wagtail/wagtail/blob/master/wagtail/contrib/modeladmin/templates/modeladmin/index.html#L6-L9 This will fix the index.css file being included twice.
5df9d8a
to
33e8f5a
Compare
Nice catch on the fix 🎉 |
Adds a custom index.css stylesheet that brings treemodeladmin in line with Wagtail's admin UI styles. Also lets the user add their own stylesheets when extending TreeModelAdmin.
@willbarton @higs4281 LMK how you feel about this approach. It's influenced by what modeladmin did before it was merged into wagtail core.
I only added a couple CSS rules to fix the buttons in the header. The arrows' spacing looks fine on my screen but I may be looking at the wrong thing. Let's chat what other fixes need to be made in post-scrum.
Additions
forms.Media
.Testing
Edit
button in the header should look like a normal edit button.Screenshots
Checklist