From 3c08e9fdec5ee6bba8aa08aac720c4f2f5cec0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 7 Aug 2013 13:17:59 +0200 Subject: [PATCH 01/25] style: update login pages to match design --- .../django-montpellier/Picto-EServices.png | Bin 0 -> 604 bytes .../themes/django-montpellier/style.css | 60 ++++++++++++++---- 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 compte_agglo_montpellier/static/themes/django-montpellier/Picto-EServices.png diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/Picto-EServices.png b/compte_agglo_montpellier/static/themes/django-montpellier/Picto-EServices.png new file mode 100644 index 0000000000000000000000000000000000000000..02919a6696735fe896a87a16b10de2f2169c47b1 GIT binary patch literal 604 zcmV-i0;BzjP)nfNp>{pc{}8x&dW_Fac~3n4o2Xc7v7)S|&)D;PLY;o!mHe z(;{IhN+O@n&+qP@&q(60hnbzUxhXXyIRW6G1Ar}ny_xMVMmxj^$%wDZBRMBo zjl{q#5CQ14(MJDMF$0nl{WqGY?CYxl5eq9hUXh#@I-5G?W)}ewh$^a0Y+~4UP0HiswJqO4kW_!wtN;HUK zA4Wf7h input { + display: block; + margin: 1em auto 0 auto; + background: #f68423; + color: white; + border: none; + padding: 3px 1em; +} + +div.login-actions { + text-align: center; +} + + .region-header { width: 1000px; position: absolute; From 660ffdacf2c67b486d0d32231544a2ed0ae53500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 7 Aug 2013 13:51:49 +0200 Subject: [PATCH 02/25] style: eservices according to design --- .../static/themes/django-montpellier/style.css | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index 906fd13..8c7c4d6 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -164,24 +164,30 @@ br.clear { #error-404, #error-500, #content .block, #password-changed { background: white; font-size: 110%; + margin-bottom: 1em; } #content .block h2 { - background: #e6e6d6 url(toptitle.png) no-repeat left top; + background: #e87b1c url(Picto-EServices.png) 5px 50% no-repeat; font-weight: normal; - color: #f68423; + color: white; text-transform: uppercase; padding: 6px 10px 6px 50px; font-size: 130%; cursor: default; /* someday, perhaps, cursor: move */ } -#content .demarches ul { +#content .demarches ul, +#content ul.mes-demarches { list-style: none; padding-left: 0px; margin: 0px; + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; } +#content ul.mes-demarches a, #content .demarches ul a { color: inherit; font-weight: bold; @@ -189,13 +195,18 @@ br.clear { padding-left: 10px; } +#content ul.mes-demarches a:hover, #content .demarches ul a:hover { color: #f68423; } +#content ul.mes-demarches li, #content .demarches ul li { margin: 1ex 0 10px 1ex; padding-left: 10px; + -webkit-column-break-inside: avoid; + -moz-column-break-inside: avoid; + column-break-inside: avoid; } #content .demarches .toutes-les-demarches { From e2078f98c2ec7c89cf0319e166eaaa609b5ee7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 7 Aug 2013 14:33:48 +0200 Subject: [PATCH 03/25] style: on/off icons for newsletters --- .../themes/django-montpellier/Annulation.png | Bin 0 -> 351 bytes .../themes/django-montpellier/Validation.png | Bin 0 -> 332 bytes .../themes/django-montpellier/style.css | 37 +++++++----------- 3 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 compte_agglo_montpellier/static/themes/django-montpellier/Annulation.png create mode 100644 compte_agglo_montpellier/static/themes/django-montpellier/Validation.png diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/Annulation.png b/compte_agglo_montpellier/static/themes/django-montpellier/Annulation.png new file mode 100644 index 0000000000000000000000000000000000000000..1d9b5265af8102ec2c559ca0ebad63a0428de61a GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa&H|6fVg?3rArNLvpMMFYN+H=J z$d`d3Po06Gcs&Ed_Z$X>HXuLuGXuk`LktWCb_@&>dM1zOfy{a8>Eaktacj;cN3TPH z0>?l0i#aWSp}>~g>tr}((Sq95=PrqIJ=AxdB%s?ARypCF0Eg3!MU@|=vL5G~=BMpD zbEf}#)cWgY7tQvR@7~bw9g{Hi*S3OY&1bv2TgybgedrN3d7-l6pyay?hxsd7=XSKu zV2N1}c*W}C@4Z^*lyCNbUok7<_gx=S)iN2Cw50Ni{V?G<@ryNe!;8=Tcihiy z|6i!Ty1)I_+p?!&lk;XRoz4F-;=!X=Dvthz`8QJ}3iYdwr#{O48Xb4&VQA_Noh#NTha%2STo_@#ffbub0=5f5RYt=!2MGof4o)MF- zf7(+ZX?|xipZLG;Hs>E^hJ>d6xEHWOIc6`9j5NY=0XeYWwh#OiCNeuwf4I=f4bi@EJM%+Gh>m`-C`#8vxi50vu`l^=e;xOu-v z)Y8RQAL!ouAaKA!D6#AM+ozXh#VwAdAIQ}yoS&V$dyc6e^S?gNO{ZiJgdb=R3<>+s a%;57w`NOX54n08MF?hQAxvX Date: Fri, 9 Aug 2013 17:39:13 +0200 Subject: [PATCH 04/25] setup.py: don't install Django during setup --- setup.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index e2de130..a1e6a33 100755 --- a/setup.py +++ b/setup.py @@ -20,22 +20,25 @@ class compile_translations(Command): def run(self): import os import sys - from django.core.management.commands.compilemessages import \ - compile_messages - for path in ['compte_agglo_montpellier'] + glob.glob('compte_agglo_montpellier/apps/*'): - if not os.path.exists(os.path.join(path, 'locale')): - continue - curdir = os.getcwd() - os.chdir(os.path.realpath(path)) - compile_messages(stderr=sys.stderr) - os.chdir(curdir) + try: + from django.core.management.commands.compilemessages import \ + compile_messages + for path in ['compte_agglo_montpellier'] + glob.glob('compte_agglo_montpellier/apps/*'): + if not os.path.exists(os.path.join(path, 'locale')): + continue + curdir = os.getcwd() + os.chdir(os.path.realpath(path)) + compile_messages(stderr=sys.stderr) + os.chdir(curdir) + except ImportError: + print + sys.stderr.write('!!! Please install Django >= 1.4 to build translations') + print + print class build(_build): sub_commands = [('compile_translations', None)] + _build.sub_commands -class sdist(_sdist): - sub_commands = [('compile_translations', None)] + _sdist.sub_commands - class install_lib(_install_lib): def run(self): self.run_command('compile_translations') @@ -92,7 +95,7 @@ setup(name="compte-agglo-montpellier", 'static/**.gif', 'static/**.css', 'static/**.js', - 'locale/**.mo', + 'locale/**.mo', 'fixtures/*.json', ] }, @@ -106,14 +109,10 @@ setup(name="compte-agglo-montpellier", 'gunicorn', 'demjson', ], - setup_requires=[ - 'django>=1.4', - ], dependency_links = [ 'git+git://repos.entrouvert.org/portail-citoyen#egg=portail-citoyen-0.1.99999', 'git+git://repos.entrouvert.org/portail-citoyen-announces#egg=portail-citoyen-announces-0.1.99999', ], cmdclass={'build': build, 'install_lib': install_lib, - 'compile_translations': compile_translations, - 'sdist': sdist}, + 'compile_translations': compile_translations}, ) From 72b5432c0121e74c7dc7f9eff209dd251b1f72db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 12 Aug 2013 18:00:12 +0200 Subject: [PATCH 05/25] style: add icons for feeds and newsletters boxes --- .../themes/django-montpellier/Picto-Bulle.png | Bin 0 -> 477 bytes .../themes/django-montpellier/Picto-coeur.png | Bin 0 -> 518 bytes .../static/themes/django-montpellier/style.css | 8 ++++++++ 3 files changed, 8 insertions(+) create mode 100644 compte_agglo_montpellier/static/themes/django-montpellier/Picto-Bulle.png create mode 100644 compte_agglo_montpellier/static/themes/django-montpellier/Picto-coeur.png diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/Picto-Bulle.png b/compte_agglo_montpellier/static/themes/django-montpellier/Picto-Bulle.png new file mode 100644 index 0000000000000000000000000000000000000000..23f443f5f2fed05c7e852581d725574fff46c628 GIT binary patch literal 477 zcmV<30V4j1P)X1^@s6S>%lC00006VoOIv00000 z008+zyMF)x010qNS#tmY7ZLyf7ZL$ypVCqQ000McNliru-3Sa1IR}Go4h#SQ0cuG^ zK~zY`%~soOgFq0Ru_yp{fGe;|poF9YQbCdqoC=%{oK%2Pf!#rH1*QY&VDhs>=mZhR z9d<@SaAH{vvrkIGEkJUTUD7v}lmW;hai~bP=6Cv6ow1~Y;-ZmM_z;pL*p+KJWIlve z_MF?j2C!xz0IUJD=CkmLbK;yoNw$*mfZVA`){?5;kIp6pNjm_i5JCVpb3aZ7%CnO6 z3Lu?ZT_L5JjP#6m+zCS=O97ODIrJ1$p%lO_AY|vL3X!a>Z0~{<{ux#SIh0N4zU9r5 z+M3$ilBMlKXltbQ5qzg1gu1!&An6F;;`SnI2QL%-Zmm-N)wF4!O8R#4q;Tx^GbVlM zyM9m-NOlSo0G@40t4VHp>Rc@hRZr0|v;e+HesqMUY>dDA&>vM+IO;S;&N~WT3);Yo zqY=2;xv}%CWRF3puhJ<*ohXDHl{y^e)_*KQZpY4+CN#Pa^*Z*W^^>y=-No?(BF#T0 TXX1^@s6RQmj^00006VoOIv00000 z008+zyMF)x010qNS#tmY7ZLyf7ZL$ypVCqQ000McNliru-3Sa1ISY!|LMH$K0h38Y zK~zY`&6nYAgfI++pQ{@nBe21-L9;aN)tL#oOW0EBR3%~%F09-|+PlZTYq;E{pki0NHJ{53x5R&{g zR*0MT;f`dZ_fg-CB<;~4t@p7qF!YrgNtz=;+^X%2gHx>D8|0)9E-~*Sa-H#c1JD6@ zB6$Z;0yqQs0?>=dNA~toRT^DsyI^ZMKL$UnDT+J<@4gp&rr`M%z>D4|00n^L-4#=$ zSz+JmWg-cE^OP~k$(jPPFriThlB{w<<0LU<-o*~j* zM}@K}8zC2@j+|ASoQ|3TA|zv{c(>wS`$zU!XYKEV{FnclAFZ_1`N0*xUH||907*qo IM6N<$f`*gTxc~qF literal 0 HcmV?d00001 diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index 3a42dc7..181d204 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -177,6 +177,14 @@ br.clear { cursor: default; /* someday, perhaps, cursor: move */ } +#content .block h2.feeds { + background-image: url(Picto-Bulle.png); +} + +#content .block h2.newsletters { + background-image: url(Picto-Coeur.png); +} + #content .demarches ul, #content ul.mes-demarches { list-style: none; From 31079259bd693d51fd48a9ed657d4ed5cca21395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 12 Aug 2013 18:07:06 +0200 Subject: [PATCH 06/25] style: fix name of heart icon --- .../static/themes/django-montpellier/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index 181d204..e45c56c 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -182,7 +182,7 @@ br.clear { } #content .block h2.newsletters { - background-image: url(Picto-Coeur.png); + background-image: url(Picto-coeur.png); } #content .demarches ul, From a9c5713ab5b0966e6d7322596b844b394d501a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 12 Aug 2013 18:12:02 +0200 Subject: [PATCH 07/25] style: "my account" box --- .../static/themes/django-montpellier/style.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index e45c56c..8d351e0 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -672,3 +672,12 @@ table.announces tbody th { color: rgb(58, 58, 58); text-decoration: none; } + +#my-password p { + font-weight: bold; + margin: 1ex; +} + +#my-password p a { + color: inherit; +} From 3e6deecb21c81285f4e8f3c0160c7ab040164b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 12 Aug 2013 18:15:28 +0200 Subject: [PATCH 08/25] style: more "my account" stuff --- .../static/themes/django-montpellier/style.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index 8d351e0..aa0363d 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -673,11 +673,15 @@ table.announces tbody th { text-decoration: none; } +#my-password { + padding-bottom: 1ex; +} + #my-password p { font-weight: bold; - margin: 1ex; } #my-password p a { color: inherit; + padding: 1ex; } From ae561db332d78f896da23f66f881a5f5a5ad86df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Tue, 13 Aug 2013 17:31:57 +0200 Subject: [PATCH 09/25] setup.py sdist: store version into the archive --- MANIFEST.in | 1 + setup.py | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 11b7d77..256ed87 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,4 @@ recursive-include compte_agglo_montpellier/apps/feed_plugin/templates *.html recursive-include compte_agglo_montpellier/apps/feed_plugin/locale *.po *.mo include local_settings.py.example include requirements.txt +include VERSION diff --git a/setup.py b/setup.py index a1e6a33..3f33f3f 100755 --- a/setup.py +++ b/setup.py @@ -1,11 +1,15 @@ #! /usr/bin/env python +import glob +import re +import sys +import os + from setuptools import setup, find_packages from setuptools.command.install_lib import install_lib as _install_lib from distutils.command.build import build as _build -from distutils.command.sdist import sdist as _sdist +from distutils.command.sdist import sdist from distutils.cmd import Command -import glob class compile_translations(Command): description = 'compile message catalogs to MO files via django compilemessages' @@ -18,8 +22,6 @@ class compile_translations(Command): pass def run(self): - import os - import sys try: from django.core.management.commands.compilemessages import \ compile_messages @@ -39,18 +41,34 @@ class compile_translations(Command): class build(_build): sub_commands = [('compile_translations', None)] + _build.sub_commands +class eo_sdist(sdist): + + def run(self): + print "creating VERSION file" + if os.path.exists('VERSION'): + os.remove('VERSION') + version = get_version() + version_file = open('VERSION', 'w') + version_file.write(version) + version_file.close() + sdist.run(self) + print "removing VERSION file" + if os.path.exists('VERSION'): + os.remove('VERSION') + class install_lib(_install_lib): def run(self): self.run_command('compile_translations') _install_lib.run(self) - def get_version(): - import glob - import re - import os version = None + if os.path.exists('VERSION'): + version_file = open('VERSION', 'r') + version = version_file.read() + version_file.close() + return version for d in glob.glob('*'): if not os.path.isdir(d): continue @@ -114,5 +132,6 @@ setup(name="compte-agglo-montpellier", 'git+git://repos.entrouvert.org/portail-citoyen-announces#egg=portail-citoyen-announces-0.1.99999', ], cmdclass={'build': build, 'install_lib': install_lib, - 'compile_translations': compile_translations}, + 'compile_translations': compile_translations, + 'sdist': eo_sdist}, ) From 67e4d13809c71970524c7ef8f9e7a96dc0d2d627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Fri, 16 Aug 2013 08:26:07 +0200 Subject: [PATCH 10/25] MANIFEST.in: include MANIFEST.in --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 256ed87..ef41f52 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,4 +6,5 @@ recursive-include compte_agglo_montpellier/apps/feed_plugin/templates *.html recursive-include compte_agglo_montpellier/apps/feed_plugin/locale *.po *.mo include local_settings.py.example include requirements.txt +include MANIFEST.in include VERSION From 0ed549e3b480fa0441f556c7804c62086a12f44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Mon, 19 Aug 2013 14:44:00 +0200 Subject: [PATCH 11/25] fixtures: fix passerelle url for the 'recette' --- compte_agglo_montpellier/fixtures/pages-preprod.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compte_agglo_montpellier/fixtures/pages-preprod.json b/compte_agglo_montpellier/fixtures/pages-preprod.json index 777df47..7be8bd6 100644 --- a/compte_agglo_montpellier/fixtures/pages-preprod.json +++ b/compte_agglo_montpellier/fixtures/pages-preprod.json @@ -5750,7 +5750,7 @@ "model" : "cmsplugin_text_wrapper.textwrapper", "pk" : 1588 }, - { "fields" : { "body" : "

Newsletters

Cliquez sur une newsletter pour vous (dés)abonner et sauvegardez les changements avec le bouton Modifier.

\"passerelle

", + { "fields" : { "body" : "

Newsletters

Cliquez sur une newsletter pour vous (dés)abonner et sauvegardez les changements avec le bouton Modifier.

\"passerelle

", "wrapper" : "block" }, "model" : "cmsplugin_text_wrapper.textwrapper", @@ -5792,7 +5792,7 @@ "model" : "cmsplugin_text_wrapper.textwrapper", "pk" : 1640 }, - { "fields" : { "body" : "

Newsletters

Cliquez sur une newsletter pour vous (dés)abonner et sauvegardez les changements avec le bouton Modifier.

\"passerelle

", + { "fields" : { "body" : "

Newsletters

Cliquez sur une newsletter pour vous (dés)abonner et sauvegardez les changements avec le bouton Modifier.

\"passerelle

", "wrapper" : "block" }, "model" : "cmsplugin_text_wrapper.textwrapper", From 8e5cf063176513bd64de5530ae3df3f26add645e Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Mon, 26 Aug 2013 15:14:31 +0200 Subject: [PATCH 12/25] Set logos image link border to zero. Closes #3491 --- .../static/themes/django-montpellier/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index aa0363d..7efe467 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -54,6 +54,10 @@ div#top h1 a { text-shadow: #6374AB 0px 0px 3px; } +div#top a img { + border: 0; +} + div#main-content-wrapper { position: relative; z-index: 100; From f49630a5256da03c8ff8362fc9ef296e9ba6fb93 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 26 Aug 2013 15:25:50 +0200 Subject: [PATCH 13/25] Revert "undo" This reverts commit f785d202013e2a7e6b7e40a3ca20a8cec3326579. --- compte_agglo_montpellier/dashboard.py | 1 - compte_agglo_montpellier/settings.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/compte_agglo_montpellier/dashboard.py b/compte_agglo_montpellier/dashboard.py index 3ae5ccb..58c1b03 100644 --- a/compte_agglo_montpellier/dashboard.py +++ b/compte_agglo_montpellier/dashboard.py @@ -45,7 +45,6 @@ class CustomIndexDashboard(Dashboard): 'cms.models.pagemodel.Page', 'data_source_plugin.models.DataSource', 'feed_plugin.models.Feed', - 'auquotidien_plugin.models.AuQuotidienAPI', ), )) diff --git a/compte_agglo_montpellier/settings.py b/compte_agglo_montpellier/settings.py index 77b349c..0ce97db 100644 --- a/compte_agglo_montpellier/settings.py +++ b/compte_agglo_montpellier/settings.py @@ -110,7 +110,6 @@ INSTALLED_APPS = ( 'portail_citoyen_announces', 'login_plugin', 'data_source_plugin', - 'auquotidien_plugin', 'a2_service_list_plugin', 'passerelle_register_plugin', 'portail_citoyen', @@ -229,8 +228,8 @@ AUTHENTICATION_EVENT_EXPIRATION = int(os.environ.get('AUTHENTICATION_EVENT_EXPIR # of user, and to handle SLO for each protocols IDP_BACKENDS = [ ] -LOCAL_METADATA_CACHE_TIMEOUT = int(os.environ.get('LOCAL_METADATA_CACHE_TIMEOUT', 600)) # You MUST changes these keys, they are just for testing ! +LOCAL_METADATA_CACHE_TIMEOUT = int(os.environ.get('LOCAL_METADATA_CACHE_TIMEOUT', 600)) SAML_SIGNATURE_PUBLIC_KEY = os.environ.get('SAML_SIGNATURE_PUBLIC_KEY', '''-----BEGIN CERTIFICATE----- MIIDIzCCAgugAwIBAgIJANUBoick1pDpMA0GCSqGSIb3DQEBBQUAMBUxEzARBgNV BAoTCkVudHJvdXZlcnQwHhcNMTAxMjE0MTUzMzAyWhcNMTEwMTEzMTUzMzAyWjAV @@ -279,7 +278,6 @@ wRiVcNacaP+BivkrMjr4BlsUM6yH4MOBsNhLURiiCL+tLJV7U0DWlCse/doWij4U TKX6tp6oI+7MIJE6ySZ0cBqOiydAkBePZhu57j6ToBkTa0dbHjn1WA== -----END RSA PRIVATE KEY-----''') -SAML_METADATA_ROOT = 'metadata' # Whether to autoload SAML 2.0 identity providers and services metadata # Only https URLS are accepted. # Can be none, sp, idp or both From b0e252c6f29d4436c85b36846b23bd0d9c2b6631 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 26 Aug 2013 15:24:37 +0200 Subject: [PATCH 14/25] feed_plugin: import widget used in the passerelle_register_plugin and show checkbox widget before their label fixes #3420 --- .../apps/feed_plugin/forms.py | 5 +- .../feed_plugin/select_user_feed.html | 13 ++- .../apps/feed_plugin/widgets.py | 104 ++++++++++++++++++ 3 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 compte_agglo_montpellier/apps/feed_plugin/widgets.py diff --git a/compte_agglo_montpellier/apps/feed_plugin/forms.py b/compte_agglo_montpellier/apps/feed_plugin/forms.py index c7ab439..f16c576 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/forms.py +++ b/compte_agglo_montpellier/apps/feed_plugin/forms.py @@ -1,8 +1,9 @@ from django import forms from django.utils.translation import ugettext as _ -import models +from . import models +from . import widgets class FeedForm(forms.Form): feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all(), - label=_('Your feeds'), widget=forms.CheckboxSelectMultiple) + label=_('Your feeds'), widget=widgets.CheckboxMultipleSelect) diff --git a/compte_agglo_montpellier/apps/feed_plugin/templates/feed_plugin/select_user_feed.html b/compte_agglo_montpellier/apps/feed_plugin/templates/feed_plugin/select_user_feed.html index cc6de55..41ec1aa 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/templates/feed_plugin/select_user_feed.html +++ b/compte_agglo_montpellier/apps/feed_plugin/templates/feed_plugin/select_user_feed.html @@ -1,6 +1,15 @@ {% load i18n %} -
+ {% csrf_token %} - {{ form.feeds }} +
    + {% for subwidget in form.feeds %} +
  • + {{ subwidget.tag }} + +
  • + {% endfor %} +
diff --git a/compte_agglo_montpellier/apps/feed_plugin/widgets.py b/compte_agglo_montpellier/apps/feed_plugin/widgets.py new file mode 100644 index 0000000..30a7262 --- /dev/null +++ b/compte_agglo_montpellier/apps/feed_plugin/widgets.py @@ -0,0 +1,104 @@ +from itertools import chain + +from django.forms.widgets import SubWidget, SelectMultiple +from django.forms.util import flatatt +from django.utils.html import conditional_escape +from django.utils.encoding import StrAndUnicode, force_unicode +from django.utils.safestring import mark_safe + +class CheckboxInput(SubWidget): + """ + An object used by CheckboxRenderer that represents a single + . + """ + def __init__(self, name, value, attrs, choice, index): + self.name, self.value = name, value + self.attrs = attrs + self.choice_value = force_unicode(choice[0]) + self.choice_label = force_unicode(choice[1]) + self.index = index + + def __unicode__(self): + return self.render() + + def render(self, name=None, value=None, attrs=None, choices=()): + name = name or self.name + value = value or self.value + attrs = attrs or self.attrs + + if 'id' in self.attrs: + label_for = ' for="%s_%s"' % (self.attrs['id'], self.index) + else: + label_for = '' + choice_label = conditional_escape(force_unicode(self.choice_label)) + return mark_safe(u'%s %s' % (label_for, self.tag(), choice_label)) + + def is_checked(self): + return self.choice_value in self.value + + def tag(self): + if 'id' in self.attrs: + self.attrs['id'] = '%s_%s' % (self.attrs['id'], self.index) + final_attrs = dict(self.attrs, type='checkbox', name=self.name, value=self.choice_value) + if self.is_checked(): + final_attrs['checked'] = 'checked' + return mark_safe(u'' % flatatt(final_attrs)) + +class CheckboxRenderer(StrAndUnicode): + def __init__(self, name, value, attrs, choices): + self.name, self.value, self.attrs = name, value, attrs + self.choices = choices + + def __iter__(self): + for i, choice in enumerate(self.choices): + yield CheckboxInput(self.name, self.value, self.attrs.copy(), choice, i) + + def __getitem__(self, idx): + choice = self.choices[idx] # Let the IndexError propogate + return CheckboxInput(self.name, self.value, self.attrs.copy(), choice, idx) + + def __unicode__(self): + return self.render() + + def render(self): + """Outputs a
    for this set of checkbox fields.""" + return mark_safe(u'
      \n%s\n
    ' % u'\n'.join([u'
  • %s
  • ' + % force_unicode(w) for w in self])) + +class CheckboxMultipleSelect(SelectMultiple): + """ + Checkbox multi select field that enables iteration of each checkbox + Similar to django.forms.widgets.RadioSelect + """ + renderer = CheckboxRenderer + + def __init__(self, *args, **kwargs): + # Override the default renderer if we were passed one. + renderer = kwargs.pop('renderer', None) + if renderer: + self.renderer = renderer + super(CheckboxMultipleSelect, self).__init__(*args, **kwargs) + + def subwidgets(self, name, value, attrs=None, choices=()): + for widget in self.get_renderer(name, value, attrs, choices): + yield widget + + def get_renderer(self, name, value, attrs=None, choices=()): + """Returns an instance of the renderer.""" + if value is None: value = '' + str_values = set([force_unicode(v) for v in value]) # Normalize to string. + if attrs is None: + attrs = {} + if 'id' not in attrs: + attrs['id'] = name + final_attrs = self.build_attrs(attrs) + choices = list(chain(self.choices, choices)) + return self.renderer(name, str_values, final_attrs, choices) + + def render(self, name, value, attrs=None, choices=()): + return self.get_renderer(name, value, attrs, choices).render() + + def id_for_label(self, id_): + if id_: + id_ += '_0' + return id_ From 98ca7e98a5f99fffa0b36e440bc57cb07fc7b509 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 26 Aug 2013 21:06:22 +0200 Subject: [PATCH 15/25] settings: include html traceback in email reports --- compte_agglo_montpellier/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/compte_agglo_montpellier/settings.py b/compte_agglo_montpellier/settings.py index 0ce97db..03b6d4c 100644 --- a/compte_agglo_montpellier/settings.py +++ b/compte_agglo_montpellier/settings.py @@ -317,6 +317,7 @@ LOGGING = { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'filters': ['cleaning'], + 'include_html': True, }, 'console': { 'class': 'logging.StreamHandler', From 53ce784cb10da5a1a2de0b9ef7b46dc322cd8063 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 27 Aug 2013 18:07:23 +0200 Subject: [PATCH 16/25] feed_plugin: add debug log of beginning and end of feed retrieval --- compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py index c9684d9..cdab17c 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py +++ b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py @@ -45,6 +45,7 @@ class ShowUserFeedPlugin(CMSPluginBase): def get_feeds(self, instance, user): entries = [] + logger.debug('loading RSS feeds of user %s', user.username) for pref in models.FeedPreference.objects.filter(user=user): feed = feedparser.parse(pref.feed.url) for entry in feed.entries: @@ -55,6 +56,7 @@ class ShowUserFeedPlugin(CMSPluginBase): break entries.append((date, entry.title, entry.link, pref.feed.name, pref.feed.color_hex, pref.feed.css_classes)) + logger.debug('loading finished of %s entries', len(entries)) entries.sort(reverse=True) entries = entries[:instance.limit] return [dict(title=title, link=link, feed_name=feed_name, From a946b905457719b81a9c99acc9efadfbbf6f3323 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 27 Aug 2013 18:08:58 +0200 Subject: [PATCH 17/25] settings: add environment variable for setting the cache backend --- compte_agglo_montpellier/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compte_agglo_montpellier/settings.py b/compte_agglo_montpellier/settings.py index 03b6d4c..697a181 100644 --- a/compte_agglo_montpellier/settings.py +++ b/compte_agglo_montpellier/settings.py @@ -197,6 +197,13 @@ if 'INTERNAL_IPS' in os.environ: else: INTERNAL_IPS = ('127.0.0.1',) +# cache +CACHES = { + 'default': { + 'BACKEND': os.environ.get('CACHE_BACKEND', 'django.core.cache.backends.locmem.LocMemCache'), + }, +} + # misc SECRET_KEY = os.environ.get('SECRET_KEY', '0!=(1kc6kri-ui+tmj@mr+*0bvj!(p*r0duu2n=)7@!p=pvf9n') DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False} From a5a96b9856fbb6a3bb06fe52eb1237ce1a38ca40 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 27 Aug 2013 18:13:43 +0200 Subject: [PATCH 18/25] settings: change format of CACHE_BACKEND environment variable to JSON --- compte_agglo_montpellier/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/settings.py b/compte_agglo_montpellier/settings.py index 697a181..f0d6742 100644 --- a/compte_agglo_montpellier/settings.py +++ b/compte_agglo_montpellier/settings.py @@ -1,3 +1,4 @@ +import json import os import logging.handlers from django.conf.global_settings import PASSWORD_HASHERS @@ -200,9 +201,11 @@ else: # cache CACHES = { 'default': { - 'BACKEND': os.environ.get('CACHE_BACKEND', 'django.core.cache.backends.locmem.LocMemCache'), + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', }, } +if 'CACHE_BACKEND' in os.environ: + CACHES['default'] = json.loads(os.environ['CACHE_BACKEND']) # misc SECRET_KEY = os.environ.get('SECRET_KEY', '0!=(1kc6kri-ui+tmj@mr+*0bvj!(p*r0duu2n=)7@!p=pvf9n') From 2921d5e0d25f7ca06552826a3b0a49440b1ea008 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 27 Aug 2013 18:24:21 +0200 Subject: [PATCH 19/25] feed_plugin: add missing getLogger call --- compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py index cdab17c..403aa19 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py +++ b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py @@ -13,6 +13,10 @@ from cms.plugin_pool import plugin_pool from . import models from . import forms + +logger = logging.getLogger(__name__) + + class SelectUserFeedPlugin(CMSPluginBase): model = models.SelectUserFeed name = _('select user feeds') From 486da97488417c160d1bfe736fe6fb612c967157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 28 Aug 2013 09:25:21 +0200 Subject: [PATCH 20/25] style: enlarge a little bit the narrow pages (#3417) --- .../static/themes/django-montpellier/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compte_agglo_montpellier/static/themes/django-montpellier/style.css b/compte_agglo_montpellier/static/themes/django-montpellier/style.css index 7efe467..fa90e38 100644 --- a/compte_agglo_montpellier/static/themes/django-montpellier/style.css +++ b/compte_agglo_montpellier/static/themes/django-montpellier/style.css @@ -291,7 +291,7 @@ span.helptext { body.narrow-page div.right { padding-top: 2em; - width: 30em; + width: 35em; margin: 1ex auto; } @@ -302,7 +302,7 @@ body.narrow-page div.right form { body.narrow-page div.right form div label { font-weight: bold; - width: 9em; + width: 14em; display: block; float: left; padding-top: 3px; From 0921eb66bb44245b06157eafb93d65beaf0076d4 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 28 Aug 2013 10:38:33 +0200 Subject: [PATCH 21/25] templates: modify texts on login page Use text from mail <304452798.302366.1377620179836.JavaMail.root@ares.agglonet.com> --- .../templates/auth/login.html | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/compte_agglo_montpellier/templates/auth/login.html b/compte_agglo_montpellier/templates/auth/login.html index a87d9fe..63511c5 100644 --- a/compte_agglo_montpellier/templates/auth/login.html +++ b/compte_agglo_montpellier/templates/auth/login.html @@ -15,38 +15,51 @@ class="narrow-page" {% block content %}
    -

    Bienvenue dans le portail « Mes e-services » de Montpellier Agglo !

    +

    Bienvenue sur le portail Internet de Montpellier Agglomération

    + +

    Un site Internet pour et par l’usager

    + +

    +Innovante, Montpellier Agglomération lance un site inédit, personnalisable à +volonté, pour que chaque internaute puisse créer sa propre version en fonction +de ses centres d’intérêts et de ses envies ! +

    + +

    +E-services accessibles 24h/24 et 7jrs/7 en un clic, navigation qui s’adapte à +l’internaute… avec la nouvelle version de son site lancée en septembre 2012, +vous avez accès à un graphisme épuré pour plus de confort de lecture, des +présentations ludiques et interactives, des photos, des vidéos… et une mine +d’informations à découvrir au fil de votre parcours ou de vos recherches. +

    + +

    Une offre de services performante

    Contacter une piscine ou le service des déchets ? Réaliser une modification de votre abonnement à la téléalarme ? Effectuer une demande de raccordement au réseau d'assainissement ? Répondre à une offre d'emploi ou déposer une -candidature spontannée ? +candidature spontanée ?

    -Ce portail vous permet d'accomplir vos démarches auprès de Montpellier Agglo -24h/24, de suivre le traitement de vos démarches en ligne et d'utiliser -l'ensemble des services en ligne mis en place par la collectivité, les -« e-services ». -

    - -

    -Il vous suffit de vous connecter avec votre compte citoyen de Montpellier Agglo -pour accéder au portail et à ses « e-services ». +La plate-forme de services dématérialisés évolue et vous permet d'accomplir la +plupart de vos démarches en ligne, 24h/24 et 7j/7, de suivre le traitement de +vos demandes de « e-services ».

    -Vous ne disposez pas encore de compte citoyen de Montpellier Agglo ? Alors -n'hésitez plus… +Pour cela il vous suffit de vous connecter avec votre compte citoyen de +Montpellier Agglo pour accéder au portail et à ses « e-services ».

    -Si vous possédez un compte lecteur à la Médiathèque, un compte famille à -l'écolothèque ou un compte élève au conservatoire, ce compte citoyen -Montpellier Agglo vous permettra également à terme d'accéder directement à ces -espaces personnalisés, sans avoir à re-saisir vos identifiants et mots de -passe. +Si vous ne disposez pas encore de compte citoyen de Montpellier Agglo ? +N'hésitez plus et inscrivez-vous dès maintenant, votre compte vous donnera +également accès à votre compte lecteur du réseau des Médiathèque, à votre +compte famille à l'Ecolothèque ou le compte élève au Conservatoire, et enfin +d'accéder directement à vos espaces personnalisés, sans avoir à re-saisir vos +identifiants et mots de passe.

    From 93fe98d006c406526b733207f24d8bbc057c84fa Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 28 Aug 2013 10:45:52 +0200 Subject: [PATCH 22/25] feed_plugin: do not fix the feed queryset --- compte_agglo_montpellier/apps/feed_plugin/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/apps/feed_plugin/forms.py b/compte_agglo_montpellier/apps/feed_plugin/forms.py index f16c576..834e9a0 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/forms.py +++ b/compte_agglo_montpellier/apps/feed_plugin/forms.py @@ -5,5 +5,5 @@ from . import models from . import widgets class FeedForm(forms.Form): - feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all(), + feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all, label=_('Your feeds'), widget=widgets.CheckboxMultipleSelect) From 67e968ba9359a0c3e62ae2a8f18ac10cf46107bf Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 28 Aug 2013 10:51:48 +0200 Subject: [PATCH 23/25] Revert "feed_plugin: do not fix the feed queryset" This reverts commit 93fe98d006c406526b733207f24d8bbc057c84fa. --- compte_agglo_montpellier/apps/feed_plugin/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/apps/feed_plugin/forms.py b/compte_agglo_montpellier/apps/feed_plugin/forms.py index 834e9a0..f16c576 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/forms.py +++ b/compte_agglo_montpellier/apps/feed_plugin/forms.py @@ -5,5 +5,5 @@ from . import models from . import widgets class FeedForm(forms.Form): - feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all, + feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all(), label=_('Your feeds'), widget=widgets.CheckboxMultipleSelect) From d3812c33842a55cdab1bd4f6152afb5a2aa365c6 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 28 Aug 2013 10:54:26 +0200 Subject: [PATCH 24/25] feed_plugin: user can choose to see no feed --- compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py | 2 ++ compte_agglo_montpellier/apps/feed_plugin/forms.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py index 403aa19..5fd0c32 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py +++ b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py @@ -28,6 +28,8 @@ class SelectUserFeedPlugin(CMSPluginBase): user = request.user submit = 'select-user-feed-plugin-%s' % instance.id if request.method == 'POST' and submit in request.POST: + import pdb + pdb.set_trace() form = forms.FeedForm(data=request.POST) if form.is_valid(): models.FeedPreference.objects.filter(user=user).delete() diff --git a/compte_agglo_montpellier/apps/feed_plugin/forms.py b/compte_agglo_montpellier/apps/feed_plugin/forms.py index f16c576..5506fd4 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/forms.py +++ b/compte_agglo_montpellier/apps/feed_plugin/forms.py @@ -6,4 +6,5 @@ from . import widgets class FeedForm(forms.Form): feeds = forms.ModelMultipleChoiceField(queryset=models.Feed.objects.all(), - label=_('Your feeds'), widget=widgets.CheckboxMultipleSelect) + label=_('Your feeds'), widget=widgets.CheckboxMultipleSelect, + required=False) From 6a71907bf706a52a1866fa445b9282cd0c069027 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 28 Aug 2013 14:16:51 +0200 Subject: [PATCH 25/25] feed_plugin: remove debugging statemens --- compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py index 5fd0c32..403aa19 100644 --- a/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py +++ b/compte_agglo_montpellier/apps/feed_plugin/cms_plugins.py @@ -28,8 +28,6 @@ class SelectUserFeedPlugin(CMSPluginBase): user = request.user submit = 'select-user-feed-plugin-%s' % instance.id if request.method == 'POST' and submit in request.POST: - import pdb - pdb.set_trace() form = forms.FeedForm(data=request.POST) if form.is_valid(): models.FeedPreference.objects.filter(user=user).delete()