Pormenjen naicn rendovanja podatak iz template, popunjeni ceo dokument
This commit is contained in:
@@ -1,66 +1,159 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Document PDF</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 2cm;
|
||||
}
|
||||
|
||||
<div class="document-container">
|
||||
{% if error %}
|
||||
<p style="color: red;">{{ error }}</p>
|
||||
{% endif %}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media print {
|
||||
table {
|
||||
page-break-inside: avoid; /* Prevent table from breaking across pages */
|
||||
}
|
||||
|
||||
tr {
|
||||
page-break-inside: avoid; /* Prevent table rows from breaking across pages */
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
thead {
|
||||
display: table-header-group; /* Ensure table headers repeat on each page */
|
||||
}
|
||||
|
||||
tfoot {
|
||||
display: table-footer-group; /* Ensure table footers repeat on each page */
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-before: always; /* Force a page break before this element */
|
||||
}
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
font-size: 12pt;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
<div>
|
||||
{{ rendered_html|safe }}
|
||||
.document-container {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.document-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.document-meta {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.document-content {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.document-title {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.document-subtitle {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.document-h1 {
|
||||
font-size: 1.75rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.document-h2 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.document-h3 {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.document-quote {
|
||||
border-left: 4px solid #ccc;
|
||||
margin: 1.5rem 0;
|
||||
padding-left: 1rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.document-body {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.green { background-color: green; color: white; }
|
||||
.lightgreen { background-color: lightgreen; }
|
||||
.yellow { background-color: yellow; }
|
||||
.orange { background-color: orange; }
|
||||
.red { background-color: red; color: white; }
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
word-wrap: break-word;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 4px 6px;
|
||||
font-size: 10pt;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
caption {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.cmmi thead th {
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document-container">
|
||||
{% if error %}
|
||||
<p style="color: red;">{{ error }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{{ rendered_html|safe }}
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.document-container {
|
||||
max-width: 800px;
|
||||
margin: 2rem auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.document-header {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.document-meta {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.document-content {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.document-title {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.document-subtitle {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.document-h1 {
|
||||
font-size: 1.75rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.document-h2 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.document-h3 {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.document-quote {
|
||||
border-left: 4px solid #ccc;
|
||||
margin: 1.5rem 0;
|
||||
padding-left: 1rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.document-body {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user