Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixAPI/templates/pdf/base.html

154 lines
4.2 KiB
HTML
Executable file

<!DOCTYPE html>
<html lang="{{ 'fa' if is_fa else 'en' }}" dir="{{ 'rtl' if is_fa else 'ltr' }}">
<head>
<meta charset="utf-8">
<title>{{ title_text or '' }}</title>
<style>
@font-face {
font-family: 'YekanBakhFaNum';
src: url("{{ fa_font_url_regular|default('') }}") format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'YekanBakhFaNum';
src: url("{{ fa_font_url_bold|default('') }}") format('truetype');
font-weight: 700;
font-style: normal;
}
@page {
margin: 1cm;
size: {{ page_size_css or ((paper_size or 'A4') ~ ' ' ~ (orientation or 'portrait')) }};
{% if not hide_page_numbers %}
@bottom-left {
color: #666;
font-size: 10px;
{% if is_fa %}font-family: 'YekanBakhFaNum', Vazirmatn, Tahoma, Arial, sans-serif;{% endif %}
{% if is_fa %}
content: "صفحه " counter(page) " از " counter(pages);
{% else %}
content: "Page " counter(page) " / " counter(pages);
{% endif %}
}
@bottom-right {
color: #666;
font-size: 10px;
{% if is_fa %}font-family: 'YekanBakhFaNum', Vazirmatn, Tahoma, Arial, sans-serif;{% endif %}
content: string(doc_footer);
}
{% endif %}
}
:root {
--primary: #366092;
--primary-dark: #2a4a6f;
--secondary: #6c757d;
--border: #dee2e6;
--text: #212529;
--muted: #6c757d;
--zebra: #f8f9fa;
--background: #ffffff;
}
body {
font-family: 'YekanBakhFaNum', Vazirmatn, Tahoma, Arial, sans-serif;
font-size: 12px;
line-height: 1.6;
color: var(--text);
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding: 20px;
background: linear-gradient(to right, #f8f9fa, #ffffff);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
border-bottom: 2px solid var(--primary);
}
.title {
font-size: 24px;
font-weight: 700;
color: var(--primary);
margin-bottom: 8px;
}
.meta {
font-size: 11px;
color: var(--muted);
}
.table-wrapper {
overflow-x: auto;
margin: 20px 0;
}
table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
font-size: 11px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
thead {
background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
color: #fff;
display: table-header-group;
}
tfoot {
display: table-footer-group;
}
th {
border: 1px solid var(--border);
padding: 12px 8px;
text-align: {{ 'right' if is_fa else 'left' }};
font-weight: 600;
text-transform: uppercase;
font-size: 10px;
letter-spacing: 0.5px;
white-space: nowrap;
}
tbody tr {
page-break-inside: avoid;
break-inside: avoid;
transition: background-color 0.2s;
}
tbody tr:nth-child(even) {
background: var(--zebra);
}
tbody tr:hover {
background-color: #e9ecef;
}
td {
border: 1px solid var(--border);
padding: 8px 6px;
vertical-align: top;
overflow-wrap: anywhere;
word-break: break-word;
white-space: normal;
text-align: {{ 'right' if is_fa else 'left' }};
page-break-inside: avoid;
}
.summary {
page-break-inside: avoid;
margin-top: 12px;
min-width: 260px;
padding: 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: #fbfbfd;
}
.footer {
font-size: 10px;
color: var(--muted);
string-set: doc_footer "{{ footer_text or '' }}";
}
.amount {
text-align: {{ 'left' if is_fa else 'right' }};
font-weight: bold;
}
</style>
</head>
<body>
{% block content %}{% endblock %}
<div class="footer"></div>
</body>
</html>