Projet

Général

Profil

0001-villeurbanne-2018-initial-theme-25259.patch

Serghei Mihai, 13 juillet 2018 10:17

Télécharger (43,9 ko)

Voir les différences:

Subject: [PATCH] villeurbanne-2018: initial theme (#25259)

 static/villeurbanne-2018/_custom.scss         | 427 ++++++++++++++++++
 static/villeurbanne-2018/_vars.scss           |  36 ++
 .../images/alertes-active.png                 | Bin 0 -> 3922 bytes
 static/villeurbanne-2018/images/alertes.png   | Bin 0 -> 2193 bytes
 .../images/demandes-active.png                | Bin 0 -> 1609 bytes
 static/villeurbanne-2018/images/demandes.png  | Bin 0 -> 1609 bytes
 .../villeurbanne-2018/images/icon-pause.png   | Bin 0 -> 445 bytes
 .../images/porte-document-active.png          | Bin 0 -> 4088 bytes
 .../images/porte-document.png                 | Bin 0 -> 2244 bytes
 .../images/profil-active.png                  | Bin 0 -> 2456 bytes
 static/villeurbanne-2018/images/profil.png    | Bin 0 -> 2456 bytes
 static/villeurbanne-2018/style.scss           |   7 +
 .../villeurbanne-2018/prepare-template.py     |  70 +++
 .../variants/villeurbanne-2018/theme.html     |  83 ++++
 themes.json                                   |   8 +
 15 files changed, 631 insertions(+)
 create mode 100644 static/villeurbanne-2018/_custom.scss
 create mode 100644 static/villeurbanne-2018/_vars.scss
 create mode 100644 static/villeurbanne-2018/images/alertes-active.png
 create mode 100644 static/villeurbanne-2018/images/alertes.png
 create mode 100644 static/villeurbanne-2018/images/demandes-active.png
 create mode 100644 static/villeurbanne-2018/images/demandes.png
 create mode 100644 static/villeurbanne-2018/images/icon-pause.png
 create mode 100644 static/villeurbanne-2018/images/porte-document-active.png
 create mode 100644 static/villeurbanne-2018/images/porte-document.png
 create mode 100644 static/villeurbanne-2018/images/profil-active.png
 create mode 100644 static/villeurbanne-2018/images/profil.png
 create mode 100644 static/villeurbanne-2018/style.scss
 create mode 100644 templates/variants/villeurbanne-2018/prepare-template.py
 create mode 100644 templates/variants/villeurbanne-2018/theme.html
static/villeurbanne-2018/_custom.scss
1
@font-face {
2
	font-family: 'Bitter';
3
	src: url('#{$bitter-font-path}/Bitter-Bold.otf') format('opentype');
4
}
5

  
6
@mixin bottom-border($max-width: 19rem) {
7
	&::after {
8
		display: block;
9
		margin: 1.5rem 0;
10
		content: '';
11
		max-width: $max-width;
12
		width: 100%;
13
		height: 0.3125rem;
14
		background-color: $primary-color;
15
	}
16
}
17

  
18
%button {
19
	text-transform: uppercase;
20
	font-weight: 700;
21
	font-size: 0.87rem;
22
	padding: 5px 15px;
23
	line-height: 1rem;
24
	color: #ffffff;
25
}
26

  
27
div#nav {
28
	margin-top: 0;
29
	margin-bottom: 0;
30
	> ul {
31
		margin-top: 0;
32
		margin-bottom: 0;
33
	}
34
}
35

  
36
#main-content {
37
	background: white;
38
	padding: 10px;
39
	@media screen and (max-width: $mobile-limit) {
40
		padding: 10px 0;
41
	}
42
}
43

  
44
label {
45
	color: $primary-color;
46
	text-transform: uppercase;
47
	font-family: "Roboto Condensed", sans-serif;
48
	font-size: 1.125rem;
49
	margin-bottom: 20px;
50
}
51

  
52
input, select, textarea {
53
	box-shadow: 1px 2px 8px rgba(23, 23, 22, 0.2);
54
	height: 2.2rem;
55
}
56

  
57
div#rub_service {
58
	h2 {
59
		color: #000000;
60
		margin: 0;
61
		text-align: left;
62
		padding: 1ex;
63
	}
