Projet

Général

Profil

0001-gers-cd32-simplify-as-a-native-theme-47562.patch

Nicolas Roche, 12 octobre 2020 18:11

Télécharger (19,5 ko)

Voir les différences:

Subject: [PATCH] gers-cd32: simplify as a native theme (#47562)

 static/gers-cd32/_custom.scss                 | 228 +++---------------
 static/gers-cd32/_vars.scss                   |  12 +-
 static/gers-cd32/config.json                  |  12 +-
 templates/theme.html                          | 224 ++++++++---------
 .../gers-cd32/combo/page_template.html        |  31 ---
 templates/variants/gers-cd32/theme.html       |  35 ---
 6 files changed, 169 insertions(+), 373 deletions(-)
 delete mode 100644 templates/variants/gers-cd32/combo/page_template.html
 delete mode 100644 templates/variants/gers-cd32/theme.html
static/gers-cd32/_custom.scss
1 1
@import '../includes/fonts/montserrat';
2 2

  
3
@mixin form-icon($content) {
4
	content: $content;
5
	font-family: FontAwesome;
6
}
7

  
8
div#header-pre {
9
	display: flex;
10
	flex-direction: row-reverse;
11
	@media screen and (max-width: $my-tablet-limit) {
12
		flex-direction: column;
13
	}
14
}
3
$header-height: 300px;
4
$header-border-height: 55px;
5
$mobile-header-height: 230px;
15 6

  
16
div#bandeau {
17
	width: calc(100% - 610px);
18
	@media screen and (max-width: $my-tablet-limit) {
19
		width: 100%;
20
	}
21
	> img {
22
		display: block;
23
		height: auto;
24
		max-width: 100%;
25
		width: 100%;
7
#header-wrapper {
8
	border-top: $header-border-height solid $primary-color;
9
	height: $header-height;
10
	@media screen and ($max-mobile-viewport) {
11
		height: $mobile-header-height;
26 12
	}
27 13
}
28 14

  
29
div#contenu {
30
	box-sizing: content-box;
31
	display: flex;
32
	flex-direction: column;
33
	justify-content: space-between;
34
	width: 550px;
35
	max-width: 550px;
36
	padding: 60px 0 0 60px;
37
	div#logo-ville img {
38
		width: 294;
39
		height: 83;
40
	}
41
	@media screen and (max-width: $my-tablet-limit) {
42
		width: unset;
43
		max-width: unset;
44
		padding: 14px 0 0 20px;
45
		div#logo-ville {
46
			flex-grow: 1;
47
			img {
48
				width: 200px;
49
				height: 56.45px;
50
			}
15
#header #top #logo {
16
	position: absolute;
17
	top: -$header-border-height;
18
	line-height: 1em;
19
	margin-top: 10px;
20
	padding-left: 0;
21
	a {
22
		color: $tertiary-color;
23
		@media screen and ($min-desktop-viewport) {
24
			text-indent: 150px;
51 25
		}
52
	}
53
	@media screen and (max-width: $my-mobile-limit) {
54
		padding-top: 17px;
55
		div#logo-ville img {
56
			width: 130px;
57
			height: 36.7px;
26
		@media screen and ($max-mobile-viewport) {
27
			text-indent: -10000px;
58 28
		}
59 29
	}
60
	div#contenu-top {
61
		display: flex;
62
		flex-direction: column;
63
		justify-content: space-between;
64
		height: 195px;
65
		@media screen and (max-width: $my-tablet-limit) {
66
			flex-direction: row;
67
			flex-grow: 1;
68
			height: 60px;
69
		}
70
		@media screen and (max-width: $my-mobile-limit) {
71
			flex-grow: 0;
72
		}
73
		div#demarches {
74
			display: flex;
75
			flex-direction: row;
76
			justify-content: space-between;
77
			color: white;
78
			width: auto;
79
			padding: 23px 35px 23px 35px;
80
			background-color: $primary-color;
81
			span.gru-icon::after {
82
				@include form-icon("\f046");
83
				font-size: 1rem;
84
				font-weight: 400;
85
			}
86
			@media screen and (max-width: $my-tablet-limit) {
87
				flex-grow: 2;
88
				padding-top: 0.8em;
89
				margin-bottom: 10px;
90
			}
91
			@media screen and (max-width: $my-mobile-limit) {
92
				flex-grow: 0;
93
				width: 0px;
94
				padding-left: 20px;
95
				margin-right: $nav-place-holder-width;
96
				span:first-child {
97
					display: none;
98
				}
99
			}
100
		}
101
		div#nav-place-holder {
102
			display: none;
103
			width: $nav-place-holder-width;
104
			@media screen and (max-width: $my-tablet-limit) {
105
				flex-grow: 1;
106
				display: inherit;
107
			}
108
			@media screen and (max-width: $my-mobile-limit) {
109
				flex-grow: 0;
110
				display: none;
111
			}
112
		}
30
}
31

  
32
#toplinks {
33
	top: -$header-border-height;
34
	background: transparent;
35
	@media screen and ($max-mobile-viewport) {
36
		display: none;
113 37
	}
114
	.logged-in, .login {
115
		display: flex;
116
		flex-direction: row;
117
		justify-content: flex-end;
118
		font-size: 0.8rem;
119
		font-weight: 300;
120
		padding-top: 2em;
121
		padding-bottom: 74px;
122
		padding-right: 50px;
123
		@media screen and (max-width: $my-tablet-limit) {
124
			padding: 0.8em 8px 0.8em;
125
		}
38
	a {
39
		color: white;
126 40
	}
127 41
}
128 42

  
129
span.connected-user {
130
	text-transform: uppercase;
131
	font-weight: bold;
132
	padding: 0 12px 0 4px;
133
	font-weight: 600;
134
}
135
a.account::after {
136
	@include form-icon("\f013");
137
	font-size: 0.95rem;
138
	color: black;
139
	border-style: solid;
140
	border-width: 0 0 0 1px;
141
	padding: 0 7px 0 7px;
142
	border-color: black
143
}
144
a.logout::after {
145
	@include form-icon("\f011");
146
	font-size: 0.95rem;
147
	border-style: solid;
148
	border-width: 0 0 0 1px;
149
	padding: 0 7px 0 7px;
150
	border-color: black
43
#nav ul {
44
	margin-top: 0;
151 45
}
152 46

  
153
h1#logo {
154
	display: none;
155
}
156
body.has-picture nav::after {
157
	display: none;
47
div.cell.foldable.folded > div > h2:first-child + picture {
48
	display: block;
158 49
}
159
div#nav-wrapper {
160
	position: absolute;
161
	top: 135px;
162
	right: 15px;
163
	button {
164
		position: absolute;
165
		right: 4rem;
166
		font-size: 0.7rem;
167
		font-weight: 400;
168
		padding-left: 50px;
169
		color: $tertiary-color;
170
		background: white;
171
		@media screen and (max-width: $my-tablet-limit) {
172
			top: -70px;
173
			right: 40px;
174
		}
175
		@media screen and (max-width: $my-mobile-limit) {
176
			right: 0;
177
		}
178
		span.icon-bar {
179
			border: 2px solid $nav-button-color;
180
		}
181
	}
182
	button::after {
183
		content: "Menu";
184
		display: block;
185
		@media screen and (max-width: $my-mobile-limit) {
186
			display: none;
187
		}
188
	}
189
	#nav > ul {
190
		border-top: none;
191
		position: relative;
192
		top: $nav-menu-side;
193
		a {
194
			color: white;
195
		}
196
	}
50

  
51
div#sidebar {
52
	box-shadow: 3px 3px 20px 0px #dedede;
53
	margin-right: 2.5em;
197 54
}
198 55

  
199
div#header-post {
200
	font-weight: 900;
201
	font-size: 2.25rem;
202
	line-height: 1;
203
	text-align: center;
204
	background-color: $secondary-color;
205
	padding: 64px 0 70px 0;
206
	margin-bottom: 45px;
56
@mixin form-icon($content) {
57
	content: $content;
58
	font-family: FontAwesome;
207 59
}
208 60

  
209 61
div#footer-wrapper {
210 62
	padding: 66px 0 73px;
211 63
}
212 64
div#footer {
213 65
	border-color: #fff;
214 66
	max-width: 1320px;
static/gers-cd32/_vars.scss
2 2
$secondary-color: #f4f4f4;
3 3
$tertiary-color: #0f183b;
4 4

  
5 5
$border-radius: 3px;
6 6
$font-size: 1.25em;
7 7
$font-family: Montserrat, sans-serif;
8 8
$link-color: $primary-color;
9 9

  
10
$my-tablet-limit: 1279px;
11 10
$my-mobile-limit: 796px;
12
$nav-place-holder-width: 80px;
13 11

  
14
$nav-mobile-limit: 50000px;
15
$nav-button-color: $tertiary-color;
16
$nav-button-background: $tertiary-color;
17
$nav-mobile-menu-background: $tertiary-color;
12
$nav-background: $secondary-color;
13
$nav-color: $tertiary-color;
14
$nav-full-width-background: true;
15
$nav-button-background: $primary-color;
16
$nav-item-selected-background: $primary-color;
17
$nav-mobile-menu-color: white;
18 18
$nav-item-hover-background: $primary-color;
19 19
$nav-border-color: transparent;
20 20
$nav-menu-side: 36px;
21 21

  
22 22
$cell-border: none;
23 23
$cell-entry-hover-background: transparent;
24 24

  
25 25
$title-transform: uppercase;
static/gers-cd32/config.json
1 1
{
2 2
  "label": "Gers (CD32)",
3 3
  "variables": {
4
    "include_top_links": false,
4
    "include_top_links": true,
5
    "pwa_display": "standalone",
6
    "logo_link_url": "/",
5 7
    "theme_color": "#ae2217"
8
  },
9
  "settings": {
10
    "combo": {
11
      "COMBO_ASSET_SLOTS.update": {
12
        "header:background": { "label": "Têtière : fond" },
13
        "header:logo": { "label": "Têtière : logo" }
14
      }
15
    }
6 16
  }
7 17
}
templates/theme.html
27 27
    {% if pwa_display == "standalone" %}
28 28
    <meta name="apple-mobile-web-app-capable" content="yes">
29 29
    {% endif %}
30 30
    {% block extra_top_head %}
31 31
    {% endblock %}
32 32
    {{ media }}
33 33
    {% block css-variant %}
34 34
    {% if css_variant %}
35
      <link rel="stylesheet" type="text/css" href="{{site_base}}{% static "" %}{{css_variant}}/style.css?{% start_timestamp %}">
35
    <link rel="stylesheet" type="text/css" href="{{site_base}}{% static "" %}{{css_variant}}/style.css?{% start_timestamp %}">
36 36
    {% else %}
37
      <link rel="stylesheet" type="text/css" href="{{site_base}}{% static "style.css" %}?{% start_timestamp %}">
37
    <link rel="stylesheet" type="text/css" href="{{site_base}}{% static "style.css" %}?{% start_timestamp %}">
38 38
    {% endif %}
39 39
    {% endblock %}
40 40
    {% block extra_css %}
41 41
    {% endblock %}
42 42
    {% block extra_scripts %}
43 43
    {% endblock %}
44 44
  </head>
45 45
  <body {% block bodyargs %}class="{% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}>
46
   <div id="nav-skip">
47
    <ul>
48
     <li><a href="#main-content">Aller au contenu</a></li>
49
     <li><a href="#nav">Aller au menu</a></li>
50
    </ul>
51
   </div>
52

  
53
   <div id="page" {% block page-args %}{% endblock %}>
54
    <header role="banner" class="site-header">
55
    <div id="header-wrapper" >
56
    {% block header-pre %}{% endblock %}
57
    <div id="header">
58
     {% block header-top %}{% endblock %}
59
     <div id="top">
60
       {% block header-title %}
61
       <h1 id="logo"><a accesskey="1" href="{% firstof logo_link_url portal_url '/' %}">{% firstof global_title site_title "Compte Citoyen" %}</a></h1>
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 %}
75
     </div>
76
     {% block header-bottom %}{% endblock %}
77
    </div> <!-- header -->
78
    {% block header-post %}{% endblock %}
79
    </div> <!-- header-wrapper -->
80
    </header>
46
    <div id="nav-skip">
47
      <ul>
48
        <li><a href="#main-content">Aller au contenu</a></li>
49
        <li><a href="#nav">Aller au menu</a></li>
50
      </ul>
51
    </div>
81 52

  
82
{% block nav %}
83
<nav role="navigation">
84
<div id="nav-wrapper" class="gru-nav-wrapper">
85
{% block nav-pre %}{% endblock %}
86
<div id="nav" class="gru-nav togglable">
87
{% block nav-top %}{% endblock %}
88
  <button id="nav-button" class="gru-nav-button togglable" aria-label="Menu">
89
    <span class="sr-only">Ouvrir le menu</span>
90
    <span class="icon-bar icon-bar-1"></span>
91
    <span class="icon-bar icon-bar-2"></span>
92
    <span class="icon-bar icon-bar-3"></span>
93
  </button>
94
{% block menu %}
95
  <ul>
96
    <li class="link-accueil"><a href="{{combo_url}}">Accueil</a></li>
