google-code-export / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
0 stars 0 forks source link

TinyMCE inline incompatibility #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a model with a inline model, add tinymce to the class Media
from django.db.models import *
from django.contrib.admin import *

class MainModel(Model):
    pass
class InlineModel(Model):
    main = ForeignKey(MainModel)
    text = TextField()

class InlineModel_Inline(StackedInline):
    model = InlineModel

class MainModelOptions(ModelAdmin)
    inlines = (InlineModel_Inline, )
    class Media:
        js = (
            '/media/admin/tinymce_2/jscripts/tiny_mce/tiny_mce.js',
            '/media/admin/tinymce_setup/tinymce_setup.js',
        )

site.register(MainModel, MainModelOptions)

2. Go to the Admin, add a MainModel object
Go to the inline section, the text field is a rich text editor
Click the + to add a new inline.
The new inline seems to be a rich text editor field, but doesn't work

What is the expected output? What do you see instead?
The newly added inline textfields should be some sorking rich text editors.

What version of the product are you using? On what operating system?
Svn trunk revision 91

I've attched a little patch for Inline.js to corect this bug

Original issue reported on code.google.com by p...@puyb.net on 21 Feb 2009 at 3:00

Attachments:

GoogleCodeExporter commented 9 years ago
Oups, i forgot to remove a debug statement (made a mistake for the file 
extension .js
-> .diff)...

New patch attached

Original comment by p...@puyb.net on 21 Feb 2009 at 3:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 1 Mar 2009 at 12:53

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 1 Mar 2009 at 12:53

GoogleCodeExporter commented 9 years ago
thanks. it´s fixed.

Original comment by sehmaschine on 13 Mar 2009 at 12:45

GoogleCodeExporter commented 9 years ago
It was fixed, but my code was droped at r230. PLease reopen this issue.

Inline.js:54 @ r230 :
/// tinymce: does not make sense with tabular inlines

Maybe, to you... But I use stacked inlines !

Why do you remove the fix (I hope this is a mistake or because you doesn't have 
time
to deal with it) ? 
Do you wan't me to make another patch ?

Original comment by p...@puyb.net on 13 Apr 2009 at 12:23

GoogleCodeExporter commented 9 years ago
hmm. with stacked inlines, it works for me. since we´ve changed the way 
addhandler
works, the previous patch has become obsolete.

I´ll take another look at the issue ...

Original comment by sehmaschine on 13 Apr 2009 at 12:27

GoogleCodeExporter commented 9 years ago
you were right ... sorry for this (probably annoying) mistake. and thanks for 
the
feedback.

Original comment by sehmaschine on 14 Apr 2009 at 8:35

GoogleCodeExporter commented 9 years ago
Thanks for your work.

I'll test this tonight.

Original comment by p...@puyb.net on 14 Apr 2009 at 8:51

GoogleCodeExporter commented 9 years ago
I'm having trouble with this now - running newest version of grappelli vs trunk 
of django.

I don't get the rich text editor in my inline TextField.

Code:

class ChartInline(admin.StackedInline):
    model = Chart
    extra = 1
    max_num = 10
    classes = ('collapse-open',)
    allow_add = True

class SizeChartAdmin(admin.ModelAdmin):
    list_display = ('name',)
    search_fields = ('name', )
    inlines = (ChartInline,)

    class Media:
        js = ['/media/admin/tinymce/jscripts/tiny_mce/tiny_mce.js', '/media/tinymce_setup.js',]

admin.site.register(SizeChart, SizeChartAdmin)

Original comment by joshuaka...@gmail.com on 14 Nov 2009 at 1:49

GoogleCodeExporter commented 9 years ago
@joshuakrajala: please don´t hijack other threads here. this one is about a 
totally
different topic.

Original comment by sehmaschine on 14 Nov 2009 at 6:43

GoogleCodeExporter commented 9 years ago
I'm sorry I don't mean to hijack - but how is my issue different. I can't get 
tinymce to work with my inlines

Original comment by joshuaka...@gmail.com on 14 Nov 2009 at 8:38

GoogleCodeExporter commented 9 years ago
this issue is about ADDING rich-text-fields with edit-inlines, not about using
tinymce in general (with or without inlines). your issue is probably related to 
your
setup. if tinymce works for you within fieldsets, it should also work within 
inlines.
you may want to open a new ticket with additional information (just by adding 
your
setup-information I won´t be able to help - you need to add some debug-info).

Original comment by sehmaschine on 14 Nov 2009 at 8:43