64
	> h2:first-child {
65
		@include bottom-border(100%);
66
	}
67
	div.back-home-button {
68
		margin-bottom: 3ex;
69
		a {
70
			@extend %button;
71
			background-color: $button-background;
72
			border-radius: $button-border-radius;
73
			&::before {
74
				content: '\f053'; /* chevron-left */
75
				font-family: FontAwesome;
76
				margin-right: 0.5rem;
77
			}
78
		}
79
	}
80
}
81

  
82

  
83
.gru-content {
84
	div.cell, div.block, div.a2-block {
85
		box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.28);
86
		padding-bottom: 0.1ex;
87
		margin-bottom: 1.4rem;
88
		h2:first-child {
89
			&::before {
90
				content: url("images/icon-pause.png");
91
				position: absolute;
92
				left: 0;
93
				top: 30%;
94
			}
95
		}
96
	}
97
	button {
98
		@extend %button;
99
	}
100
}
101

  
102
div.cell {
103
	h2:first-child {
104
		&::before {
105
			content: url("images/icon-pause.png");
106
			position: absolute;
107
			left: 0;
108
		}
109
	}
110
	&.trackingcodeinputcell {
111
		background-color: $primary-color;
112
		font-family: Roboto, serif;
113
		color: #ffffff;
114
		border-color: $primary-color;
115
		h2:first-child {
116
			color: #ffffff;
117
			font-size: 1.875rem;
118
			padding: 1ex;
119
			background-color: $primary-color;
120
			&::before {
121
				display: none;
122
			}
123
		}
124
		button {
125
			background: #ffffff;
126
			color: $primary-color;
127
		}
128
		#tracking-code {
129
			width: 13rem;
130
			padding: 0 1rem;
131
			color: $primary-color;
132
			height: 3.125rem;
133
			margin-right: 0.325rem;
134
		}
135
	}
136
	&.dashboard-title {
137
		box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.28);
138
		h2:first-child {
139
			padding: 1ex;
140
			background-color: #eeeeee;
141
			font-size: 1.875rem;
142
			&::before {
143
				display: none;
144
			}
145
		}
146
	}
147
	&.dashboard {
148
		border: 0;
149
		padding: 1.5rem;
150
		background-color: #eeeeee;
151
		ul {
152
			li {
153
				a {
154
					font-weight: 700;
155
					font-size: 1.1rem;
156
					color: #a9aaac;
157
					border-bottom: 1px solid #a9aaac;
158
					&:hover {
159
						color: #00515e;
160
						text-decoration: underline;
161
					}
162
				}
163
				&.selected a {
164
					color: #00515e;
165
					text-decoration: underline;
166
				}
167
				@each $item in (profil, demandes, porte-document, alertes) {
168
					&.menu-#{$item} a {
169
						background-image: url('images/#{$item}.png');
170
						background-size: auto 2.5em;
171
						background-repeat: no-repeat;
172
						padding: 1.5rem 0 1.5rem 3.5rem;
173
						background-position: left center;
174
						&:hover {
175
							background-image: url('images/#{$item}-active.png');
176
						}
177
					}
178
					&.menu-#{$item}.selected a {
179
						background-image: url('images/#{$item}-active.png');
180
					}
181
				}
182
			}
183
		}
184
	}
185
}
186

  
187
ul.account-management li {
188
	padding: 0;
189
	a {
190
		font-weight: 700;
191
	}
192
}
193

  
194
.field {
195
	margin-bottom: 0.95rem;
196
	.label {
197
		padding: 0;
198
		text-align: left;
199
	}
200
	.value {
201
		font-weight: 700;
202
		line-height: 1.125rem;
203
	}
204
}
205

  
206
div.block {
207
	flex-wrap: wrap;
208
	@media screen and (max-width: $mobile-limit) {
209
		padding: 0;
210
	}
211
}
212

  
213
div.login-actions {
214
	font-style: italic;
215
	font-size: 1.125rem;
216
	line-height: 1.25rem;
217
	color: #636361;
218
	margin-bottom: 1.25rem;
219
}
220

  
221
div#login-page {
222
	display: flex;
223
	justify-content: center;
224
	padding: 3.75rem 0;
