added ckeditor to manage campaign forms to provide rich text editing and image uploads [#32447975]
parent
e7d2589b77
commit
e8bd5ab2dc
|
@ -5,6 +5,7 @@ from regluit.utils import crypto
|
|||
from datetime import timedelta
|
||||
from decimal import Decimal
|
||||
from notification import models as notification
|
||||
from ckeditor.fields import RichTextField
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import Q, get_model
|
||||
|
@ -177,8 +178,8 @@ class Campaign(models.Model):
|
|||
LICENSE_CHOICES = CCLicense.CCCHOICES
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
name = models.CharField(max_length=500, null=True, blank=False)
|
||||
description = models.TextField(null=True, blank=False)
|
||||
details = models.TextField(null=True, blank=True)
|
||||
description = RichTextField(null=True, blank=False)
|
||||
details = RichTextField(null=True, blank=True)
|
||||
target = models.DecimalField(max_digits=14, decimal_places=2, null=True, blank=False)
|
||||
license = models.CharField(max_length=255, choices = LICENSE_CHOICES, default='CC BY-NC-ND')
|
||||
left = models.DecimalField(max_digits=14, decimal_places=2, null=True, blank=False)
|
||||
|
|
|
@ -221,8 +221,6 @@ def getManageCampaignForm ( instance, data=None, *args, **kwargs ):
|
|||
model = Campaign
|
||||
fields = 'description', 'details', 'license', 'target', 'deadline', 'paypal_receiver', 'edition'
|
||||
widgets = {
|
||||
'description': forms.Textarea(attrs={'cols': 80, 'rows': 20}),
|
||||
'details': forms.Textarea(attrs={'cols': 80, 'rows': 5}),
|
||||
'deadline': SelectDateWidget,
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ Please fix the following before launching your campaign:
|
|||
<div class="tabs-1">
|
||||
<form action="#" method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form.media }}
|
||||
<h3>Select the edition</h3>
|
||||
<p> Please choose the edition that most closely matches the edition to be unglued:</p>
|
||||
|
||||
|
|
|
@ -27,3 +27,4 @@ pyasn1
|
|||
pycrypto
|
||||
django-maintenancemode
|
||||
django-smtp-ssl
|
||||
django-ckeditor
|
||||
|
|
|
@ -28,6 +28,14 @@ MEDIA_ROOT = ''
|
|||
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
||||
MEDIA_URL = ''
|
||||
|
||||
CKEDITOR_UPLOAD_PATH = ''
|
||||
CKEDITOR_RESTRICT_BY_USER = True
|
||||
CKEDITOR_CONFIGS = {
|
||||
'default': {
|
||||
'width': 700,
|
||||
},
|
||||
}
|
||||
|
||||
# Absolute path to the directory static files should be collected to.
|
||||
# Don't put anything in this directory yourself; store your static files
|
||||
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
||||
|
@ -125,7 +133,7 @@ INSTALLED_APPS = (
|
|||
'regluit.frontend.templatetags',
|
||||
'regluit.payment.templatetags',
|
||||
'notification',
|
||||
|
||||
'ckeditor',
|
||||
# this must appear *after* django.frontend or else it overrides the
|
||||
# registration templates in frontend/templates/registration
|
||||
'django.contrib.admin',
|
||||
|
|
|
@ -129,6 +129,7 @@ LOGGING = {
|
|||
}
|
||||
|
||||
STATIC_ROOT = '/var/www/static'
|
||||
CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
|
||||
|
||||
IS_PREVIEW = False
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ LOGGING = {
|
|||
}
|
||||
|
||||
STATIC_ROOT = '/var/www/static'
|
||||
CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
|
||||
|
||||
IS_PREVIEW = False
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ LOGGING = {
|
|||
}
|
||||
|
||||
STATIC_ROOT = '/var/www/static'
|
||||
CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
|
||||
|
||||
# decide which of the period tasks to add to the schedule
|
||||
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
|
||||
|
|
Loading…
Reference in New Issue