{% extends "layouts/" + render_mode + ".html" %} {% block title %}{{_("Browsing")}} - {{ message }}{% endblock %} {% block contenttools %} {%- set activities = [{ 'name': 'parent-folder', 'url': '../', 'text': _("Parent"), 'description': _("Open Parent Folder"), 'icon': 'upload' }, { 'name': 'folder_add', 'url': '#folder-add', 'text': _("Add Folder"), 'description': _("Create a new folder"), 'icon': 'plus' }, { 'name': 'mailbox_add', 'url': '#mailbox-add', 'text': _("Add Mailbox"), 'description': _("Create a new mailbox"), 'icon': 'plus' }] -%} {%- include("partials/tools_default.html") -%} {% endblock %} {%- macro help(attr) -%} {% if attr == 'flag_mailpile' %}

These are Mailpile-specific data.

{% elif attr == 'flag_directory' %} {% elif attr == 'flag_mailbox' %}

These are mailboxes recognized by Mailpile. You can view their contents or add them to the search index by selecting them and clicking "Watch" above.

{% elif attr == 'flag_files' %} {% endif %} {%- endmacro -%} {%- macro browse_url(attr, info) -%} {%- if attr == 'flag_mailbox' -%} {{- U('/search/?q=vfs:', info.encoded) -}} {%- else -%} {{- U('/browse', info.path, '/') -}} {%- endif -%} {%- endmacro -%} {%- macro box_icon(attr, info, icn) -%} {%- if info.icon -%} {%- else -%} {%- endif -%} {%- endmacro -%} {%- macro settings(attr, info, icn) -%} {%- if info.settings or (attr == 'flag_mailbox') -%} {%- if attr == 'flag_mailbox' -%} {%- set _url = '#mailbox-settings' -%} {%- else -%} {%- set _url = info.settings -%} {%- endif -%}
{%- endif -%} {%- endmacro -%} {% block content %}
{%- set loops = [] %} {%- for attr, titl, icn, link in ( ('flag_mailpile', 'Mailpile', 'star', True), ('flag_mailbox', 'Mailboxes', 'inbox', True), ('flag_directory', 'Folders', 'news', True), ('flag_files', 'Files', 'document', True)) %} {%- set oloop_first = loop.first %} {%- for info in result|selectattr(attr) %} {%- if loop.first %} {%- do loops.append(info.name) %}

{{ titl }}

{{ help(attr) }}
{%- endif %}
{%- set _url = browse_url(attr, info) %} {{ box_icon(attr, info, icn) }}   {{ settings(attr, info) }} {{ info.name }}
{%- if loop.last %}
{%- endif %} {%- endfor %} {%- endfor %} {% endblock %}