225
	div.block {
226
		max-width: 26.25rem;
227
		box-sizing: border-box;
228
		width: 100%;
229
		background-color: #eeeeee;
230
		h2:first-child {
231
			background-color: #eeeeee;
232
		}
233
	}
234
	div#welcome-text {
235
		display: none;
236
	}
237
	p {
238
		margin-bottom: 1.875rem;
239
	}
240
	form {
241
		input {
242
			width: 100%;
243
		}
244
		@include bottom-border;
245
	}
246
}
247

  
248
div#fc-button {
249
	box-shadow: 0 0 0;
250
	@media screen and (max-width: $mobile-limit) {
251
		width: 220px;
252
	}
253
	a.button div {
254
		height: auto;
255
	}
256
}
257
div#fc-button-wrapper p {
258
	line-height: 1.4;
259
	font-size: 1.125rem;
260
}
261

  
262
div.wcsformsofcategorycell ul {
263
	> li > a {
264
		border: 0;
265
		position: relative;
266
		padding-left: 2rem;
267
		&::before {
268
			position: absolute;
269
			content: '\f0da'; /* caret-right */
270
			font-family: FontAwesome;
271
			margin-right: 0.5rem;
272
			color: #cccccc;
273
			left: 1rem;
274
		}
275
	}
276
}
277

  
278
div#tracking-code {
279
	color: #ffffff;
280
	background-color: $primary-color;
281
	h3 {
282
		background-color: $primary-color;
283
		color: #ffffff;
284
		padding-left: 0.5ex;
285
	}
286
	a {
287
		color: #ffffff;
288
		font-size: 100%;
289
	}
290
}
291

  
292
div#steps ol {
293
	background-color: #eeeeee;
294
	padding: 0 1ex;
295
	li {
296
		display: flex;
297
		align-items: center;
298
		span.marker {
299
			font-size: 150%;
300
			font-weight: 700;
301
		}
302
		span.marker, span.label {
303
			color: #aaaaaa;
304
			white-space: wrap;
305
			text-align:left;
306
			white-space: normal;
307
		}
308
		&.current {
309
			border-bottom: 1px solid #ccc;
310
			@media screen and (max-width: $mobile-limit) {
311
				border-bottom: 0;
312
			}
313
			span.marker, span.label {
314
				color: $primary-color;
315
			}
316
		}
317
	}
318
}
319

  
320
div.widget {
321
	@include bottom-border;
322
}
323

  
324
div.buttons {
325
	div.widget::after {
326
		display: none;
327
	}
328
	> div {
329
		@media screen and (max-width: $mobile-limit) {
330
			float: none;
331
		}
332
	}
333
	div.submit-button {
334
		float: right;
335
		button::after {
336
			content: '\f054'; /* chevron-right */
337
			font-family: FontAwesome;
338
			margin-left: 0.5rem;
339
		}
340
	}
341
	div.previous-button {
342
		float: right;
343
		button::before {
344
			content: '\f053'; /* chevron-left */
345
			font-family: FontAwesome;
346
			margin-right: 0.5rem;
347
		}
348
	}
349
	div.cancel-button {
350
		float: left;
351
		@media screen and (max-width: $mobile-limit) {
352
			float: none;
353
		}
354
	}
355
}
356

  
357
div#summary {
358
	position: relative;
359
	h2 {
360
		@include bottom-border(73%);
361
	}
362
	a#disclose-dataview {
363
		background: $primary-color;
364
		position: absolute;
365
		right: 0;
366
		top: 30%;
367
		color: #ffffff;
368
		padding: 0.3rem 0.6rem;
369
		font-family: 'Bitter', sans-serif;
370
		font-weight: 700;
371
		&::after {
372
			content: '\f078'; /* chevron-down */
373
			font-family: FontAwesome;
374
			margin-left: 0.5rem;
375
		}
376
	}
377
	div.dataview {
378
		div.page {
379
			h3 {
380
				font-family: 'Bitter', sans-serif;
381
				font-size: 1.875rem;
382
				font-weight: 700;
383
			}
384
			@include bottom-border;
385
		}
386
		span.label {
387
			color: $primary-color;
388
			text-transform: uppercase;
389
			font-family: "Roboto Condensed", sans-serif;
390
			margin-bottom: 0.625rem;
391
			font-size: 1.25rem;
392
			font-weight: 700;
393
			display: inline-block;
394
			padding: 0;
395
		}
396
		div.value, span.value {
397
			color: #636361;
398
			font-family: "Roboto", sans-serif;
399
			font-size: 1.25rem;
400
			font-weight: normal;
401
			margin: 0;
402
		}
403
	}
