diff --git a/config/config.default.php b/config/config.default.php
index 219ac56b..8467e144 100644
--- a/config/config.default.php
+++ b/config/config.default.php
@@ -163,4 +163,11 @@ return [
//'Strict-Transport-Security' => 'max-age=7776000',
//'Expect-CT' => 'max-age=7776000,enforce,report-uri="[uri]"',
],
+
+ // A list of credits
+ 'credits' => [
+ 'Contribution' => 'Please visit [engelsystem/engelsystem](https://github.com/engelsystem/engelsystem) if '
+ . 'you want to to contribute, have found any [bugs](https://github.com/engelsystem/engelsystem/issues) '
+ . 'or need help.'
+ ]
];
diff --git a/resources/views/pages/credits.twig b/resources/views/pages/credits.twig
index ff2bf873..eb98c7e7 100644
--- a/resources/views/pages/credits.twig
+++ b/resources/views/pages/credits.twig
@@ -6,35 +6,25 @@
Credits
+ {% for title, credit in credits %}
+
+
{{ title }}
+ {{ credit|markdown }}
+
+ {% endfor %}
+
-
-
-
Translation
-
- Many thanks for the german translation: e7p
+ contributor list on GitHub for a complete list.
diff --git a/src/Controllers/CreditsController.php b/src/Controllers/CreditsController.php
index 568811c7..b2805b84 100644
--- a/src/Controllers/CreditsController.php
+++ b/src/Controllers/CreditsController.php
@@ -2,15 +2,24 @@
namespace Engelsystem\Controllers;
+use Engelsystem\Config\Config;
use Engelsystem\Http\Response;
class CreditsController extends BaseController
{
+ /** @var Config */
+ protected $config;
+
/** @var Response */
protected $response;
- public function __construct(Response $response)
+ /**
+ * @param Response $response
+ * @param Config $config
+ */
+ public function __construct(Response $response, Config $config)
{
+ $this->config = $config;
$this->response = $response;
}
@@ -19,6 +28,9 @@ class CreditsController extends BaseController
*/
public function index()
{
- return $this->response->withView('pages/credits.twig');
+ return $this->response->withView(
+ 'pages/credits.twig',
+ ['credits' => $this->config->get('credits')]
+ );
}
}
diff --git a/tests/Unit/Controllers/CreditsControllerTest.php b/tests/Unit/Controllers/CreditsControllerTest.php
index 6f0200f2..3ce92cb1 100644
--- a/tests/Unit/Controllers/CreditsControllerTest.php
+++ b/tests/Unit/Controllers/CreditsControllerTest.php
@@ -2,6 +2,7 @@
namespace Unit\Controllers;
+use Engelsystem\Config\Config;
use Engelsystem\Controllers\CreditsController;
use Engelsystem\Http\Response;
use PHPUnit\Framework\MockObject\MockObject;
@@ -17,12 +18,13 @@ class CreditsControllerTest extends TestCase
{
/** @var Response|MockObject $response */
$response = $this->createMock(Response::class);
+ $config = new Config(['foo' => 'bar', 'credits' => ['lor' => 'em']]);
$response->expects($this->once())
->method('withView')
- ->with('pages/credits.twig');
+ ->with('pages/credits.twig', ['credits' => ['lor' => 'em']]);
- $controller = new CreditsController($response);
+ $controller = new CreditsController($response, $config);
$controller->index();
}
}