diff --git a/MANIFEST.in b/MANIFEST.in index 6f05fa9..9a21b7b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,3 @@ -recursive-include portail_citoyen/apps/login_plugin/templates *.html -recursive-include portail_citoyen/apps/login_plugin/static *.css *.gif *.png *.js -recursive-include portail_citoyen/apps/login_plugin/locale *.po *.mo recursive-include portail_citoyen/apps/data_source_plugin/templates *.html recursive-include portail_citoyen/apps/data_source_plugin/static *.css *.gif *.png *.js recursive-include portail_citoyen/apps/data_source_plugin/locale *.po *.mo diff --git a/portail_citoyen/apps/login_plugin/__init__.py b/portail_citoyen/apps/login_plugin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/portail_citoyen/apps/login_plugin/cms_plugins.py b/portail_citoyen/apps/login_plugin/cms_plugins.py deleted file mode 100644 index ee01717..0000000 --- a/portail_citoyen/apps/login_plugin/cms_plugins.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.utils.translation import ugettext_lazy as _ -from django.contrib.auth.forms import AuthenticationForm -from django.core.urlresolvers import reverse - -from cms.plugin_base import CMSPluginBase -from cms.plugin_pool import plugin_pool -from models import LoginPlugin as LoginPluginModel - -class LoginPlugin(CMSPluginBase): - model = LoginPluginModel - name = _('Login Plugin') - render_template = "login_plugin/plugin.html" - text_enabled = False - - def render(self, context, instance, placeholdre): - context.update({ - 'form': AuthenticationForm(), - 'action': reverse('login'), - }) - return context - -plugin_pool.register_plugin(LoginPlugin) diff --git a/portail_citoyen/apps/login_plugin/locale/fr/LC_MESSAGES/django.po b/portail_citoyen/apps/login_plugin/locale/fr/LC_MESSAGES/django.po deleted file mode 100644 index d383988..0000000 --- a/portail_citoyen/apps/login_plugin/locale/fr/LC_MESSAGES/django.po +++ /dev/null @@ -1,37 +0,0 @@ -# Translation of portail-citoyen strings -# Copyright (C) 2013 Entr'ouvert -# This file is distributed under the same license as the portail-citoyen package. -# Benjamin Dauvergne , 2013. -# -msgid "" -msgstr "" -"Project-Id-Version: portail_citoyen 0.1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-19 15:11+0100\n" -"PO-Revision-Date: 2013-03-19 15:15+0100\n" -"Last-Translator: Benjamin Dauvergne \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: cms_plugins.py:11 -msgid "Login Plugin" -msgstr "Bloc de connexion" - -#: templates/login_plugin/plugin.html:27 -#, python-format -msgid "" -"\n" -"

Bonjour %(name)s !

\n" -" " -msgstr "" - -#: templates/login_plugin/plugin.html:31 -msgid "Logout" -msgstr "Déconnexion" - -#: templates/login_plugin/plugin.html:33 -msgid "Mon profil" -msgstr "" diff --git a/portail_citoyen/apps/login_plugin/models.py b/portail_citoyen/apps/login_plugin/models.py deleted file mode 100644 index 9a82f16..0000000 --- a/portail_citoyen/apps/login_plugin/models.py +++ /dev/null @@ -1,6 +0,0 @@ -from cms.models import CMSPlugin - -class LoginPlugin(CMSPlugin): - - def __unicode__(self): - return 'Login' diff --git a/portail_citoyen/apps/login_plugin/templates/login_plugin/plugin.html b/portail_citoyen/apps/login_plugin/templates/login_plugin/plugin.html deleted file mode 100644 index cb3ee8c..0000000 --- a/portail_citoyen/apps/login_plugin/templates/login_plugin/plugin.html +++ /dev/null @@ -1,27 +0,0 @@ -{% load url from future %} -{% load i18n %} -
-{% if not request.user.is_authenticated %} -
- {% csrf_token %} - - {{ form.as_p }} - - - {% if next %} - - {% endif %} -
-

