How to go about enabling side scrolling in Wagtail admin site - django

I have been tackling a particular design issue with Wagtail admin. Thus far I have not found a way to enable side scrolling admin listing pages. I want to extend my user model with more data about the users (e.g., occupation, education, address, and so on). While extending Wagtail with some models for a particular project, I noticed Wagtail admin listing pages do not automatically activate sides crolling as Django admin does.
I have looked at Wagtail hooks doccumentation but apparently there isn't a straightforward way to do that. I don't think it would be wise to mess with core css. Does anyone have an idea on how to customize css to enable that?
See pictures below:
This is how Django admin handles it. We can add filters while the table adjusts itself activating side scrolling.
Wagtail Bakery demo user model has few fields. So the listing admin page does not need to side scroll. I have not tested adding filters on this page yet, but I am assuming it will work just as it did to my other models.
This is how my admin page looks like when using filters. The table does not activate side scrolling and gets messed up when I use filters.
I'd appreciate any help poiting the way to best tackle this problem. Thus far I found this and this answers to similar, though not exaclty the same, problems with Wagtail admin design.

Related

Wagtail SteamFields for community user generated content instead of editor, author workflow

I really like StreamFields, but I don't want the baggage of Wagtail's Publishing system.
For example, consider a Forum community site. Instead of using CK Editor or BBCode, Markdown etc form input. I want to give users the option of StreamField based input to construct posts or replies
Is this possible? If yes, what steps would I need to take or edits to Wagtail do I need to do?
I'm guessing using a permission system while keeping the user as a limited admin would be the thing to do, since removing the user from admin doesn't seem to be possible since Wagtail is heavily reliant on Django Admin.
I'm guessing using a permission system while keeping the user as a
limited admin would be the thing to do, since removing the user from
admin doesn't seem to be possible since Wagtail is heavily reliant on
Django Admin.
If you want to reuse StreamFields, you probably want to use the Wagtail admin interface; doing otherwise is likely to be quite a bit of work. So users will need to be able to log in and have the wagtail_admin permission so they can access the admin interface. If you tried to use Page models for your forum, you are going to end up crossways of the way Wagtail's page permissions cascade. You could probably write your own admin views for regular users to add certain kinds of content.
But honestly, unless you have quite a bit of experience with Wagtail in its normal content management mode, I wouldn't suggest you try using it for this use case.

WYSIWYG form for users in Django CMS

Recently I started using Django CMS, it turns out to be a great tool for web developer. But one thing I couldn't have achieved so far is creating a form for users so they could submit some content created with WYSIWYG editor. I thought maybe there's some easy way to add editor available in admin panel (the one you use with creating / modifying Text plugins), doesn't seem like that unfortunately.
Long story short - I'd like to enbable users to use the same WYISWYG editor available from admin panel, without giving them permission to access admin panel. Is it possible? Or do I have to use some additional extension so I could embed similiar editor on my Page(s)?
Maybe you should look into divio/djangocms-text-ckeditor. It offers a HTMLFieldto be parts of models and a TextEditorWidgetto be parts of your app's forms.
So based on the comments I assume, when you say "users", you mean anonymous site visitors that are not registered to the CMS? And you want to display a WYSIWYG form field to them to "submit some content"?
If my assumptions are correct, you just need to create an own plugin or maybe an app.
See http://docs.django-cms.org/en/release-3.4.x/how_to/custom_plugins.html

Should I use a blog app in Django?

I want to create my own admin panel and every users will can have their own blogs. I'm using a blog app called 'Zinnia', I liked it. Zinnia have some visual editors (WYMEditor, Tinymce) also have a tag system, etc. that I want to have in my admin panel.
I was wondering if should I create my own admin panel or blog app and integrate the visual editor programatically. What would be better?
Thanks for answers.
EDIT: My real question is: What's better?
create my admin and my blog app
create my admin integrating Zinnia or another blog app
use the django admin panel (but i want to customize the fully admin panel, so I guess that is not a good option)
Remembering, the users (not only admins) can post to their blogs. (this is the reason that I don't want to use the Django admin)
EDIT 2:
Exactly what I want: I want to use all the features (such as tagging, WYMEditor [I know i can implement this programmaticaly], etc.) of Zinnia (or another blog app) with my custom admin panel, with my buttons, my layout, my css, my everything!
Thanks for all answers, it's important for me.
Here is a simple tutorial for creating a django blog app:
http://lightbird.net/dbe/blog.html
If you are still learning django, I recommend it to create your own blog!!!
Creating a good Django blog application is straightforward, but tedious work, that can quite easily get unwieldy if you start implementing additional features such as multiple language support, linkback handling, search, sitemap generation, etc.
I definitely wouldn't suggest that you start from scratch. If your not completely satisfied by the full extent of possibilities or the initial feature set of Zinnia, you can check out all the Django blog applications on Django Packages.

Custom Django admin panel

I want to use Django for a web application I'm building that will have an admin panel. I know that you need to just activate the admin app and you're ready to go. However, I would like to have a custom panel, I mean, I want to design the layout myself, I want to add menus and forms for the admin to insert new data in the database etc. Is it possible? or I should write a similar application that will have such features?
For more control over the layout (custom menus etc.) you should check django-admin-tools.
And if you take a look at Django's docs you'll learn that you can easily tweak and override most parts of the admin. For example here is a demonstration on how to use a custom form:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom-validation-to-the-admin
So the admin is pretty customizable. But the question if you should build your own app or reuse the admin depends pretty much on your specific needs. At least make sure you know in which directions the admin can be easily bend.
The sole purpose for Django's admin is to allow you to manipulate (add/edit/remove) data in your database. I think you should at least try to check what the admin is capable of before trying to reinvent the wheel. You'll soon discover the level of complex insight the admin allows you to have. Then you'll discover that making it yourself is unnecessary excess of work and you'll end up with modifying a couple of admin-templates and CSS styles.
Yes, you can customize Django Admin Panel, Django provides some sort of customization for showing database tables structure from their own, for that you can follow DJANGO ADMIN SITE DOC , it will really help you.
For the customizations beyond the Django admin site settings, you can customize admin panel add manual layout, by adding manual detailing in Django template files which are stored in Django environment, django/django/contrib/admin/templates/admin/index.html of your current Django version. You can update its HTML, CSS, and JS according to need.

duplicate admin inline in django

I have django powered admin site, using grappelli. At one point we use a lot of admin inlines which sometimes have almost identical content to them. So it would be really useful to have some sort of duplicate button next to each inline element. Pushing it would just add the same content without the ID.
Is something like that possible. I know I could write custom admin action but those are not supported for inlines?
thanks