97
    <li class="link-demarches"><a href="{{wcs_url}}/login">Démarches</a></li>
98
    <li class="link-profil"><a href="{{authentic_url}}/accounts/">Profil</a></li>
99
    <li class="link-aide"><a href="{{help_url}}">Aide</a></li>
100
  </ul>
101
{% endblock %}
102
{% block nav-bottom %}{% endblock %}
103
</div> <!-- nav -->
104
{% block nav-post %}{% endblock %}
105
</div> <!-- nav-wrapper -->
106
</nav>
107
{% endblock %}
53
    <div id="page" {% block page-args %}{% endblock %}>
54
      <header role="banner" class="site-header">
55
        <div id="header-wrapper" >
56
          {% block header-pre %}{% endblock %}
57
          <div id="header">
58
            {% block header-top %}{% endblock %}
59
            <div id="top">
60
              {% block header-title %}
61
              <h1 id="logo"><a accesskey="1" href="{% firstof logo_link_url portal_url '/' %}">{% firstof global_title site_title "Compte Citoyen" %}</a></h1>
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 %}
75
            </div>
76
            {% block header-bottom %}{% endblock %}
77
          </div> <!-- header -->
78
          {% block header-post %}{% endblock %}
79
        </div> <!-- header-wrapper -->
80
      </header>
108 81

  
109
  {% block before-main-content %}
110
  {% endblock %}
82
      {% block nav %}
83
      <nav role="navigation">
84
        <div id="nav-wrapper" class="gru-nav-wrapper">
85
          {% block nav-pre %}{% endblock %}
86
          <div id="nav" class="gru-nav togglable">
87
            {% block nav-top %}{% endblock %}
88
            <button id="nav-button" class="gru-nav-button togglable" aria-label="Menu">
89
              <span class="sr-only">Ouvrir le menu</span>
90
              <span class="icon-bar icon-bar-1"></span>
91
              <span class="icon-bar icon-bar-2"></span>
92
              <span class="icon-bar icon-bar-3"></span>
93
            </button>
94
            {% block menu %}
95
            <ul>
96
              <li class="link-accueil"><a href="{{combo_url}}">Accueil</a></li>
97
              <li class="link-demarches"><a href="{{wcs_url}}/login">Démarches</a></li>
98
              <li class="link-profil"><a href="{{authentic_url}}/accounts/">Profil</a></li>
99
              <li class="link-aide"><a href="{{help_url}}">Aide</a></li>
100
            </ul>
101
            {% endblock %}
102
            {% block nav-bottom %}{% endblock %}
103
          </div> <!-- nav -->
104
          {% block nav-post %}{% endblock %}
105
        </div> <!-- nav-wrapper -->
106
      </nav>
107
      {% endblock %}
111 108

  
112
  <main role="main">
113
  <div id="main-content-wrapper">
114
    <div id="main-content">
109
      {% block before-main-content %}
110
      {% endblock %}
115 111

  
116
{% block content-messages %}
117
{% block messages %}
118
{% if messages %}
119
  <div id="messages" class="messages-login">
120
    <ul class="messages">
121
        {% for message in messages %}
122
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
123
        {% endfor %}
124
    </ul>
125
  </div>
126
{% endif %}
127
{% endblock %}
128
{% endblock %}
112
      <main role="main">
113
        <div id="main-content-wrapper">
114
          <div id="main-content">
129 115

  
130
    {% block content-pre %}{% endblock %}
131
    <div id="content" class="gru-content large">
132
            {% block content-top %}{% endblock %}
133
            {% block content %}
116
            {% block content-messages %}
117
            {% block messages %}
118
            {% if messages %}
119
            <div id="messages" class="messages-login">
120
              <ul class="messages">
121
                {% for message in messages %}
122
                <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
123
                {% endfor %}
124
              </ul>
125
            </div>
126
            {% endif %}
127
            {% endblock %}
134 128
            {% endblock %}
135
            {% block content-bottom %}{% endblock %}
136
    </div> <!-- #content -->
137
    {% block content-post %}{% endblock %}
138 129

  
139
    </div> <!-- #main-content -->
140
    </div> <!-- #main-content-wrapper -->
141
   </main>
130
            {% block content-pre %}{% endblock %}
131
            <div id="content" class="gru-content large">
132
              {% block content-top %}{% endblock %}
133
              {% block content %}
134
              {% endblock %}
135
              {% block content-bottom %}{% endblock %}
