Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyMCE cleanup - no selector is needed in settings #2261

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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