clean up; add todos; update changelog and credits

This commit is contained in:
Artur Barseghyan 2017-12-15 23:08:44 +01:00
parent 475fcf7ddb
commit f754f635f7
14 changed files with 41 additions and 2102 deletions

View file

@ -15,6 +15,13 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.
0.12.7
------
2017-12-dd
- Minor fixes (in the add form element entry bootstrap3 template).
- Add content rich text plugin (based on CKEditor).
0.12.6
------
2017-12-12

View file

@ -41,4 +41,6 @@ Thanks to the following people for their contributions:
for number of bug reports and minor Python3 fixes.
- `Frantisek Holop
<https://github.com/barseghyanartur/django-fobi/commits?author=minusf>`_
for (minor, still very accurate) fixes/clean-up in documentation/code.
for (minor, still very accurate) fixes/clean-up in documentation/code and
his contributions the content rich-text plugin (some if which he did
working for RIPE NCC).

View file

@ -69,6 +69,15 @@ Regarding the Django REST framework integration
+ Fix representation of the content_text plugin, as now "No image provided"
text is rendered instead of an text.
Regarding the new content rich text plugin
------------------------------------------
.. code-block:: text
- Add correspondent Django REST Framework integration plugin for
the new ``content_richtext`` plugin.
- Add new widget for ``content_richtext`` plugin for Foundation5, Simple
and DjangoCMS themes.
Regarding Heroku demo
---------------------
.. code-block:: text

View file

@ -479,7 +479,7 @@ CKEDITOR_CONFIGS = {
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent',
'HorizontalRule', '-', 'JustifyLeft', 'JustifyCenter',
'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink'],
['Link', 'Unlink', 'Image'],
['Table',],
['RemoveFormat'],
],

View file

@ -4,7 +4,7 @@ import sys
from distutils.version import LooseVersion
from setuptools import setup, find_packages
version = '0.12.6'
version = '0.12.7'
# ***************************************************************************
# ************************** Python version *********************************

View file

@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.12.6'
__build__ = 0x00008f
__version__ = '0.12.7'
__build__ = 0x000090
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'

View file

@ -2,38 +2,29 @@ fobi.contrib.plugins.form_elements.content.content_richtext
-----------------------------------------------------------
A ``Fobi`` Rich text form element plugin based on
`Summernote <https://summernote.org/>`_.
`CKEditor <https://ckeditor.com/>`_ and
`django-ckeditor <https://github.com/django-ckeditor/django-ckeditor>`_.
Installation
~~~~~~~~~~~~
(1) Install ``django-summernote``.
(1) Install ``django-ckeditor``.
.. code-block:: sh
pip install django-summernote
pip install django-ckeditor
(2) Add ``django_summernote`` to ``INSTALLED_APPS`` in ``settings.py``.
(2) Add ``ckeditor`` to ``INSTALLED_APPS`` in ``settings.py``.
.. code-block:: python
INSTALLED_APPS = (
...
'django_summernote',
'ckeditor',
...
)
(3) Add ``django_summernote.urls`` to ``urls.py``.
.. code-block:: python
urlpatterns = [
...
url(r'^summernote/', include('django_summernote.urls')),
...
]
(4) Add ``fobi.contrib.plugins.form_elements.content.content_richtext`` to
(3) Add ``fobi.contrib.plugins.form_elements.content.content_richtext`` to
``INSTALLED_APPS`` in ``settings.py``.
.. code-block:: python
@ -44,6 +35,17 @@ Installation
...
)
(4) Add ``fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget`` to
``INSTALLED_APPS`` in ``settings.py`` (if you're using ``bootstrap3`` theme).
.. code-block:: python
INSTALLED_APPS = (
...
'fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget',
...
)
(5) In the terminal type:
.. code-block:: sh
@ -88,6 +90,3 @@ Controlling HTML tags and attributes
'abbr': ['title'],
'acronym': ['title'],
}
For frontend-only control one could alternatively use
a ``summernote`` plugin like ``summernote-cleaner``.

View file

@ -20,12 +20,7 @@ class ContentRichTextPluginWidget(BaseContentRichTextPluginWidget):
media_js = [
'ckeditor/ckeditor-init.js',
'ckeditor/ckeditor/ckeditor.js',
# 'bootstrap3/js/fobi.plugin.slider-bootstrap3-widget.js',
]
# media_css = [
# 'bootstrap3/css/bootstrap-slider.min.css',
# 'bootstrap3/css/fobi.plugin.slider-bootstrap3-widget.css',
# ]
# Registering the widget

View file

