Skip to content
Snippets Groups Projects
Commit 27ddd60a authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '364-add-possibility-to-upload-files-via-ckeditor' into 'master'

Resolve "Add possibility to upload files via CKEditor"

Closes #364

See merge request !470
parents 55a137d3 a035532f
No related branches found
No related tags found
1 merge request!470Resolve "Add possibility to upload files via CKEditor"
Pipeline #5639 passed
...@@ -312,3 +312,7 @@ rules.add_perm("core.delete_dashboardwidget", delete_dashboard_widget_predicate) ...@@ -312,3 +312,7 @@ rules.add_perm("core.delete_dashboardwidget", delete_dashboard_widget_predicate)
edit_default_dashboard_predicate = has_person & has_global_perm("core.edit_default_dashboard") edit_default_dashboard_predicate = has_person & has_global_perm("core.edit_default_dashboard")
rules.add_perm("core.edit_default_dashboard", edit_default_dashboard_predicate) rules.add_perm("core.edit_default_dashboard", edit_default_dashboard_predicate)
# Upload and browse files via CKEditor
upload_files_ckeditor_predicate = has_person & has_global_perm("core.upload_files_ckeditor")
rules.add_perm("core.upload_files_ckeditor", upload_files_ckeditor_predicate)
...@@ -113,6 +113,7 @@ INSTALLED_APPS = [ ...@@ -113,6 +113,7 @@ INSTALLED_APPS = [
"material", "material",
"pwa", "pwa",
"ckeditor", "ckeditor",
"ckeditor_uploader",
"django_js_reverse", "django_js_reverse",
"colorfield", "colorfield",
"django_bleach", "django_bleach",
...@@ -653,6 +654,9 @@ CKEDITOR_CONFIGS = { ...@@ -653,6 +654,9 @@ CKEDITOR_CONFIGS = {
} }
} }
# Upload path for CKEditor. Relative to MEDIA_ROOT.
CKEDITOR_UPLOAD_PATH = "ckeditor_uploads/"
# Which HTML tags are allowed # Which HTML tags are allowed
BLEACH_ALLOWED_TAGS = ["p", "b", "i", "u", "em", "strong", "a", "div"] BLEACH_ALLOWED_TAGS = ["p", "b", "i", "u", "em", "strong", "a", "div"]
......
...@@ -8,8 +8,10 @@ from django.views.i18n import JavaScriptCatalog ...@@ -8,8 +8,10 @@ from django.views.i18n import JavaScriptCatalog
import calendarweek.django import calendarweek.django
import debug_toolbar import debug_toolbar
from ckeditor_uploader import views as ckeditor_uploader_views
from django_js_reverse.views import urls_js from django_js_reverse.views import urls_js
from health_check.urls import urlpatterns as health_urls from health_check.urls import urlpatterns as health_urls
from rules.contrib.views import permission_required
from two_factor.urls import urlpatterns as tf_urls from two_factor.urls import urlpatterns as tf_urls
from . import views from . import views
...@@ -81,6 +83,16 @@ urlpatterns = [ ...@@ -81,6 +83,16 @@ urlpatterns = [
path("maintenance-mode/", include("maintenance_mode.urls")), path("maintenance-mode/", include("maintenance_mode.urls")),
path("impersonate/", include("impersonate.urls")), path("impersonate/", include("impersonate.urls")),
path("__i18n__/", include("django.conf.urls.i18n")), path("__i18n__/", include("django.conf.urls.i18n")),
path(
"ckeditor/upload/",
permission_required("core.ckeditor_upload_files")(ckeditor_uploader_views.upload),
name="ckeditor_upload",
),
path(
"ckeditor/browse/",
permission_required("core.ckeditor_upload_files")(ckeditor_uploader_views.browse),
name="ckeditor_browse",
),
path("select2/", include("django_select2.urls")), path("select2/", include("django_select2.urls")),
path("jsreverse.js", urls_js, name="js_reverse"), path("jsreverse.js", urls_js, name="js_reverse"),
path("calendarweek_i18n.js", calendarweek.django.i18n_js, name="calendarweek_i18n_js"), path("calendarweek_i18n.js", calendarweek.django.i18n_js, name="calendarweek_i18n_js"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment