diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78f0838..bf6452b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## x.y.z
### Added
-- Add a FE editor (#864)
+- Add an FE editor (#864, #872, #874)
- Add automerging of green Dependabot PRs (#756)
### Changed
diff --git a/Classes/Controller/FrontEndEditorController.php b/Classes/Controller/FrontEndEditorController.php
index e79dd55..1ef5d4c 100644
--- a/Classes/Controller/FrontEndEditorController.php
+++ b/Classes/Controller/FrontEndEditorController.php
@@ -8,6 +8,7 @@ use Psr\Http\Message\ResponseInterface;
use TTN\Tea\Domain\Model\Product\Tea;
use TTN\Tea\Domain\Repository\Product\TeaRepository;
use TYPO3\CMS\Core\Context\Context;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
@@ -70,4 +71,22 @@ class FrontEndEditorController extends ActionController
return $this->redirect('index');
}
+
+ public function newAction(?Tea $tea = null): ResponseInterface
+ {
+ // Note: We are using `makeInstance` here instead of `new` to allow for XCLASSing.
+ $teaToAssign = $tea ?? GeneralUtility::makeInstance(Tea::class);
+ $this->view->assign('tea', $teaToAssign);
+
+ return $this->htmlResponse();
+ }
+
+ public function createAction(Tea $tea): ResponseInterface
+ {
+ $tea->setOwnerUid($this->getUidOfLoggedInUser());
+
+ $this->teaRepository->add($tea);
+
+ return $this->redirect('index');
+ }
}
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index 5a9716f..4eb8ad4 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -67,6 +67,14 @@
Speichern
+
+
+ Neuen Tee anlegen
+
+
+
+ Neuen Tee anlegen
+