From 648d5a6ad7120f8b81b81cce27cccb6397a369d2 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Thu, 19 Jun 2014 12:02:29 +0200 Subject: [PATCH 1/3] Fixed CKEditor stuff: - Added missing insertpre plugin and allow
 tag with class
  attribute. Added font style to base.css.
- Removed unused link to old ckeditor.css (now managed by
  django-ckeditor).
---
 CHANGELOG                                     |   3 +
 .../ckeditor/plugins/insertpre/README.md      |  27 ++++
 .../insertpre/icons/insertpre-color.png       | Bin 0 -> 603 bytes
 .../plugins/insertpre/icons/insertpre.png     | Bin 0 -> 693 bytes
 .../ckeditor/plugins/insertpre/lang/en.js     |   6 +
 .../ckeditor/plugins/insertpre/lang/pl.js     |   6 +
 .../ckeditor/plugins/insertpre/plugin.js      | 131 ++++++++++++++++++
 openslides/core/static/css/base.css           |   6 +
 openslides/core/static/js/ckeditor-config.js  |  43 ------
 openslides/global_settings.py                 |   5 +-
 .../motion/templates/motion/motion_form.html  |   1 -
 openslides/utils/forms.py                     |   3 +-
 12 files changed, 184 insertions(+), 47 deletions(-)
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/lang/en.js
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/lang/pl.js
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/plugin.js
 delete mode 100644 openslides/core/static/js/ckeditor-config.js

diff --git a/CHANGELOG b/CHANGELOG
index fc619bbd0..188b00ed3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,9 @@ Version 1.6.1 (unreleased)
 ==========================
 [https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
 
+Other:
+- Fixed CKEditor stuff (added insertpre plugin and removed unused code)
+
 
 Version 1.6 (2014-06-02)
 ========================
diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
new file mode 100644
index 000000000..5bf8edb2f
--- /dev/null
+++ b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
@@ -0,0 +1,27 @@
+CKEditor Insert <pre> Plugin
+===============================
+
+This plugin makes it easier to insert a <pre> tag in CKEditor.
+
+Installation
+------------
+
+1. Clone/copy this repository contents in a new "plugins/insertpre" folder in your CKEditor installation.
+2. Enable the "insertpre" plugin in the CKEditor configuration file (config.js):
+
+        config.extraPlugins = 'insertpre';
+
+That's all. "InsertPre" button will appear on the editor toolbar and will be ready to use.
+
+3. Optionally, you may specify which class should be added to the <pre> element:
+
+        CKEDITOR.config.insertpre_class = 'prettyprint';
+
+   As well as specify how the <pre> tag should be rendered inside CKEditor:
+   
+		CKEDITOR.config.insertpre_style = 'background-color:#F8F8F8;border:1px solid #DDD;padding:10px;';
+
+License
+-------
+
+Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html).
diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png
new file mode 100644
index 0000000000000000000000000000000000000000..0c76bd1297751b66230f74719504b2adb02b1615
GIT binary patch
literal 603
zcmV-h0;K(kP)^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP
zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK
z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc
zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw
p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT

literal 0
HcmV?d00001

diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png
new file mode 100644
index 0000000000000000000000000000000000000000..756a4906f94bd832bfd77e8018c82339245c2be7
GIT binary patch
literal 693
zcmV;m0!safP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyx8
z3=Aw}o`rh=00K2hL_t(I%Z-yePa9DXg}?h)9E;d8iExDC$nXOqiU?@jxuHO`q@hlm
zh8|H<1PPEVrKh5&Kr%{4iG)N=8ibLI-@D7+y^{jl!Q^?QsqUFGb7#&d5dlCcRRZ1s
zhQFf$d>0W9fQT>@`4B}>D@l^nIVZo1D2il%e}4~{2egPx2rMT_lJG%8NXt&#P
ze}6Bxx3}V)lbf3xIXE~Ni;R*Luw=1nyOB#)aIOk+A7)YFWT*PTB%gX=koyMaycrM3f*p(TrS7O#l>SqV|Y3zeSLlX>F(|>
znx39E^?IF7rvpHz)8XvwjBGYbv)N>EaS>w-#u&8LV*w>1Y;A45E))v&g@uLp4-XG)
zZf%d4Yh<(8@n(h_z*@Va0d{wHn}>&opS|}aNdiEUBzW&xUtb?518A*(
z?O@~s=iK>o
-    
     
 {% endblock %}
 
diff --git a/openslides/utils/forms.py b/openslides/utils/forms.py
index 1dfe2404c..ca4db1a7c 100644
--- a/openslides/utils/forms.py
+++ b/openslides/utils/forms.py
@@ -29,7 +29,8 @@ HTML_TAG_WHITELIST = ('a',
 HTML_ATTRIBUTES_WHITELIST = {
     'a': ['href'],
     '*': ['style'],
-    'img': ['src'],
+    'pre': ['class'],
+    'img': ['src', 'width', 'height'],
 }
 
 HTML_STYLES_WHITELIST = ('color', 'background-color', 'list-style', 'width', 'height')

From 587a3766d2154689960b2a04ac06da06fcc50024 Mon Sep 17 00:00:00 2001
From: Emanuel Schuetze 
Date: Thu, 19 Jun 2014 14:13:06 +0200
Subject: [PATCH 2/3] Fixed participant csv import for group id

- Allowed to add multiple groups in csv group id field (e.g. "3,4")
- Fixed bug that group ids > 9 can not be imported.
- Updated error message if group id does not exists.
---
 CHANGELOG                                    |  6 ++++++
 extras/csv-examples/participants-demo_de.csv |  2 +-
 openslides/participant/csv_import.py         | 12 +++++-------
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 188b00ed3..8e28b5e64 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,12 @@ Version 1.6.1 (unreleased)
 ==========================
 [https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
 
+Participants:
+- Fixed participant csv import for group id:
+  * Allowed to add multiple groups in csv group id field, e.g. "3,4".
+  * Fixed bug that group ids > 9 can not be imported.
+  * Updated error message if group id does not exists.
+
 Other:
 - Fixed CKEditor stuff (added insertpre plugin and removed unused code)
 
diff --git a/extras/csv-examples/participants-demo_de.csv b/extras/csv-examples/participants-demo_de.csv
index 6b05c0562..d50b9fdc1 100644
--- a/extras/csv-examples/participants-demo_de.csv
+++ b/extras/csv-examples/participants-demo_de.csv
@@ -13,7 +13,7 @@ Teilnehmer/innen-Namen aus http://de.wikipedia.org/wiki/Otto_Normalverbraucher";
 ;"Tädi";"Maali";"female";;3;"Estland";;;;1
 ;"Maija";"Maikäläinen";"female";;3;"Finnland";;;;1
 ;"Jean";"Dupont";"male";;3;"Frankreich";;;;1
-;"Paul";"Martin";"female";;4;"Frankreich";"Versammlungsleitung";;;1
+;"Paul";"Martin";"male";;"3,4";"Frankreich";"Versammlungsleitung";;;1
 ;"Fred";"Bloggs";"male";;3;"Großbritanien";;;;0
 ;"John";"Smith";"male";;4;"Großbritanien";"Versammlungsleitung";;;1
 ;"Ashok";"Kumar";"male";;3;"Indien";;;;1
diff --git a/openslides/participant/csv_import.py b/openslides/participant/csv_import.py
index 55c16c2c4..73bf403c0 100644
--- a/openslides/participant/csv_import.py
+++ b/openslides/participant/csv_import.py
@@ -54,15 +54,13 @@ def import_users(csvfile):
                         user.is_active = False
                     user.default_password = gen_password()
                     user.save()
-                    for groupid in groups:
+                    for groupid in groups.split(','):
                         try:
-                            if groupid != ",":
+                            if groupid and int(groupid):
                                 Group.objects.get(pk=groupid).user_set.add(user)
-                        except ValueError:
-                            error_messages.append(_('Ignoring malformed group id in line %d.') % (line_no + 1))
-                            continue
-                        except Group.DoesNotExist:
-                            error_messages.append(_('Group id %(id)s does not exists (line %(line)d).') % {'id': groupid, 'line': line_no + 1})
+                        except (Group.DoesNotExist, ValueError):
+                            error_messages.append(_('Ignoring group id "%(id)s" in line %(line)d which does not exist.') %
+                                                  {'id': groupid, 'line': line_no + 1})
                             continue
                     user.reset_password()
                     count_success += 1

From f6d0a96126bb4be4c5dc787945f1736c50a0eca8 Mon Sep 17 00:00:00 2001
From: Emanuel Schuetze 
Date: Thu, 19 Jun 2014 12:12:48 +0200
Subject: [PATCH 3/3] Show supporters on motion slide if available.

---
 CHANGELOG                                     |  3 +++
 openslides/motion/templates/motion/slide.html | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 8e28b5e64..a8a2bd2c3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,9 @@ Version 1.6.1 (unreleased)
 ==========================
 [https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
 
+Motions:
+- Show supporters on motion slide if available.
+
 Participants:
 - Fixed participant csv import for group id:
   * Allowed to add multiple groups in csv group id field, e.g. "3,4".
diff --git a/openslides/motion/templates/motion/slide.html b/openslides/motion/templates/motion/slide.html
index bd8804385..2a6c97f03 100644
--- a/openslides/motion/templates/motion/slide.html
+++ b/openslides/motion/templates/motion/slide.html
@@ -55,6 +55,17 @@
         -
     {% endfor %}
 
+    
+    {% with motion.supporter.all as supporters %}
+    {% if supporters|length > 0 %}
+        

{% trans "Supporters" %}:

+ {% for supporter in supporters %} + {{ supporter.person }}{% if not forloop.last %},
{% endif %} + {% endfor %} +

+ {% endif %} + {% endwith %} + {% if motion.category %}

{% trans "Category" %}: