Projet

Général

Profil

0001-templates-divide-bodyargs-into-bodyclasses-and-bodya.patch

Frédéric Péters, 30 juillet 2017 13:03

Télécharger (10,7 ko)

Voir les différences:

Subject: [PATCH] templates: divide bodyargs into bodyclasses and bodyattrs
 (#17843)

 templates/combo/page_template.html                        | 15 +++++++++------
 templates/fargo/base_iframe.html                          |  2 +-
 templates/theme.html                                      |  2 +-
 templates/variants/alfortville/prepare-template.py        |  2 +-
 .../hautes-alpes/combo/page_template_commune.html         |  2 +-
 templates/variants/minint/theme.html                      |  2 +-
 templates/variants/montpellier/theme.html                 |  2 +-
 templates/variants/nancy-2017/prepare-template.py         |  2 +-
 templates/variants/nancy-2017/theme.html                  |  4 ++--
 9 files changed, 18 insertions(+), 15 deletions(-)
templates/combo/page_template.html
19 19
{% end_skeleton_extra_placeholder %}
20 20
{% endblock %}
21 21

  
22
{% block bodyargs %}
23
class="page-{{ page.slug }} {% if pages %}section-{{pages.0.slug}}{% endif %}
24
{% skeleton_extra_placeholder extra-body-class %}
25
{% end_skeleton_extra_placeholder %}"
26
{% skeleton_extra_placeholder extra-body-args %}
27
{% end_skeleton_extra_placeholder %}
22
{% block bodyattrs %}
28 23
data-api-root="{{ site_base }}/api/"
29 24
{% if check_badges %}data-check-badges="true"{% endif %}
25
{% skeleton_extra_placeholder extra-body-args %}
26
{% end_skeleton_extra_placeholder %}
27
{% endblock %}
28

  
29
{% block bodyclasses %}
30
page-{{ page.slug }} {% if pages %}section-{{pages.0.slug}}{% endif %}
31
{% skeleton_extra_placeholder extra-body-class %}
32
{% end_skeleton_extra_placeholder %}
30 33
{% endblock %}
31 34

  
32 35
{% block title %} - {% if render_skeleton %}{% skeleton_extra_placeholder title %}{{ site_title }}{% end_skeleton_extra_placeholder %}{% else %}{{page.title}}{% endif %}{% endblock %}
templates/fargo/base_iframe.html
11 11
    {% block extra_head %}
12 12
    {% endblock %}
13 13
  </head>
14
  <body {% block bodyargs %}{% endblock %}>
14
  <body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
15 15
    {% block content %}
16 16
    {% endblock %}
17 17
  </body>
templates/theme.html
26 26
    {% block extra_scripts %}
27 27
    {% endblock %}
28 28
  </head>
29
  <body {% block bodyargs %}{% endblock %}>
29
  <body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
30 30
   <div id="nav-skip">
31 31
    <div>
32 32
     <a href="#main-content">Aller au contenu</a>
templates/variants/alfortville/prepare-template.py
38 38
    </head>''')
39 39

  
40 40
content = re.sub('<body(.*?)>',
41
        r'<body\1 {% block bodyargs %}{% endblock %}>',
41
        r'<body\1 {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>',
42 42
        content)
43 43

  
44 44
content = content.replace('>Compte citoyen<', '>{{ site_title }}<')
templates/variants/hautes-alpes/combo/page_template_commune.html
1 1
{% extends "combo/page_template.html" %}
2 2
{% load combo %}
3 3

  
4
{% block bodyargs %}class="template-commune"{% endblock %}
4
{% block bodyclasses %}template-commune{% endblock %}
5 5

  
6 6
{% block header-title %}
7 7
<div id="header-logo">
templates/variants/minint/theme.html
74 74
  
75 75
</head>
76 76

  
77
<body {% block bodyargs %}{% endblock %}>
77
<body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
78 78

  
79 79
<noscript>
80 80
  <p class="text-center text-danger">Javascript est désactivé dans votre navigateur.</p>
templates/variants/montpellier/theme.html
27 27
    {% endblock %}
28 28
    {{ PIWIK_JS|safe }}
29 29
  </head>
30
  <body {% block bodyargs %}{% endblock %}>
30
  <body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
31 31
   <div id="nav-skip">
32 32
    <div>
33 33
     <a href="#main-content">Aller au contenu</a>
templates/variants/nancy-2017/prepare-template.py
48 48
            'href="{{site_base}}%s" class="tooltip" data-tooltip="%s' % (url, label))
49 49

  
50 50
content = re.sub('<body(.*?)>',
51
        r'<body {% block bodyargs %}{% endblock %}>',
51
        r'<body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>',
52 52
        content)
53 53

  
54 54
content = content.replace('@@CONTENT@@',
templates/variants/nancy-2017/theme.html
33 33
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
34 34
<![endif]-->
35 35
    </head>
36
<body {% block bodyargs %}{% endblock %}>
36
<body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
37 37
  <div id="page" class="page">
38 38
    <header id="header" class="header" role="banner">
39 39
      <div class="connexion">
......
186 186
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol viewBox="0 0 512 512" id="check-1"><path d="M503 127l-46-45c-12-12-32-12-45 0L195 308l-82-82c-12-13-33-13-45 0l-45 45c-13 12-13 33 0 45l150 150c12 13 32 13 45 0l68-68 217-225c6-7 9-15 9-23s-3-16-9-23z"/></symbol><symbol viewBox="0 0 512 512" id="envelope-1"><path d="M475 430V210c-6 7-12 13-19 19-51 39-92 72-122 97-10 8-18 14-24 19-6 4-14 9-24 14-11 4-21 7-30 7s-19-3-30-7c-10-5-18-10-24-14-6-5-14-11-24-19-30-25-71-58-122-97-7-6-13-12-19-19v220c0 2 0 4 2 6s4 3 7 3h420c3 0 5-1 7-3s2-4 2-6zm0-301v-10l-1-4-1-2-3-3H46c-3 0-5 1-7 2-2 2-2 4-2 7 0 32 14 59 42 81 36 29 75 59 114 91 1 1 5 3 10 8 6 5 10 8 13 11 4 2 8 5 13 9 5 3 10 6 14 8 5 1 9 2 13 2s8-1 13-2c4-2 9-5 14-8 5-4 9-7 13-9 3-3 7-6 13-11 5-5 9-7 10-8 39-32 78-62 114-91 11-8 20-19 29-33s13-26 13-38zm37-10v311c0 12-4 23-13 32s-20 13-33 13H46c-13 0-24-4-33-13S0 442 0 430V119c0-13 4-23 13-32s20-14 33-14h420c13 0 24 5 33 14s13 19 13 32z"/></symbol><symbol viewBox="0 0 16 16" id="hamburger"><path class="cbar" d="M0 6h16v4H0z"/><path class="cbar" d="M0 6h16v4H0z"/><path class="cbar" d="M0 6h16v4H0z"/></symbol><symbol viewBox="0 0 512 512" id="magnifying-glass"><path d="M501 433l-88-88c22-35 35-77 35-121C448 100 348 0 224 0S0 100 0 224s100 224 224 224c44 0 86-13 121-35l88 88c6 6 16 6 22 0l46-46c6-6 6-16 0-22zm-277-49c-88 0-160-72-160-160S136 64 224 64s160 72 160 160-72 160-160 160z"/></symbol><symbol viewBox="0 0 512 512" id="pdf-1"><g transform="matrix(.92726 0 0 .92726 .632 .632)"><path d="M160.381 282.225c0-14.832-10.299-23.684-28.474-23.684-7.414 0-12.437.715-15.071 1.432V307.6c3.114.707 6.942.949 12.192.949 19.391 0 31.353-9.809 31.353-26.324zM272.875 259.019c-8.145 0-13.397.717-16.519 1.435v105.523c3.116.729 8.142.729 12.69.729 33.017.231 54.554-17.946 54.554-56.474.242-33.513-19.385-51.213-50.725-51.213z"/><path d="M488.426 197.019H475.2v-63.816c0-.398-.063-.799-.116-1.202-.021-2.534-.827-5.023-2.562-6.995L366.325 3.694c-.032-.031-.063-.042-.085-.076-.633-.707-1.371-1.295-2.151-1.804a9.495 9.495 0 0 0-.706-.419 11.131 11.131 0 0 0-2.131-.896c-.2-.056-.38-.138-.58-.19A10.774 10.774 0 0 0 358.193 0H97.2C85.282 0 75.6 9.693 75.6 21.601v175.413H62.377c-17.049 0-30.873 13.818-30.873 30.873v160.545c0 17.043 13.824 30.87 30.873 30.87h13.224V529.2c0 11.907 9.682 21.601 21.6 21.601h356.4c11.907 0 21.6-9.693 21.6-21.601V419.302h13.226c17.044 0 30.871-13.827 30.871-30.87v-160.54c-.001-17.054-13.828-30.873-30.872-30.873zM97.2 21.605h250.193v110.513c0 5.967 4.841 10.8 10.8 10.8H453.6v54.108H97.2V21.605zm265.159 287.418c0 30.876-11.243 52.165-26.82 65.333-16.971 14.117-42.82 20.814-74.396 20.814-18.9 0-32.297-1.197-41.401-2.389V234.365c13.399-2.149 30.878-3.346 49.304-3.346 30.612 0 50.478 5.508 66.039 17.226 16.743 12.445 27.274 32.302 27.274 60.778zM80.7 393.499V234.365c11.241-1.904 27.042-3.346 49.296-3.346 22.491 0 38.527 4.308 49.291 12.928 10.292 8.131 17.215 21.534 17.215 37.328 0 15.799-5.25 29.198-14.829 38.285-12.442 11.728-30.865 16.996-52.407 16.996-4.778 0-9.1-.243-12.435-.723v57.67H80.7v-.004zm372.901 129.854H97.2V419.302h356.4v104.051zm31.297-261.226h-61.989v36.851h57.913v29.674h-57.913V393.5h-36.593V232.216h98.582v29.911z"/></g></symbol><symbol viewBox="0 0 512 512" id="print-1"><path d="M128 439h256v-73H128zm0-183h256V146h-46c-7 0-14-2-19-8-5-5-8-12-8-19V73H128zm329 18c0-5-2-9-5-13-4-3-8-5-13-5s-9 2-13 5c-4 4-5 8-5 13s1 10 5 13c4 4 8 6 13 6s9-2 13-6c3-3 5-8 5-13zm37 0v119c0 3-1 5-3 7-2 1-4 2-6 2h-64v46c0 8-3 14-8 19-6 6-12 8-20 8H119c-8 0-14-2-20-8-5-5-8-11-8-19v-46H27c-2 0-4-1-6-2-2-2-3-4-3-7V274c0-15 6-28 16-38 11-11 24-17 39-17h18V64c0-8 3-14 8-19 6-6 12-8 20-8h192c7 0 16 1 25 5s16 9 22 14l43 43c5 6 10 13 14 22s6 18 6 25v73h18c15 0 28 6 39 17 10 10 16 23 16 38z"/></symbol><symbol viewBox="0 0 512 512" id="rss"><path d="M69 375c-38 0-69 31-69 69 0 37 31 68 69 68s68-31 68-68c0-38-30-69-68-69zM5 176v90c64 1 124 26 169 72s71 106 72 170h90C334 326 186 178 5 176zM5 0v90c229 2 414 189 417 418h90C509 229 283 2 5 0z"/></symbol></svg>
187 187
</div>
188 188
</body>
189
</html>
189
</html>
190
-