112 lines
2.7 KiB
Django/Jinja
112 lines
2.7 KiB
Django/Jinja
{% macro display_entry(entry) %}
|
|
<sl-tree-item
|
|
id="entry_{{ entry.name }}"
|
|
class="tree-entry-item"
|
|
data-type="entry"
|
|
data-name="{{ entry.name }}"
|
|
data-group-path="/"
|
|
{% if secret | default(false) %}
|
|
{% if secret.name == entry.name %}
|
|
selected=""
|
|
{% endif %}
|
|
{% endif %}
|
|
>
|
|
<sl-icon name="shield"> </sl-icon>
|
|
<span class="px-2">{{ entry.name }}</span>
|
|
</sl-tree-item>
|
|
{% endmacro %}
|
|
|
|
|
|
{% macro display_group(group) %}
|
|
<sl-tree-item
|
|
class="secret-group-list-item"
|
|
data-type="group"
|
|
data-name="{{ group.group_name }}"
|
|
data-group-path="{{ group.path }}"
|
|
{% if group_path_nodes | default(false) %}
|
|
{% if group.group_name in group_path_nodes %}
|
|
expanded=""
|
|
{% endif %}
|
|
{% if selected_group | default(None) %}
|
|
{% if group.path == selected_group %}
|
|
selected=""
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
>
|
|
<sl-icon name="folder"> </sl-icon>
|
|
<span class="px-2">{{ group.group_name }}</span>
|
|
{% for entry in group.entries %}
|
|
{{ display_entry(entry) }}
|
|
{% endfor %}
|
|
{% for child in group.children %}
|
|
{{ display_group(child) }}
|
|
{% endfor %}
|
|
</sl-tree-item>
|
|
{% endmacro %}
|
|
|
|
|
|
{% extends 'base/master-detail-email.html.j2' %}
|
|
|
|
{% block title %}Secrets{% endblock %}
|
|
|
|
|
|
{% block master %}
|
|
|
|
<div class="flowbite-init-target">
|
|
<div id="secret-tree">
|
|
<sl-tree class="tree-with-icons">
|
|
<sl-tree-item
|
|
id="secret-group-root-item"
|
|
data-type="root"
|
|
data-name="root"
|
|
|
|
{% if "/" in group_path_nodes %}
|
|
expanded=""
|
|
{% endif %}
|
|
{% if selected_group == "/"%}
|
|
selected=""
|
|
{% endif %}
|
|
>
|
|
<sl-icon name="folder"> </sl-icon>
|
|
<span class="px-2">Ungrouped</span>
|
|
{% for entry in groups.ungrouped %}
|
|
{{ display_entry(entry) }}
|
|
{% endfor %}
|
|
</sl-tree-item>
|
|
{% for child in groups.groups %}
|
|
{{ display_group(child) }}
|
|
{% endfor %}
|
|
</sl-tree>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block detail %}
|
|
{% if group_page | default(false) %}
|
|
<div class="w-full" id="secretdetails">
|
|
{% include '/secrets/partials/group_detail.html.j2' %}
|
|
</div>
|
|
{% elif root_group_page | default(false) %}
|
|
<div class="w-full" id="secretdetails">
|
|
{% include '/secrets/partials/edit_root.html.j2' %}
|
|
</div>
|
|
{% elif secret_page | default(false) %}
|
|
<div class="w-full" id="secretdetails">
|
|
{% include '/secrets/partials/tree_detail.html.j2' %}
|
|
</div>
|
|
{% else %}
|
|
{% include '/secrets/partials/default_detail.html.j2' %}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block local_scripts %}
|
|
<script>
|
|
{% include '/secrets/partials/tree_event.js' %}
|
|
</script>
|
|
{% endblock %}
|