404
}
405

  
406
ul#evolutions, div#receipt-intro {
407
	font-size: 1.25rem;
408
	color: #636361;
409
}
410

  
411
ul#evolutions {
412
	li span.item {
413
		background: $primary-color !important;
414
		color: #ffffff !important;
415
	}
416
	&::after, li::after {
417
		background: $primary-color;
418
	}
419
	span.status {
420
		font-weight: normal;
421
	}
422
	div.evolution-metadata {
423
		padding-top: 15px;
424
	}
425
}
426

  
427

  
static/villeurbanne-2018/_vars.scss
1
$primary-color: #0094aa;
2

  
3
$font-family: Roboto, sans-serif;
4
$font-color: #222;
5
$font-size: 16px;
6

  
7
$width: 1230px;
8

  
9
$border-radius: 0;
10

  
11
$nav-background: $primary-color;
12
$nav-color: white;
13
$nav-active-color: lighten($primary-color, 10%);
14
$nav-button-background: transparent;
15

  
16
$footer-background: #636361;
17
$link-color: $primary-color;
18

  
19
$sidebar-width: 450px;
20

  
21
$title-color: #636361;
22
$title-weight: 700;
23
$title-font-size: 1.5rem;
24
$title-font-family: "Bitter", sans-serif;
25
$title-padding: 1ex 1ex 1ex 3ex;
26
$title-background: transparent;
27

  
28
$cell-title-cover-border: false;
29
$cell-entry-hover-effect: none;
30
$cell-border: 0;
31

  
32
$button-background: $primary-color;
33
$button-border-radius: 1.8rem;
34

  
35
$widget-border: 1px solid $primary-color;
36
$widget-focus-background: #ffffff;
static/villeurbanne-2018/style.scss
1
@charset "UTF-8";
2

  
3
@import 'vars';
4
@import '../includes/publik';
5
@import '../includes/font-bitter';
6
@import '../includes/font-roboto.scss';
7
@import 'custom';
templates/variants/villeurbanne-2018/prepare-template.py
1
#! /usr/bin/env python
2

  
3
import os
4
import subprocess
5
import re
6
import sys
7
from lxml import etree
8
from lxml.html import html_parser
9

  
10
FILENAME = 'tmp.html'
11

  
12
if os.path.exists(FILENAME):
13
    os.unlink(FILENAME)
14

  
15
URL = 'https://perso.entrouvert.org/~smihai/villeurbanne/sample.php'
16
subprocess.call(['wget', '--quiet', '-O', FILENAME, '--convert-links', URL])
17

  
18
content = open(FILENAME).read().strip()
19
if len(content) < 500:
20
    sys.exit(0)
21

  
22
root = etree.fromstring(content, parser=html_parser)
23

  
24
for script in root.xpath('//script'):
25
    # remove all google related tags
26
    if script.text and 'google' in script.text or 'google' in script.attrib.get('src', ''):
27
        parent = script.getparent()
28
        parent.remove(script)
29

  
30
# remove external undesired elements
31
elements = ['container.css', 'font-awesome', 'fonts.googleapis.com']
32
for link in root.xpath('//link'):
33
    for element in elements:
34
        if element in link.attrib['href']:
35
            parent = link.getparent()
36
            parent.remove(link)
37

  
38

  
39
# empty "content" container
40
for content in root.xpath('//div[@class="main-content"]/div[@class="container"]'):
41
    content.clear()
42
    content.attrib['class'] ='publik-container'
43

  
44
content = etree.tostring(root, method='html', pretty_print=True)
45

  
46
# remove all references to downloaded temporary file
47
content = content.replace(FILENAME, '')
48

  
49
content = content.replace('<head>', '<head>{% block head %}{% endblock %}')
50

  
51
content = content.replace('</head>', '<title>{% block global_title %}{% endblock %}</title>\n</head>')
52

  
53
content = content.replace('<body',
54
        r'<body {% block bodyargs %}{% endblock %} ')
