From aeb66ace4d9d885873a9322338ee3cdc171190b7 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Fri, 29 Sep 2017 20:07:18 -0400 Subject: [PATCH] Added CKEditor --- OACPL/settings.base.py | 3 +++ OACPL/urls.py | 3 ++- newsletters/models.py | 4 +++- requirements.txt | 3 ++- templates/admin/base_site.html | 6 ------ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/OACPL/settings.base.py b/OACPL/settings.base.py index f3c7581..f55462b 100644 --- a/OACPL/settings.base.py +++ b/OACPL/settings.base.py @@ -13,6 +13,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_URL = 'http://oacpl.zakscode.com' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -41,6 +42,8 @@ INSTALLED_APPS = [ 'bootstrap_admin', 'case_law', 'charter_members.apps.CharterMembersConfig', + 'ckeditor', + 'ckeditor_uploader', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/OACPL/urls.py b/OACPL/urls.py index 62d04ba..5880840 100644 --- a/OACPL/urls.py +++ b/OACPL/urls.py @@ -1,7 +1,7 @@ import os from django.conf import settings -from django.conf.urls import url +from django.conf.urls import url, include from django.contrib import admin from django.contrib.auth.decorators import login_required from django.shortcuts import Http404 @@ -27,6 +27,7 @@ urlpatterns = [ url(r'^admin/', admin.site.urls, name='admin'), url(r'^attorney/(?P\d+)', charter_members.views.index, name='attorney'), url(r'^caselaw/', case_law.views.browser, name='caselaw'), + url(r'^ckeditor/', include('ckeditor_uploader.urls')), url(r'^contact/', main.views.contact, name='contact'), url(r'^experts/(?P\d+)', expert_witnesses.views.viewer, name='expert'), url(r'^experts/', expert_witnesses.views.browser, name='experts'), diff --git a/newsletters/models.py b/newsletters/models.py index 5aedf67..459da81 100644 --- a/newsletters/models.py +++ b/newsletters/models.py @@ -2,9 +2,11 @@ from django.db import models from django.contrib.auth.admin import User from django.utils import timezone +from ckeditor_uploader.fields import RichTextUploadingField + class Newsletter(models.Model): - body = models.TextField() + body = RichTextUploadingField() created = models.DateTimeField(auto_now_add=True) creator = models.ForeignKey(User) publish = models.DateTimeField(default=timezone.now) diff --git a/requirements.txt b/requirements.txt index e43a349..4cdbc56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ bootstrap-admin==0.3.7.1 -Django==1.11.4 +Django==1.11.5 Pillow==4.2.1 requests==2.11.1 +django-ckeditor==5.3.0 diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html index 5b5cf34..4b7d579 100644 --- a/templates/admin/base_site.html +++ b/templates/admin/base_site.html @@ -14,12 +14,6 @@ #newslettersubscription-group input { transform: translate(-20px, 4px) } - - a[href="https://www.froala.com/wysiwyg-editor?k=u"] { - display: none !important; - position: absolute; - top: -99999999px; - } {% endblock %}