diff --git a/assets/css/style.css b/assets/css/style.css index eb3bfa7..91c7218 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -310,6 +310,12 @@ a { letter-spacing: -0.01em; } +.page-head h1 .pill { + vertical-align: middle; + font-size: 0.55em; + margin-left: 4px; +} + .page-subtitle { margin: 0; color: var(--color-text-muted); diff --git a/templates/dialogs.twig b/templates/dialogs.twig index 7d58f99..e12ebb3 100644 --- a/templates/dialogs.twig +++ b/templates/dialogs.twig @@ -5,67 +5,60 @@
{{ icons.chat() }}
-

Диалоги

+

Диалоги {% if dialogs is not empty %}{{ dialogs|length }}{% endif %}

Личные сообщения с другими пользователями

{% if isAuthorized %} -
-
-

{{ icons.chat() }} Мои диалоги

- {% if dialogs is not empty %}{{ dialogs|length }} шт.{% endif %} + {% if dialogs is empty %} +
+ {{ icons.chat() }} + Диалогов пока нет
- - {% if dialogs is empty %} -
- {{ icons.chat() }} - Диалогов пока нет -
- {% else %} -
- {% for dialog in dialogs %} - - - - {% if dialog.companionAvatar %} - {{ dialog.companionData.name }} - {% else %} - {{ (dialog.companionData.name|default(dialog.companionData.login))|slice(0, 1)|upper }} - {% endif %} - - + {% else %} +
+ {% for dialog in dialogs %} + + + + {% if dialog.companionAvatar %} + {{ dialog.companionData.name }} + {% else %} + {{ (dialog.companionData.name|default(dialog.companionData.login))|slice(0, 1)|upper }} + {% endif %} - +
+ {% if dialog.lastMessage %} + {% if dialog.lastMessage.user_from == userId %}Вы:{% endif %} + {% if dialog.lastMessage.type == 'text' %} + {{ dialog.lastMessage.text|slice(0, 80) }}{% if dialog.lastMessage.text|length > 80 %}…{% endif %} + {% elseif dialog.lastMessage.type == 'image' %} + {{ icons.paperclip() }} Изображение + {% elseif dialog.lastMessage.type == 'file' %} + {{ icons.paperclip() }} Файл + {% endif %} + {% else %} + Сообщений пока нет + {% endif %} +
+
+ {% if dialog.unviewedCount > 0 %} + {{ dialog.unviewedCount }} + {% endif %} + + {% endfor %} +
+ {% endif %} {% else %}
{{ icons.warning() }}Вы не авторизованы
{% endif %}