55

  
56
content = content.replace('<div class="publik-container">', '''
57
<div class="publik-container">
58
{% block nav %}{% endblock %}
59
{% block messages %}
60
{% endblock %}
61
{% block site-content %}
62
{% endblock %}''')
63

  
64
content = content.replace('</body>', '''
65
{% block tracking %}
66
{% endblock %}
67
</body>
68
''')
69

  
70
open('base-theme.html', 'w').write(content)
templates/variants/villeurbanne-2018/theme.html
1
{% extends 'base-theme.html' %}
2
{% load i18n static combo %}
3

  
4
{% block global_title %}
5
{% firstof global_title "Villeurbanne" %} {% block title %}{% endblock %}
6
{% endblock %}
7

  
8
{% block head %}
9
    {% if meta_robots %}
10
    <meta name="robots" content="{{ meta_robots }}" />
11
    {% elif environment_label %}
12
    <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, notranslate, noimageindex" />
13
    {% endif %}
14
    {% if meta_description %}
15
    <meta name="description" content="{{ meta_description }}" />
16
    {% endif %}
17
    {% if favicon %}
18
    <link rel="shortcut icon" href="{{site_base}}{% static "" %}{{favicon}}" />
19
    {% endif %}
20
    {% block extra_top_head %}
21
    {% endblock %}
22
    {{ media }}
23
    <link rel="stylesheet" type="text/css" href="{{site_base}}{% static 'villeurbanne-2018/style.css' %}?{{statics_hash}}">
24

  
25
    {% block extra_css %}
26
    {% endblock %}
27
    {% block extra_scripts %}
28
    {% endblock %}
29
{% endblock %}
30

  
31
{% block bodyargs %}class="touch-ok {% block bodyclasses %}{% endblock %}" {% block bodyattrs %}{% endblock %}{% endblock %}
32

  
33
{% block user-info %}
34
          {% if user.is_authenticated %}
35
          <span class="logged-in">
36
            {% if idp_account_url %}<a href="{{idp_account_url}}">{% endif %}
37
            <span class="connected-user">{{user.first_name}} {{user.last_name}}</span>{% if idp_account_url %}</a>{% endif %}
38
            <a accesskey="o" class="logout" href="{% url 'auth_logout' %}">D&eacute;connexion</a>
39
          </span>
40
          {% else %}
41
            {% if idp_registration_url %}
42
            <span class="login"><a accesskey="2" href="{% url 'auth_login' %}">Connexion</a> <span class="sep">/</span>
43
                    <a class="registration" href="{{idp_registration_url}}">Inscription</a></span>
44
            {% else %}
45
            <span class="login"><a accesskey="2" href="{% url 'auth_login' %}">Connexion <span class="sep">/</span> Inscription</a></span>
46
            {% endif %}
47
          {% endif %}
48
{% endblock %}
49

  
50
{% block nav %}
51
<nav>
52
<div id="nav" class="togglable">
53
{% block menu %}
54
{% endblock %}
55
</div>
56
</nav>
57
{% endblock %}
58

  
59
{% block messages %}
60
{% if messages %}
61
<div id="messages">
62
  <ul class="messages">
63
      {% for message in messages %}
64
      <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
65
      {% endfor %}
66
  </ul>
67
</div>
68
{% endif %}
69
{% endblock %}
70

  
71
{% block site-content %}
72
<div id="main-content-wrapper">
73
  <div id="main-content">
74
    <div id="content" class="gru-content">
75
      {% block content %}
76
      {% endblock %}
77
    </div>
78
  </div>
79
{% endblock %}
80

  
81
{% block tracking %}
82
    {% include "includes/tracking.html" %}
83
{% endblock %}
themes.json
573 573
     "theme_color": "#01A0BE"
574 574
   }
575 575
  },
576
  {"id": "villeurbanne-2018",
577
   "label": "Villeurbanne 2018",
578
   "variables": {
579
     "css_variant": "villeurbanne-2018",
580
     "no_extra_js": true,
581
     "theme_color": "#00515e"
582
   }
583
  },
576 584
  {"id": "minint",
577 585
   "label": "Ministère de l'Intérieur",
578 586
   "variables": {
579
-