Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
campaign
Commits
08b1a533
Commit
08b1a533
authored
Jun 13, 2017
by
Okhin
Browse files
Let's use CKEditor
parent
3dd67924
Pipeline
#1133
failed with stage
in 41 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
picampaign/campaign/migrations/0009_auto_20170613_1842.py
0 → 100644
View file @
08b1a533
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 16:42
from
__future__
import
unicode_literals
import
ckeditor.fields
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'campaign'
,
'0008_auto_20170213_1232'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'argumentary'
,
name
=
'title'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'title'
),
),
migrations
.
AlterField
(
model_name
=
'argumentary'
,
name
=
'title_de'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'title'
),
),
migrations
.
AlterField
(
model_name
=
'argumentary'
,
name
=
'title_en'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'title'
),
),
migrations
.
AlterField
(
model_name
=
'argumentary'
,
name
=
'title_fr'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'title'
),
),
migrations
.
AlterField
(
model_name
=
'campaign'
,
name
=
'description'
,
field
=
ckeditor
.
fields
.
RichTextField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'campaign'
,
name
=
'description_de'
,
field
=
ckeditor
.
fields
.
RichTextField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'campaign'
,
name
=
'description_en'
,
field
=
ckeditor
.
fields
.
RichTextField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'campaign'
,
name
=
'description_fr'
,
field
=
ckeditor
.
fields
.
RichTextField
(
null
=
True
),
),
]
picampaign/campaign/models.py
View file @
08b1a533
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.conf
import
settings
from
ckeditor.fields
import
RichTextField
from
picampaign.organization.models
import
Organization
from
picampaign.contact.models
import
Contact
...
...
@@ -10,7 +11,7 @@ class Campaign(models.Model):
"""Campaign model, describe what have to be achieved"""
id
=
models
.
AutoField
(
primary_key
=
True
)
title
=
models
.
CharField
(
max_length
=
255
)
description
=
models
.
TextField
(
null
=
True
)
description
=
Rich
TextField
(
null
=
True
)
organization
=
models
.
ForeignKey
(
Organization
,
related_name
=
'campaigns'
)
start_date
=
models
.
DateField
()
end_date
=
models
.
DateField
()
...
...
@@ -23,7 +24,7 @@ class Argumentary(models.Model):
"""Argumentary for a campaign"""
id
=
models
.
AutoField
(
primary_key
=
True
)
campaign
=
models
.
ForeignKey
(
Campaign
)
title
=
models
.
Char
Field
(
max_length
=
255
,
verbose_name
=
_
(
'title'
),
null
=
True
,
blank
=
True
)
title
=
RichText
Field
(
max_length
=
255
,
verbose_name
=
_
(
'title'
),
null
=
True
,
blank
=
True
)
text
=
models
.
TextField
(
null
=
True
)
def
__str__
(
self
):
...
...
picampaign/organization/migrations/0006_auto_20170613_1807.py
0 → 100644
View file @
08b1a533
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 16:07
from
__future__
import
unicode_literals
import
ckeditor.fields
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'organization'
,
'0005_organization_website'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'organization'
,
name
=
'description'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
),
),
migrations
.
AlterField
(
model_name
=
'organization'
,
name
=
'description_de'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'organization'
,
name
=
'description_en'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'organization'
,
name
=
'description_fr'
,
field
=
ckeditor
.
fields
.
RichTextField
(
blank
=
True
,
null
=
True
),
),
]
picampaign/organization/models.py
View file @
08b1a533
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
ckeditor.fields
import
RichTextField
from
picampaign.contact.models
import
Contact
...
...
@@ -9,7 +11,7 @@ class Organization(models.Model):
sip_key
=
models
.
CharField
(
max_length
=
255
)
users
=
models
.
ManyToManyField
(
User
,
blank
=
True
,
related_name
=
'organizations'
)
description
=
models
.
TextField
(
blank
=
True
)
description
=
Rich
TextField
(
blank
=
True
)
logo
=
models
.
ImageField
(
upload_to
=
'organization/logos/'
,
blank
=
True
)
website
=
models
.
URLField
(
blank
=
True
)
...
...
picampaign/settings.py.sample
View file @
08b1a533
...
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
'rest_framework',
'modeltranslation',
'ckeditor',
'picampaign.contact',
'picampaign.campaign',
'picampaign.organization',
...
...
@@ -119,3 +120,16 @@ TEMPLATES = [
}
},
]
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'Custom',
'toolbar_Custom': [
['Bold', 'Italic', 'Underline'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink'],
['RemoveFormat', 'Source']
]
'allowed_content': 'a em strong ul li br du dl dt h3 h4 h5',
}
}
setup.py
View file @
08b1a533
...
...
@@ -13,11 +13,13 @@ requires = [
'django-modeltranslation'
,
'requests'
,
'pillow'
,
'django-ckeditor'
,
'django-wysiwyg'
,
]
setup
(
name
=
'picampaign'
,
namespace_packages
=
[
'picampaign'
],
version
=
'0.1.
0
'
,
version
=
'0.1.
1
'
,
description
=
'PiPhone Campaign Manager.'
,
long_description
=
README
,
classifiers
=
[
"Programming Language :: Python"
],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment