attestation_template v2: show

This commit is contained in:
simon lehericey 2023-11-14 17:46:52 +01:00
parent f6b10731d3
commit f6001c8eae
11 changed files with 241 additions and 0 deletions

View file

@ -4,3 +4,4 @@
//= link administrate/application.css
//= link administrate/application.js
//= link manager.css
//= link attestation.css

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -0,0 +1,71 @@
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 252 90'>
<defs>
<symbol id='a' viewBox='0 0 11 15.5'>
<path d='M10.4 5.3C11.9 1.5 10.1 0 7.9 0 4.2 0 0 6.5 0 11.7c0 2.5 1.2 3.8 3 3.8 2.1 0 4.3-2 6.2-5.5h-1c-1.2 1.5-2.6 2.6-3.9 2.6-1.3 0-2-.8-2-2.6a10.7 10.7 0 01.3-2.2zm-4-3.1c1.1 0 2 .8 1.5 2.6L3.1 6.1c.8-2.2 2.2-4 3.4-4z' />
</symbol>
<symbol id='b' viewBox='0 0 12.4 21.8'>
<use width='11' height='15.5' y='6.4' href='#a' />
<path d='M7.9 4.7L12.4.6V0h-3L6.7 4.7H8z' />
</symbol>
<symbol id='c' viewBox='0 0 11.5 19'>
<path d='M1.7 5.7h2.6L.1 17.1a1.3 1.3 0 001.2 2c3 0 6.4-2.6 7.8-6.2h-.7a9.4 9.4 0 01-5.1 3.5L7 5.7H11l.5-1.6H7.7L9 0H7.6L4.9 4.1l-3.2.4v1.2z' />
</symbol>
<symbol id='d' viewBox='0 0 9.8 21.9'>
<path d='M7.6 8c.3-1-.4-1.6-1-1.6-2.2 0-5 2.1-6 5h.7A5.6 5.6 0 014.4 9L.1 20.3a1.1 1.1 0 001 1.6c2.2 0 4.7-2 5.8-5H6A5.6 5.6 0 013 19.5zM8 3.7a1.8 1.8 0 001.8-1.8A1.8 1.8 0 008 0a1.8 1.8 0 00-1.8 1.8A1.8 1.8 0 008 3.6' />
</symbol>
<symbol id='e' viewBox='0 0 14.8 15.5'>
<path d='M3.3 3.1c.7 0 1 1 0 3.4l-3 6.8c-.7 1.3 0 2.2 1.2 2.2a1.3 1.3 0 001.5-1l3-8C7.4 4.8 10 3 11 3s.8.6.3 1.6l-4.6 9a1.3 1.3 0 001.1 1.9c2.3 0 5-2 6-5h-.6A5.6 5.6 0 0110 13l4-8a6.1 6.1 0 00.8-2.8A2 2 0 0012.6 0c-2 0-3.6 2.2-6 5V2.8C6.6 1.4 6.1 0 4.8 0 3.2 0 1.8 2.5.7 4.9h.7c.7-1.1 1.3-1.8 2-1.8' />
</symbol>
<symbol id='f' viewBox='0 0 12 15.5'>
<path d='M11.8 3.5c.5-1.9.2-3.5-1.2-3.5-1.8 0-2.3 1.2-4 5V2.8C6.5 1.3 6 0 4.6 0 3.1 0 1.7 2.5.5 5h.8C2 3.7 2.8 3 3.3 3c.7 0 1 1 0 3.4l-3 6.8c-.7 1.3 0 2.1 1.2 2.1a1.3 1.3 0 001.5-1l3-8a50.3 50.3 0 012.6-3h3.2z' />
</symbol>
<symbol id='g' viewBox='0 0 14.7 16.2'>
<path d='M10.5 13.1c-.6 0-1-1 0-3.4L14.6.1 13.4 0l-1.3 1.3h-.3C6.1 1.3 0 8.6 0 14.2a2 2 0 002.1 2.1c1.7 0 3.3-2.4 5.2-5l-.1 1c-.3 2.6.6 4 2 4 1.5 0 3-2.4 4-4.9h-.7c-.7 1.1-1.5 1.8-2 1.8zM7.9 9.8c-1.3 1.6-3.4 3.5-4.3 3.5-.5 0-.9-.5-.9-1.6 0-3.5 4-8.2 6-8.2a4.2 4.2 0 011.4.2z' />
</symbol>
<symbol id='h' viewBox='0 0 21.9 19.8'>
<path d='M11.2 19.8l.3-.9c-3.8-.7-4.3-.7-2.7-4.8l1.4-3.9h3c1.9 0 1.9.9 1.6 3h1l2.6-6.9h-1c-1 1.6-1.8 2.9-3.8 2.9h-3l2-5.6c.8-2 1.1-2.4 3.7-2.4h.7c2.6 0 3 .7 3 3.5h1l.9-4.7H7.3L7 .9c3 .6 3.3.9 2 4.8L5.7 14c-1.5 3.9-2 4.2-5.5 4.8l-.3.9z' />
</symbol>
<symbol id='i' viewBox='0 0 10.1 21.9'>
<path d='M2.9 19.4L10.1.3 9.8 0l-5 .6v.6l1 .7c.9.7.6 1.3-.2 3.4L.2 19.9a1.3 1.3 0 001.1 2c2.3 0 4.7-2.1 5.8-5h-.7a6.5 6.5 0 01-3.5 2.5' />
</symbol>
<symbol id='j' viewBox='0 0 18 22'>
<path d='M18 .6h-4.3a3.8 3.8 0 00-2.1-.6A6.6 6.6 0 005 6.5a3.3 3.3 0 003 3.6c-1.9.8-3 1.8-3 2.9a1.7 1.7 0 00.9 1.5c-4.3 1.3-6 2.8-6 4.7 0 2 2.6 2.8 5.6 2.8 5.3 0 9.6-2.7 9.6-5.1 0-1.8-1.6-2.5-4.3-3.3-2.2-.7-3.2-.8-3.2-1.6A2.4 2.4 0 019 10.2a6.6 6.6 0 006.1-6.5 4.5 4.5 0 00-.2-1.5h2.5zM9.8 16.2c2.1.7 3 1 3 1.6 0 1.4-2 2.5-5.6 2.5-2.7 0-4-.6-4-2 0-1.5 1.4-2.5 3.5-3.3a21.5 21.5 0 003 1.2zM9 9c-1 0-1.3-.8-1.3-1.7 0-2.8 1.4-6.2 3.5-6.2 1 0 1.3.8 1.3 1.6 0 2.9-1.4 6.3-3.5 6.3z' />
</symbol>
<symbol id='k' viewBox='0 0 23 25.1'>
<path d='M14.3 15.6c1.9 0 2 .8 1.6 2.8H17l2.5-6.8h-1c-1 1.6-1.7 2.9-3.8 2.9h-4.1l2-5.6c.7-2 1-2.4 3.7-2.4H18c2.6 0 3 .7 3 3.5h1l.9-4.7H7.3l-.3.9c3 .6 3.3.9 2 4.8l-3.2 8.4c-1.5 3.9-2 4.2-5.6 4.8l-.2 1h17.4l3.2-5h-1.2c-2 2-4 3.8-8 3.8-4.7 0-4.3-.3-2.7-4.6l1.4-3.8h4.2zm2.3-11.8L21 .6V0h-3l-2.6 3.9h1.2v-.1z' />
</symbol>
<symbol id='l' viewBox='0 0 13.6 21.8'>
<path d='M11.4 6.4c-2 0-4 2.2-5.8 4.8L9.6.3 9.4 0l-5 .6V1l1 .8c.9.7.6 1.3-.2 3.4L.8 16.8A13.9 13.9 0 000 19c0 1.4 1.8 2.7 3.5 2.7 3.8 0 10-6.9 10-12.2 0-2.3-.5-3.2-2.1-3.2zM4.8 19.5c-.8 0-1.9-.7-1.9-1.3a15.5 15.5 0 01.8-2.2L5 12.7C6.3 11 8.4 9.3 9.6 9.3c.7 0 1.2.4 1.2 1.5 0 3.1-2.9 8.7-6 8.7z' />
</symbol>
<symbol id='m' viewBox='0 0 19.2 19.9'>
<path d='M17.6 0H7.3L7 .9c3 .6 3.3.9 2 4.8l-3.2 8.5c-1.5 3.9-2 4.2-5.5 4.8L0 20h15.7l3.5-6H18c-2 2-4.2 4.8-7.7 4.8-2.7 0-3-.5-1.6-4.5l3.1-8.5c1.4-3.9 2-4.2 5.5-4.8z' />
</symbol>
<symbol id='n' viewBox='0 0 126 90'>
<use width='12.4' height='21.8' x='112.7' y='66.1' xlink:href='#b' />
<use width='11.5' height='19' x='102.2' y='69' xlink:href='#c' />
<use width='9.8' height='21.9' x='93.6' y='66.1' xlink:href='#d' />
<use width='14.8' height='15.5' x='77.2' y='72.5' xlink:href='#e' />
<use width='12' height='15.5' x='65.7' y='72.5' xlink:href='#f' />
<use width='11' height='15.5' x='54.3' y='72.5' xlink:href='#a' />
<use width='11.5' height='19' x='43.7' y='69' xlink:href='#c' />
<use width='14.7' height='16.2' x='28.9' y='71.8' xlink:href='#g' />
<use width='12' height='15.5' x='19.6' y='72.5' xlink:href='#f' />
<use width='21.9' height='19.8' y='67.6' xlink:href='#h' />
<use width='12.4' height='21.8' x='77.3' y='33.1' xlink:href='#b' />
<use width='11.5' height='19' x='66.8' y='36' xlink:href='#c' />
<use width='9.8' height='21.9' x='58.2' y='33' xlink:href='#d' />
<use width='10.1' height='21.9' x='49.4' y='33.1' xlink:href='#i' />
<use width='14.7' height='16.2' x='34.9' y='38.8' xlink:href='#g' />
<use width='18' height='22' x='18.6' y='39.4' xlink:href='#j' />
<use width='23' height='25.1' y='29.3' xlink:href='#k' />
<use width='12.4' height='21.8' x='76.8' y='.1' xlink:href='#b' />
<use width='11.5' height='19' x='66.2' y='2.9' xlink:href='#c' />
<use width='12' height='15.5' x='54.8' y='6.5' xlink:href='#f' />
<use width='11' height='15.5' x='43.4' y='6.4' xlink:href='#a' />
<use width='13.6' height='21.8' x='29.4' y='.1' xlink:href='#l' />
<use width='9.8' height='21.9' x='20.6' xlink:href='#d' />
<use width='19.2' height='19.9' y='1.4' xlink:href='#m' />
</symbol>
</defs>
<use fill='#161616' width='126' height='90' x='0' y='0' href='#n' />
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

