Files
celtic-life-science/app/pdf/templates/forms/_macros.html
T
Shubhankar45 4e5e95775d --
2026-10-27 12:03:31 +00:00

57 lines
2.0 KiB
HTML

{# Building blocks shared by the company-form PDFs. Each mirrors a part of the printed form. #}
{% macro letterhead(full) %}
<div class="company">
<div class="name">{{ company_name }}</div>
{% if full %}
<div class="line">{{ company_address }}</div>
<div class="line">Website: {{ company_website }} E-Mail:{{ company_email }}</div>
<div class="line">PHONE: {{ company_phone }}</div>
{% endif %}
</div>
{% endmacro %}
{# NAME / HEADQUARTER on the left, DATE / MONTH on the right — empty slots stay empty. #}
{% macro meta_block(rows) %}
{% if rows %}
<table class="meta">
{% for pair in rows %}
<tr>
{% for slot in pair %}
<td class="{{ 'ml' if loop.first else 'mr' }}">{% if slot %}<b>{{ slot[0] }}</b> {{ slot[1] }}{% endif %}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% endif %}
{% endmacro %}
{% macro grid(g, left=False) %}
<table class="grid{% if left %} left{% endif %}" style="width:{{ g.width }}">
<colgroup>{% for w in g.widths %}<col style="width:{{ w }}">{% endfor %}</colgroup>
<thead>
<tr>{% for h in g.headers %}<th>{% for part in h.split("\n") %}{{ part }}{% if not loop.last %}<br>{% endif %}{% endfor %}</th>{% endfor %}</tr>
</thead>
<tbody>
{% for r in g.rows %}
<tr>{% for c in r.cells %}<td class="{{ g.aligns[loop.index0] }}">{{ c }}</td>{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
{% endmacro %}
{# "SIGNATURE" alone, low on the right — the sales / activity / call-report forms. #}
{% macro sign_right(text="SIGNATURE") %}
<div class="sign-right">{{ text }}</div>
{% endmacro %}
{# Tour plan, standard tour plan and fare chart: MR signature plus the AM approval. #}
{% macro sign_approval(approval) %}
<table class="sign-approval">
<tr>
<td>SIGNATURE: <span class="ln">{{ approval.mr_name }}</span></td>
<td>{{ approval.label }} <span class="ln">{{ approval.value }}</span>{% if approval.when %}<div class="sign-when">{{ approval.when }}</div>{% endif %}</td>
</tr>
</table>
{% endmacro %}