utilise la nouvelle syntaxe pour le tag url dans tous les templates
This commit is contained in:
parent
e65a0e3be3
commit
c15706e106
|
@ -5,21 +5,21 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from django.conf import settings
|
||||
|
||||
MAIL_TEMPLATES = {
|
||||
'Alerte nouvelles annonces':
|
||||
'{% load url from future %}Alerte nouvelles annonces':
|
||||
{ 'sujet': _(u'{{ annonces|length }} nouvelles annonces vous intéressent sur {{host}}'),
|
||||
|
||||
'texte': _(u'''Les annonces suivantes correspondent à vos critères:{% for annonce in annonces %}
|
||||
- {{ host }}{% url recherche-annonce pk=annonce.id %}
|
||||
- {{ host }}{% url 'recherche-annonce' pk=annonce.id %}
|
||||
{% endfor %}
|
||||
|
||||
Pour modifier vos critères allez sur {{host}}{% url mes-alertes %} .
|
||||
Pour modifier vos critères allez sur {{host}}{% url 'mes-alertes' %} .
|
||||
''') },
|
||||
'Annonce valide':
|
||||
{ 'sujet': _(u'Votre annonce est publiée'),
|
||||
'texte': _(u'''L'annonce suivante a été validée pour publication:
|
||||
{{ annonce.type }} à {{ annonce.prix_par_mois }} € dans {{ annonce.ville }}
|
||||
|
||||
Vous pouvez la consulter sur {{host}}{% url offre %} .
|
||||
Vous pouvez la consulter sur {{host}}{% url 'offre' %} .
|
||||
''') },
|
||||
'Annonce invalide':
|
||||
{ 'sujet': _(u'Votre annonce est refusée à la publication'),
|
||||
|
@ -33,7 +33,7 @@ a été refusée à la publication pour la raison:
|
|||
{{raison}}
|
||||
===================================================
|
||||
|
||||
Vous pouvez la modifier sur {{host}}{% url editer-annonce pk=annonce.id %} .
|
||||
Vous pouvez la modifier sur {{host}}{% url 'editer-annonce' pk=annonce.id %} .
|
||||
''') },
|
||||
'Depublication automatique': {
|
||||
'sujet': _(u'''Dépublication automatique d\'une de vos \
|
||||
|
@ -45,7 +45,7 @@ annonces sur {{host}}'''),
|
|||
a été dépubliée car elle est publiée depuis plus de {{duree}} jours.
|
||||
Vous pouvez la republier en vous connectant à votre compte sur
|
||||
|
||||
{{host}}{% url editer-annonce pk=annonce.id %}''') },
|
||||
{{host}}{% url 'editer-annonce' pk=annonce.id %}''') },
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
<div id="annonce-{{annonce.id}}" class="annonce{% if annonce.etat_validation == 'publiee' %} publiee{% else %} depubliee{% endif %}">
|
||||
{% if annonce.etat_validation == 'attend_validation' %}
|
||||
<p class="alert alert-info">{% trans "En attente de validation" %}</p>
|
||||
|
@ -46,8 +47,8 @@
|
|||
{% trans "Dépublier" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<a class="btn" href="{% url editer-annonce pk=annonce.id %}">{% trans "Modifier" %}</a>
|
||||
<a class="btn btn-danger" href="{% url supprimer-annonce pk=annonce.id %}">{% trans "Supprimer" %}</a>
|
||||
<a class="btn" href="{% url 'editer-annonce' pk=annonce.id %}">{% trans "Modifier" %}</a>
|
||||
<a class="btn btn-danger" href="{% url 'supprimer-annonce' pk=annonce.id %}">{% trans "Supprimer" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{% extends "appli_socle/osm_base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load fiber_tags %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block body-class %}{{ block.super }} offre{% endblock %}
|
||||
|
||||
|
@ -13,20 +12,20 @@
|
|||
{% show_content "intro-aside-left" %}
|
||||
<hr/>
|
||||
<ul>
|
||||
{% url creer-annonce as the_url %}
|
||||
{% url 'creer-annonce' as the_url %}
|
||||
<li class="menu{% if request.path == the_url %} current{% endif %}"><a href="{{ the_url }}">{% trans "Créer une nouvelle annonce" %}</a></p>
|
||||
</ul>
|
||||
</div>
|
||||
<hr/>
|
||||
<ul>
|
||||
{% url offre as the_url %}
|
||||
{% url 'offre' as the_url %}
|
||||
<li class="menu{% if request.path == the_url %} current{% endif %}"><h3><a href="{{ the_url }}">{% trans "Mes offres" %}</a></h3></li>
|
||||
<li><ul>
|
||||
{% for annonce in annonces_publiees|slice:":30" %}
|
||||
{% if forloop.first %}
|
||||
<li class="menu"><h5>publiées</h5></li>
|
||||
{% endif %}
|
||||
<li class="logement"><a href="{% url offre %}#annonce-{{ annonce.id }}">
|
||||
<li class="logement"><a href="{% url 'offre' %}#annonce-{{ annonce.id }}">
|
||||
{{ annonce.type }} à {{ annonce.prix_par_mois }} € à {{ annonce.ville }}
|
||||
</a>
|
||||
</li>
|
||||
|
@ -35,7 +34,7 @@
|
|||
{% if forloop.first %}
|
||||
<li class="menu"><h5>non publiées</h5></li>
|
||||
{% endif %}
|
||||
<li class="logement"><a href="{% url offre %}#annonce-{{ annonce.id }}">
|
||||
<li class="logement"><a href="{% url 'offre' %}#annonce-{{ annonce.id }}">
|
||||
{{ annonce.type }} à {{ annonce.prix_par_mois }} € à {{ annonce.ville }}
|
||||
</a>
|
||||
</li>
|
||||
|
@ -45,14 +44,14 @@
|
|||
<hr/>
|
||||
<ul>
|
||||
<h3 class="menu">Gérer mon compte</h3>
|
||||
{% url mes-alertes-offre as the_url %}
|
||||
{% url 'mes-alertes-offre' as the_url %}
|
||||
<li><ul>
|
||||
<li class="menu{% if request.path == the_url %}current{% endif %}"><a href="{{ the_url }}">{% trans "Modifier mes alertes" %}</a></li>
|
||||
{% url mon-email as the_url %}
|
||||
{% url 'mon-email' as the_url %}
|
||||
<li class="menu{% if request.path == the_url %}current{% endif %}"><a href="{{ the_url }}">{% trans "Modifier mon email" %}</a></li>
|
||||
{% url changement-mot-de-passe as the_url %}
|
||||
{% url 'changement-mot-de-passe' as the_url %}
|
||||
<li class="menu{% if request.path == the_url %}current{% endif %}"><a href="{{ the_url }}">{% trans "Modifier mon mot de passe" %}</a></li>
|
||||
{% url supprimer-compte as the_url %}
|
||||
{% url 'supprimer-compte' as the_url %}
|
||||
<li class="menu{% if request.path == the_url %}current{% endif %}"><a href="{{ the_url }}">{% trans "Supprimer mon compte" %}</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{% load i18n %}
|
||||
{% load fiber_tags %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block aside-left %}
|
||||
{% show_page_content "aside-left" %}
|
||||
|
@ -11,8 +12,8 @@
|
|||
{% crispy form %}
|
||||
{% show_page_content "after-form" %}
|
||||
<div id="autre-liens">
|
||||
<p><a href="{% url inscription %}?next={% url offre %}">{% trans "Vous êtes propriétaire ? Inscrivez-vous !" %}</a></p>
|
||||
<p><a href="{% url mot-de-passe-perdu '' %}">{% trans "J'ai perdu mon mot de passe..." %}</a></p>
|
||||
<p><a href="{% url 'inscription' %}?next={% url 'offre' %}">{% trans "Vous êtes propriétaire ? Inscrivez-vous !" %}</a></p>
|
||||
<p><a href="{% url 'mot-de-passe-perdu' '' %}">{% trans "J'ai perdu mon mot de passe..." %}</a></p>
|
||||
</div>
|
||||
{% show_page_content "after-text" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% block extrastyle %}
|
||||
{% load url from future %}
|
||||
{% load static %}
|
||||
<style type="text/css">
|
||||
#{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
<div class="annonce" id="annonce-{{ annonce.id }}">
|
||||
<div>
|
||||
<div class="titre"><a href="{% url recherche-annonce pk=annonce.id %}"><span class="type-de-logement">{{ annonce.type }}</span><span class="surface"> de {{ annonce.surface_en_m2 }} m²</span> <span class="ville">à {{ annonce.ville }}</span></a></div>
|
||||
<div class="titre"><a href="{% url 'recherche-annonce' pk=annonce.id %}"><span class="type-de-logement">{{ annonce.type }}</span><span class="surface"> de {{ annonce.surface_en_m2 }} m²</span> <span class="ville">à {{ annonce.ville }}</span></a></div>
|
||||
<div class="photo">
|
||||
{% if annonce.photo %}
|
||||
<img class="photo" src="{{ MEDIA_URL }}/{{ annonce.photo }}"/>
|
||||
|
@ -33,7 +34,7 @@
|
|||
{% if annonce.proprietaire.url_de_contact %}
|
||||
<a class="btn" target="_blank" href="{{ annonce.proprietaire.url_de_contact }}">{% trans "Contact" %}</a>
|
||||
{% else %}
|
||||
<a class="btn" href="{% url annonce-contact pk=annonce.id %}">{% trans "Contact" %}</a>
|
||||
<a class="btn" href="{% url 'annonce-contact' pk=annonce.id %}">{% trans "Contact" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "appli_socle/osm_base.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load fiber_tags %}
|
||||
|
@ -25,7 +26,7 @@
|
|||
<hr/>
|
||||
<div id="menu-recherche">
|
||||
<ul>
|
||||
{% url recherche as the_url %}
|
||||
{% url 'recherche' as the_url %}
|
||||
<li class="menu{% if the_url == request.path %} current{% endif %}"><a href="{{ the_url }}">Consulter les annonces</a></li>
|
||||
</ul>
|
||||
{% show_menu "visibles" 2 2 "" %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "appli_recherche/base.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block body %}
|
||||
|
|
|
@ -270,9 +270,9 @@ class Contact(ProfilRechercheView, SingleObjectMixin, FormView):
|
|||
message = variables['message'] = textwrap.fill(form.cleaned_data['message'], 70)
|
||||
variables['base_url'] = self.request.build_absolute_uri('/')
|
||||
sujet_par_defaut = '''Demande de contact une annonce publiée sur {{host}}'''
|
||||
texte_par_defaut = '''Vous recevez ce mail car votre annonce:
|
||||
texte_par_defaut = '''{% load url from future %}Vous recevez ce mail car votre annonce:
|
||||
|
||||
{{ base_url }}{% url editer-annonce pk=annonce.id %}
|
||||
{{ base_url }}{% url 'editer-annonce' pk=annonce.id %}
|
||||
|
||||
a attiré l'attention d'un étudiant ou d'un chercheur de l'université Paris
|
||||
Dauphine. Voici son messages de contact:
|
||||
|
|
|
@ -113,8 +113,8 @@ class AuthentificationHomepageForm(forms.Form):
|
|||
Fieldset(_(u"Je suis propriétaire, j'accède à mon compte"),
|
||||
Field('identifiant'),
|
||||
Field('mot_de_passe'),
|
||||
HTML(u'''{% load i18n %}<p id="inscrivez-vous"><a href="{% url inscription %}?next=/offre">{% trans "Vous êtes propriétaire ? Inscrivez-vous !" %}</a></p>'''),
|
||||
HTML(u'''{% load i18n %}<p id="perdu-mot-de-passe"><a href="{% url mot-de-passe-perdu '' %}">{% trans "J'ai perdu mon mot de passe..." %}</a></p>'''),
|
||||
HTML(u'''{% load url from future %}{% load i18n %}<p id="inscrivez-vous"><a href="{% url 'inscription' %}?next=/offre">{% trans "Vous êtes propriétaire ? Inscrivez-vous !" %}</a></p>'''),
|
||||
HTML(u'''{% load url from future %}{% load i18n %}<p id="perdu-mot-de-passe"><a href="{% url 'mot-de-passe-perdu' '' %}">{% trans "J'ai perdu mon mot de passe..." %}</a></p>'''),
|
||||
ButtonHolder(
|
||||
Submit('connexion-offre', _(u'Me connecter')))))
|
||||
helper.form_class = 'form-horizontal'
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url admin:index %}">{% trans 'Home' %}</a>
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› Envoyer un mail en masse aux propriétaires intéressés
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>Cet email sera envoyé à <a href="{% url admin:appli_socle_profiloffre_changelist %}?accepte_notif_alertes__exact=1">l'ensemble des propriétaire ayant accepté de recevoir des alertes (opt-in).</a></p>
|
||||
<p>Cet email sera envoyé à <a href="{% url 'admin:appli_socle_profiloffre_changelist' %}?accepte_notif_alertes__exact=1">l'ensemble des propriétaire ayant accepté de recevoir des alertes (opt-in).</a></p>
|
||||
{% crispy form %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url admin:index %}">{% trans 'Home' %}</a>
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› Paramètres
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% load url from future %}
|
||||
{% block onload %}window.location.href = '/'{% endblock %}
|
||||
{% block page %}
|
||||
<h1>Déconnexion en cours...</h1>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% block extrastyle %}
|
||||
{% load url from future %}
|
||||
{% load static %}
|
||||
<style type="text/css">
|
||||
#{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{% extends "admin/index.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n admin_static %}
|
||||
|
||||
{% if not is_popup %}
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url admin:index %}">{% trans 'Home' %}</a>
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
›
|
||||
{% for app in app_list %}
|
||||
{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n admin_modify admin_static %}
|
||||
{% load admin_urls %}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load url from future %}
|
||||
{% load i18n admin_static %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% load url from future %}
|
||||
{% load fiber_tags %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
|
@ -32,7 +33,7 @@
|
|||
{% endblock %}
|
||||
<div id="connexion-etudiant">
|
||||
<p id="lien-connexion-etudiant"><a class="btn" href="/presentation/mmo-tudiants/">{% trans "Je suis étudiant, je me connecte" %}</a></p>
|
||||
<form id="connexion-etudiant-form" action="{% url recherche-connexion %}?next={% url recherche %}" method="post">
|
||||
<form id="connexion-etudiant-form" action="{% url 'recherche-connexion' %}?next={% url 'recherche' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<span id="bouton-connexion">{% blocktrans %}Pour consulter les annonces merci d'utiliser vos identifiants ENT.{% endblocktrans %}</span>
|
||||
<button name="compte-ent">OK</button>
|
||||
|
@ -42,7 +43,7 @@
|
|||
<p id="lien-connexion-proprietaire">
|
||||
<a class="btn" href="/presentation/mmo-propritaires/">{% blocktrans %}Je suis propriétaire, j'accède à mon compte{% endblocktrans %}</a>
|
||||
</p>
|
||||
<form id="connexion-proprietaire-form" action="{% url offre-connexion %}?next={% url offre %}" method="post">
|
||||
<form id="connexion-proprietaire-form" action="{% url 'offre-connexion' %}?next={% url 'offre' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="gauche">
|
||||
<label><span>{% trans "Email" %}</span> <input type="text" name="identifiant" placeholder="{% trans "Email" %}"/></label>
|
||||
|
@ -50,12 +51,12 @@
|
|||
</div>
|
||||
<div class="droite">
|
||||
<button name="connexion-offre">OK</button>
|
||||
<div id="aide-mot-de-passe-perdu"><a href="{% url mot-de-passe-perdu email='' %}">J'ai perdu mon mot de passe</a></div>
|
||||
<div id="aide-mot-de-passe-perdu"><a href="{% url 'mot-de-passe-perdu' email='' %}">J'ai perdu mon mot de passe</a></div>
|
||||
</div>
|
||||
</form>
|
||||
<p id="inscription-proprietaire">
|
||||
{% blocktrans %}Vous êtes propriétaire et n'avez pas encore de compte ? {% endblocktrans %}
|
||||
<a href="{% url inscription %}">{% trans "Inscrivez-vous ici." %}</a>
|
||||
<a href="{% url 'inscription' %}">{% trans "Inscrivez-vous ici." %}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -66,13 +67,13 @@
|
|||
{% elif user.is_profilrecherche %}
|
||||
<h3>Merci de vous être inscrit sur notre site. Vous êtes actuellement connecté au site dauphine logement.</h3>
|
||||
<ul>
|
||||
<li><a href="{% url recherche %}">{% trans "Consulter les offres" %}</a></li>
|
||||
<li><a href="{% url mes-annonces %}">{% trans "Mes offres" %}</a></li>
|
||||
<li><a href="{% url mes-alertes %}">{% trans "Mes alertes" %}</a></li>
|
||||
<li><a href="{% url 'recherche' %}">{% trans "Consulter les offres" %}</a></li>
|
||||
<li><a href="{% url 'mes-annonces' %}">{% trans "Mes offres" %}</a></li>
|
||||
<li><a href="{% url 'mes-alertes' %}">{% trans "Mes alertes" %}</a></li>
|
||||
</ul>
|
||||
{% elif user.is_profiloffre %}
|
||||
<h3>Merci de vous être inscrit sur notre site. Vous êtes actuellement connecté au site dauphine logement.</h3>
|
||||
<p><a href="{% url offre %}">Gérer mes annonces et mon compte</a></p>
|
||||
<p><a href="{% url 'offre' %}">Gérer mes annonces et mon compte</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -87,7 +88,7 @@
|
|||
<h2>Nos logements</h2>
|
||||
{% cache 120 homepage_annonces %}
|
||||
{% for annonce in annonces %}
|
||||
<p><strong><a href="{% url recherche-annonce pk=annonce.id %}">{% blocktrans with type=annonce.type surface=annonce.surface_en_m2 ville=annonce.ville %}
|
||||
<p><strong><a href="{% url 'recherche-annonce' pk=annonce.id %}">{% blocktrans with type=annonce.type surface=annonce.surface_en_m2 ville=annonce.ville %}
|
||||
{{ type }} de {{ surface }} m² à {{ ville }}{% endblocktrans %}</a></strong>
|
||||
{% include "appli_socle/petite_carte.html" %}
|
||||
</p>
|
||||
|
|
Reference in New Issue