laterite-admin 0.9.11

Laterite CMF admin surface: the Axum router, session middleware, and login shell
Documentation
1
2
3
4
5
6
7
8
        {% for row in rows %}
        <tr{% if reorder.is_some() || tree.is_some() %} data-lat-id="{{ row.id }}"{% endif %}{% if tree.is_some() %} data-lat-depth="{{ row.depth }}"{% endif %}{% if let Some(r) = reorder %} data-lat-parent="{{ r.parent }}"{% endif %}{% if row_link %}{% if let Some(base) = edit_base %} data-lat-href="{{ base }}/{{ row.id }}/edit" tabindex="0"{% endif %}{% endif %}>
          {% if let Some(r) = reorder %}<td class="lat-table__grip"><span class="lat-grip" draggable="true" title='{{ shell.t("Drag to reorder") }}' aria-hidden="true">{{ shell.icon("grip-vertical")|safe }}</span><form class="lat-grip__moves" method="post" action="{{ r.path }}" hx-post="{{ r.path }}" hx-target="#{{ region }}" hx-swap="outerHTML"><input type="hidden" name="_csrf" value="{{ shell.csrf_token }}"><input type="hidden" name="id" value="{{ row.id }}"><input type="hidden" name="page" value="{{ r.page }}"><input type="hidden" name="parent" value="{{ r.parent }}"><button class="lat-grip__move" type="submit" name="move" value="up" aria-label='{{ shell.t("Move up") }}'{% if loop.first && page == 1 %} disabled{% endif %}>&#9650;</button><button class="lat-grip__move" type="submit" name="move" value="down" aria-label='{{ shell.t("Move down") }}'{% if loop.last && page == total_pages %} disabled{% endif %}>&#9660;</button></form></td>{% endif %}
          {% if deletable %}<td class="lat-table__pick"><input type="checkbox" name="id" value="{{ row.id }}" form="lat-list-actions" aria-label='{{ shell.t("Select record") }}'></td>{% endif %}
          {% for cell in row.cells %}<td{% if !cell.class.is_empty() %} class="{{ cell.class }}"{% endif %}{% if tree.is_some() && loop.first %} style="padding-left:{{ row.indent }}"{% endif %}>{% if tree.is_some() && loop.first %}{% if let Some(href) = row.toggle %}<a class="lat-tree__toggle" href="{{ href }}" aria-expanded="false" aria-label='{{ shell.t("Expand") }}'></a>{% else %}<span class="lat-tree__leaf"></span>{% endif %}{% endif %}{{ cell.html|safe }}</td>{% endfor %}
          {% if edit_base.is_some() || delete_path.is_some() || tree.is_some() %}<td class="lat-table__actions"><span class="lat-rowactions">{% if let Some(base) = edit_base %}<a class="lat-btn lat-btn--ghost lat-btn--sm lat-btn--icon lat-rowactions__edit" href="{{ base }}/{{ row.id }}/edit" title='{{ shell.t("Edit") }}' aria-label='{{ shell.t("Edit") }}'>{{ shell.icon("pencil")|safe }}</a>{% endif %}{% if let Some(t) = tree %}{% if let Some(mp) = t.move_path %}<a class="lat-btn lat-btn--ghost lat-btn--sm lat-btn--icon" href="{{ mp }}/{{ row.id }}/move" title='{{ shell.t("Move to…") }}' aria-label='{{ shell.t("Move to…") }}'>{{ shell.icon("git-branch")|safe }}</a>{% endif %}{% endif %}{% if let Some(action) = delete_path %}<form method="post" action="{{ action.path }}" hx-post="{{ action.path }}" hx-target="#{{ region }}" hx-swap="outerHTML"><input type="hidden" name="_csrf" value="{{ shell.csrf_token }}"><input type="hidden" name="id" value="{{ row.id }}"><button class="lat-btn lat-btn--ghost lat-btn--sm lat-btn--icon" type="submit" data-lat-confirm="{{ action.confirm }}" title="{{ action.label }}" aria-label="{{ action.label }}">{{ shell.icon(action.icon)|safe }}</button></form>{% endif %}</span></td>{% endif %}
        </tr>
        {% endfor %}