{% extends "server/base.html" %} {% import "chats/macros.html" as m with context %} {% set searching = "q" in request.query_params %} {% block title %}{{ m.named(opened.detail.conversation) if opened else t.text("chats.title") }}{% endblock %} {% block root %} class="filled"{% endblock %} {% block head %}{% endblock %} {% block top %}
{# a wide screen: the title, which agents, and the search through their messages #}

{{ t.text("chats.title") }}

{% set picked = agents | selectattr("id", "in", scoped | map(attribute="id") | list) | list %}
{# a phone: the bar of the layer it shows #} {% if layer == "list" and not searching %}

{{ t.text("chats.title") }}

{{ m.icon("search") }}
{% elif layer == "list" %} {% elif opened and layer == "info" %}
{{ m.icon("chevron-left") }}

{{ t.text("chats.info") }}

{% elif opened and opened.detail.conversation.review == "pending" %}
{{ m.icon("chevron-left") }}

{{ m.named(opened.detail.conversation) }}

{% elif opened %} {% set conversation = opened.detail.conversation %}
{{ m.icon("chevron-left") }} {{ m.face(conversation) }}
{{ m.named(conversation) }}{% if conversation.kind == "group" %}{{ t.text("chats.members", {"n": conversation.member_count}) }} ยท {% endif %}{{ t.text("chats.replies", {"agent": opened.agent.name}) }}
{{ m.icon("ellipsis") }}
{% else %}
{{ m.icon("chevron-left") }}

{{ t.text("chats.title") }}

{% endif %}
{% endblock %} {% block body %}
{% include "chats/list.html" %}
{# the conversation chosen last opens, one still loading given up #}
{% if opened %}{% include "chats/opened.html" %} {% elif layer != "list" %}

{{ t.text("chats.unavailable") }}

{% endif %}
{% endblock %}