From 9e86389b6277884d180a9e881aa0c1b4d5d9d731 Mon Sep 17 00:00:00 2001 From: Celestora Date: Tue, 2 Nov 2021 23:07:26 +0200 Subject: [PATCH] Add admin-placeable alerts --- Web/Models/Entities/User.php | 5 +++++ Web/Presenters/templates/User/View.xml | 2 +- Web/static/css/style.css | 10 ++++++++++ install/sqls/00003-user-alerts.sql | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 install/sqls/00003-user-alerts.sql diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index 6913855d..9af9b93c 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -204,6 +204,11 @@ class User extends RowModel return $this->getRecord()->shortcode; } + function getAlert(): ?string + { + return $this->getRecord()->alert; + } + function getBanReason(): ?string { return $this->getRecord()->block_reason; diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index c2576ac6..ff54e49e 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -349,7 +349,7 @@
- +
{$alert}

{$user->getFullName()}

diff --git a/Web/static/css/style.css b/Web/static/css/style.css index c769cb28..affab2fc 100644 --- a/Web/static/css/style.css +++ b/Web/static/css/style.css @@ -1432,4 +1432,14 @@ body.scrolled .toTop:hover { #ovkDraw .literally .lc-picker .toolbar-button:hover:not(.disabled), #ovkDraw .literally .horz-toolbar .square-toolbar-button:hover:not(.disabled) { border-color: #cdcdcd; +} + +.user-alert { + margin-left: 9px; + margin-bottom: 8px; + padding: 4px; + border: 1px solid #c3a476; + font-weight: 900; + background-color: #f3ddbd; + color: #58462a; } \ No newline at end of file diff --git a/install/sqls/00003-user-alerts.sql b/install/sqls/00003-user-alerts.sql new file mode 100644 index 00000000..69244523 --- /dev/null +++ b/install/sqls/00003-user-alerts.sql @@ -0,0 +1 @@ +ALTER TABLE `profiles` ADD `alert` TEXT NULL DEFAULT NULL AFTER `since`; \ No newline at end of file