@ -0,0 +1,112 @@
@font-face {
font-family: "Marianne";
src: url("marianne-regular.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Marianne";
src: url("marianne-bold.ttf");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: "Marianne";
src: url("marianne-thin.ttf");
font-weight: 100; // weasy print n"accepte pas lighter
font-style: normal;
}
@page {
size: A4;
margin: 17mm 17mm 34mm; // add margin at the bottom to add address
@bottom-center {
font-size: 8pt;
content: counter(page) " / " counter(pages);
margin-top: 17mm;
}
@bottom-left {
content: element(footer);
}
}
#attestation {
@media screen {
max-width: 21cm;
padding: 17mm;
margin: 0 auto;
}
font-family: Marianne;
.header {
display: flex;
justify-content: space-between;
}
.right {
text-align: right;
}
.bloc-marque {
margin-bottom: 14mm;
}
.marianne {
height: 4.25mm;
margin-bottom: 1mm;
}
.intitule {
font-size: 12pt;
font-weight: bold;
margin: 0 0 1mm;
}
.devise {
height: 8.5mm;
margin: 0;
}
.issuer {
font-size: 10pt;
margin: 0 0 14mm; // pas sur, pour mettre une marge si issuer plus bas que date
}
.direction {
font-size: 12pt;
font-weight: bold;
margin: 0 0 23.3mm;
}
.date {
font-size: 8pt;
margin: 0 0 14mm;
}
.title {
font-size: 12pt;
font-weight: bold;
text-align: center;
margin: 0 0 12.6mm;
}
.main {
font-size: 10pt;
}
.notice {
font-size: 10pt;
font-style: italic;
}
.footer {
position: running(footer);
font-size: 7pt;
font-weight: 100;
}
}

