feat: use tailwind css
This commit is contained in:
@@ -1,86 +1,139 @@
|
||||
@page {
|
||||
size: A4;
|
||||
padding: 2cm;
|
||||
}
|
||||
@page:first {
|
||||
padding: 0;
|
||||
}
|
||||
@media print {
|
||||
.page,
|
||||
.page-break {
|
||||
break-after: page;
|
||||
}
|
||||
.markdown h1 {
|
||||
font-size: 2.25em; /* relative to base 12pt */
|
||||
font-weight: 700; /* font-bold */
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.first-page {
|
||||
margin-left: 2cm;
|
||||
margin-right: 2cm;
|
||||
.markdown h2 {
|
||||
font-size: 1.875em;
|
||||
font-weight: 600;
|
||||
margin-top: 1.25em;
|
||||
margin-bottom: 0.75em;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
font-size: 12pt;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
p {
|
||||
margin-top: 0.25em;
|
||||
.markdown h3 {
|
||||
font-size: 1.5em;
|
||||
font-weight: 600;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 40px;
|
||||
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 2em;
|
||||
}
|
||||
h2 {
|
||||
margin-top: 0.5em;
|
||||
.markdown h4 {
|
||||
font-size: 1.25em;
|
||||
font-weight: 500;
|
||||
margin-top: 0.75em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
table {
|
||||
.markdown p {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.markdown a {
|
||||
color: #2563eb;
|
||||
text-decoration: none;
|
||||
}
|
||||
.markdown a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.markdown strong {
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.markdown em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
background-color: #f3f4f6;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 0.875em; /* relative to base 12pt */
|
||||
padding: 0.125em 0.25em;
|
||||
border-radius: 0.25em;
|
||||
}
|
||||
|
||||
.markdown pre {
|
||||
background-color: #111827;
|
||||
color: #f3f4f6;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 0.875em;
|
||||
padding: 1em;
|
||||
border-radius: 0.5em;
|
||||
overflow-x: auto;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
border-left: 4px solid #d1d5db;
|
||||
padding-left: 1em;
|
||||
font-style: italic;
|
||||
color: #4b5563;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.markdown ul {
|
||||
list-style-type: disc;
|
||||
padding-left: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown ol {
|
||||
list-style-type: decimal;
|
||||
padding-left: 1.5em;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown li {
|
||||
margin-bottom: 0.25em;
|
||||
line-height: 1.625;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
border: none;
|
||||
border-top: 1px solid #d1d5db;
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
max-width: 100%;
|
||||
border-radius: 0.5em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
padding: 0.25em 0.5em;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
margin: 1em 0;
|
||||
font-size: 0.875em; /* relative to base 12pt */
|
||||
}
|
||||
|
||||
article {
|
||||
margin-bottom: 20px;
|
||||
.markdown th,
|
||||
.markdown td {
|
||||
border: 1px solid #d1d5db;
|
||||
padding: 0.5em 0.25em;
|
||||
}
|
||||
|
||||
.issue-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: end;
|
||||
|
||||
margin-top: 2em;
|
||||
margin-bottom: 0.5em;
|
||||
|
||||
h3,
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
.markdown th {
|
||||
background-color: #f3f4f6;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Nested lists */
|
||||
.markdown ul ul {
|
||||
list-style-type: circle;
|
||||
padding-left: 1.5em;
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
|
||||
.markdown ol ol {
|
||||
list-style-type: lower-alpha;
|
||||
padding-left: 1.5em;
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
8
pkg/invoice/report/assets/tailwind.js
Normal file
8
pkg/invoice/report/assets/tailwind.js
Normal file
File diff suppressed because one or more lines are too long
@@ -5,93 +5,138 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Rechnung vom {{ .Date | date }}</title>
|
||||
<!-- <link href="css/style.css" rel="stylesheet" /> -->
|
||||
<script>
|
||||
{{ .Tailwind }}
|
||||
</script>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
padding: 2cm;
|
||||
}
|
||||
@page:first {
|
||||
padding: 0;
|
||||
}
|
||||
@media print {
|
||||
.page,
|
||||
.page-break {
|
||||
break-after: page;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
{{ .Style }}
|
||||
</style>
|
||||
<style>
|
||||
|
||||
{{.Invoice.CSS}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header class="first-page" style="margin-top: 2cm">
|
||||
<body class="font-sans text-gray-800 text-[12pt]">
|
||||
<!-- Header -->
|
||||
<header class="mx-[2cm] flex justify-between mb-10 mt-8">
|
||||
<div class="company">
|
||||
<h2>{{ .Company.Name }}</h2>
|
||||
<p>
|
||||
{{ .Company.Address.Street}} {{.Company.Address.Number}} <br />
|
||||
<h2 class="text-2xl font-semibold">{{ .Company.Name }}</h2>
|
||||
<p class="mt-2">
|
||||
{{ .Company.Address.Street }} {{ .Company.Address.Number }} <br />
|
||||
{{ .Company.Address.ZIPCode }} {{ .Company.Address.Place }} <br />
|
||||
{{ .Company.Contact }}
|
||||
</p>
|
||||
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="invoice-info">
|
||||
<div class="invoice-info text-right">
|
||||
<p>
|
||||
<strong>Rechnung:</strong> {{ .Invoice.Reference }} <br />
|
||||
<strong>Datum:</strong> {{ .Date | date }} <br />
|
||||
<span class="font-semibold">Rechnung:</span> {{ .Invoice.Reference }}
|
||||
<br />
|
||||
<span class="font-semibold">Datum:</span> {{ .Date | date }} <br />
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
<section class="client first-page">
|
||||
<h2>Rechnung an:</h2>
|
||||
|
||||
<!-- Client Info -->
|
||||
<section class="client mx-[2cm] mb-12">
|
||||
<h2 class="text-xl font-semibold mb-2">Rechnung an:</h2>
|
||||
<p>
|
||||
{{ .Client.Name }} <br />
|
||||
{{ .Client.Address.Street}} {{.Client.Address.Number}} <br />
|
||||
{{ .Client.Address.Street }} {{ .Client.Address.Number }} <br />
|
||||
{{ .Client.Address.ZIPCode }} {{ .Client.Address.Place }} <br />
|
||||
{{ .Client.Contact }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="page p1 first-page">
|
||||
<article>
|
||||
<table>
|
||||
<thead>
|
||||
<!-- Invoice Table -->
|
||||
<section class="page mb-12">
|
||||
<article class="mx-[2cm] overflow-x-auto">
|
||||
<table class="w-full border border-gray-300 border-collapse mb-5">
|
||||
<thead class="bg-gray-200">
|
||||
<tr>
|
||||
<th style="min-width: 3.5em">FID</th>
|
||||
<th>Name</th>
|
||||
<th>Aufwand</th>
|
||||
<th style="min-width: 5.5em">Preis</th>
|
||||
<th
|
||||
class="border border-gray-300 px-2 py-0.5 min-w-[3.5em] text-left"
|
||||
>
|
||||
FID
|
||||
</th>
|
||||
<th class="border border-gray-300 px-2 py-0.5 text-left">Name</th>
|
||||
<th class="border border-gray-300 px-2 py-0.5 text-left">
|
||||
Aufwand
|
||||
</th>
|
||||
<th
|
||||
class="border border-gray-300 px-2 py-0.5 min-w-[5.5em] text-left"
|
||||
>
|
||||
Preis
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Issues }}
|
||||
<tr>
|
||||
<td style="font-family: monospace">{{ .Shorthand }}</td>
|
||||
<td>{{ .Title }}</td>
|
||||
<td>{{ .Duration | duration }}</td>
|
||||
<td>{{ .Duration | price }} CHF</td>
|
||||
<td class="border border-gray-300 px-2 py-0.5 font-mono">
|
||||
{{ .Shorthand }}
|
||||
</td>
|
||||
<td class="border border-gray-300 px-2 py-0.5">{{ .Title }}</td>
|
||||
<td class="border border-gray-300 px-2 py-0.5">
|
||||
{{ .Duration | duration }}
|
||||
</td>
|
||||
<td class="border border-gray-300 px-2 py-0.5">
|
||||
{{ .Duration | price }} CHF
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2" style="text-align: right">Summe:</th>
|
||||
|
||||
<td>{{ .Total | duration }}</td>
|
||||
<td>{{ .Total | price}}</td>
|
||||
<th
|
||||
colspan="2"
|
||||
class="border border-gray-300 px-2 py-0.5 text-right"
|
||||
>
|
||||
Summe:
|
||||
</th>
|
||||
<td class="border border-gray-300 px-2 py-0.5">
|
||||
{{ .Total | duration }}
|
||||
</td>
|
||||
<td class="border border-gray-300 px-2 py-0.5">
|
||||
{{ .Total | price }}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</article>
|
||||
|
||||
{{ .Invoice.HTML }}
|
||||
</section>
|
||||
<section>
|
||||
<h2 style="margin-top: 0">Details zu den Features</h2>
|
||||
|
||||
<!-- Issue Details -->
|
||||
<section>
|
||||
<h2 class="font-semibold mb-4 text-2xl">Details zu den Features</h2>
|
||||
{{ range .Issues }}
|
||||
<article>
|
||||
<div class="issue-title">
|
||||
<h3>
|
||||
<a href="{{ .HTMLURL }}" style="font-family: monospace"
|
||||
<article class="mb-6">
|
||||
<div class="flex justify-between items-end mb-2">
|
||||
<h3 class="font-semibold text-xl pt-5">
|
||||
<a
|
||||
href="{{ .HTMLURL }}"
|
||||
class="font-mono text-blue-600 hover:underline"
|
||||
>{{ .Shorthand }}</a
|
||||
>: {{ .Title }}
|
||||
</h3>
|
||||
<p>
|
||||
{{ if .Closed }} Fertiggestellt: {{ .Closed | time }} {{else}} not
|
||||
<p class="text-sm text-gray-600">
|
||||
{{ if .Closed }} Fertiggestellt: {{ .Closed | time }} {{ else }} not
|
||||
closed {{ end }}
|
||||
</p>
|
||||
</div>
|
||||
{{ .CleanBody | md | oh 3 }}
|
||||
<div class="text-sm markdown">{{ .CleanBody | md | oh 3 }}</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user