|
|
{% macro metadata_block(metadata) -%} |
|
|
{% if metadata %} |
|
|
<div class="section"> |
|
|
<h2>Metadatos</h2> |
|
|
<div class="card-grid"> |
|
|
{% if metadata.script_type %}<div class="card"><strong>Tipo:</strong> {{ metadata.script_type }}</div>{% endif %} |
|
|
{% if metadata.suitescript_version %}<div class="card"><strong>SuiteScript:</strong> {{ metadata.suitescript_version }}</div>{% endif %} |
|
|
{% if metadata.language %}<div class="card"><strong>Lenguaje:</strong> {{ metadata.language }}</div>{% endif %} |
|
|
{% if metadata.module_type %}<div class="card"><strong>Módulo:</strong> {{ metadata.module_type }}</div>{% endif %} |
|
|
</div> |
|
|
{% if metadata.description %}<p>{{ metadata.description }}</p>{% endif %} |
|
|
{% if metadata.dependencies %} |
|
|
<p class="muted">Dependencias: |
|
|
{% for dep in metadata.dependencies %} |
|
|
<span class="pill">{{ dep }}</span> |
|
|
{% endfor %} |
|
|
</p> |
|
|
{% endif %} |
|
|
</div> |
|
|
{% endif %} |
|
|
{%- endmacro %} |
|
|
|
|
|
{% macro summary_block(text) -%} |
|
|
{% if text %} |
|
|
<div class="section"> |
|
|
<h2>Resumen Ejecutivo</h2> |
|
|
<div class="summary-box">{{ text }}</div> |
|
|
</div> |
|
|
{% endif %} |
|
|
{%- endmacro %} |
|
|
|
|
|
{% macro list_block(title, items) -%} |
|
|
{% if items %} |
|
|
<div class="section"> |
|
|
<h2>{{ title }}</h2> |
|
|
<ul> |
|
|
{% for item in items %} |
|
|
<li> |
|
|
{% if item is mapping %} |
|
|
{% for key, value in item.items() %} |
|
|
<strong>{{ key|replace('_',' ')|title }}:</strong> {{ value }}{% if not loop.last %}; {% endif %} |
|
|
{% endfor %} |
|
|
{% else %} |
|
|
{{ item }} |
|
|
{% endif %} |
|
|
</li> |
|
|
{% endfor %} |
|
|
</ul> |
|
|
</div> |
|
|
{% endif %} |
|
|
{%- endmacro %} |
|
|
|
|
|
|
|
|
{% macro table_block(title, rows, columns) -%} |
|
|
{% if rows %} |
|
|
<div class="section"> |
|
|
<h2>{{ title }}</h2> |
|
|
<table> |
|
|
<thead> |
|
|
<tr> |
|
|
{% for column in columns %} |
|
|
<th>{{ column.title }}</th> |
|
|
{% endfor %} |
|
|
</tr> |
|
|
</thead> |
|
|
<tbody> |
|
|
{% for row in rows %} |
|
|
|
|
|
{% if row is mapping %} |
|
|
<tr> |
|
|
{% for column in columns %} |
|
|
{% set value = row.get(column.field) %} |
|
|
{% if value is sequence and value is not string %} |
|
|
<td>{{ value|join(", ") }}</td> |
|
|
{% else %} |
|
|
<td>{{ value or "" }}</td> |
|
|
{% endif %} |
|
|
{% endfor %} |
|
|
</tr> |
|
|
{% else %} |
|
|
|
|
|
<tr> |
|
|
<td colspan="{{ columns|length }}"> |
|
|
{{ row }} |
|
|
</td> |
|
|
</tr> |
|
|
{% endif %} |
|
|
{% endfor %} |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
{% endif %} |
|
|
{%- endmacro %} |
|
|
|
|
|
{% macro logic_block(title, text) -%} |
|
|
{% if text %} |
|
|
<div class="section"> |
|
|
<h2>{{ title }}</h2> |
|
|
<p>{{ text }}</p> |
|
|
</div> |
|
|
{% endif %} |
|
|
{%- endmacro %} |
|
|
|