generate breadcrumb (#7443)
This commit is contained in:
parent
b977caf970
commit
da31d76c59
23
template.py
23
template.py
|
@ -67,8 +67,31 @@ class RemoteTemplate(object):
|
|||
[end]
|
||||
"""
|
||||
|
||||
custom_breadcrumb = ''
|
||||
from quixote import get_response, get_publisher
|
||||
from quixote.html import htmlescape
|
||||
response = get_response()
|
||||
if hasattr(response, 'breadcrumb') and response.breadcrumb:
|
||||
s = []
|
||||
path = get_publisher().get_application_static_files_root_url()
|
||||
for i, (component, label) in enumerate(response.breadcrumb[1:]):
|
||||
if component.startswith('http:') or component.startswith('https:'):
|
||||
s.append('<li><a href="%s">%s</a></li>' % (component, label))
|
||||
continue
|
||||
if type(label) is str:
|
||||
label = htmlescape(label)
|
||||
if i == len(response.breadcrumb)-2: # last
|
||||
s.append('<li class="active">%s</li>' % label)
|
||||
else:
|
||||
s.append('<li><a href="%s%s">%s</a></li>' % (path, component, label))
|
||||
path += component
|
||||
custom_breadcrumb = ' '.join(s)
|
||||
|
||||
template_content = r.text.encode('utf-8')
|
||||
template_content = template_content.replace('[if-any content][content][end]', body)
|
||||
template_content = template_content.replace(
|
||||
'[if-any breadcrumb-elements][breadcrumb-elements][end]',
|
||||
custom_breadcrumb)
|
||||
template_content = template_content.replace('[if-any extra-top-head][extra-top-head][end]', extra_top_head)
|
||||
template_content = template_content.replace('[if-any extra-head][extra-head][end]', extra_head)
|
||||
template_content = template_content.replace('[if-any left-menu-links][left-menu-links][end]', left_menu_links)
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
{% trans "Log in" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Connexion</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li class="active">Connexion</li>
|
||||
</ol>
|
||||
<div id="left">
|
||||
<div class="block">
|
||||
<div id="tabs">
|
||||
|
|
|
@ -31,6 +31,15 @@ class="page-{{ page.slug }}"
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
{% for one_page in pages %}
|
||||
{% if not forloop.last %}
|
||||
<li><a href={{one_page.get_online_url}}">{{one_page.title}}</a></li>
|
||||
{% else %}
|
||||
<li class="active">{{one_page.title}}</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% block combo-content %}
|
||||
{% block page-content %}
|
||||
{% placeholder "content" %}
|
||||
|
|
|
@ -10,3 +10,20 @@
|
|||
{% skeleton_extra_placeholder left-menu-links %}
|
||||
{% end_skeleton_extra_placeholder %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
{% for one_page in pages %}
|
||||
{% if not forloop.last %}
|
||||
<li><a href="{{site_base}}{{one_page.get_online_url}}">{{one_page.title}}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% skeleton_extra_placeholder breadcrumb-elements %}
|
||||
{% end_skeleton_extra_placeholder %}
|
||||
</ol>
|
||||
{% block combo-content %}
|
||||
{% block page-content %}
|
||||
{% placeholder "content" %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
{% trans "Authentic - Account Management" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Mon compte</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li class="active">Mon compte</li>
|
||||
</ol>
|
||||
<h2>{% trans "Account Management" %}</h2>
|
||||
<h3>{% trans "Profile" %}</h3>
|
||||
<div id="profile">
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
{% block title %}{% trans "Create profile" %}{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Modifier mon compte</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li><a href="{{idp_url}}/accounts/">Mon compte</a></li>
|
||||
<li class="active">Modifier mon compte</li>
|
||||
</ol>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
{% block title %}{% trans "Email change" %}{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Changement d'email</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li class="active">Changement d'email</li>
|
||||
</ol>
|
||||
<p class="infonotice">{% blocktrans with email=user.email %}Your current email is {{ email }}{% endblocktrans %}</p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
{% trans "Delete account" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Suppression de compte</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{ portal_url }}">Démarches en ligne</a></li>
|
||||
<li class="active">Suppression de compte</li>
|
||||
</ol>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<p>{% trans "Delete my account and all my personal datas ?" %}</p>
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
{% extends "authentic2/base-page.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li class="active">Changement de mot de passe</li>
|
||||
</ol>
|
||||
|
||||
{% block title %}
|
||||
{% trans "Changing password" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Changement de mot de passe</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Changing password" %}</h2>
|
||||
|
||||
|
|
|
@ -5,17 +5,11 @@
|
|||
{% trans "Registration" %}
|
||||
{% endblock %}
|
||||
|
||||
{% load breadcrumbs %}
|
||||
{% block breadcrumbs %}
|
||||
{{ block.super }}
|
||||
{% breadcrumb_url 'Register' %}
|
||||
{% block breadcrumb-elements %}
|
||||
<li class="active">Enregistrement</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<ol class="box-breadcrumb breadcrumb">
|
||||
<li><a href="{{wcs_url}}">Démarches en ligne</a></li>
|
||||
<li class="active">Enregistrement</li>
|
||||
</ol>
|
||||
<h2>{% trans "Registration" %}</h2>
|
||||
|
||||
<form method="post" action=".">
|
||||
|
|
Reference in New Issue