Apply suggestions from code review
authorMarcel Werk <burntime@woltlab.com>
Mon, 2 Oct 2023 10:17:54 +0000 (12:17 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 24 Dec 2023 16:05:10 +0000 (17:05 +0100)
com.woltlab.wcf/templates/creditsAcpDashboardBox.tpl [deleted file]
wcfsetup/install/files/acp/style/layout.scss
wcfsetup/install/files/lib/bootstrap/com.woltlab.wcf.php
wcfsetup/install/files/lib/system/acp/dashboard/box/CreditsAcpDashboardBox.class.php
wcfsetup/install/files/lib/system/acp/dashboard/box/IAcpDashboardBox.class.php
wcfsetup/install/files/lib/system/acp/dashboard/box/NewsAcpDashboardBox.class.php
wcfsetup/install/files/lib/system/acp/dashboard/box/SystemInfoAcpDashboardBox.class.php
wcfsetup/install/files/lib/system/acp/dashboard/event/AcpDashboardCollecting.class.php

diff --git a/com.woltlab.wcf/templates/creditsAcpDashboardBox.tpl b/com.woltlab.wcf/templates/creditsAcpDashboardBox.tpl
deleted file mode 100644 (file)
index e6b216b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<dl>
-       <dt>{lang}wcf.acp.index.credits.developedBy{/lang}</dt>
-       <dd><a href="https://www.woltlab.com/{if $__wcf->getLanguage()->getFixedLanguageCode() === 'de'}de/{/if}" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank" rel="noopener"{/if}>WoltLab&reg; GmbH</a></dd>
-</dl>
-
-<dl>
-       <dt>{lang}wcf.acp.index.credits.productManager{/lang}</dt>
-       <dd>
-               <ul class="inlineList commaSeparated">
-                       <li>Marcel Werk</li>
-               </ul>
-       </dd>
-</dl>
-
-<dl>
-       <dt>{lang}wcf.acp.index.credits.developer{/lang}</dt>
-       <dd>
-               <ul class="inlineList commaSeparated">
-                       <li>Tim D&uuml;sterhus</li>
-                       <li>Alexander Ebert</li>
-                       <li>Joshua R&uuml;sweg</li>
-                       <li>Matthias Schmidt</li>
-                       <li>Marcel Werk</li>
-               </ul>
-       </dd>
-</dl>
-
-<dl>
-       <dt>{lang}wcf.acp.index.credits.designer{/lang}</dt>
-       <dd>
-               <ul class="inlineList commaSeparated">
-                       <li>Alexander Ebert</li>
-                       <li>Marcel Werk</li>
-               </ul>
-       </dd>
-</dl>
-
-<dl>
-       <dt>{lang}wcf.acp.index.credits.contributor{/lang}</dt>
-       <dd>
-               <ul class="inlineList commaSeparated">
-                       <li>Andrea Berg</li>
-                       <li>Thorsten Buitkamp</li>
-                       <li>
-                               <a href="https://github.com/WoltLab/WCF/contributors" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank" rel="noopener"{/if}>{lang}wcf.acp.index.credits.contributor.more{/lang}</a>
-                       </li>
-               </ul>
-       </dd>
-</dl>
-
-<dl>
-       <dt></dt>
-       <dd>Copyright &copy; 2001-{TIME_NOW|date:'Y'} WoltLab&reg; GmbH. All rights reserved.</dd>
-</dl>
-
-<dl>
-       <dt></dt>
-       <dd>{lang}wcf.acp.index.credits.trademarks{/lang}</dd>
-</dl>
index a4f7d8dbc93ad5bb41d1d506cfa59aae15078468..ae70ac7e531fb46ab31610efab28ae902b2708ee 100644 (file)
@@ -929,14 +929,14 @@ html[data-color-scheme="dark"] {
 .acpDashboardBox {
        background-color: var(--wcfContentContainerBackground);
        border-radius: var(--wcfBorderRadius);
-       box-shadow:
-               0 0 3px rgba(0, 0, 0, 0.12),
-               0 1px 2px rgba(0, 0, 0, 0.24);
+       box-shadow: var(--wcfBoxShadowCard);
+       display: flex;
+       flex-direction: column;
        padding: 20px;
+       row-gap: 20px;
 }
 
 .acpDashboardBox__title {
-       margin-bottom: 20px;
        @include wcfFontHeadline;
        @include wcfFontBold;
 }
index 6ca2b95c95d8913c062f7e4d25b56ea19f480922..b793a945dea0b64bb40c0e8246c9add4b88c3d91 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-use wcf\system\acp\dashboard\box\CreditsAcpDashboardBox;
-use wcf\system\acp\dashboard\box\NewsAcpDashboardBox;
-use wcf\system\acp\dashboard\box\SystemInfoAcpDashboardBox;
 use wcf\system\acp\dashboard\event\AcpDashboardCollecting;
 use wcf\system\cronjob\CronjobScheduler;
 use wcf\system\event\EventHandler;
@@ -78,9 +75,9 @@ return static function (): void {
     $eventHandler->register(PackageUpdateListChanged::class, PackageUpdateListChangedLicenseListener::class);
 
     $eventHandler->register(AcpDashboardCollecting::class, static function (AcpDashboardCollecting $event) {
-        $event->register('com.woltlab.wcf.news', new NewsAcpDashboardBox());
-        $event->register('com.woltlab.wcf.systemInfo', new SystemInfoAcpDashboardBox());
-        $event->register('com.woltlab.wcf.credits', new CreditsAcpDashboardBox());
+        $event->register(new \wcf\system\acp\dashboard\box\NewsAcpDashboardBox());
+        $event->register(new \wcf\system\acp\dashboard\box\SystemInfoAcpDashboardBox());
+        $event->register(new \wcf\system\acp\dashboard\box\CreditsAcpDashboardBox());
     });
 
     try {
index cbbb6f598a460473ec00cbe08ef4967d8e54f776..b48ee87f978391b7a6a4dede63ace685c376c5ee 100644 (file)
@@ -22,4 +22,9 @@ final class CreditsAcpDashboardBox extends AbstractAcpDashboardBox
     {
         return WCF::getTPL()->fetch('creditsAcpDashboardBox');
     }
+
+    public function getName(): string
+    {
+        return 'com.woltlab.wcf.credits';
+    }
 }
index 8cf40c46f537bfa5e97c178198186dbeddd978fa..7ddfe5aed73650c7bebfff86231369b691d00bf6 100644 (file)
@@ -30,4 +30,9 @@ interface IAcpDashboardBox
      * Returns the content of this box.
      */
     public function getContent(): string;
+
+    /**
+     * Returns the name (identifier) of this box.
+     */
+    public function getName(): string;
 }
index 4602781ea0029106490edec40292bf7f3abbcb96..42eb8ec2ae4fb7267205d53a32fb9deac69e7365 100644 (file)
@@ -27,4 +27,9 @@ final class NewsAcpDashboardBox extends AbstractAcpDashboardBox
     {
         return WCF::getTPL()->fetch('newsAcpDashboardBox');
     }
+
+    public function getName(): string
+    {
+        return 'com.woltlab.wcf.news';
+    }
 }
index 0bda07e858ca096373e2e2cde4bdfd74868b0547..75230be05b87b16d279ce8899c747eef134a3c6a 100644 (file)
@@ -23,6 +23,11 @@ final class SystemInfoAcpDashboardBox extends AbstractAcpDashboardBox
         return WCF::getTPL()->fetch('systemInfoAcpDashboardBox', 'wcf', $this->getVariables());
     }
 
+    public function getName(): string
+    {
+        return 'com.woltlab.wcf.systemInfo';
+    }
+
     private function getVariables(): array
     {
         return [
index fcac3f8448bac11b9bbcbc9abf43199de7677522..2d54dc080b87a30c762e02b5cf12ec259c866321 100644 (file)
@@ -23,9 +23,9 @@ final class AcpDashboardCollecting implements IEvent
     /**
      * Registers a new box.
      */
-    public function register(string $name, IAcpDashboardBox $box): void
+    public function register(IAcpDashboardBox $box): void
     {
-        $this->boxes[$name] = $box;
+        $this->boxes[$box->getName()] = $box;
     }
 
     /**