Projet

Général

Profil

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

Serghei Mihai, 12 juillet 2018 23:15

Télécharger (43,8 ko)

Voir les différences:

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

 static/villeurbanne-2018/_custom.scss         | 421 ++++++++++++++++++
 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           |   5 +
 .../villeurbanne-2018/prepare-template.py     |  73 +++
 .../variants/villeurbanne-2018/theme.html     |  83 ++++
 themes.json                                   |   8 +
 15 files changed, 626 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
@mixin bottom-border($max-width: 19rem) {
2
	&::after {
3
		display: block;
4
		margin: 1.5rem 0;
5
		content: '';
6
		max-width: $max-width;
7
		width: 100%;
8
		height: 0.3125rem;
9
		background-color: $primary-color;
10
	}
11
}
12

  
13
%button {
14
	text-transform: uppercase;
15
	font-weight: 700;
16
	font-size: 0.87rem;
17
	padding: 5px 15px;
18
	line-height: 1rem;
19
	color: #ffffff;
20
}
21

  
22
div#nav {
23
	margin-top: 0;
24
	margin-bottom: 0;
25
	> ul {
26
		margin-top: 0;
27
		margin-bottom: 0;
28
	}
29
}
30

  
31
#main-content {
32
	background: white;
33
	padding: 10px;
34
	@media screen and (max-width: $mobile-limit) {
35
		padding: 10px 0;
36
	}
37
}
38

  
39
label {
40
	color: $primary-color;
41
	text-transform: uppercase;
42
	font-family: "Roboto Condensed", sans-serif;
43
	font-size: 1.125rem;
44
	margin-bottom: 20px;
45
}
46

  
47
input, select, textarea {
48
	box-shadow: 1px 2px 8px rgba(23, 23, 22, 0.2);
49
	height: 2.2rem;
50
}
51

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

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

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

  
181
ul.account-management li {
182
	padding: 0;
183
	a {
184
		font-weight: 700;
185
	}
186
}
187

  
188
.field {
189
	margin-bottom: 0.95rem;
190
	.label {
191
		padding: 0;
192
		text-align: left;
193
	}
194
	.value {
195
		font-weight: 700;
196
		line-height: 1.125rem;
197
	}
198
}
199

  
200
div.block {
201
	flex-wrap: wrap;
202
	@media screen and (max-width: $mobile-limit) {
203
		padding: 0;
204
	}
205
}
206

  
207
div.login-actions {
208
	font-style: italic;
209
	font-size: 1.125rem;
210
	line-height: 1.25rem;
211
	color: #636361;
212
	margin-bottom: 1.25rem;
213
}
214

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

  
242
div#fc-button {
243
	box-shadow: 0 0 0;
244
	@media screen and (max-width: $mobile-limit) {
245
		width: 220px;
246
	}
247
	a.button div {
248
		height: auto;
249
	}
250
}
251
div#fc-button-wrapper p {
252
	line-height: 1.4;
253
	font-size: 1.125rem;
254
}
255

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

  
272
div#tracking-code {
273
	color: #ffffff;
274
	background-color: $primary-color;
275
	h3 {
276
		background-color: $primary-color;
277
		color: #ffffff;
278
		padding-left: 0.5ex;
279
	}
280
	a {
281
		color: #ffffff;
282
		font-size: 100%;
283
	}
284
}
285

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

  
314
div.widget {
315
	@include bottom-border;
316
}
317

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

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

  
400
ul#evolutions, div#receipt-intro {
401
	font-size: 1.25rem;
402
	color: #636361;
403
}
404

  
405
ul#evolutions {
406
	li span.item {
407
		background: $primary-color !important;
408
		color: #ffffff !important;
409
	}
410
	&::after, li::after {
411
		background: $primary-color;
412
	}
413
	span.status {
414
		font-weight: normal;
415
	}
416
	div.evolution-metadata {
417
		padding-top: 15px;
418
	}
419
}
420

  
421

  
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 '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']
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
# remove copy of jquery
50
content = re.sub('<script src=.*jquery.min.js.*', '', content)
51

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

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

  
56
content = content.replace('<body',
57
        r'<body {% block bodyargs %}{% endblock %} ')
58

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

  
67
content = content.replace('</body>', '''
68
{% block tracking %}
69
{% endblock %}
70
</body>
71
''')
72

  
73
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
-