Minor functioinality improvements

This commit is contained in:
Dennis Eichhorn 2018-11-23 11:37:30 +01:00
parent db1ad88b74
commit 8fb3e3edc2
3 changed files with 9 additions and 6 deletions

View File

@ -152,7 +152,12 @@ class ApiController extends Controller
$newsArticle = $this->createNewsArticleFromRequest($request);
NewsArticleMapper::create($newsArticle);
$response->set($request->getUri()->__toString(), $newsArticle->jsonSerialize());
$response->set($request->getUri()->__toString(), [
'status' => NotificationLevel::OK,
'title' => 'News',
'message' => 'News article successfully created.',
'response' => $newsArticle->jsonSerialize()
]);
}
/**

View File

@ -31,7 +31,7 @@ echo $this->getData('nav')->render(); ?>
</section>
<div class="box wf-100">
<?= $this->getData('editor')->getData('text')->render('iNews'); ?>
<?= $this->getData('editor')->getData('text')->render('iNews', 'plain', 'docForm'); ?>
</div>
</div>
</div>
@ -39,7 +39,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-3">
<section class="box wf-100">
<div class="inner">
<form id="docForm" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/news?{?}&csrf={$CSRF}'); ?>">
<form id="docForm" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/news?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100">
<tr><td colspan="2"><label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<tr><td colspan="2"><select name="status" id="iStatus">

View File

@ -22,9 +22,7 @@ echo $this->getData('nav')->render(); ?>
<section class="box wf-100">
<header><h1><?= $this->printHtml($news->getTitle()); ?></h1></header>
<div class="inner">
<article>
<?= $this->printHtml($news->getContent()); ?>
</article>
<article><?= $news->getContent(); ?></article>
</div>
</section>
</div>