mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Replace ckeditor with tinymce (#30)
* Replace ckeditor with tinymce due to deprecation * Remove any ckeditor dependency from old migrations Disable alters, replace create with plain models.TextField * Reformat files * Add more hardening in image_upload
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# Generated by Django 4.1 on 2022-08-23 15:54
|
||||
|
||||
import ckeditor.fields
|
||||
import ckeditor_uploader.fields
|
||||
# ckeditor dependency removal
|
||||
# import ckeditor.fields
|
||||
# import ckeditor_uploader.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -12,24 +13,24 @@ class Migration(migrations.Migration):
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="flatpage",
|
||||
name="content",
|
||||
field=ckeditor_uploader.fields.RichTextUploadingField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="about",
|
||||
field=ckeditor.fields.RichTextField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="footer",
|
||||
field=ckeditor.fields.RichTextField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="footer_extended",
|
||||
field=ckeditor.fields.RichTextField(blank=True),
|
||||
),
|
||||
# migrations.AlterField(
|
||||
# model_name="flatpage",
|
||||
# name="content",
|
||||
# field=ckeditor_uploader.fields.RichTextUploadingField(),
|
||||
# ),
|
||||
# migrations.AlterField(
|
||||
# model_name="siteconfiguration",
|
||||
# name="about",
|
||||
# field=ckeditor.fields.RichTextField(blank=True),
|
||||
# ),
|
||||
# migrations.AlterField(
|
||||
# model_name="siteconfiguration",
|
||||
# name="footer",
|
||||
# field=ckeditor.fields.RichTextField(blank=True),
|
||||
# ),
|
||||
# migrations.AlterField(
|
||||
# model_name="siteconfiguration",
|
||||
# name="footer_extended",
|
||||
# field=ckeditor.fields.RichTextField(blank=True),
|
||||
# ),
|
||||
]
|
||||
|
@@ -0,0 +1,34 @@
|
||||
# Generated by Django 5.0.2 on 2024-02-17 12:19
|
||||
|
||||
import tinymce.models
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("portal", "0016_remove_siteconfiguration_site_name"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="flatpage",
|
||||
name="content",
|
||||
field=tinymce.models.HTMLField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="about",
|
||||
field=tinymce.models.HTMLField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="footer",
|
||||
field=tinymce.models.HTMLField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="siteconfiguration",
|
||||
name="footer_extended",
|
||||
field=tinymce.models.HTMLField(blank=True),
|
||||
),
|
||||
]
|
@@ -6,8 +6,7 @@ from django.dispatch.dispatcher import receiver
|
||||
from django.utils.safestring import mark_safe
|
||||
from solo.models import SingletonModel
|
||||
|
||||
from ckeditor.fields import RichTextField
|
||||
from ckeditor_uploader.fields import RichTextUploadingField
|
||||
from tinymce import models as tinymce
|
||||
|
||||
from ram import __version__ as app_version
|
||||
from ram.utils import slugify
|
||||
@@ -15,7 +14,7 @@ from ram.utils import slugify
|
||||
|
||||
class SiteConfiguration(SingletonModel):
|
||||
site_author = models.CharField(max_length=256, blank=True)
|
||||
about = RichTextField(blank=True)
|
||||
about = tinymce.HTMLField(blank=True)
|
||||
items_per_page = models.CharField(
|
||||
max_length=2,
|
||||
choices=[(str(x * 3), str(x * 3)) for x in range(2, 11)],
|
||||
@@ -30,8 +29,8 @@ class SiteConfiguration(SingletonModel):
|
||||
],
|
||||
default="type",
|
||||
)
|
||||
footer = RichTextField(blank=True)
|
||||
footer_extended = RichTextField(blank=True)
|
||||
footer = tinymce.HTMLField(blank=True)
|
||||
footer_extended = tinymce.HTMLField(blank=True)
|
||||
show_version = models.BooleanField(default=True)
|
||||
use_cdn = models.BooleanField(default=True)
|
||||
extra_head = models.TextField(blank=True)
|
||||
@@ -56,7 +55,7 @@ class Flatpage(models.Model):
|
||||
name = models.CharField(max_length=256, unique=True)
|
||||
path = models.CharField(max_length=256, unique=True)
|
||||
published = models.BooleanField(default=False)
|
||||
content = RichTextUploadingField()
|
||||
content = tinymce.HTMLField()
|
||||
creation_time = models.DateTimeField(auto_now_add=True)
|
||||
updated_time = models.DateTimeField(auto_now=True)
|
||||
|
||||
|
Reference in New Issue
Block a user