136
            </div> <!-- #content -->
137
            {% block content-post %}{% endblock %}
142 138

  
143
   <footer role="contentinfo">
144
    {% block footer-pre %}{% endblock %}
145
    <div id="footer-wrapper">
146
    <div id="footer">
147
      {% block footer-top %}{% endblock %}
148
      {% block footer %}
149
      <p id="legal">Copyright © 2005-2016 Entr'ouvert</p>
150
      {% endblock %}
151
      {% block footer-bottom %}
152
          {% block back-top %}
153
          {% endblock %}
154
      {% endblock %}
155
    </div>
156
    </div>
157
    {% block footer-post %}{% endblock %}
158
   </footer>
159
   </div> <!-- #page -->
160
   {% if environment_label %}<span id="environment-label">{{ environment_label }}</span>{% endif %}
161
   {% include "includes/tracking.html" %}
162
   {% block body-bottom %}
163
   {% endblock %}
139
          </div> <!-- #main-content -->
140
        </div> <!-- #main-content-wrapper -->
141
      </main>
142

  
143
      <footer role="contentinfo">
144
        {% block footer-pre %}{% endblock %}
145
        <div id="footer-wrapper">
146
          <div id="footer">
147
            {% block footer-top %}{% endblock %}
148
            {% block footer %}
149
            <p id="legal">Copyright © 2005-2016 Entr'ouvert</p>
150
            {% endblock %}
151
            {% block footer-bottom %}
152
            {% block back-top %}
153
            {% endblock %}
154
            {% endblock %}
155
          </div>
156
        </div>
157
        {% block footer-post %}{% endblock %}
158
      </footer>
159
    </div> <!-- #page -->
160
    {% if environment_label %}<span id="environment-label">{{ environment_label }}</span>{% endif %}
161
    {% include "includes/tracking.html" %}
162
    {% block body-bottom %}
163
    {% endblock %}
164 164
  </body>
165 165
</html>
templates/variants/gers-cd32/combo/page_template.html
1
{% extends "combo/page_template.html" %}
2
{% load combo %}
3

  
4
{% block user-info %}
5
{% skeleton_extra_placeholder user-info %}
6
{% if user.is_authenticated %}
7

  
8
<span class="logged-in">
9
  Bonjour
10
  <span class="connected-user">{{user.first_name}} {{user.last_name}}</span>
11
  {% if idp_account_url %}
12
  <a class="account" href="{{idp_account_url}}" title="Accéder à mon compte"></a>
13
  {% endif %}
14
  <a class="logout" href="{% url 'auth_logout' %}" title="Se déconnecter"></a>
15
</span>
16

  
17
{% else %}
18

  
19
{% if idp_registration_url %}
20
<span class="login">
21
  <a accesskey="2" href="{% url 'auth_login' %}">Connexion</a>
22
  <span class="sep">/</span>
23
  <a class="registration" href="{{idp_registration_url}}">Inscription</a>
24
</span>
25
{% else %}
26
<span class="login"><a accesskey="2" href="{% url 'auth_login' %}">Connexion <span class="sep">/</span> Inscription</a></span>
27
{% endif %}
28

  
29
{% endif %}
30
{% end_skeleton_extra_placeholder %}
31
{% endblock %}
templates/variants/gers-cd32/theme.html
1
{% extends "theme.html" %}
2
{% load static %}
3

  
4
{% block header-pre %}
5
<div id="header-pre">
6
  <div id="contenu">
7
    <div id="contenu-top">
8
      <div id="logo-ville">
9
        <a href="{{website_url}}">
10
          <img src="{{ site_base }}{% static 'gers-cd32/img/logo.png' %}"/>
11
        </a>
12
      </div>
13
      <div id="demarches"><span>Mes Démarches</span><span class="gru-icon"/></div>
14
      <div id="nav-place-holder"></div>
15
    </div>
16
    {% block user-info %}
17
    {% endblock %}
18
  </div> <!-- contenu -->
19
  <div id="bandeau">
20
    {% if page.picture %}
21
    <img src="{{site_base}}{{page.picture.url}}"/>
22
    {% else %}
23
    <img src="{{site_base}}{% static 'gers-cd32/img/csm_defaultImage.png' %}"/>
24
    {% endif %}
25
  </div>
26
</div>
27
{% endblock %}
28

  
29
{% block header-post %}
30
{% if  page.title %}
31
<div id="header-post">
32
  {{page.title}}
33
</div>
34
{% endif %}
35
{% endblock %}
36
-