Доработки клиентского интерфейса + мелкие правки
This commit is contained in:
1 parent
c43bcff23f
commit
55078ddb36
21 files changed
+2172
-521
No files matched your search
@@ -0,0 +1,45 @@
|
||||
{# Инлайн SVG-иконки. Использование: {% import '_icons.twig' as icons %} ... {{ icons.home() }} #}
|
||||
|
||||
{% macro base(paths, class) %}<svg class="icon{% if class %} {{ class }}{% endif %}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">{{ paths|raw }}</svg>{% endmacro %}
|
||||
|
||||
{% macro home(class) %}{{ _self.base('<path d="M4 11 12 4l8 7"/><path d="M6 10v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-9"/><path d="M10 20v-5h4v5"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro chat(class) %}{{ _self.base('<rect x="3" y="5" width="18" height="12" rx="3"/><path d="M8 17l-2.5 3v-3"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro users(class) %}{{ _self.base('<circle cx="12" cy="8" r="3.2"/><path d="M5 20c0-3.5 3-6.2 7-6.2s7 2.7 7 6.2"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro info(class) %}{{ _self.base('<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><circle cx="12" cy="7.6" r="0.9" fill="currentColor" stroke="none"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro flask(class) %}{{ _self.base('<path d="M10 3h4"/><path d="M10 3v6.2l-5.2 9a1 1 0 0 0 .9 1.5h12.6a1 1 0 0 0 .9-1.5L14 9.2V3"/><path d="M7.7 15h8.6"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro shield(class) %}{{ _self.base('<path d="M12 3l7 3v6c0 5-3 8.5-7 9-4-0.5-7-4-7-9V6z"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro logout(class) %}{{ _self.base('<path d="M15 4h-4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h4"/><path d="M10 12h10"/><path d="M17 8l4 4-4 4"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro login(class) %}{{ _self.base('<path d="M9 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H9"/><path d="M14 12H4"/><path d="M8 8l-4 4 4 4"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro menu(class) %}{{ _self.base('<line x1="4" y1="7" x2="20" y2="7"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="17" x2="20" y2="17"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro close(class) %}{{ _self.base('<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro warning(class) %}{{ _self.base('<path d="M12 3l10 18H2z"/><line x1="12" y1="9.5" x2="12" y2="14"/><circle cx="12" cy="17" r="0.9" fill="currentColor" stroke="none"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro check(class) %}{{ _self.base('<path d="M4 12.5l5 5 11-11"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro send(class) %}{{ _self.base('<path d="M3 11l18-8-8 18-2-8-8-2z"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro paperclip(class) %}{{ _self.base('<path d="M8 13V7a4 4 0 0 1 8 0v9a2.5 2.5 0 0 1-5 0V8"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro mail(class) %}{{ _self.base('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 6.5l8 6 8-6"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro clock(class) %}{{ _self.base('<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3.5 2"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro hash(class) %}{{ _self.base('<line x1="9" y1="4" x2="7" y2="20"/><line x1="17" y1="4" x2="15" y2="20"/><line x1="4" y1="9" x2="20" y2="9"/><line x1="3" y1="15" x2="19" y2="15"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro layers(class) %}{{ _self.base('<path d="M12 4l8 4.5-8 4.5-8-4.5L12 4z"/><path d="M4 13.5L12 18l8-4.5"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro arrowLeft(class) %}{{ _self.base('<path d="M19 12H5"/><path d="M11 6l-6 6 6 6"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro arrowRight(class) %}{{ _self.base('<path d="M5 12h14"/><path d="M13 6l6 6-6 6"/>', class) }}{% endmacro %}
|
||||
|
||||
{% macro user(class) %}{{ _self.base('<circle cx="12" cy="8" r="3.4"/><path d="M6 19c0-3.3 2.7-5.5 6-5.5s6 2.2 6 5.5"/>', class) }}{% endmacro %}
|
||||
+76
-45
@@ -1,53 +1,84 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% block title %}Диалоги{% endblock %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
{% block title %}Диалог с {{ companionName }}{% endblock %}
|
||||
{% block main %}
|
||||
{% if isAuthorized %}
|
||||
<h1>Диалог # {{ dialog_id }} с "{{ companionName }} ({{ companionId }})"</h1>
|
||||
|
||||
<div class="messageBox">
|
||||
{% for message in messages %}
|
||||
<div class="message {% if message.user_from == userId %}fromMe{% else %}fromCompanion{% endif %}">
|
||||
<div class="name"><a href="/users/{{ message.user_from_data.id }}">{{ message.user_from_data.name }}</a></div>
|
||||
<div class="text">
|
||||
{% if message.type == 'text' %}
|
||||
{{ message.text }}
|
||||
{% elseif message.type == 'image' %}
|
||||
{% if message.file.error == false %}
|
||||
<a href="{{ message.file.path }}" target="_blank">
|
||||
<img class="dialogImage" src="{{ message.file.path }}" alt="{{ message.file.name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<b>Некорректное изображение</b>
|
||||
{% endif %}
|
||||
{% elseif message.type == 'file' %}
|
||||
{% if message.file.error == false %}
|
||||
<a class="fileLink" href="{{ message.file.path }}" target="_blank">{{ message.file.name }}</a>
|
||||
{% else %}
|
||||
<b>Некорректный файл</b>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="date">{{ message.date }}</div>
|
||||
{% if message.user_from == userId %}
|
||||
<div class="deliveryStatus {% if message.user_from == userId and message.viewed == "Y" %}viewed{% endif %}"> </div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ (companionName|default('?'))|slice(0, 1)|upper }}</div>
|
||||
<div>
|
||||
<h1>{{ companionName }}</h1>
|
||||
<p class="page-subtitle">Диалог №{{ dialog_id }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<form method="POST" action="/users/{{ companionId }}/sendMessage" enctype="multipart/form-data">
|
||||
<input type="hidden" name="dialogId" value="{{ dialog_id }}">
|
||||
<textarea name="message"></textarea>
|
||||
<label class="input-file w100">
|
||||
<input type="file" name="file">
|
||||
<span class="w100">Выберите файл</span>
|
||||
</label>
|
||||
<button class="button w100" type="submit" value="sendMessage">Отправить</button>
|
||||
</form>
|
||||
</p>
|
||||
<div class="chat-panel">
|
||||
<div class="chat-panel-header">
|
||||
<span class="user-avatar">{{ (companionName|default('?'))|slice(0, 1)|upper }}</span>
|
||||
<div class="chat-panel-header-meta">
|
||||
<strong>{{ companionName }}</strong>
|
||||
<span class="status {% if companionOnline %}is-online{% endif %}">
|
||||
<span class="status-dot"></span>
|
||||
{{ companionOnline ? 'Онлайн' : 'Не в сети' }}
|
||||
</span>
|
||||
</div>
|
||||
<span class="pill">{{ icons.chat() }} {{ messagesCount }} сообщений</span>
|
||||
</div>
|
||||
|
||||
{% if messages is empty %}
|
||||
<div class="messageBox">
|
||||
<div class="empty-state">
|
||||
{{ icons.chat() }}
|
||||
<span>Сообщений пока нет — начните переписку</span>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="messageBox">
|
||||
{% for message in messages %}
|
||||
<div class="message {% if message.user_from == userId %}fromMe{% else %}fromCompanion{% endif %}">
|
||||
<div class="name"><a href="/users/{{ message.user_from_data.id }}">{{ message.user_from_data.name }}</a></div>
|
||||
<div class="text">
|
||||
{% if message.type == 'text' %}
|
||||
{{ message.text }}
|
||||
{% elseif message.type == 'image' %}
|
||||
{% if message.file.error == false %}
|
||||
<a href="{{ message.file.path }}" target="_blank">
|
||||
<img class="dialogImage" src="{{ message.file.path }}" alt="{{ message.file.name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<b>Некорректное изображение</b>
|
||||
{% endif %}
|
||||
{% elseif message.type == 'file' %}
|
||||
{% if message.file.error == false %}
|
||||
<a class="fileLink" href="{{ message.file.path }}" target="_blank">{{ icons.paperclip() }} {{ message.file.name }}</a>
|
||||
{% else %}
|
||||
<b>Некорректный файл</b>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="date">{{ message.date }}</div>
|
||||
{% if message.user_from == userId %}
|
||||
<div class="deliveryStatus {% if message.user_from == userId and message.viewed == "Y" %}viewed{% endif %}"> </div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="chat-compose">
|
||||
<form method="POST" action="/users/{{ companionId }}/sendMessage" enctype="multipart/form-data">
|
||||
<input type="hidden" name="dialogId" value="{{ dialog_id }}">
|
||||
<textarea name="message" placeholder="Введите сообщение..."></textarea>
|
||||
<div class="chat-compose-actions">
|
||||
<label class="input-file">
|
||||
<input type="file" name="file">
|
||||
<span>{{ icons.paperclip() }} Файл</span>
|
||||
</label>
|
||||
<button class="button" type="submit" value="sendMessage">{{ icons.send() }} Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">Вы не авторизованы</div>
|
||||
<div class="alert alert-error">{{ icons.warning() }}<span>Вы не авторизованы</span></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
+68
-26
@@ -1,32 +1,74 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
{% block title %}Диалоги{% endblock %}
|
||||
{% block main %}
|
||||
<h1>Диалоги</h1>
|
||||
{% if isAuthorized %}
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ icons.chat() }}</div>
|
||||
<div>
|
||||
<h1>Диалоги</h1>
|
||||
<p class="page-subtitle">Личные сообщения с другими пользователями</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Прочитано</td>
|
||||
<td>Непрочитанных</td>
|
||||
<td>С кем диалог</td>
|
||||
<td>Действия</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dialog in dialogs %}
|
||||
<tr>
|
||||
<td>{{ dialog.id }}</td>
|
||||
<td>{{ dialog.viewed }}</td>
|
||||
<td>{{ dialog.unviewedCount }}</td>
|
||||
<td>{{ dialog.companionData.nameForDisplay }}</td>
|
||||
<td><a href="/dialog/{{ dialog.id }}">Открыть диалог</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if isAuthorized %}
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.chat() }} Мои диалоги</h2>
|
||||
{% if dialogs is not empty %}<span class="pill">{{ dialogs|length }} шт.</span>{% endif %}
|
||||
</div>
|
||||
|
||||
{% if dialogs is empty %}
|
||||
<div class="empty-state">
|
||||
{{ icons.chat() }}
|
||||
<span>Диалогов пока нет</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="table-wrap">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Собеседник</th>
|
||||
<th style="width: 120px;">Статус</th>
|
||||
<th style="width: 110px;">Сообщений</th>
|
||||
<th style="width: 130px;">Непрочитанных</th>
|
||||
<th style="width: 150px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dialog in dialogs %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="cell-user">
|
||||
<span class="user-avatar">{{ dialog.companionData.nameForDisplay|slice(0, 1)|upper }}</span>
|
||||
<div class="cell-user-meta">
|
||||
<span>{{ dialog.companionData.name }}</span>
|
||||
<span class="cell-user-sub">{{ dialog.companionData.login }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="status {% if dialog.companionOnline %}is-online{% endif %}">
|
||||
<span class="status-dot"></span>
|
||||
{{ dialog.companionOnline ? 'Онлайн' : 'Не в сети' }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ dialog.messagesCount }}</td>
|
||||
<td>
|
||||
{% if dialog.unviewedCount > 0 %}
|
||||
<span class="nav-badge">{{ dialog.unviewedCount }}</span>
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a class="row-action" href="/dialog/{{ dialog.id }}">{{ icons.chat() }} Открыть</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">Вы не авторизованы</div>
|
||||
<div class="alert alert-error">{{ icons.warning() }}<span>Вы не авторизованы</span></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
+76
-25
@@ -1,28 +1,79 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
{% block title %}Главная страница{% endblock %}
|
||||
{% block main %}
|
||||
<h1>Главная страница</h1>
|
||||
<p>Добро пожаловать на сайт проекта DeltaFrameework!</p>
|
||||
<p>Публичная часть сайта работает с использованием шаблонизатора Twig и пока малофункциональна.</p>
|
||||
<h2>Контакты</h2>
|
||||
<p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Способ связи</th>
|
||||
<th>Контакт</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>E-mail</td>
|
||||
<td>rsgrinko@gmail.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telegram</td>
|
||||
<td>rsgrinko</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
{% endblock %}
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ icons.home() }}</div>
|
||||
<div>
|
||||
<h1>Главная страница</h1>
|
||||
<p class="page-subtitle">Добро пожаловать на сайт проекта DeltaFramework!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<p>Публичная часть сайта работает с использованием шаблонизатора Twig и пока малофункциональна, но уже
|
||||
показывает живые данные из системы.</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.info() }} Система в цифрах</h2>
|
||||
</div>
|
||||
<div class="stat-grid">
|
||||
<div class="stat-tile tone-primary">
|
||||
<div class="stat-tile-icon">{{ icons.users() }}</div>
|
||||
<div>
|
||||
<div class="stat-tile-value">{{ stats.usersTotal }}</div>
|
||||
<div class="stat-tile-label">Всего пользователей</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-tile tone-success">
|
||||
<div class="stat-tile-icon">{{ icons.chat() }}</div>
|
||||
<div>
|
||||
<div class="stat-tile-value">{{ stats.usersOnline }}</div>
|
||||
<div class="stat-tile-label">Онлайн сейчас</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-tile tone-violet">
|
||||
<div class="stat-tile-icon">{{ icons.check() }}</div>
|
||||
<div>
|
||||
<div class="stat-tile-value">{{ stats.usersVerified }}</div>
|
||||
<div class="stat-tile-label">С подтверждённым E-Mail</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-tile tone-accent">
|
||||
<div class="stat-tile-icon">{{ icons.flask() }}</div>
|
||||
<div>
|
||||
<div class="stat-tile-value">{{ stats.coreVersion }}</div>
|
||||
<div class="stat-tile-label">Версия ядра</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.mail() }} Контакты</h2>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Способ связи</th>
|
||||
<th>Контакт</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>E-mail</td>
|
||||
<td>rsgrinko@gmail.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telegram</td>
|
||||
<td>rsgrinko</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
+23
-20
@@ -1,23 +1,26 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
{% block title %}Информация о сборке{% endblock %}
|
||||
{% block main %}
|
||||
<h1>Информация о сборке</h1>
|
||||
<p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ключ</th>
|
||||
<th>Значение</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key, value in data %}
|
||||
<tr>
|
||||
<td>{{ key }}</td>
|
||||
<td>{{ value }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
{% endblock %}
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ icons.info() }}</div>
|
||||
<div>
|
||||
<h1>Информация о сборке</h1>
|
||||
<p class="page-subtitle">Текущие параметры и версия ядра фреймворка</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="meta-grid">
|
||||
{% for key, value in data %}
|
||||
<div class="meta-item">
|
||||
<div class="meta-item-icon">{{ icons.hash() }}</div>
|
||||
<div>
|
||||
<span class="meta-item-label">{{ key }}</span>
|
||||
<span class="meta-item-value">{{ value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
+49
-27
@@ -1,44 +1,66 @@
|
||||
<!DOCTUPE html>
|
||||
{% import '_icons.twig' as icons %}<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Delta Framework{% endblock %}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="/assets/css/style.css?{{ salt }}" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script src="/assets/js/jquery-3.7.0.min.js?{{ salt }}"></script>
|
||||
<script src="/assets/js/script.js?{{ salt }}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="logo">
|
||||
<div class="logoText">DeltaFramework</div>
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="mainMenu">
|
||||
<div class="menuItem {% if currentPage == 'index' %}active{% endif %}"><a href="/">Главная</a></div>
|
||||
<div class="menuItem"><a href="/admin/">Админка</a></div>
|
||||
{% if isAuthorized %}
|
||||
<div class="menuItem {% if currentPage == 'dialogs' %}active{% endif %}"><a href="/dialogs">Диалоги{% if newMessages > 0 %} ({{ newMessages }}){% endif %}</a></div>
|
||||
{% endif %}
|
||||
<div class="menuItem {% if currentPage == 'users' %}active{% endif %}"><a href="/users">Список пользователей</a></div>
|
||||
<div class="menuItem {% if currentPage == 'info' %}active{% endif %}"><a href="/info">Информация о сборке</a></div>
|
||||
<div class="menuItem {% if currentPage == 'test' %}active{% endif %}"><a href="/test">Тестовая</a></div>
|
||||
|
||||
<div class="userInfo">
|
||||
<div class="brand-block">
|
||||
<div class="brand-mark">Δ</div>
|
||||
<div class="brand-title">Delta<span>Framework</span></div>
|
||||
<div class="brand-tagline">Простой PHP-фреймворк для веб-проектов</div>
|
||||
</div>
|
||||
|
||||
<div class="shell">
|
||||
<header class="shell-header">
|
||||
<div class="shell-header-inner">
|
||||
<button class="nav-toggle" id="navToggle" type="button" aria-label="Открыть меню" aria-expanded="false" aria-controls="mainNav">
|
||||
{{ icons.menu('nav-toggle-icon nav-toggle-open') }}
|
||||
{{ icons.close('nav-toggle-icon nav-toggle-close') }}
|
||||
</button>
|
||||
|
||||
<nav class="nav" id="mainNav">
|
||||
<a class="nav-link {% if currentPage == 'index' %}active{% endif %}" href="/">{{ icons.home() }}<span>Главная</span></a>
|
||||
<a class="nav-link" href="/admin/">{{ icons.shield() }}<span>Админка</span></a>
|
||||
{% if isAuthorized %}
|
||||
{{ userData.name }} [<a href="/logout">Выход</a>]
|
||||
{% else %}
|
||||
Гость [<a href="/login">Войти</a>]
|
||||
<a class="nav-link {% if currentPage == 'dialogs' %}active{% endif %}" href="/dialogs">
|
||||
{{ icons.chat() }}<span>Диалоги</span>
|
||||
{% if newMessages > 0 %}<span class="nav-badge">{{ newMessages }}</span>{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a class="nav-link {% if currentPage == 'users' %}active{% endif %}" href="/users">{{ icons.users() }}<span>Пользователи</span></a>
|
||||
<a class="nav-link {% if currentPage == 'info' %}active{% endif %}" href="/info">{{ icons.info() }}<span>Информация</span></a>
|
||||
<a class="nav-link {% if currentPage == 'test' %}active{% endif %}" href="/test">{{ icons.flask() }}<span>Тестовая</span></a>
|
||||
|
||||
<div class="nav-user">
|
||||
{% if isAuthorized %}
|
||||
<span class="user-avatar">{{ (userData.name|default(userData.login|default('U')))|slice(0, 1)|upper }}</span>
|
||||
<span class="user-name">{{ userData.name }}</span>
|
||||
<a class="nav-link nav-link-icon" href="/logout" title="Выход">{{ icons.logout() }}</a>
|
||||
{% else %}
|
||||
<a class="nav-link nav-link-guest" href="/login">{{ icons.login() }}<span>Войти</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="breadcrumbs"><a href="/">Главная</a> » Раздел » Тестовая</div>
|
||||
</header>
|
||||
|
||||
<div class="shell-content">
|
||||
{% block main %}{% endblock %}
|
||||
</div>
|
||||
<div class="footer">
|
||||
<a href="https://github.com/rsgrinko/delta_framework" target="_blank">DeltaFramework</a> by <a href="https://it-stories.ru/about" target="_blank">Roman S Grinko</a>, {{ currentYear }} | Generation time: {{ executionTime }} | Memory use: {{ memoryUse }}
|
||||
</div>
|
||||
|
||||
<footer class="shell-footer">
|
||||
<div class="shell-footer-inner">
|
||||
<span><a href="https://github.com/rsgrinko/delta_framework" target="_blank">DeltaFramework</a> by <a href="https://it-stories.ru/about" target="_blank">Roman S Grinko</a> © {{ currentYear }}</span>
|
||||
<span class="footer-meta">{{ executionTime }} · {{ memoryUse }}</span>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+38
-29
@@ -1,34 +1,43 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
{% block title %}Авторизация{% endblock %}
|
||||
{% block main %}
|
||||
<h1>Авторизация</h1>
|
||||
{% if failed %}
|
||||
<div class="alert alert-error">{{ errorMessage }}</div>
|
||||
{% endif %}
|
||||
<p>
|
||||
<form action="/login/authorize" method="POST">
|
||||
<input class="input" type="text" name="login" placeholder="Введите логин">
|
||||
<input class="input" type="password" name="password" placeholder="Введите пароль">
|
||||
<div class="auth-shell">
|
||||
<div class="auth-card">
|
||||
<div class="auth-box">
|
||||
<div class="page-head-icon">{{ icons.login() }}</div>
|
||||
<h1>Авторизация</h1>
|
||||
<p class="page-subtitle">Войдите, чтобы продолжить работу</p>
|
||||
|
||||
{% if USE_CAPTCHA %}
|
||||
<div class="input captchaInput">
|
||||
<img id="captchaCode" src="{{ SITE_URL }}/core/captcha.php">
|
||||
<span id="updateCaptcha" class="button" style="vertical-align: super;">Обновить код</span>
|
||||
{% if failed %}
|
||||
<div class="alert alert-error">{{ icons.warning() }}<span>{{ errorMessage }}</span></div>
|
||||
{% endif %}
|
||||
|
||||
<form action="/login/authorize" method="POST">
|
||||
<input class="input" type="text" name="login" placeholder="Введите логин">
|
||||
<input class="input" type="password" name="password" placeholder="Введите пароль">
|
||||
|
||||
{% if USE_CAPTCHA %}
|
||||
<div class="input captchaInput">
|
||||
<img id="captchaCode" src="{{ SITE_URL }}/core/captcha.php">
|
||||
<span id="updateCaptcha" class="button button-ghost" style="vertical-align: super;">Обновить код</span>
|
||||
</div>
|
||||
<input type="text" class="input" name="captchaCode" placeholder="Код с картинки">
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let $captchaImage = $('#captchaCode'),
|
||||
$captchaSrc = $captchaImage.attr('src'),
|
||||
$updateBtn = $('#updateCaptcha');
|
||||
$updateBtn.click(function () {
|
||||
$captchaImage.attr('src', $captchaSrc + `?v=${new Date().getTime()}`);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<button class="button w100" type="submit">Войти</button>
|
||||
</form>
|
||||
</div>
|
||||
<input type="text" class="input" name="captchaCode" placeholder="Код с картинки">
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
let $captchaImage = $('#captchaCode'),
|
||||
$captchaSrc = $captchaImage.attr('src'),
|
||||
$updateBtn = $('#updateCaptcha');
|
||||
$updateBtn.click(function () {
|
||||
$captchaImage.attr('src', $captchaSrc + `?v=${new Date().getTime()}`);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<button class="button w100" type="submit">Войти</button>
|
||||
</form>
|
||||
</p>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
+45
-31
@@ -1,36 +1,50 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
|
||||
{% block title %}тестинг{% endblock %}
|
||||
{% block title %}Тестовая страница{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<h1>Тестовая страница</h1>
|
||||
<p>This is sample text!</p>
|
||||
<div class="alert alert-error">Error alert</div>
|
||||
<div class="alert alert-success">Success alert</div>
|
||||
<div class="alert alert-info">Info alert</div>
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ icons.flask() }}</div>
|
||||
<div>
|
||||
<h1>Тестовая страница</h1>
|
||||
<p class="page-subtitle">Витрина компонентов оформления</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Table</h2>
|
||||
<p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field 1</th>
|
||||
<th>Field 2</th>
|
||||
<th>Field 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Value 1</td>
|
||||
<td>Value 2</td>
|
||||
<td>Value 3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Value 4</td>
|
||||
<td>Value 5</td>
|
||||
<td>Value 6</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
{% endblock %}
|
||||
<div class="section">
|
||||
<p>This is sample text!</p>
|
||||
<div class="alert alert-error">{{ icons.warning() }}<span>Error alert</span></div>
|
||||
<div class="alert alert-success">{{ icons.check() }}<span>Success alert</span></div>
|
||||
<div class="alert alert-info">{{ icons.info() }}<span>Info alert</span></div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.hash() }} Table</h2>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field 1</th>
|
||||
<th>Field 2</th>
|
||||
<th>Field 3</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Value 1</td>
|
||||
<td>Value 2</td>
|
||||
<td>Value 3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Value 4</td>
|
||||
<td>Value 5</td>
|
||||
<td>Value 6</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
+51
-12
@@ -1,18 +1,57 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
|
||||
{% block title %}Профиль пользователя {{ userData.login }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<h1>Профиль пользователя {{ userData.login }}</h1>
|
||||
<p>
|
||||
<span><b>ID:</b> {{ userData.id }}</span><br>
|
||||
<span><b>Логин:</b> {{ userData.login }}</span><br>
|
||||
<span><b>Имя:</b> {{ userData.name }}</span><br>
|
||||
<span><b>E-Mail:</b> {{ userData.email }}</span><br>
|
||||
<span><b>Был активен:</b> {{ userData.last_active }}</span><br>
|
||||
<form action="/users/{{ userData.id }}/dialog" method="POST">
|
||||
<button class="button" type="submit">Написать</button>
|
||||
</form>
|
||||
<div class="profile-hero">
|
||||
<div class="profile-hero-avatar">
|
||||
{% if avatar %}
|
||||
<img src="{{ avatar.path }}" alt="{{ userData.name }}">
|
||||
{% else %}
|
||||
{{ (userData.name|default(userData.login))|slice(0, 1)|upper }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<h1>{{ userData.name|default(userData.login) }}</h1>
|
||||
<p class="page-subtitle">Профиль пользователя {{ userData.login }}</p>
|
||||
<div class="status {% if online %}is-online{% endif %}">
|
||||
<span class="status-dot"></span>
|
||||
{{ online ? 'Онлайн' : 'Не в сети' }}
|
||||
</div>
|
||||
{% if roles is not empty %}
|
||||
<div class="profile-hero-roles">
|
||||
{% for role in roles %}
|
||||
<span class="role-badge">{{ icons.shield() }} {{ role.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</p>
|
||||
{% endblock %}
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.info() }} Данные пользователя</h2>
|
||||
</div>
|
||||
<dl class="info-list">
|
||||
<dt>{{ icons.hash() }} ID</dt>
|
||||
<dd>{{ userData.id }}</dd>
|
||||
<dt>{{ icons.users() }} Логин</dt>
|
||||
<dd>{{ userData.login }}</dd>
|
||||
<dt>{{ icons.users() }} Имя</dt>
|
||||
<dd>{{ userData.name }}</dd>
|
||||
<dt>{{ icons.mail() }} E-Mail</dt>
|
||||
<dd>{{ userData.email }}</dd>
|
||||
<dt>{{ icons.check() }} Активен</dt>
|
||||
<dd>{{ userData.active == 'Y' ? 'Да' : 'Нет' }}</dd>
|
||||
<dt>{{ icons.clock() }} Регистрация</dt>
|
||||
<dd>{{ userData.date_created }}</dd>
|
||||
<dt>{{ icons.clock() }} Был активен</dt>
|
||||
<dd>{{ userData.last_active }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<form action="/users/{{ userData.id }}/dialog" method="POST">
|
||||
<button class="button" type="submit">{{ icons.chat() }} Написать сообщение</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
+78
-24
@@ -1,29 +1,83 @@
|
||||
{% extends 'layout.twig' %}
|
||||
{% import '_icons.twig' as icons %}
|
||||
|
||||
{% block title %}Список пользователей{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<h1>Список пользователей</h1>
|
||||
<p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Логин</th>
|
||||
<th>Имя</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.login }}</td>
|
||||
<td>{{ user.name }}</td>
|
||||
<td><a href="/users/{{ user.id }}">Открыть профиль</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
{% endblock %}
|
||||
<div class="page-head">
|
||||
<div class="page-head-icon">{{ icons.users() }}</div>
|
||||
<div>
|
||||
<h1>Пользователи</h1>
|
||||
<p class="page-subtitle">Все зарегистрированные пользователи системы</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2>{{ icons.users() }} Список пользователей</h2>
|
||||
{% if users is not empty %}<span class="pill">{{ users|length }} шт.</span>{% endif %}
|
||||
</div>
|
||||
|
||||
{% if users is empty %}
|
||||
<div class="empty-state">
|
||||
{{ icons.users() }}
|
||||
<span>Пользователи не найдены</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="table-wrap">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 60px;">ID</th>
|
||||
<th>Пользователь</th>
|
||||
<th>E-Mail</th>
|
||||
<th style="width: 130px;">Статус</th>
|
||||
<th style="width: 130px;">Регистрация</th>
|
||||
<th style="width: 130px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.id }}</td>
|
||||
<td>
|
||||
<div class="cell-user">
|
||||
<span class="user-avatar">{{ (user.name|default(user.login))|slice(0, 1)|upper }}</span>
|
||||
<div class="cell-user-meta">
|
||||
<span>{{ user.name }}</span>
|
||||
<span class="cell-user-sub">{{ user.login }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ user.email }}<br>
|
||||
{% if user.email_confirmed == 'Y' %}
|
||||
<span class="confirm-badge is-yes">{{ icons.check() }} подтверждён</span>
|
||||
{% else %}
|
||||
<span class="confirm-badge is-no">{{ icons.warning() }} не подтверждён</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<span class="status {% if user.online %}is-online{% endif %}">
|
||||
<span class="status-dot"></span>
|
||||
{{ user.online ? 'Онлайн' : 'Не в сети' }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ user.date_created|default('—') }}</td>
|
||||
<td><a class="row-action" href="/users/{{ user.id }}">{{ icons.users() }} Профиль</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if totalPages > 1 %}
|
||||
<div class="pagination">
|
||||
<a class="page-btn {% if page <= 1 %}is-disabled{% endif %}" href="/users?page={{ page - 1 }}">{{ icons.arrowLeft() }}</a>
|
||||
<span class="page-info">Страница {{ page }} из {{ totalPages }}</span>
|
||||
<a class="page-btn {% if page >= totalPages %}is-disabled{% endif %}" href="/users?page={{ page + 1 }}">{{ icons.arrowRight() }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user