Skip to content

Commit

Permalink
Merge pull request #2261 from IFRCGo/feature/tinymce-cleanup
Browse files Browse the repository at this point in the history
TinyMCE cleanup - no selector is needed in settings
  • Loading branch information
szabozoltan69 authored Sep 12, 2024
2 parents 10282b5 + 54feb91 commit ca65199
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
6 changes: 1 addition & 5 deletions api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from lang.admin import TranslationAdmin, TranslationInlineModelAdmin
from notifications.models import RecordType, SubscriptionType

from .forms import ActionForm, DescriptionPlain, SocietyNameOverviewPlain, SummaryPlain
from .forms import ActionForm

# from reversion.models import Revision

Expand Down Expand Up @@ -183,12 +183,10 @@ class SituationReportInline(admin.TabularInline):

class EventFeaturedDocumentInline(admin.TabularInline):
model = models.EventFeaturedDocument
form = DescriptionPlain


class EventLinkInline(admin.TabularInline, TranslationInlineModelAdmin):
model = models.EventLink
form = DescriptionPlain


class EventAdmin(CompareVersionAdmin, RegionRestrictedAdmin, TranslationAdmin):
Expand Down Expand Up @@ -319,7 +317,6 @@ class FieldReportAdmin(CompareVersionAdmin, RegionRestrictedAdmin, TranslationAd
"countries",
"districts",
)
form = SummaryPlain

readonly_fields = ("report_date", "created_at", "updated_at")
list_filter = [MembershipFilter]
Expand Down Expand Up @@ -652,7 +649,6 @@ class CountryAdmin(geoadmin.OSMGeoAdmin, CompareVersionAdmin, RegionRestrictedAd
CountryICRCPresenceInline,
]
exclude = ("key_priorities",)
form = SocietyNameOverviewPlain


class RegionAdmin(geoadmin.OSMGeoAdmin, CompareVersionAdmin, RegionRestrictedAdmin, TranslationAdmin):
Expand Down
35 changes: 0 additions & 35 deletions api/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,3 @@ class ActionForm(forms.ModelForm):
class Meta:
model = Action
fields = "__all__"


class SocietyNameOverviewPlain(forms.ModelForm):
class Meta:
widgets = {
"society_name_en": forms.Textarea(attrs={"class": "plain-textarea"}),
"society_name_es": forms.Textarea(attrs={"class": "plain-textarea"}),
"society_name_fr": forms.Textarea(attrs={"class": "plain-textarea"}),
"society_name_ar": forms.Textarea(attrs={"class": "plain-textarea"}),
"overview_en": forms.Textarea(attrs={"class": "plain-textarea"}),
"overview_es": forms.Textarea(attrs={"class": "plain-textarea"}),
"overview_fr": forms.Textarea(attrs={"class": "plain-textarea"}),
"overview_ar": forms.Textarea(attrs={"class": "plain-textarea"}),
}


class SummaryPlain(forms.ModelForm):
class Meta:
widgets = {
"summary_en": forms.Textarea(attrs={"class": "plain-textarea"}),
"summary_es": forms.Textarea(attrs={"class": "plain-textarea"}),
"summary_fr": forms.Textarea(attrs={"class": "plain-textarea"}),
"summary_ar": forms.Textarea(attrs={"class": "plain-textarea"}),
}


class DescriptionPlain(forms.ModelForm):
class Meta:
widgets = {
"description": forms.Textarea(attrs={"class": "plain-textarea"}),
"description_en": forms.Textarea(attrs={"class": "plain-textarea"}),
"description_es": forms.Textarea(attrs={"class": "plain-textarea"}),
"description_fr": forms.Textarea(attrs={"class": "plain-textarea"}),
"description_ar": forms.Textarea(attrs={"class": "plain-textarea"}),
}
2 changes: 0 additions & 2 deletions main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@
},
]

# selector – exclude Geometry fields (bbox) and some plain textareas (see forms.py)
TINYMCE_DEFAULT_CONFIG = {
"selector": "textarea.vLargeTextField",
"entity_encoding": "raw",
"height": 360,
"width": 1120,
Expand Down

0 comments on commit ca65199

Please sign in to comment.