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  | 22 ++++++++++++++++++++++
 templates/theme.html               | 17 +++++------------
 3 files changed, 29 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
{% if include_top_links != False %}
2
<div id="toplinks">
3
{% block user-info %}
4
{% skeleton_extra_placeholder user-info %}
5
  {% if user.is_authenticated %}
6
  <span class="logged-in">
7
    {% if idp_account_url %}<a class="account-link" href="{{idp_account_url}}">{% endif %}
8
    <span class="connected-user">{% block user-info-user-name %}{{user.first_name}} {{user.last_name}}{% endblock %}</span>{% if idp_account_url %}</a>{% endif %}
9
    <a accesskey="o" class="logout" href="{% url 'auth_logout' %}">{% block user-info-logout-label %}Déconnexion{% endblock %}</a>
10
  </span>
11
  {% else %}
12
    <span class="login"><a accesskey="2" class="login-link" href="{% url 'auth_login' %}"
13
      >{% block user-info-login-label %}Connexion{% endblock %}
14
      {% if idp_registration_url and include_registration_link != False %}</a>{% endif %}
15
      <span class="sep">/</span>
16
      {% if idp_registration_url and include_registration_link != False %}<a class="registration" href="{{idp_registration_url}}"
17
      >{% block user-info-registration-label %}Inscription{% endblock %}{% endif %}</a></span>
18
  {% endif %}
19
{% end_skeleton_extra_placeholder %}
20
{% endblock %}
21
</div>
22
{% 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
-