View file

@ -0,0 +1,17 @@
module Administrateurs
class AttestationTemplateV2sController < AdministrateurController
before_action :retrieve_procedure, :retrieve_attestation_template
def show
json_body = @attestation_template.json_body&.deep_symbolize_keys
@body = TiptapService.to_html(json_body, {})
render layout: 'attestation'
end
private
def retrieve_attestation_template
@attestation_template = @procedure.attestation_template || @procedure.build_attestation_template
end
end

View file

@ -0,0 +1,30 @@
= image_tag('centered_marianne.svg', alt: '', class: 'marianne')
.header
.left
.bloc-marque
%p.intitule
PRÉFET<br />
DU VAL-<br />
DE-MARNE
= image_tag('liberte2.svg', alt: '', class: 'devise')
%p.issuer
Service Hébergement et Accès au Logement<br />
Bureau de l'Accès au Logement
.right
%p.direction
Direction Régionale et Interdépartementale<br />
de l'Hébergement et du Logement<br />
DRIHL Val-de-Marne
%p.date Créteil, le 20 mars 2023
%h1.title ATTESTATION
.main
= sanitize(@body)
%p.footer
12/14 rue des Archives 94000 Créteil<br />
www.drihl.ile-de-france.developpement-durable.gouv.fr

View file

@ -0,0 +1,6 @@
%html
%head
= stylesheet_link_tag 'attestation', media: 'all'
%body#attestation
= yield

View file

@ -625,6 +625,9 @@ Rails.application.routes.draw do
resource :chorus, only: [:edit, :update] do
get 'add_champ_engagement_juridique'
end
resource :attestation_template_v2, only: [:show]
resource :dossier_submitted_message, only: [:edit, :update, :create]
# ADDED TO ACCESS IT FROM THE IFRAME
get 'attestation_template/preview' => 'attestation_templates#preview'