phonograph/interim-server/templates/lens.html

50 lines
1.7 KiB
HTML
Raw Normal View History

2025-07-08 14:37:03 -07:00
{% extends "base.html" %}
{% block main %}
<script type="module" src="{{ settings.root_path }}/js_dist/cells.mjs"></script>
<script type="module" src="{{ settings.root_path }}/js_dist/lens-controls.mjs"></script>
<script type="module" src="{{ settings.root_path }}/js_dist/viewer-components.mjs"></script>
2025-07-08 16:54:51 -07:00
<script type="module" src="{{ settings.root_path }}/js_dist/viewer-controller.mjs"></script>
2025-07-16 22:03:04 -07:00
<script type="module" src="{{ settings.root_path }}/glm_dist/field_adder.mjs"></script>
2025-07-08 14:37:03 -07:00
<link rel="stylesheet" href="{{ settings.root_path }}/viewer.css">
<table class="viewer">
<thead>
<tr>
{% for field in fields %}
2025-07-08 16:54:51 -07:00
<th width="{{ field.width_px }}">
2025-07-08 14:37:03 -07:00
<div class="padded-cell">{{ field.label.clone().unwrap_or(field.name.clone()) }}</div>
</th>
{% endfor %}
2025-07-16 22:03:04 -07:00
<th class="column-adder">
<field-adder root-path="{{ settings.root_path }}" columns="{{ all_columns | json }}"></field-adder>
2025-07-08 14:37:03 -07:00
</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
2025-07-08 16:54:51 -07:00
<tr data-pkey="{{ row.pkeys | json }}">
2025-07-08 14:37:03 -07:00
{% for field in fields %}
<td>
2025-07-08 16:54:51 -07:00
{% match field.get_value_encodable(row.data) %}
{% when Ok with (encodable) %}
<{{ field.webc_tag() | safe }}
{% for (k, v) in field.webc_custom_attrs() %}
{{ k }}="{{ v }}"
{% endfor %}
column="{{ field.name }}"
value="{{ encodable | json }}"
class="cell"
>
{{ field.render(encodable) | safe }}
</{{ field.webc_tag() | safe }}
2025-07-08 14:37:03 -07:00
{% when Err with (err) %}
<span class="pg-value-error">{{ err }}</span>
{% endmatch %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}