common templates for authentic and combo

This commit is contained in:
Serghei Mihai 2015-03-26 18:48:41 +01:00
parent 921fbc0c4c
commit 0054222008
47 changed files with 56 additions and 202 deletions

View File

@ -21,12 +21,12 @@ build: clean
done
install:
mkdir -p $(DESTDIR)$(prefix)/share/authentic2/montpellier
mkdir -p $(DESTDIR)$(prefix)/share/portail-citoyen2/montpellier
mkdir -p $(DESTDIR)$(prefix)/share/montpellier-theme/templates
mkdir -p $(DESTDIR)$(prefix)/share/wcs/themes/montpellier2
mkdir -p $(DESTDIR)$(prefix)/share/wcs/themes/montpellier-commune
mkdir -p $(DESTDIR)$(prefix)/share/montpellier-theme/static
cp -r static/* $(DESTDIR)$(prefix)/share/montpellier-theme/static
cp -r templates/* $(DESTDIR)$(prefix)/share/montpellier-theme/templates/
cp -r idp/* $(DESTDIR)$(prefix)/share/authentic2/montpellier
cp -r portail-citoyen/* $(DESTDIR)$(prefix)/share/portail-citoyen2/montpellier
cp -ar wcs/montpellier2/* $(DESTDIR)$(prefix)/share/wcs/themes/montpellier2/

View File

@ -1,3 +0,0 @@
<div class="block">
{{ body|safe }}
</div>

View File

@ -1,2 +0,0 @@
{% load i18n sekizai_tags %}
test

View File

@ -1,151 +0,0 @@
{% load i18n sekizai_tags static blurp_tags %}
{% with demarches=agglo.data %}
{% if demarches %}
<h3 class="aq-catgr-plg-title"><a href="{{ wcs_url }}/login">Démarches de Montpellier Méditerranée Métropole</a></h3>
<ul class="aq-forms-plg-listing demarches-agglo" {% if demarches|length <= 1 %}style="-moz-column-count: 1; -webkit-column-count: 1; column-count: 1"{% endif %}>
{% for data in demarches %}
<li class="aq-forms-plg-item">
<a class="aq-forms-plg-link" href="{{ wcs_url}}/login/?ReturnUrl={{ data.url }}">{{ data.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<div class="ma_commune">
<ul class="aq-forms-plg-listing">
</ul>
</div>
<div class="aq-catgr-plg" data-empty="{% trans "Other procedures.." %}">
<h3 class="aq-catgr-plg-title">{% trans "Les démarches dans les autres communes" %}</h3>
<div class="aq-catgr-plg-selector-container">
</div>
</div>
{% addtoblock "js" %}
<script type="text/javascript">
function get_base_url(url) {
var urlArray = url.split('/');
return urlArray[0] + '//' + urlArray[2];
}
$(document).ready(function () {
var demarches = {};
var city_to_id_map = {};
var id_to_city_map = {};
{% if clapiers %}
demarches['clapiers'] = {{ clapiers.data|jsonify }};
city_to_id_map['Clapiers'] = 'clapiers';
id_to_city_map['clapiers'] = 'Clapiers';
{% endif %}
{% if laverune %}
demarches['laverune'] = {{ laverune.data|jsonify }};
city_to_id_map['Lavérune'] = 'laverune';
id_to_city_map['laverune'] = 'Lavérune';
{% endif %}
{% if vendargues %}
demarches['vendargues'] = {{ vendargues.data|jsonify }};
city_to_id_map['Vendargues'] = 'vendargues';
id_to_city_map['vendargues'] = 'Vendargues';
{% endif %}
{% if villeneuve %}
demarches['villeneuve'] = {{ villeneuve.data|jsonify }};
city_to_id_map['Villeneuve-lès-Maguelone'] = 'villeneuve';
id_to_city_map['villeneuve'] = 'Villeneuve-lès-Maguelone';
{% endif %}
{% if fabregues %}
demarches['fabregues'] = {{ fabregues.data|jsonify }};
city_to_id_map['Fabrègues'] = 'fabregues';
id_to_city_map['fabregues'] = 'Fabrègues';
{% endif %}
{% if saint_georges_dorques %}
demarches['saint-georges'] = {{ saint_georges_dorques.data|jsonify }};
city_to_id_map['Saint-Georges-d\'Orques'] = 'saint-georges';
id_to_city_map['saint-georges'] = 'Saint-Georges-d\'Orques';
{% endif %}
{% if sussargues %}
demarches['sussargues'] = {{ sussargues.data|jsonify }};
city_to_id_map['Sussargues'] = 'sussargues';
id_to_city_map['sussargues'] = 'Sussargues';
{% endif %}
{% if cournonterral %}
demarches['cournonterral'] = {{ cournonterral.data|jsonify }};
city_to_id_map['Cournonterral'] = 'cournonterral';
id_to_city_map['cournonterral'] = 'Cournonterral';
{% endif %}
{% if lattes %}
demarches['lattes'] = {{ lattes.data|jsonify }};
city_to_id_map['Lattes'] = 'lattes';
id_to_city_map['lattes'] = 'Lattes';
{% endif %}
var city = '{{ user.socialaccount_set.all.0.extra_data.ville }}';
var city_id = city_to_id_map[city];
if (demarches[city_id] != undefined && demarches[city_id].length > 0) {
var base_url = get_base_url(demarches[city_id][0].url) + '/login/';
var ma_commune = '{% trans "Démarches de ma commune : " %} <a href="'+ base_url + '">' + city + '</a>';
var h3 = '<h3 class="aq-catgr-plg-title">' + ma_commune + '</h3>';
$('.ma_commune').prepend(h3);
$.each(demarches[city_id], function(index, value) {
var li = '<li class="aq-forms-plg-item"><a class="aq-forms-plg-link" href="' + base_url + '?ReturnUrl=' + value.url + '">' + value.title + '</a><li>';
$('.ma_commune .aq-forms-plg-listing').append(li);
});
}
var $p = $('<p/>');
var $select = $('<select/>');
$select.append('<option value="">Vos Communes...</option>');
$.each(demarches, function (name, elements) {
if (name == city_id)
return;
if (elements.length == 0) return;
var $option = $('<option/>');
var id = name;
var city_name = id_to_city_map[name];
$option.text(city_name);
$option.val(id);
$select.append($option);
var $container = $('<div/>');
var $title = $('<h3/>');
var $listing = $('<ul/>');
if (elements.length <= 1)
$listing.attr('style', "-moz-column-count: 1; -webkit-column-count: 1; column-count: 1");
$listing.attr('class', 'aq-forms-plg-listing');
$container.attr({'id': id, 'class': "aq-catgr-plg-body"});
$title.attr('class', "aq-catgr-plg-title");
var base_url;
if (elements.length > 0) {
base_url = get_base_url(elements[0].url) + '/login/';
var title_link = '<a href="' + base_url + '">{% trans "Démarches de" %} ' + city_name + '</a>';
$title.append(title_link);
} else {
$title.text(name);
}
$container.append($title);
$.each(elements, function(index, elt) {
var item = '<li class="aq-forms-plg-item"><a class="aq-forms-plg-link" href="' + base_url + '?ReturnUrl=' + elt.url + '">' + elt.title + '</a><li>';
$listing.append(item);
});
$container.append($listing);
$("div.aq-catgr-plg").append($container);
$container.hide();
});
$p.append($select);
$('.aq-catgr-plg-selector-container').append($p);
// Show selected categories
var on_select_change = function(event) {
var $option = $('option:selected', event.target);
if ($option.val()) {
var id = '#' + $option.val();
$('.aq-catgr-plg .aq-catgr-plg-body').not(id).hide();
$(id).show();
} else {
$('.aq-catgr-plg .aq-catgr-plg-body').hide();
}
}
$select.bind('change', on_select_change);
});
</script>
{% endaddtoblock %}

View File

@ -1,12 +0,0 @@
{% if demarches_en_cours %}
<ul class="aq-forms-plg-listing" {% if demarches_en_cours|length <= 1 %}style="-moz-column-count: 1; -webkit-column-count: 1; column-count: 1"{% endif %}>
{% for data in demarches_en_cours %}
{% if data.url and data.title and not data.form_status_is_endpoint %}
<li class="aq-forms-plg-item">
<a class="aq-forms-plg-link"
href="{{ data.url }}">{{ data.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}

View File

@ -1,7 +1,7 @@
{% load i18n %}
<form method="post" action="." class="{% if form.non_field_errors %}form-with-errors {% endif %}">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" {% if submit_name %}name="{{ submit_name }}"{% endif %}
value="{% if submit_value %}{{ submit_value }}{% else %}{% trans 'Submit' %}{% endif %}" />

View File

@ -2,7 +2,7 @@
<div>
<form method="post" action="">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" name="{{ submit_name }}" value="{% trans "Log in" %}"/>
{% if cancel %}
<input type="submit" name="cancel" value="{% trans 'Cancel' %}"/>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
{% load i18n static sekizai_tags %}
{% load i18n static %}
<html>
<head>
<meta charset="UTF-8"><!---->
@ -9,8 +9,9 @@
<meta http-equiv="content-language" content="fr" />
<title>Compte Citoyen :: Montpellier Méditerranée Métropole :: {% block title %}{% endblock %}</title>
<link rel="shortcut icon" href="{% static "themes/django-montpellier/favicon.png" %}" />
{% render_block "css" %}
<link rel="stylesheet" type="text/css" href="{% static "themes/django-montpellier/style.css" %}" >
{% block extra_styles %}
{% endblock %}
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,700italic,400italic|Carme|Arvo' rel='stylesheet' type='text/css'>
<script src="//d3nslu0hdya83q.cloudfront.net/dist/1.0/raven.min.js"></script>
<script>
@ -19,7 +20,6 @@
{% block extra_scripts %}
{% endblock %}
{{ PIWIK_JS|safe }}
{% render_block "js" %}
</head>
<body {% block bodyargs %}{% endblock %}>
<div id="page">
@ -76,23 +76,23 @@
{% endif %}
</div>
<div id="menu">
{% block menu %}
<ul>
<li id="top-menu-accueil" class="sibling">
<a href="{{ portal_url }}">Accueil</a>
</li>
<li id="top-menu-mon-compte" class="selected">
<a href="{{ idp_url }}/accounts">Mon compte</a>
</li>
<li id="top-menu-mes-abonnements" class="sibling">
<a href="{{ portal_url }}/mes-abonnements/">Mes abonnements</a>
</li>
<li id="top-menu-aide" class="sibling">
<a href="{{ portal_url }}/aide/">Aide</a>
</li>
</ul>
{% block menu %}
{% if user.is_authenticated %}
<ul>
<li id="top-menu-accueil" class="sibling">
<a href="{{ portal_url }}">Accueil</a>
</li>
<li id="top-menu-mon-compte" class="selected">
<a href="{{ idp_url }}/accounts">Mon compte</a>
</li>
<li id="top-menu-mes-abonnements" class="sibling">
<a href="{{ portal_url }}/mes-abonnements/">Mes abonnements</a>
</li>
<li id="top-menu-aide" class="sibling">
<a href="{{ portal_url }}/aide/">Aide</a>
</li>
</ul>
{% endif %}
{% endblock %}
</div>
{% block content_header %}{% endblock %}
@ -178,6 +178,7 @@
</ul>
</div>
</div>
{% render_block "js-endpage" %}
{% block js-endpage %}
{% endblock %}
</body>
</html>

View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% load combo %}
{% block title %}{{ page.title }}{% endblock %}
{% block menu %}
{% show_menu %}
{% endblock %}
{% block content %}
{% placeholder "content" %}
{% endblock %}

View File

@ -0,0 +1,12 @@
{% extends "combo/page_template.html" %}
{% load combo %}
{% block content %}
<div id="left">
{% placeholder "left" %}
</div>
<div id="right">
{% placeholder "right" %}
</div>
<br style="clear"/>
{% endblock %}

View File

@ -22,7 +22,7 @@ lien pour valider le changement d'adresse de courriel.
<div class="right">
<form method="post" action="." class="password_change_form">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" value="{% trans 'Submit' %}" />
<button type="button" onclick="location.href = '/'">{% trans "Back" %}</button>

View File

@ -4,8 +4,6 @@ Vous avez demandé à ouvrir un compte citoyen sur le portail de Montpellier
Méditerranée Métropole ou sur le portail de votre commune, nous vous en
remercions.
Votre identifiant daccès est : {{ user.username }}
Vous pourrez utiliser ce même compte aussi bien pour vos démarches sur le
portail de Montpellier Méditerranée Métropole que sur le portail de démarches
en ligne de votre commune si celle-ci le propose.
@ -13,7 +11,7 @@ en ligne de votre commune si celle-ci le propose.
Pour confirmer la création et activer votre compte, cliquez sur le lien
suivant :
http://{{ site.domain }}{% url 'registration_activate' activation_key %}
{{ registration_url }}
Ce lien est valable pendant {{ expiration_days }} jours.

View File

@ -28,7 +28,7 @@ effet.
<div class="right">
<form method="post" action="." class="password_change_form">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" value="{% trans 'Submit' %}" />
<button type="button" onclick="location.href = '/'">{% trans "Back" %}</button>

View File

@ -31,7 +31,7 @@ nouvelle fois à l'identique.
<form method="post" action=".">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" value="{% trans 'Submit' %}" />
<button type="button" onclick="location.href = '/'">{% trans "Back" %}</button>

View File

@ -24,11 +24,10 @@ courriel vous permettant de définir un nouveau mot de passe.
</div>
<div class="right">
<form method="post" action=".">
{% csrf_token %}
{% include "form_fields.html" with form=form %}
{% include "authentic2/form_fields.html" with form=form %}
<input type="submit" value="{% trans 'Submit' %}" />
<button type="button" onclick="location.href = '/'">{% trans "Back" %}</button>

View File

@ -22,7 +22,7 @@ class="narrow-page"
</div>
<div class="right">
{% include 'form.html' with form=form %}
{% include 'authentic2/form.html' with form=form %}
</div>
<br class="clear"/>