new form layout and other tpl fixes

This commit is contained in:
Dennis Eichhorn 2021-04-18 22:29:46 +02:00
parent 55b0dbc11f
commit c7543fdb34
2 changed files with 122 additions and 76 deletions

View File

@ -12,8 +12,8 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
use \Modules\Tasks\Models\TaskPriority; use Modules\Tasks\Models\TaskPriority;
use \Modules\Tasks\Models\TaskType; use Modules\Tasks\Models\TaskType;
/** @var \phpOMS\Views\View $this */ /** @var \phpOMS\Views\View $this */
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
@ -24,30 +24,46 @@ echo $this->getData('nav')->render(); ?>
<form id="fTask" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task?{?}&csrf={$CSRF}'); ?>"> <form id="fTask" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task?{?}&csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('Task'); ?></div> <div class="portlet-head"><?= $this->getHtml('Task'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<table class="layout wf-100" style="table-layout: fixed"> <div class="form-group">
<tbody> <label for="iReceiver"><?= $this->getHtml('To'); ?></label>
<tr><td><label for="iReceiver"><?= $this->getHtml('To'); ?></label> <?= $this->getData('accGrpSelector')->render('iReceiver', 'forward', true); ?>
<tr><td><?= $this->getData('accGrpSelector')->render('iReceiver', 'forward', true); ?> </div>
<tr><td><label for="iObserver"><?= $this->getHtml('CC'); ?></label>
<tr><td><?= $this->getData('accGrpSelector')->render('iCC', 'cc', false); ?> <div class="form-group">
<tr><td><label for="iPriority"><?= $this->getHtml('Priority'); ?></label> <label for="iObserver"><?= $this->getHtml('CC'); ?></label>
<tr><td> <?= $this->getData('accGrpSelector')->render('iCC', 'cc', false); ?>
<select id="iPriority" name="priority"> </div>
<option value="<?= TaskPriority::NONE; ?>" selected><?= $this->getHtml('P0'); ?>
<option value="<?= TaskPriority::VLOW; ?>"><?= $this->getHtml('P1'); ?> <div class="form-group">
<option value="<?= TaskPriority::LOW; ?>"><?= $this->getHtml('P2'); ?> <label for="iPriority"><?= $this->getHtml('Priority'); ?></label>
<option value="<?= TaskPriority::MEDIUM; ?>"><?= $this->getHtml('P3'); ?> <select id="iPriority" name="priority">
<option value="<?= TaskPriority::HIGH; ?>"><?= $this->getHtml('P4'); ?> <option value="<?= TaskPriority::NONE; ?>" selected><?= $this->getHtml('P0'); ?>
<option value="<?= TaskPriority::VHIGH; ?>"><?= $this->getHtml('P5'); ?> <option value="<?= TaskPriority::VLOW; ?>"><?= $this->getHtml('P1'); ?>
</select> <option value="<?= TaskPriority::LOW; ?>"><?= $this->getHtml('P2'); ?>
<tr><td><label for="iDue"><?= $this->getHtml('Due'); ?></label> <option value="<?= TaskPriority::MEDIUM; ?>"><?= $this->getHtml('P3'); ?>
<tr><td><input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>"> <option value="<?= TaskPriority::HIGH; ?>"><?= $this->getHtml('P4'); ?>
<tr><td><label for="iTitle"><?= $this->getHtml('Title'); ?></label> <option value="<?= TaskPriority::VHIGH; ?>"><?= $this->getHtml('P5'); ?>
<tr><td><input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title'); ?>" required> </select>
<tr><td><label for="iMessage"><?= $this->getHtml('Message'); ?></label> </div>
<tr><td><?= $this->getData('editor')->render('task-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('task-editor', 'plain', 'fTask'); ?> <div class="form-group">
</table> <label for="iDue"><?= $this->getHtml('Due'); ?></label>
<input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>">
</div>
<div class="form-group">
<label for="iTitle"><?= $this->getHtml('Title'); ?></label>
<input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title'); ?>" required>
</div>
<div class="form-group">
<label for="iMessage"><?= $this->getHtml('Message'); ?></label>
<?= $this->getData('editor')->render('task-editor'); ?>
</div>
<div class="form-group">
<?= $this->getData('editor')->getData('text')->render('task-editor', 'plain', 'fTask'); ?>
</div>
</div> </div>
<div class="portlet-foot"> <div class="portlet-foot">
<input id="iCreateSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"> <input id="iCreateSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
@ -62,19 +78,18 @@ echo $this->getData('nav')->render(); ?>
<div class="portlet-head"><?= $this->getHtml('Media'); ?></div> <div class="portlet-head"><?= $this->getHtml('Media'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<form> <form>
<table class="layout wf-100"> <div class="form-group">
<tbody> <label for="iMedia"><?= $this->getHtml('Media'); ?></label>
<tr><td><label for="iMedia"><?= $this->getHtml('Media'); ?></label> <div class="ipt-wrap wf-100">
<tr><td> <div class="ipt-first"><input type="text" id="iMedia" name="mediaFile" placeholder="&#xf15b; File"></div>
<div class="ipt-wrap"> <div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div>
<div class="ipt-first"><input type="text" id="iMedia" name="mediaFile" placeholder="&#xf15b; File"></div> </div>
<div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div> </div>
</div>
<tr><td><label for="iUpload"><?= $this->getHtml('Upload'); ?></label> <div class="form-group">
<tr><td> <input type="file" id="iUpload" name="upload" form="fTask" multiple>
<input type="file" id="iUpload" name="upload" form="fTask" multiple> <input form="fTask" type="hidden" name="type"><td>
<input form="fTask" type="hidden" name="type"><td> </div>
</table>
</div> </div>
</form> </form>
</div> </div>

View File

@ -315,50 +315,81 @@ echo $this->getData('nav')->render(); ?>
> >
<div class="portlet-head"><?= $this->getHtml('Message'); ?></div> <div class="portlet-head"><?= $this->getHtml('Message'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<table class="layout wf-100" style="table-layout: fixed"> <div class="form-group">
<tr><td><?= $this->getData('editor')->render('task-editor'); ?> <?= $this->getData('editor')->render('task-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render( </div>
<div class="form-group">
<?= $this->getData('editor')->getData('text')->render(
'task-editor', 'task-editor',
'plain', 'plain',
'taskElementCreate', 'taskElementCreate',
'', '', '', '',
'/content', '{/api}task?id={?id}' '/content', '{/api}task?id={?id}'
); ?> ); ?>
<tr><td><label for="iPriority"><?= $this->getHtml('Priority'); ?></label> </div>
<tr><td>
<select id="iPriority" name="priority"> <div class="form-group">
<option value="<?= TaskPriority::NONE; ?>"<?= $task->getPriority() === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0'); ?> <label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<option value="<?= TaskPriority::VLOW; ?>"<?= $task->getPriority() === TaskPriority::VLOW ? ' selected' : '';?>><?= $this->getHtml('P1'); ?> <select id="iStatus" name="status">
<option value="<?= TaskPriority::LOW; ?>"<?= $task->getPriority() === TaskPriority::LOW ? ' selected' : '';?>><?= $this->getHtml('P2'); ?> <option value="<?= TaskStatus::OPEN; ?>"<?= $task->getStatus() === TaskStatus::OPEN ? ' selected' : '';?>><?= $this->getHtml('S1'); ?>
<option value="<?= TaskPriority::MEDIUM; ?>"<?= $task->getPriority() === TaskPriority::MEDIUM ? ' selected' : '';?>><?= $this->getHtml('P3'); ?> <option value="<?= TaskStatus::WORKING; ?>"<?= $task->getStatus() === TaskStatus::WORKING ? ' selected' : '';?>><?= $this->getHtml('S2'); ?>
<option value="<?= TaskPriority::HIGH; ?>"<?= $task->getPriority() === TaskPriority::HIGH ? ' selected' : '';?>><?= $this->getHtml('P4'); ?> <option value="<?= TaskStatus::SUSPENDED; ?>"<?= $task->getStatus() === TaskStatus::SUSPENDED ? ' selected' : '';?>><?= $this->getHtml('S3'); ?>
<option value="<?= TaskPriority::VHIGH; ?>"<?= $task->getPriority() === TaskPriority::VHIGH ? ' selected' : '';?>><?= $this->getHtml('P5'); ?> <option value="<?= TaskStatus::CANCELED; ?>"<?= $task->getStatus() === TaskStatus::CANCELED ? ' selected' : '';?>><?= $this->getHtml('S4'); ?>
</select> <option value="<?= TaskStatus::DONE; ?>"<?= $task->getStatus() === TaskStatus::DONE ? ' selected' : '';?>><?= $this->getHtml('S5'); ?>
<tr><td><label for="iDue"><?= $this->getHtml('Due'); ?></label> </select>
<tr><td><input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml( </div>
!empty($elements) ? \end($elements)->due->format('Y-m-d\TH:i:s') : $task->due->format('Y-m-d\TH:i:s')
); ?>"> <div class="form-group">
<tr><td><label for="iStatus"><?= $this->getHtml('Status'); ?></label> <label for="iReceiver"><?= $this->getHtml('To'); ?></label>
<tr><td><select id="iStatus" name="status"> <?= $this->getData('accGrpSelector')->render('iReceiver', 'to', true); ?>
<option value="<?= TaskStatus::OPEN; ?>"<?= $task->getStatus() === TaskStatus::OPEN ? ' selected' : '';?>><?= $this->getHtml('S1'); ?> </div>
<option value="<?= TaskStatus::WORKING; ?>"<?= $task->getStatus() === TaskStatus::WORKING ? ' selected' : '';?>><?= $this->getHtml('S2'); ?>
<option value="<?= TaskStatus::SUSPENDED; ?>"<?= $task->getStatus() === TaskStatus::SUSPENDED ? ' selected' : '';?>><?= $this->getHtml('S3'); ?> <div class="more-container">
<option value="<?= TaskStatus::CANCELED; ?>"<?= $task->getStatus() === TaskStatus::CANCELED ? ' selected' : '';?>><?= $this->getHtml('S4'); ?> <input id="more-customer-sales" type="checkbox">
<option value="<?= TaskStatus::DONE; ?>"<?= $task->getStatus() === TaskStatus::DONE ? ' selected' : '';?>><?= $this->getHtml('S5'); ?> <label for="more-customer-sales">
</select> <span>Advanced</span>
<tr><td><label for="iCompletion"><?= $this->getHtml('Completion'); ?></label> <i class="fa fa-chevron-right expand"></i>
<tr><td><input id="iCompletion" name="completion" type="number" min="0" max="100"> </label>
<tr><td><label for="iReceiver"><?= $this->getHtml('To'); ?></label> <div>
<tr><td><?= $this->getData('accGrpSelector')->render('iReceiver', 'to', true); ?> <div class="form-group">
<tr><td><label for="iMedia"><?= $this->getHtml('Media'); ?></label> <label for="iPriority"><?= $this->getHtml('Priority'); ?></label>
<tr><td><div class="ipt-wrap"> <select id="iPriority" name="priority">
<div class="ipt-first"><input type="text" id="iMedia" placeholder="&#xf15b; File"></div> <option value="<?= TaskPriority::NONE; ?>"<?= $task->getPriority() === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0'); ?>
<div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div> <option value="<?= TaskPriority::VLOW; ?>"<?= $task->getPriority() === TaskPriority::VLOW ? ' selected' : '';?>><?= $this->getHtml('P1'); ?>
<option value="<?= TaskPriority::LOW; ?>"<?= $task->getPriority() === TaskPriority::LOW ? ' selected' : '';?>><?= $this->getHtml('P2'); ?>
<option value="<?= TaskPriority::MEDIUM; ?>"<?= $task->getPriority() === TaskPriority::MEDIUM ? ' selected' : '';?>><?= $this->getHtml('P3'); ?>
<option value="<?= TaskPriority::HIGH; ?>"<?= $task->getPriority() === TaskPriority::HIGH ? ' selected' : '';?>><?= $this->getHtml('P4'); ?>
<option value="<?= TaskPriority::VHIGH; ?>"<?= $task->getPriority() === TaskPriority::VHIGH ? ' selected' : '';?>><?= $this->getHtml('P5'); ?>
</select>
</div> </div>
<tr><td><label for="iUpload"><?= $this->getHtml('Upload'); ?></label>
<tr><td> <div class="form-group">
<input type="file" id="iUpload" name="fileUpload" form="fTask"> <label for="iDue"><?= $this->getHtml('Due'); ?></label>
</table> <input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml(
!empty($elements) ? \end($elements)->due->format('Y-m-d\TH:i:s') : $task->due->format('Y-m-d\TH:i:s')
); ?>">
</div>
</div>
<div class="form-group">
<label for="iCompletion"><?= $this->getHtml('Completion'); ?></label>
<input id="iCompletion" name="completion" type="number" min="0" max="100">
</div>
</div>
<div class="form-group">
<label for="iMedia"><?= $this->getHtml('Media'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><input type="text" id="iMedia" placeholder="&#xf15b; File"></div>
<div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div>
</div>
</div>
<div class="form-group">
<label for="iUpload"><?= $this->getHtml('Upload'); ?></label>
<input type="file" id="iUpload" name="fileUpload" form="fTask">
</div>
</div> </div>
<div class="portlet-foot"> <div class="portlet-foot">
<input class="add" data-form="" type="submit" id="iTaskElementCreateButton" name="taskElementCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>"> <input class="add" data-form="" type="submit" id="iTaskElementCreateButton" name="taskElementCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>">