41 lines
2.0 KiB
HTML
41 lines
2.0 KiB
HTML
{% macro render_folder(folder) %}
|
|
{% set content_children = foldered_contents[folder.id]|default([]) %}
|
|
{% set has_children = folder.children or content_children %}
|
|
|
|
<li class="icon-folder li-explr-folder li-explr-folder-{{ folder.id }}">
|
|
<a href="{% if use_href %}{{ url_for('slideshow_content_cd') }}?path={{ folder.path }}{% else %}javascript:void(0);{% endif %}"
|
|
class="{% if folder.path == working_folder_path %}active{% endif %} {{ 'explr-pick-folder' if not use_href }}">
|
|
{{ folder.name }}
|
|
</a>
|
|
|
|
{% if has_children %}
|
|
<ul>
|
|
{% for child in folder.children %}
|
|
{{ render_folder(child) }}
|
|
{% endfor %}
|
|
{% for content in content_children %}
|
|
{% set slides = slides_with_content[content.id]|default([]) if slides_with_content else [] %}
|
|
{% set icon = enum_content_type.get_fa_icon(content.type) %}
|
|
{% set color = enum_content_type.get_color_icon(content.type) %}
|
|
<li class="explr-item" data-entity-json="{{ content.to_json({'classIcon': icon, 'classColor': color, 'metadata': json_loads(content.metadata)}) }}">
|
|
<i class="fa {{ icon }} {{ color }}"></i>
|
|
{% if slides|length > 0 %}
|
|
<sub>
|
|
<i class="fa fa-play"></i>
|
|
</sub>
|
|
{% endif %}
|
|
<a href="{% if use_href %}{{ url_for('slideshow_content_edit', content_id=content.id, path=folder.path) }}{% else %}javascript:void(0);{% endif %}"
|
|
class="{{ 'explr-pick-element' if not use_href }}">
|
|
{{ content.name }}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endmacro %}
|
|
|
|
<ul class="explr hidden" id="tree" data-working-folder-id="{{ working_folder.id }}">
|
|
{{ render_folder(folders_tree) }}
|
|
</ul>
|