Debian Codegraph @

addons/marketing_card/views/card_card_templates.xml

raw
1 <?xml version="1.0"?>
2 <odoo>
3 <!--Notable pitfalls-->
4 <!--Unpatched wkhtmltoimage uses an old version of webkit, meaning things like standard flexbox
5 are not supported and -webkit flags should be used.-->
6 <!--Your local fonts may diverge from production fonts, make sure the designs work as intended
7 in their final production environment.-->
8 <template id="common_template">
9 <html>
10 <head>
11 <meta charset="utf-8"/>
12 <style>
13 body {
14 @charset "UTF-8";
15 padding: 35px;
16 font-family: Roboto, Ubuntu, "Noto Sans", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
17 font-size: 1em;
18 background: <t t-out="card_campaign.card_template_id.primary_color"/>;
19 color: <t t-out="card_campaign.card_template_id.primary_text_color"/>;
20 background-size: cover;
21 background-attachment: fixed;
22 display: -webkit-box;
23 display: flex;
24 -webkit-box-orient: vertical;
25 flex-direction: column;
26 -webkit-box-pack: justify;
27 justify-content: space-around;
28 }
29 .button_background {
30 background: <t t-out="card_campaign.card_template_id.secondary_color"/>;
31 color: <t t-out="card_campaign.card_template_id.secondary_text_color"/>;
32 }
33 .header {
34 line-height: 1.2em;
35 }
36 .header, .subheader, .cta_button h1 {
37 display: -webkit-box;
38 -webkit-box-orient: vertical;
39 }
40 .header, .subheader, .cta_button h1, .cta_button h2 {
41 margin: 0.1em;
42 }
43 .subheader, .cta_button h1{
44 line-height: 1.2em;
45 }
46 .cta_button {
47 text-align: center;
48 width: fit-content;
49 min-width: 30%;
50 max-width: 70%;
51 padding: 0.2rem 0.2rem;
52 }
53 .rounded_button {
54 border-radius: 50px;
55 }
56 .rounded_rectangle_button {
57 border-radius: 8px;
58 }
59 .footer {
60 width: 100%;
61 display: -webkit-box;
62 display: flex;
63 -webkit-box-orient: horizontal;
64 flex-direction: row;
65 -webkit-box-pack: justify;
66 justify-content: space-between;
67 }
68 .footer &gt; div {
69 height: 100%;
70 }
71 .profile_section {
72 margin-right: 0.25rem;
73 font-size: 1.25rem;
74 display: -webkit-box;
75 display: flex;
76 -webkit-box-orient: horizontal;
77 flex-direction: row;
78 -webkit-box-align: center;
79 align-items: center;
80 }
81 .text_section {
82 display: -webkit-box;
83 display: flex;
84 -webkit-box-orient: vertical;
85 flex-direction: column;
86 -webkit-box-align: start;
87 align-items: flex-start;
88 align-content: flex-start;
89 -webkit-box-pack: center;
90 justify-content: center;
91 }
92 .profile_section .text_section .text_subsections {
93 font-size: 1rem;
94 }
95 </style>
96 </head>
97 <t t-set="values" t-value="card_campaign._get_card_element_values(object)"/>
98 <body t-attf-style="background-image: url('data:image/png;base64,{{card_campaign.content_background or card_campaign.card_template_id.default_background}}');">
99 </body>
100 </html>
101 </template>
102
103 <template id="template_1" inherit_id="common_template" primary="True">
104 <xpath expr="//html/head/style" position="after">
105 <style>
106 body {
107 -webkit-box-align: center;
108 align-items: center;
109 }
110 .center_column {
111 text-align: center;
112 display: -webkit-box;
113 display: flex;
114 -webkit-box-orient: vertical;
115 flex-direction: column;
116 -webkit-box-align: center;
117 align-items: center;
118 -webkit-box-pack: justify;
119 justify-content: space-around;
120 line-height: 2rem;
121 height: 60%;
122 width: 100%;
123 }
124 .center_column .cta_button {
125 min-width: 50%;
126 max-width: 70%;
127 }
128 .footer {
129 -webkit-box-align: center;
130 align-items: center;
131 height: 30%;
132 }
133 .profile_section img {
134 object-fit: cover;
135 border-radius: 50px;
136 }
137 .profile_section .text_section span {
138 display: block;
139 }
140 .logo {
141 max-height: 40px;
142 width: auto;
143 }
144 </style>
145 </xpath>
146 <xpath expr="//html/body" position="inside">
147 <div class="center_column">
148 <div class="title">
149 <h1 class="header" t-out="values['header']" t-att-style="'color: %s;' % card_campaign.content_header_color"></h1>
150 <h2 class="subheader" t-out="values['sub_header']" t-att-style="'color: %s;' % card_campaign.content_sub_header_color"></h2>
151 </div>
152 <div class="button_background rounded_button cta_button" t-if="card_campaign.content_button">
153 <h1 t-out="card_campaign.content_button">Button</h1>
154 </div>
155 </div>
156 <div class="footer">
157 <div class="profile_section">
158 <img
159 t-attf-src="data:image/png;base64,{{values['image1']}}"
160 alt="Profile Picture"
161 width="64px"
162 height="64px"
163 style="margin-right: 10px"
164 t-if="values['image1']"
165 />
166 <div t-else=""></div>
167 <div class="text_section">
168 <span t-out="values['section']"/>
169 <div class="text_subsections">
170 <span t-out="values['sub_section1']"/>
171 <span t-out="values['sub_section2']"/>
172 </div>
173 </div>
174 </div>
175 <img
176 t-attf-src="data:image/png;base64,{{values['image2']}}"
177 alt="Profile Picture"
178 height="auto"
179 class="logo"
180 t-if="values['image2']"
181 />
182 </div>
183 </xpath>
184 </template>
185
186 <template id="template_2" inherit_id="common_template" primary="True">
187 <xpath expr="//html/head/style" position="after">
188 <style>
189 body {
190 -webkit-box-align: center;
191 align-items: center;
192 justify-content: space-between;
193 }
194 .title {
195 line-height: 2rem;
196 width: 100%;
197 }
198 .footer {
199 -webkit-box-align: center;
200 align-items: center;
201 height: 30%;
202 }
203 .cta_button {
204 text-align: center;
205 width: fit-content;
206 max-height: 3rem;
207 }
208 .profile_section img {
209 object-fit: cover;
210 border-radius: 50px;
211 }
212 .profile_section .text_section {
213 margin-left: 0.25rem;
214 }
215 .profile_section .text_section span {
216 display: block;
217 }
218 .logo_line {
219 width: 100%;
220 display: -webkit-box;
221 display: flex;
222 -webkit-box-orient: horizontal;
223 flex-direction: row;
224 -webkit-box-align: center;
225 align-items: center;
226 align-content: center;
227 -webkit-box-pack: end;
228 justify-content: flex-end;
229 }
230 .logo {
231 margin: 0.1rem;
232 align-self: flex-end;
233 max-height: 40px;
234 width: auto;
235 }
236 </style>
237 </xpath>
238 <xpath expr="//html/body" position="inside">
239 <div class="logo_line">
240 <img
241 t-attf-src="data:image/png;base64,{{values['image2']}}"
242 alt="Profile Picture"
243 class="logo"
244 t-if="values['image2']"
245 />
246 </div>
247 <div class="title">
248 <h1 class="header" t-out="values['header']" t-att-style="'color: %s;' % card_campaign.content_header_color"/>
249 <h2 class="subheader" t-out="values['sub_header']" t-att-style="'color: %s;' % card_campaign.content_sub_header_color"/>
250 </div>
251 <div class="footer">
252 <div class="profile_section">
253 <img
254 t-attf-src="data:image/png;base64,{{values['image1']}}"
255 alt="Profile Picture"
256 width="64px"
257 height="64px"
258 t-if="values['image1']"
259 />
260 <div t-else=""></div>
261 <div class="text_section">
262 <span t-out="values['section']"/>
263 <div class="text_subsections">
264 <span t-out="values['sub_section1']"/>
265 <span t-out="values['sub_section2']"/>
266 </div>
267 </div>
268 </div>
269 <div class="button_background rounded_button cta_button" t-if="card_campaign.content_button">
270 <h1 t-out="card_campaign.content_button">button text</h1>
271 </div>
272 </div>
273 </xpath>
274 </template>
275
276 <template id="template_3" inherit_id="common_template" primary="True">
277 <xpath expr="//html/head/style" position="after">
278 <style>
279 body {
280 -webkit-box-pack: justify;
281 justify-content: space-between;
282 }
283 .title {
284 line-height: 2rem;
285 width: 80%;
286 }
287 .footer {
288 -webkit-box-align: end;
289 align-items: flex-end;
290 height: 50%;
291 }
292 .footer &gt; div {
293 min-width: 50%;
294 }
295 .cta_button {
296 margin-top: 20px;
297 }
298 .profile_image {
299 object-fit: cover;
300 border-radius: 50px;
301 }
302 .cta_section {
303 max-width: 75%;
304 display: -webkit-box;
305 display: flex;
306 -webkit-box-orient: vertical;
307 flex-direction: column;
308 -webkit-box-align: center;
309 align-items: center;
310 -webkit-box-pack: justify;
311 justify-content: space-between;
312 }
313 .cta_section .text_section {
314 width: 100%;
315 font-size: 1.25rem;
316 }
317 .cta_section .text_subsections {
318 font-size: 0.85rem;
319 }
320 .logo {
321 position: absolute;
322 right: 35px;
323 top: 35px;
324 max-height: 40px;
325 width: auto;
326 }
327 </style>
328 </xpath>
329 <xpath expr="//html/body" position="inside">
330 <img
331 t-attf-src="data:image/png;base64,{{values['image2']}}"
332 alt="Profile Picture"
333 class="logo"
334 t-if="values['image2']"
335 />
336 <div class="title">
337 <h2 class="subheader" t-out="values['sub_header']" t-att-style="'color: %s;' % card_campaign.content_sub_header_color"></h2>
338 <h1 class="header" t-out="values['header']" t-att-style="'color: %s;' % card_campaign.content_header_color"></h1>
339 </div>
340 <div class="footer">
341 <div>
342 <div class="text_section">
343 <span t-out="values['section']"/>
344 <div class="text_subsections">
345 <span t-out="values['sub_section1']"/>
346 <t t-if="values['sub_section1'] and values['sub_section2']">-</t>
347 <span t-out="values['sub_section2']"/>
348 </div>
349 </div>
350 <div class="button_background rounded_rectangle_button cta_button" t-if="card_campaign.content_button">
351 <h2 t-out="card_campaign.content_button">button text</h2>
352 </div>
353 </div>
354 <img
355 class="profile_image"
356 t-attf-src="data:image/png;base64,{{values['image1']}}"
357 alt="Profile Picture"
358 width="106px"
359 height="106px"
360 t-if="values['image1']"
361 />
362 </div>
363 </xpath>
364 </template>
365
366
367 <template id="template_4" inherit_id="common_template" primary="True">
368 <xpath expr="//html/head/style" position="after">
369 <style>
370 body {
371 justify-content: space-between;
372 }
373 .header {
374 -webkit-line-clamp: 3;
375 max-height: 4.5em;
376 line-height: 1.2em;
377 }
378 .title {
379 line-height: 2rem;
380 width: 80%;
381 }
382 .footer {
383 height: 50%;
384 }
385 .cta_button {
386 text-align: center;
387 max-height: 3rem;
388 }
389 .profile_image {
390 object-fit: cover;
391 border-radius: 50px;
392 }
393 .cta_section {
394 max-width: 75%;
395 display: -webkit-box;
396 display: flex;
397 -webkit-box-orient: vertical;
398 flex-direction: column;
399 -webkit-box-align: center;
400 align-items: center;
401 }
402 .text_section {
403 width: 55%;
404 font-size: 1.25rem;
405 }
406 .text_subsections {
407 font-size: 0.85rem;
408 }
409 .text_subsections span {
410 text-wrap: nowrap;
411 white-space: nowrap;
412 }
413 .cta_button {
414 width: fit-content;
415 margin-top: 30px;
416 }
417 .logo_line {
418 width: 100%;
419 display: -webkit-box;
420 display: flex;
421 -webkit-box-orient: horizontal;
422 flex-direction: row;
423 -webkit-box-align: center;
424 align-items: center;
425 align-content: center;
426 -webkit-box-pack: start;
427 justify-content: flex-start;
428 }
429 .logo {
430 max-height: 40px;
431 width: auto;
432 }
433 .profile_image {
434 background-size: cover;
435 position: absolute;
436 right: 35px;
437 top: 35px;
438 }
439 </style>
440 </xpath>
441 <xpath expr="//html/body" position="inside">
442 <div class="logo_line">
443 <img
444 t-attf-src="data:image/png;base64,{{values['image2']}}"
445 alt="Profile Picture"
446 class="logo"
447 t-if="values['image2']"
448 />
449 </div>
450 <img
451 class="profile_image"
452 t-attf-src="data:image/png;base64,{{values['image1']}}"
453 alt="Profile Picture"
454 width="106px"
455 height="106px"
456 t-if="values['image1']"
457 />
458 <div class="title">
459 <h2 class="subheader" t-out="values['sub_header']" t-att-style="'color: %s;' % card_campaign.content_sub_header_color"></h2>
460 <h1 class="header" t-out="values['header']" t-att-style="'color: %s;' % card_campaign.content_header_color"></h1>
461 </div>
462 <div class="footer">
463 <div class="text_section">
464 <span t-out="values['section']"/>
465 <div class="text_subsections">
466 <span t-out="values['sub_section1']"/>
467 <t t-if="values['sub_section1'] and values['sub_section2']">-</t>
468 <span t-out="values['sub_section2']"/>
469 </div>
470 </div>
471 <div class="button_background rounded_button cta_button" t-if="card_campaign.content_button">
472 <h1 t-out="card_campaign.content_button">button text</h1>
473 </div>
474 </div>
475 </xpath>
476 </template>
477
478 <template id="template_5" inherit_id="common_template" primary="True">
479 <xpath expr="//html/head/style" position="after">
480 <style>
481 body {
482 height: 100%;
483 }
484 .footer {
485 margin-top: 5%;
486 height: 40%;
487 }
488 .cta_button {
489 text-align: center;
490 }
491 .profile_image {
492 object-fit: cover;
493 border-radius: 50px;
494 }
495 .cta_section {
496 max-width: 75%;
497 display: -webkit-box;
498 display: flex;
499 -webkit-box-orient: vertical;
500 flex-direction: column;
501 -webkit-box-align: center;
502 align-items: center;
503 }
504 .text_section {
505 font-size: 1.25rem;
506 }
507 .text_subsections {
508 height: 100%;
509 width: 100%;
510 font-size: 0.85rem;
511 }
512 .cta_button {
513 width: fit-content;
514 min-width: 30%;
515 max-width: 50%;
516 }
517 .logo_line {
518 width: 100%;
519 display: -webkit-box;
520 display: flex;
521 -webkit-box-orient: horizontal;
522 flex-direction: row;
523 -webkit-box-align: center;
524 align-items: center;
525 align-content: center;
526 -webkit-box-pack: justify;
527 justify-content: space-between;
528 }
529 .logo {
530 max-height: 40px;
531 width: auto;
532 }
533 </style>
534 </xpath>
535 <xpath expr="//html/body" position="inside">
536 <div class="logo_line">
537 <img
538 class="profile_image"
539 t-attf-src="data:image/png;base64,{{values['image1']}}"
540 alt="Profile Picture"
541 width="60px"
542 height="60px"
543 t-if="values['image1']"
544 />
545 <!--spacing filler in case there is no image-->
546 <div t-if="not values['image1']"></div>
547 <div class="button_background rounded_button cta_button" t-if="card_campaign.content_button">
548 <h1 t-out="card_campaign.content_button">button text</h1>
549 </div>
550 </div>
551 <div class="title">
552 <h2 class="subheader" t-out="values['sub_header']" t-att-style="'color: %s;' % card_campaign.content_sub_header_color"></h2>
553 <h1 class="header" t-out="values['header']" t-att-style="'color: %s;' % card_campaign.content_header_color"></h1>
554 </div>
555 <div class="footer">
556 <div class="text_section">
557 <span t-out="values['section']"/>
558 <div class="text_subsections">
559 <span t-out="values['sub_section1']"/>
560 <t t-if="values['sub_section1'] and values['sub_section2']">-</t>
561 <span t-out="values['sub_section2']"/>
562 </div>
563 </div>
564 <img
565 t-attf-src="data:image/png;base64,{{values['image2']}}"
566 alt="Profile Picture"
567 class="logo"
568 t-if="values['image2']"
569 />
570 </div>
571 </xpath>
572 </template>
573 </odoo>