darklow / django-suit-redactor Goto Github PK
View Code? Open in Web Editor NEWImperavi Readactor (WYSIWYG editor) integration app for Django admin
Imperavi Readactor (WYSIWYG editor) integration app for Django admin
There doesn't seem to be a free as in free beer license for redactor 9.X.
Do you have an OEM license for redactor? Or is redactor 8.X CC-licensed?
Django 1.6.2
django-suit 0.2.4-0.2.9
django-suit-reactor 0.2
Scenario:
2 Models - parent and FK with SortableStackedInline in admin and reactor widget over field
class PageInline(SortableTabularInline):
model = Page
extra = 0
fields = ('name','description','order')
sortable = 'order'
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'description':
kwargs['widget'] = RedactorWidget(editor_options={'lang': 'en'})
return super(PageInline,self).formfield_for_dbfield(db_field,**kwargs)
How to recreate:
Expected:
Save without any problems
Actual:
Getting error that 'description' is empty
Work Around:
Hello,
Django==1.8.19
django-suit==0.2.12
django-suit-redactor==0.0.4
When the rendering is done, this function is done:
def render(self, name, value, attrs=None):
output = super(RedactorWidget, self).render(name, value, attrs)
output += mark_safe(
'<script type="text/javascript">$("#id_%s").redactor(%s);</script>'
% (name, json.dumps(self.editor_options)))
return output
When adding a new admin inline row, the name contains __prefix__
and the rendering does not work correctly because of that.
Hello,
I'm trying to add h5 and h6 formatting options, but it doesn't affect the editor.
# ModelForm
class Meta:
model: Something
widgets = {
'content': RedactorWidget(editor_options={
'lang': 'en',
'iframe': True,
'formatting': ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']})
}
Does django_suit_redactor support formatting in editor options?
How do I add a new plugin?
http://imperavi.com/redactor/examples/buttons-sup-and-sub/
Is anyone working on update to Redactor 10.0?
I was taking a look to the redactor site on how to translate their plugin to another language, but i noticed it does not work with this package implementation.
Do you know how can i integrate translations?
When you use a RedactorWidget in a SortableTabularInline and the SortableTabularInline items get re-ordered, the item that gets reordered no longer displays the content of the RedactorWidget (but appears to allow you to change it).
class QuestionForm(ModelForm):
model = Question
class Meta:
widgets = {
'html': RedactorWidget(editor_options={'lang': 'en'})
}
class QuestionInline(SortableTabularInline):
model = Question
form = QuestionForm
sortable = 'order'
class TestForm(ModelForm):
model = Test
class TestAdmin(ModelAdmin):
form = TestForm
inlines = (QuestionInline,)
admin.site.register(Test, TestAdmin)
suit-redactor gives error in Django 2.1+ :
render() got an unsuspected keyword argument renderer'
In some cases, when you use an app thet provides an own version of jquery, the redactor widget fails to initialize.
The line
$('#textarea').redactor(...)
Throws an exception: Uncaught TypeError: undefined is not a function
You could solve this by ovveriding the change_form.html
admin template:
{% extends "admin/change_form.html" %}
{% block extrahead %}{{ block.super }}
<!-- append redactor js to the end of the head segment -->
<script type="text/javascript" src="/static/suit-redactor/redactor/redactor.min.js"></script>
{% endblock %}
The caveat of that is that the js is included in the template twice (and possibly interpreted twice), but it makes things work again.
Or if there is the possibility to tell other apps to abstain from adding its own jquery, you could do that. In my specific example, this is the case for https://github.com/asyncee/django-easy-select2. There you can set the option
SELECT2_USE_BUNDLED_JQUERY = False
The issue is caused because django-admins jquery is loaded before redactor.min.js and the other apps jquery after redactor.min.js, wich overrides that binding.
This is not really a bug, but worth a mention in the docs.
When using the Editor within a Django CMS Plugin - Tabular Inline, it is almost unuseable.
The Editor is squashed into a very small area if more than one field is specified.
When clicked on uploaded image to edit, its continue resizing even if mouse button released.
When its debugged on Chrome, its giving: Uncaught RangeError: Maximum call stack size exceeded jquery-1.8.3.min.js:2
django-wysiwyg-redactor==0.4.9
django-suit-redactor==0.0.4
django-suit==0.2.21
Django==1.9.8
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.