Доработки клиентского интерфейса + мелкие правки
This commit is contained in:
1 parent
c43bcff23f
commit
55078ddb36
21 files changed
+2172
-521
No files matched your search
Generated
+4
@@ -2,6 +2,7 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-http/client-common" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-http/discovery" />
|
||||
@@ -93,6 +94,9 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/cakephp/core" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/cakephp/utility" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/robmorgan/phinx" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
Generated
+4
-1
@@ -102,12 +102,15 @@
|
||||
<path value="$PROJECT_DIR$/vendor/cakephp/core" />
|
||||
<path value="$PROJECT_DIR$/vendor/cakephp/utility" />
|
||||
<path value="$PROJECT_DIR$/vendor/robmorgan/phinx" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
|
||||
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
|
||||
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpInterpreters">
|
||||
<interpreters>
|
||||
<interpreter id="9b5f2f5e-509e-45e2-a30a-b4d1544b217e" name="rsgrinko@dev.it-stories.ru:22 password" home="sshConfig://DATA" auto="false" debugger_id="php.debugger.XDebug">
|
||||
<remote_data INTERPRETER_PATH="/usr/bin/php" HELPERS_PATH="/home/rsgrinko/.phpstorm_helpers" VALID="true" RUN_AS_ROOT_VIA_SUDO="false" SSH_CONFIG_ID="b4bdc3dc-f3e4-4fbe-9d94-3cb514b49751" SSH_CONFIG_NAME="rsgrinko@dev.it-stories.ru:22 password" SSH_CREDENTIALS_ID="sshConfig://rsgrinko@dev.it-stories.ru:22 password" />
|
||||
<remote_data INTERPRETER_PATH="/usr/bin/php" HELPERS_PATH="/home/rsgrinko/.phpstorm_helpers" VALID="true" RUN_AS_ROOT_VIA_SUDO="false" SSH_CONFIG_ID="b4bdc3dc-f3e4-4fbe-9d94-3cb514b49751" SSH_CONFIG_NAME="rsgrinko@10.10.10.56:22 password" SSH_CREDENTIALS_ID="sshConfig://rsgrinko@dev.it-stories.ru:22 password" />
|
||||
</interpreter>
|
||||
</interpreters>
|
||||
</component>
|
||||
|
||||
Generated
+1
-1
@@ -3,7 +3,7 @@
|
||||
<component name="WebServers">
|
||||
<option name="servers">
|
||||
<webServer id="afaead60-4e07-45ee-a3a6-955b92f318f9" name="dev.it-stories.ru" url="http://dev.it-stories.ru">
|
||||
<fileTransfer rootFolder="/home/rsgrinko/www/dev.it-stories.ru/public_html" accessType="SFTP" host="dev.it-stories.ru" port="22" sshConfigId="b4bdc3dc-f3e4-4fbe-9d94-3cb514b49751" sshConfig="rsgrinko@dev.it-stories.ru:22 password">
|
||||
<fileTransfer rootFolder="/home/rsgrinko/www/dev.it-stories.ru/public_html" accessType="SFTP" host="10.10.10.56" port="22" sshConfigId="b4bdc3dc-f3e4-4fbe-9d94-3cb514b49751" sshConfig="rsgrinko@10.10.10.56:22 password">
|
||||
<advancedOptions>
|
||||
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" />
|
||||
</advancedOptions>
|
||||
|
||||
+1292
-253
File diff suppressed because it is too large.
Load diff
@@ -3,5 +3,18 @@ $(document).ready(function () {
|
||||
let file = this.files[0];
|
||||
$(this).next().html(file.name);
|
||||
});
|
||||
|
||||
let $navToggle = $('#navToggle'),
|
||||
$mainNav = $('#mainNav');
|
||||
|
||||
$navToggle.on('click', function () {
|
||||
let isOpen = $mainNav.toggleClass('open').hasClass('open');
|
||||
$navToggle.attr('aria-expanded', isOpen ? 'true' : 'false');
|
||||
});
|
||||
|
||||
$mainNav.on('click', 'a', function () {
|
||||
$mainNav.removeClass('open');
|
||||
$navToggle.attr('aria-expanded', 'false');
|
||||
});
|
||||
});
|
||||
|
||||
Generated
+225
-3
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "9419b876e772f4ad73c85976abad7860",
|
||||
"content-hash": "8a68019d2f59427aeaf3fa0d389ef3cf",
|
||||
"packages": [
|
||||
{
|
||||
"name": "cakephp/core",
|
||||
@@ -367,6 +367,68 @@
|
||||
},
|
||||
"time": "2023-02-07T12:51:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "graham-campbell/result-type",
|
||||
"version": "v1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/GrahamCampbell/Result-Type.git",
|
||||
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
|
||||
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"phpoption/phpoption": "^1.9.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GrahamCampbell\\ResultType\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
}
|
||||
],
|
||||
"description": "An Implementation Of The Result Type",
|
||||
"keywords": [
|
||||
"Graham Campbell",
|
||||
"GrahamCampbell",
|
||||
"Result Type",
|
||||
"Result-Type",
|
||||
"result"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
|
||||
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-20T21:45:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "1.5.2",
|
||||
@@ -1235,6 +1297,81 @@
|
||||
},
|
||||
"time": "2020-07-07T09:29:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoption/phpoption",
|
||||
"version": "1.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/schmittjoh/php-option.git",
|
||||
"reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54",
|
||||
"reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "1.9-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PhpOption\\": "src/PhpOption/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Johannes M. Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "https://github.com/schmittjoh"
|
||||
},
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
}
|
||||
],
|
||||
"description": "Option Type for PHP",
|
||||
"keywords": [
|
||||
"language",
|
||||
"option",
|
||||
"php",
|
||||
"type"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/schmittjoh/php-option/issues",
|
||||
"source": "https://github.com/schmittjoh/php-option/tree/1.9.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-20T21:41:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "1.1.2",
|
||||
@@ -3246,6 +3383,90 @@
|
||||
}
|
||||
],
|
||||
"time": "2023-02-08T07:49:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/phpdotenv",
|
||||
"version": "v5.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vlucas/phpdotenv.git",
|
||||
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
|
||||
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pcre": "*",
|
||||
"graham-campbell/result-type": "^1.1.3",
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"phpoption/phpoption": "^1.9.3",
|
||||
"symfony/polyfill-ctype": "^1.24",
|
||||
"symfony/polyfill-mbstring": "^1.24",
|
||||
"symfony/polyfill-php80": "^1.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"ext-filter": "*",
|
||||
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-filter": "Required to use the boolean validator."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Dotenv\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Vance Lucas",
|
||||
"email": "vance@vancelucas.com",
|
||||
"homepage": "https://github.com/vlucas"
|
||||
}
|
||||
],
|
||||
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
|
||||
"keywords": [
|
||||
"dotenv",
|
||||
"env",
|
||||
"environment"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/vlucas/phpdotenv/issues",
|
||||
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-04-30T23:37:27+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@@ -6165,8 +6386,9 @@
|
||||
"ext-simplexml": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-mbstring": "*"
|
||||
"ext-mbstring": "*",
|
||||
"ext-gd": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
+51
-19
@@ -82,18 +82,31 @@
|
||||
|
||||
public static function index()
|
||||
{
|
||||
self::render('index.twig');
|
||||
self::render('index.twig', [
|
||||
'stats' => [
|
||||
'usersTotal' => User::getUsersCount(),
|
||||
'usersOnline' => User::getOnlineCount(),
|
||||
'usersVerified' => User::getUsersCount(true),
|
||||
'coreVersion' => CORE_VERSION,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function info()
|
||||
{
|
||||
$buildInfo = [
|
||||
'Версия ядра' => CORE_VERSION,
|
||||
'Лимит пагинации' => SystemConfig::getValue('PAGINATION_LIMIT'),
|
||||
'Время для расчета онлайна' => USER_ONLINE_TIME,
|
||||
'Время жизни кеша' => CACHE_TTL,
|
||||
'E-Mail сайта' => SERVER_EMAIL,
|
||||
'Имя отправителя сайта' => SERVER_EMAIL_NAME,
|
||||
'Версия ядра' => CORE_VERSION,
|
||||
'Версия PHP' => PHP_VERSION,
|
||||
'Лимит пагинации' => SystemConfig::getValue('PAGINATION_LIMIT'),
|
||||
'Время для расчета онлайна' => USER_ONLINE_TIME . ' сек.',
|
||||
'Кеширование' => USE_CACHE ? 'Включено' : 'Выключено',
|
||||
'Время жизни кеша' => CACHE_TTL . ' сек.',
|
||||
'Captcha' => USE_CAPTCHA ? 'Включена' : 'Выключена',
|
||||
'Защита от DDoS' => USE_DDOS_PROTECTION ? 'Включена' : 'Выключена',
|
||||
'Префикс таблиц БД' => DB_TABLE_PREFIX,
|
||||
'E-Mail сайта' => SERVER_EMAIL,
|
||||
'Имя отправителя сайта' => SERVER_EMAIL_NAME,
|
||||
'Часовой пояс' => date_default_timezone_get(),
|
||||
];
|
||||
self::render('info.twig', ['data' => $buildInfo]);
|
||||
}
|
||||
@@ -102,21 +115,32 @@
|
||||
{
|
||||
/** @var User $USER */
|
||||
global $USER;
|
||||
self::render('dialogs.twig', ['dialogs' => User::isAuthorized() ? $USER->getDialogs() : []]);
|
||||
$dialogs = [];
|
||||
if (User::isAuthorized()) {
|
||||
$dialogs = $USER->getDialogs();
|
||||
foreach ($dialogs as $key => $dialog) {
|
||||
$dialogs[$key]['companionOnline'] = User::isOnline((int)$dialog['companionId']);
|
||||
$dialogs[$key]['messagesCount'] = $USER->getDialogObject()->getDialogMessagesCount((int)$dialog['id']);
|
||||
}
|
||||
}
|
||||
self::render('dialogs.twig', ['dialogs' => $dialogs]);
|
||||
}
|
||||
|
||||
public static function dialog(int $id)
|
||||
{
|
||||
/** @var User $USER */
|
||||
global $USER;
|
||||
$companionId = $USER->getDialogObject()->getDialogCompanionId($id);
|
||||
self::render(
|
||||
'dialog.twig',
|
||||
[
|
||||
'dialog_id' => $id,
|
||||
'messages' => $USER->getMessages($id, true),
|
||||
'userId' => $USER->getId(),
|
||||
'companionId' => $USER->getDialogObject()->getDialogCompanionId($id),
|
||||
'companionName' => (new User($USER->getDialogObject()->getDialogCompanionId($id)))->getName(),
|
||||
'dialog_id' => $id,
|
||||
'messages' => $USER->getMessages($id, true),
|
||||
'userId' => $USER->getId(),
|
||||
'companionId' => $companionId,
|
||||
'companionName' => (new User($companionId))->getName(),
|
||||
'companionOnline' => User::isOnline($companionId),
|
||||
'messagesCount' => $USER->getDialogObject()->getDialogMessagesCount($id),
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -139,17 +163,20 @@
|
||||
|
||||
public static function users()
|
||||
{
|
||||
Pagination::execute($_REQUEST['page'], User::getAllCount(), SystemConfig::getValue('PAGINATION_LIMIT'));
|
||||
Pagination::execute((int)($_REQUEST['page'] ?? 1), User::getAllCount(), (string)SystemConfig::getValue('PAGINATION_LIMIT'));
|
||||
$limit = Pagination::getLimit();
|
||||
$limit= '0, 10';
|
||||
$arUsers = User::getUsers($limit);
|
||||
foreach($arUsers as $key => $user) {
|
||||
unset($arUsers[$key]['password']);
|
||||
$arUsers[$key]['online'] = User::isOnline((int)$user['id']);
|
||||
}
|
||||
self::render('users.twig', ['users' => $arUsers]);
|
||||
self::render('users.twig', [
|
||||
'users' => $arUsers,
|
||||
'page' => Pagination::getPage(),
|
||||
'totalPages' => Pagination::getTotalPages(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public static function test($a = null, $b = null, $c = null, $d = null)
|
||||
{
|
||||
ddd($_SESSION);
|
||||
@@ -204,8 +231,13 @@
|
||||
|
||||
public static function userProfile(int $id)
|
||||
{
|
||||
$userData = (new User($id))->getAllUserData(true);
|
||||
self::render('userProfile.twig', ['userData' => $userData]);
|
||||
$userObject = new User($id);
|
||||
self::render('userProfile.twig', [
|
||||
'userData' => $userObject->getAllUserData(true),
|
||||
'roles' => $userObject->getRolesObject()->getFullRoles(),
|
||||
'online' => User::isOnline($id),
|
||||
'avatar' => $userObject->getImage(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function goToDialog(int $userId)
|
||||
|
||||
@@ -63,6 +63,26 @@
|
||||
return $start . ', ' . self::$limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение номера текущей страницы
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getPage(): int
|
||||
{
|
||||
return (int)self::$page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение общего количества страниц
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getTotalPages(): int
|
||||
{
|
||||
return self::$total_pages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Вывод пагинации на страницу
|
||||
*
|
||||
|
||||
@@ -76,8 +76,9 @@
|
||||
*/
|
||||
public static function execute()
|
||||
{
|
||||
$requestPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
foreach (self::$routes as $pattern => $callback) {
|
||||
if (preg_match($pattern, $_SERVER['REQUEST_URI'], $params)) // сравнение идет через регулярное выражение
|
||||
if (preg_match($pattern, $requestPath, $params)) // сравнение идет через регулярное выражение
|
||||
{
|
||||
array_shift($params);
|
||||
Registry::set('currentPage', $callback);
|
||||
|
||||
@@ -400,6 +400,17 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение количества пользователей, находящихся сейчас онлайн
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getOnlineCount(): int
|
||||
{
|
||||
$res = (DataBase::getInstance())->query('SELECT COUNT(*) as count FROM `' . self::TABLE . '` WHERE last_active > ' . (time() - USER_ONLINE_TIME));
|
||||
return (int)$res[0]['count'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Шифрование пароля
|
||||
*
|
||||
|
||||
@@ -48,10 +48,6 @@
|
||||
Router::route('/test/(\d+)', '\Core\App::test');
|
||||
Router::route('/test/(\d+)/page/(\d+)', '\Core\App::test');
|
||||
|
||||
/** Тестовые маршруты */
|
||||
Router::route('/sections', '\Core\App::sections');
|
||||
Router::route('/section/(\d+)', '\Core\App::section');
|
||||
|
||||
Router::route('blog/(\w+)/(\d+)', function ($category, $id) {
|
||||
echo $category . ':' . $id;
|
||||
});
|
||||
@@ -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