Giter Site home page Giter Site logo

django-suit-redactor's People

Contributors

darklow avatar saulshanabrook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-suit-redactor's Issues

Licensing situation not clear

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?

Reactor in new inline row required fail

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:

  • adding new inline in admin
  • fill 'description' into reactor widget
  • click save

Expected:
Save without any problems

Actual:
Getting error that 'description' is empty

  • looking at HTTP POST - the text value for description field is empty too.

Work Around:

  1. after first save you can fill in description and save without problems
  2. remove widget

Adding new inline rendering failed

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.

editor_options and formatting

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?

Redactor i18n

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?

SortableTabularInline conflict

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)

Failed initialisation if other app provides jquery after redactor.min.js is included

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.

Django-CMS plugin inline

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.

Image editing problem

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.