Save a SEO title and description when creating an incident

This commit is contained in:
Nico Stapelbroek 2018-03-06 19:38:52 +01:00
parent 0fcd939f50
commit 129030daaf
3 changed files with 14 additions and 1 deletions

View File

@ -104,6 +104,10 @@ class CreateIncidentCommandHandler
// Store any meta? // Store any meta?
if ($meta = $command->meta) { if ($meta = $command->meta) {
foreach ($meta as $key => $value) { foreach ($meta as $key => $value) {
if (empty($value)) {
continue;
}
Meta::create([ Meta::create([
'key' => $key, 'key' => $key,
'value' => $value, 'value' => $value,

View File

@ -131,7 +131,8 @@ class IncidentController extends Controller
Binput::get('stickied', false), Binput::get('stickied', false),
Binput::get('occurred_at'), Binput::get('occurred_at'),
null, null,
[] [],
['seo' => Binput::get('seo', [])]
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return cachet_redirect('dashboard.incidents.create') return cachet_redirect('dashboard.incidents.create')

View File

@ -129,6 +129,14 @@
</label> </label>
</div> </div>
@endif @endif
<div class="form-group">
<label>{{ trans('forms.seo.title') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small>
<input type="text" name="seo[title]" class="form-control" placeholder="{{ trans('forms.optional') }}">
</div>
<div class="form-group">
<label>{{ trans('forms.seo.description') }}</label> <small class="text-muted">{{ trans('forms.optional') }}</small>
<input type="text" name="seo[description]" class="form-control" placeholder="{{ trans('forms.optional') }}">
</div>
</fieldset> </fieldset>
<div class="form-group"> <div class="form-group">