Mot de passe perdu ?

- {% url 'registration_register' as registration_url %} - {% if registration_url %} -

Pas encore de compte ?

- {% endif %} -{% else %} - {% blocktrans with name=request.user %} -

Bonjour {{ name }} !

- {% endblocktrans %} - {% url 'auth_logout' as logout_url %} - {% if logout_url %}

{% trans "Logout" %}

{% endif %} -{% endif %} -
diff --git a/portail_citoyen/apps/login_plugin/tests.py b/portail_citoyen/apps/login_plugin/tests.py deleted file mode 100644 index 501deb7..0000000 --- a/portail_citoyen/apps/login_plugin/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/portail_citoyen/apps/login_plugin/views.py b/portail_citoyen/apps/login_plugin/views.py deleted file mode 100644 index 60f00ef..0000000 --- a/portail_citoyen/apps/login_plugin/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/portail_citoyen/cms_plugins.py b/portail_citoyen/cms_plugins.py index 114ed33..40a32a7 100644 --- a/portail_citoyen/cms_plugins.py +++ b/portail_citoyen/cms_plugins.py @@ -31,9 +31,9 @@ class FormPluginBase(CMSPluginBase): form_class = self.get_form_class(request, context, instance, placeholder) if issubclass(form_class, ModelForm): - if not hasattr(self, 'get_object'): + if not hasattr(self, 'get_form_instance'): raise ImproperlyConfigured('Your plugin class is missing a get_object method but use a ModelForm') - kwargs['instance'] = context['object'] = self.get_object(request, context, instance, placeholder) + kwargs['instance'] = context['object'] = self.get_form_instance(request, context, instance, placeholder) if utils.callable_has_arg(form_class.__init__, 'plugin_instance'): kwargs['plugin_instance'] = instance if utils.callable_has_arg(form_class.__init__, 'request'): @@ -66,7 +66,7 @@ class ProfileFormPlugin(FormPluginBase): module = importlib.import_module(module_path) return getattr(module, class_name) - def get_object(self, request, context, instance, placeholder): + def get_form_instance(self, request, context, instance, placeholder): return request.user plugin_pool.register_plugin(ProfileFormPlugin) diff --git a/portail_citoyen/fixtures/demo.json b/portail_citoyen/fixtures/demo.json index c63b044..6b617ef 100644 --- a/portail_citoyen/fixtures/demo.json +++ b/portail_citoyen/fixtures/demo.json @@ -4412,7 +4412,7 @@ "model": "cms.title", "fields": { "menu_title": "", - "redirect": "/mes-e-services", + "redirect": "/accueil", "meta_keywords": "", "page_title": "", "language": "fr", @@ -4435,14 +4435,14 @@ "meta_keywords": "", "page_title": "", "language": "fr", - "title": "Mes e-services", + "title": "Accueil", "has_url_overwrite": false, "application_urls": "", "creation_date": "2013-04-17T14:38:21.239Z", "page": 4, - "path": "mes-e-services", + "path": "accueil", "meta_description": "", - "slug": "mes-e-services" + "slug": "accueil" } }, { @@ -4469,7 +4469,7 @@ "model": "cms.title", "fields": { "menu_title": "", - "redirect": "/mes-e-services", + "redirect": "/accueil", "meta_keywords": "", "page_title": "", "language": "fr", @@ -4492,14 +4492,14 @@ "meta_keywords": "", "page_title": "", "language": "fr", - "title": "Mes e-services", + "title": "Accueil", "has_url_overwrite": false, "application_urls": "", "creation_date": "2013-04-17T14:38:21.239Z", "page": 7, - "path": "mes-e-services", + "path": "accueil", "meta_description": "", - "slug": "mes-e-services" + "slug": "accueil" } }, { @@ -5135,16 +5135,6 @@ "movie_url": "https://www.youtube.com/watch?v=4ria7AhD7ro" } }, -{ - "pk": 606, - "model": "login_plugin.loginplugin", - "fields": {} -}, -{ - "pk": 1289, - "model": "login_plugin.loginplugin", - "fields": {} -}, { "pk": 2, "model": "data_source_plugin.datasource", diff --git a/portail_citoyen/settings.py b/portail_citoyen/settings.py index e752b63..a8bff99 100644 --- a/portail_citoyen/settings.py +++ b/portail_citoyen/settings.py @@ -140,7 +140,6 @@ INSTALLED_APPS = ( 'cms.plugins.teaser', 'cms.plugins.video', 'cmsplugin_text_wrapper', - 'login_plugin', 'feed_plugin', 'data_source_plugin', 'a2_service_list_plugin', diff --git a/portail_citoyen/static/portail_citoyen/css/style.css b/portail_citoyen/static/portail_citoyen/css/style.css index 340459a..ee3b1b5 100644 --- a/portail_citoyen/static/portail_citoyen/css/style.css +++ b/portail_citoyen/static/portail_citoyen/css/style.css @@ -39,6 +39,8 @@ a { body { overflow-x: hidden; background: white; + max-width: 1000px; + margin: 0 auto; } div#page { @@ -49,18 +51,14 @@ div#header { background-color: #ffffff; width: 100%; margin: 0 0 0 0; - position: absolute; + position: relative; top: 0px; - margin-left: -500px; z-index: 0; } div#top { - height: 456px; - width: 1500px; margin: 0 auto 0 auto; - margin-left: 50%; } div#top h1 { @@ -85,8 +83,8 @@ div#top a img { div#main-content-wrapper { position: relative; z-index: 100; - width: 1000px; - margin: 200px auto 0px auto; + max-width: 1000px; + margin: 0px auto 0px auto; } div#main-content { @@ -98,7 +96,7 @@ div#footer { clear: both; background: white; padding: 0px; - width: 1000px; + width: 90%; margin: 10px auto 0 auto; position: relative; } @@ -367,7 +365,7 @@ div.login-actions { .region-header { - width: 1000px; + width: 100%; position: absolute; top: 0px; } @@ -992,3 +990,52 @@ p.fullname { display: inline; margin-right: 1.5em; } + +@media screen and (max-width: 760px) { + body.narrow-page div.right { + clear: none; + width: 100%; + } + #left, #right { + clear: none; + width: 100%; + } +} + +@media screen and (max-width: 490px) { + #single-title { + cursor: pointer; + } + #nav { + width: 100%; + } + #nav ul { + column-count: 2; + -webkit-column-count: 2; + } + #nav ul li { + margin-top: 0; + } + #real-content { + padding: 0; + } + #toplinks { + top: 0; + left: 0; + width: 98%; + } + +} + +@media screen and (max-width: 400px) { + div#top h1 { + padding-left: 1ex; + margin-left: 0; + } + div#welcome { + display: none; + } + h2#welcome-title { + margin: 0; + } +} diff --git a/portail_citoyen/templates/base.html b/portail_citoyen/templates/base.html index 07f0280..3a419a7 100644 --- a/portail_citoyen/templates/base.html +++ b/portail_citoyen/templates/base.html @@ -76,5 +76,24 @@ jQuery('#messages').delay(3000*(1+{{ messages|length }})).fadeOut('slow'); {% endif %} + diff --git a/tools/export_data.sh b/tools/export_data.sh index 88d28df..248dc28 100755 --- a/tools/export_data.sh +++ b/tools/export_data.sh @@ -1,5 +1,5 @@ #!/bin/sh portail-citoyen-manage dumpdata --indent=2 sites cms cms.cmsplugin cmsplugin_text_wrapper \ - file googlemap link picture snippet teaser video login_plugin data_source_plugin \ + file googlemap link picture snippet teaser video data_source_plugin \ a2_service_list_plugin feed_plugin idp attribute_aggregator > demo.json