Skip to content

Commit

Permalink
EY-3728 Tom mal for notat (#268)
Browse files Browse the repository at this point in the history
* EY-3728 Tom mal for notat

* tillate brev-api i pdfgen
  • Loading branch information
Watercolours authored Jun 4, 2024
1 parent 5a8360b commit 75f576f
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/ey-pdfgen/.nais/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ spec:
accessPolicy:
inbound:
rules:
- application: journalfoer-soeknad
- application: etterlatte-gyldig-soeknad
- application: etterlatte-brev-api
2 changes: 1 addition & 1 deletion apps/ey-pdfgen/.nais/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ spec:
accessPolicy:
inbound:
rules:
- application: journalfoer-soeknad
- application: etterlatte-gyldig-soeknad
- application: etterlatte-brev-api
73 changes: 73 additions & 0 deletions apps/ey-pdfgen/data/notat/tom_mal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"tittel" : "En slags tittel",
"payload" : [
{
"type" : "heading-three",
"children" : [
{
"type" : "paragraph",
"text" : "En tittel"
}
]
},
{
"type" : "paragraph",
"children" : [
{
"type" : "paragraph",
"text" : "Med litt diverse tekst. Ikke mye spennende her. "
}
]
},
{
"type" : "heading-three",
"children" : [
{
"type" : "paragraph",
"text" : "Tittel over liste"
}
]
},
{
"type" : "bulleted-list",
"children" : [
{
"type" : "list-item",
"children" : [
{
"type" : "paragraph",
"text" : "Her"
}
]
},
{
"type" : "list-item",
"children" : [
{
"type" : "paragraph",
"text" : "er"
}
]
},
{
"type" : "list-item",
"children" : [
{
"type" : "paragraph",
"text" : "en"
}
]
},
{
"type" : "list-item",
"children" : [
{
"type" : "paragraph",
"text" : "liste"
}
]
}
]
}
]
}
59 changes: 59 additions & 0 deletions apps/ey-pdfgen/templates/notat/tom_mal.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="no">
<head>
<meta charset="UTF-8"/>
{{> eypdfgen/partials_v2/style}}
<title>{{ tittel }}</title>
</head>
<body>

<div id="header">
<img class="navlogo" src="{{ image "Navlogo.png" }}"/>

<h1 class="title">
{{ tittel }}
</h1>
</div>

<div class="container">
{{#each payload}}
{{#eq type "heading-two"}}
{{#each this.children}}
<h2>{{ this.text }}</h2>
{{/each}}
{{/eq}}

{{#eq type "heading-three"}}
{{#each this.children}}
<h3>{{ this.text }}</h3>
{{/each}}
{{/eq}}

{{#eq type "paragraph"}}
{{#each this.children}}
{{#eq this.type "bulleted-list"}}
<ul>
{{#each this.children}}
<li>{{this.text}}</li>
{{/each}}
</ul>
{{else}}
<p>{{this.text}}</p>
{{/eq}}
{{/each}}
{{/eq}}

{{#eq type "bulleted-list"}}
{{#each this.children}}
<ul>
{{#each this.children}}
<li>{{this.text}}</li>
{{/each}}
</ul>
{{/each}}
{{/eq}}
{{/each}}
</div>

</body>
</html>

0 comments on commit 75f576f

Please sign in to comment.