mirror of
https://github.com/flextype/flextype.git
synced 2025-08-27 06:54:31 +02:00
- Fieldsets Controller/Views implementation
This commit is contained in:
@@ -3,19 +3,12 @@
|
||||
{% block content %}
|
||||
<form method="post" id="form">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" id="fieldset-id-current-{{ id }}" name="fieldset-id-current" value="{{ id }}">
|
||||
<input type="hidden" id="action" name="action" value="save-form">
|
||||
<input type="hidden" id="id" name="id" value="{{ id }}">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<label for="title">{{ tr('admin_title') }}</label>
|
||||
<input type="text" id="fieldsetTitle" name="title" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_title_empty_input') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="id">{{ tr('admin_name') }}</label>
|
||||
<input type="text" id="fieldsetId" name="id" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" id="createFieldset" name="create_fieldset" value="{{ tr('admin_create') }}" class="btn btn-black">
|
||||
<textarea id="codeMirrorEditor" style="min-height:500px;" name="data" rows="8" cols="80" class="form-control">{{ data }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Flextype\Component\Http\Http;
|
||||
use Flextype\Component\Form\Form;
|
||||
use Flextype\Component\Html\Html;
|
||||
use Flextype\Component\Token\Token;
|
||||
use function Flextype\Component\I18n\__;
|
||||
|
||||
Themes::view('admin/views/partials/head')->display();
|
||||
Themes::view('admin/views/partials/navbar')
|
||||
->assign('links', [
|
||||
'fieldset' => [
|
||||
'link' => Http::getBaseUrl() . '/admin/fieldsets/edit?fieldset=' . Http::get('fieldset'),
|
||||
'title' => __('admin_fieldset'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
])
|
||||
->assign('buttons', [
|
||||
'save_entry' => [
|
||||
'link' => 'javascript:;',
|
||||
'title' => __('admin_save'),
|
||||
'attributes' => ['class' => 'js-save-form-submit float-right btn']
|
||||
]
|
||||
])
|
||||
->display();
|
||||
Themes::view('admin/views/partials/content-start')->display();
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?= Form::open(null, ['id' => 'form']) ?>
|
||||
<?= Form::hidden('token', Token::generate()) ?>
|
||||
<?= Form::hidden('action', 'save-form') ?>
|
||||
<?= Form::hidden('name', Http::get('fieldset')) ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<?= Form::textarea('fieldset', $fieldset, ['class' => 'form-control', 'style' => 'min-height:500px;', 'id' => 'codeMirrorEditor']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= Form::close() ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php Themes::view('admin/views/partials/content-end')->display() ?>
|
||||
<?php Themes::view('admin/views/partials/footer')->display() ?>
|
Reference in New Issue
Block a user