django-summernote
django-summernote copied to clipboard
Wrong attributes in widget_iframe.html template
When using django-summernote to get rich text editor in admin interface, the editor does not follow size settings.
In my app admin.py ` from .models import MyModel from django_summernote.admin import SummernoteModelAdmin
class MyModelAdmin(SummernoteModelAdmin): summernote_fields = ('text',) `
In my app settings.py
SUMMERNOTE_CONFIG = { ... 'summernote': { ... # Change editor size 'width': '100%', 'height': '480', ... } ... }
This will use summernote in admin interface for MyModel.text, but it will not be 480px high and full available space wide. I suspect that the reason is use of width and height attributes for summernote-div div.
in django-summernote/templates/widget-iframe.html `
If I change it to style: `
The problem is that width set in config will apply also to the internal editor in the generated html for the iframe. If I want that to be e.g. 50% width left in the parent
My question is, is this a good way how to fix that? Or is there any better? I am rather new to css.
Another issue is that widget_iframe.html does not apply css files from config like widget_iframe_editor.html does. Is that intentional? The original issue could have been solved also by changing style of summernote-div elements in custom css, but if they are not applied, it will not work.