Projet

Général

Profil

0001-themes-easily-move-the-user-info-block-52275.patch

Voir les différences:

Subject: [PATCH] themes: easily move the user-info block (#52275)

* add block 'header-content'
* add block 'top-links'
* move user-info code in own file
 templates/combo/page_template.html | 19 ++-----------------
 templates/includes/user-info.html  | 24 ++++++++++++++++++++++++
 templates/theme.html               | 17 +++++------------
 3 files changed, 31 insertions(+), 29 deletions(-)
 create mode 100644 templates/includes/user-info.html
templates/combo/page_template.html
134 134
  {% placeholder "footer" acquired=True name=name %}
135 135
{% endblock %}
136 136

  
137
{% block user-info %}
138
{% skeleton_extra_placeholder user-info %}
139
          {% if user.is_authenticated %}
140
          <span class="logged-in">
141
            {% if idp_account_url %}<a class="account-link" href="{{idp_account_url}}">{% endif %}
142
            <span class="connected-user">{% block user-info-user-name %}{{user.first_name}} {{user.last_name}}{% endblock %}</span>{% if idp_account_url %}</a>{% endif %}
143
            <a accesskey="o" class="logout" href="{% url 'auth_logout' %}">{% block user-info-logout-label %}Déconnexion{% endblock %}</a>
144
          </span>
145
          {% else %}
146
            <span class="login"><a accesskey="2" class="login-link" href="{% url 'auth_login' %}"
147
              >{% block user-info-login-label %}Connexion{% endblock %}
148
              {% if idp_registration_url and include_registration_link != False %}</a>{% endif %}
149
              <span class="sep">/</span>
150
              {% if idp_registration_url and include_registration_link != False %}<a class="registration" href="{{idp_registration_url}}"
151
              >{% block user-info-registration-label %}Inscription{% endblock %}{% endif %}</a></span>
152
          {% endif %}
153
{% end_skeleton_extra_placeholder %}
137
{% block top-links %}
138
  {% include 'includes/user-info.html' %}
154 139
{% endblock %}
155 140

  
156 141
{% block back-top %}
templates/includes/user-info.html
1
{% load combo %}
2

  
3
{% if include_top_links != False %}
4
<div id="toplinks">
5
{% block user-info %}
6
{% skeleton_extra_placeholder user-info %}
7
  {% if user.is_authenticated %}
8
  <span class="logged-in">
9
    {% if idp_account_url %}<a class="account-link" href="{{idp_account_url}}">{% endif %}
10
    <span class="connected-user">{% block user-info-user-name %}{{user.first_name}} {{user.last_name}}{% endblock %}</span>{% if idp_account_url %}</a>{% endif %}
11
    <a accesskey="o" class="logout" href="{% url 'auth_logout' %}">{% block user-info-logout-label %}Déconnexion{% endblock %}</a>
12
  </span>
13
  {% else %}
14
    <span class="login"><a accesskey="2" class="login-link" href="{% url 'auth_login' %}"
15
      >{% block user-info-login-label %}Connexion{% endblock %}
16
      {% if idp_registration_url and include_registration_link != False %}</a>{% endif %}
17
      <span class="sep">/</span>
18
      {% if idp_registration_url and include_registration_link != False %}<a class="registration" href="{{idp_registration_url}}"
19
      >{% block user-info-registration-label %}Inscription{% endblock %}{% endif %}</a></span>
20
  {% endif %}
21
{% end_skeleton_extra_placeholder %}
22
{% endblock %}
23
</div>
24
{% endif %}
templates/theme.html
60 60
       {% block header-title %}
61 61
       <h1 id="logo"><a accesskey="1" href="{% firstof logo_link_url portal_url '/' %}">{% firstof global_title site_title "Compte Citoyen" %}</a></h1>
62 62
       {% endblock %}
63
       {% if include_top_links != False %}
64
        <div id="toplinks">
65
          {% block user-info %}
66
          {% if user.is_authenticated %}
67
          <span class="logged-in">
68
            <span class="connected-user">{{user.first_name}} {{user.last_name}}</span>
69
            <a class="logout" href="{% url 'auth_logout' %}">D&eacute;connexion</a>
70
          </span>
71
          {% endif %}
72
          {% endblock %}
73
        </div> <!-- toplinks -->
74
        {% endif %}
63

  
64
       {% block header-content %}
65
         {% block top-links %}
66
         {% endblock %}
67
       {% endblock %}
75 68
     </div>
76 69
     {% block header-bottom %}{% endblock %}
77 70
    </div> <!-- header -->
78
-