From 99344c5497c24b7501a29fa223051f3c1aa16111 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Thu, 14 Apr 2022 12:29:07 +0200 Subject: [PATCH] Groups: Add admin-placeable alerts --- Web/Models/Entities/Club.php | 5 +++++ Web/Presenters/templates/Group/View.xml | 2 ++ Web/static/css/style.css | 9 +++++++++ install/sqls/00022-group-alerts.sql | 1 + 4 files changed, 17 insertions(+) create mode 100644 install/sqls/00022-group-alerts.sql diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php index 382332dd..f306a8e6 100644 --- a/Web/Models/Entities/Club.php +++ b/Web/Models/Entities/Club.php @@ -346,6 +346,11 @@ class Club extends RowModel { return $this->getRecord()->website; } + + function getAlert(): ?string + { + return $this->getRecord()->alert; + } use Traits\TSubscribable; } diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml index 6ab0c055..c31e4812 100644 --- a/Web/Presenters/templates/Group/View.xml +++ b/Web/Presenters/templates/Group/View.xml @@ -14,6 +14,8 @@ {block content}
+
{strpos($alert, "@") === 0 ? tr(substr($alert, 1)) : $alert}
+
{_"information"}
diff --git a/Web/static/css/style.css b/Web/static/css/style.css index 5a70d404..92d41694 100644 --- a/Web/static/css/style.css +++ b/Web/static/css/style.css @@ -1648,6 +1648,15 @@ body.scrolled .toTop:hover { color: #58462a; } +.group-alert { + margin-bottom: 8px; + padding: 4px; + border: 1px solid #c3a476; + font-weight: 900; + background-color: #f3ddbd; + color: #58462a; +} + .knowledgeBaseArticle { margin-top: -11px; /* this is very stupid fix but nah */ diff --git a/install/sqls/00022-group-alerts.sql b/install/sqls/00022-group-alerts.sql new file mode 100644 index 00000000..24cd2a01 --- /dev/null +++ b/install/sqls/00022-group-alerts.sql @@ -0,0 +1 @@ +ALTER TABLE `groups` ADD `alert` TEXT NULL DEFAULT NULL;