@ -1,264 +0,0 @@
/*! =======================================================
VERSION 9.2.2
========================================================= */
/*! =========================================================
* bootstrap-slider.js
*
* Maintainers:
* Kyle Kemp
* - Twitter: @seiyria
* - Github: seiyria
* Rohit Kalkur
* - Twitter: @Rovolutionary
* - Github: rovolution
*
* =========================================================
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
.slider {
display: inline-block;
vertical-align: middle;
position: relative;
}
.slider.slider-horizontal {
width: 210px;
height: 20px;
}
.slider.slider-horizontal .slider-track {
height: 10px;
width: 100%;
margin-top: -5px;
top: 50%;
left: 0;
}
.slider.slider-horizontal .slider-selection,
.slider.slider-horizontal .slider-track-low,
.slider.slider-horizontal .slider-track-high {
height: 100%;
top: 0;
bottom: 0;
}
.slider.slider-horizontal .slider-tick,
.slider.slider-horizontal .slider-handle {
margin-left: -10px;
}
.slider.slider-horizontal .slider-tick.triangle,
.slider.slider-horizontal .slider-handle.triangle {
position: relative;
top: 50%;
transform: translateY(-50%);
border-width: 0 10px 10px 10px;
width: 0;
height: 0;
border-bottom-color: #0480be;
margin-top: 0;
}
.slider.slider-horizontal .slider-tick-container {
white-space: nowrap;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.slider.slider-horizontal .slider-tick-label-container {
white-space: nowrap;
margin-top: 20px;
}
.slider.slider-horizontal .slider-tick-label-container .slider-tick-label {
padding-top: 4px;
display: inline-block;
text-align: center;
}
.slider.slider-vertical {
height: 210px;
width: 20px;
}
.slider.slider-vertical .slider-track {
width: 10px;
height: 100%;
left: 25%;
top: 0;
}
.slider.slider-vertical .slider-selection {
width: 100%;
left: 0;
top: 0;
bottom: 0;
}
.slider.slider-vertical .slider-track-low,
.slider.slider-vertical .slider-track-high {
width: 100%;
left: 0;
right: 0;
}
.slider.slider-vertical .slider-tick,
.slider.slider-vertical .slider-handle {
margin-top: -10px;
}
.slider.slider-vertical .slider-tick.triangle,
.slider.slider-vertical .slider-handle.triangle {
border-width: 10px 0 10px 10px;
width: 1px;
height: 1px;
border-left-color: #0480be;
margin-left: 0;
}
.slider.slider-vertical .slider-tick-label-container {
white-space: nowrap;
}
.slider.slider-vertical .slider-tick-label-container .slider-tick-label {
padding-left: 4px;
}
.slider.slider-disabled .slider-handle {
background-image: -webkit-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
background-image: -o-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
background-image: linear-gradient(to bottom, #dfdfdf 0%, #bebebe 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdfdfdf', endColorstr='#ffbebebe', GradientType=0);
}
.slider.slider-disabled .slider-track {
background-image: -webkit-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
background-image: -o-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
background-image: linear-gradient(to bottom, #e5e5e5 0%, #e9e9e9 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe5e5e5', endColorstr='#ffe9e9e9', GradientType=0);
cursor: not-allowed;
}
.slider input {
display: none;
}
.slider .tooltip.top {
margin-top: -36px;
}
.slider .tooltip-inner {
white-space: nowrap;
max-width: none;
}
.slider .hide {
display: none;
}
.slider-track {
position: absolute;
cursor: pointer;
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%);
background-image: linear-gradient(to bottom, #f5f5f5 0%, #f9f9f9 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
.slider-selection {
position: absolute;
background-image: -webkit-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
background-image: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 4px;
}
.slider-selection.tick-slider-selection {
background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
}
.slider-track-low,
.slider-track-high {
position: absolute;
background: transparent;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 4px;
}
.slider-handle {
position: absolute;
top: 0;
width: 20px;
height: 20px;
background-color: #337ab7;
background-image: -webkit-linear-gradient(top, #149bdf 0%, #0480be 100%);
background-image: -o-linear-gradient(top, #149bdf 0%, #0480be 100%);
background-image: linear-gradient(to bottom, #149bdf 0%, #0480be 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
filter: none;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
border: 0px solid transparent;
}
.slider-handle.round {
border-radius: 50%;
}
.slider-handle.triangle {
background: transparent none;
}
.slider-handle.custom {
background: transparent none;
}
.slider-handle.custom::before {
line-height: 20px;
font-size: 20px;
content: '\2605';
color: #726204;
}
.slider-tick {
position: absolute;
width: 20px;
height: 20px;
background-image: -webkit-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
background-image: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
filter: none;
opacity: 0.8;
border: 0px solid transparent;
}
.slider-tick.round {
border-radius: 50%;
}
.slider-tick.triangle {
background: transparent none;
}
.slider-tick.custom {
background: transparent none;
}
.slider-tick.custom::before {
line-height: 20px;
font-size: 20px;
content: '\2605';
color: #726204;
}
.slider-tick.in-selection {
background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
opacity: 1;
}

View file

@ -1,26 +0,0 @@
.slider .slider-selection {
background: none;
background-image: none;
}
.slider .slider-selection.tick-slider-selection {
background: none;
background-image: none;
}
.slider .slider-tick.in-selection {
background-image: linear-gradient(to bottom, #f5f5f5 0, #c5c5c5 100%);
}
span.slider-endpoint-label-start {
display: inline-block;
clear: none;
max-width: 170px;
margin-right: 5px;
vertical-align: top;
}
span.slider-endpoint-label-end {
display: inline-block;
clear: none;
max-width: 170px;
margin-left: 5px;
vertical-align: top;
}

View file

@ -1,24 +0,0 @@
/*
Document : fobi.plugin.slider-bootstrap3-widget.js
Created on : Oct 19, 2016, 03:30:35 AM
Author : Artur Barseghyan (artur.barseghyan@gmail.com)
Description:
`bootstrap3` theme slider plugin scripts.
*/
;
$(document).ready(function() {
// We consider multiple sliders
$('select.slider').each(function() {
var selectElement = $(this);
var selectedValue = null;
try {
selectedValue = parseInt(selectElement.val());
} catch(err) {
selectedValue = parseInt(selectElement.data('data-slider-value'));
}
var sliderElement = $(this).bootstrapSlider();
sliderElement.bootstrapSlider('setValue', selectedValue);
});
});