new form layout and other tpl fixes

This commit is contained in:
Dennis Eichhorn 2021-04-18 22:29:46 +02:00
parent 7febcfe07a
commit fdc4e95471
3 changed files with 63 additions and 53 deletions

View File

@ -28,7 +28,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Archive'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="newsArchiveList" class="default">
<table id="newsArchiveList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Type'); ?>

View File

@ -48,33 +48,39 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-3">
<section class="portlet">
<form id="docForm" method="<?= $isNewArticle ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}news?' . ($isNewArticle ? '' : 'id={?id}&') . 'csrf={$CSRF}'); ?>">
<form id="docForm"
method="<?= $isNewArticle ? 'PUT' : 'POST'; ?>"
action="<?= UriFactory::build('{/api}news?' . ($isNewArticle ? '' : 'id={?id}&') . 'csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('Status'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tr><td>
<select name="status" id="iStatus">
<option value="<?= NewsStatus::DRAFT; ?>"<?= $news->getStatus() === NewsStatus::DRAFT ? ' selected' : ''; ?>><?= $this->getHtml('Draft'); ?>
<option value="<?= NewsStatus::VISIBLE; ?>"<?= $news->getStatus() === NewsStatus::VISIBLE ? ' selected' : ''; ?>><?= $this->getHtml('Visible'); ?>
</select>
<tr><td>
<label for="iPublish"><?= $this->getHtml('Publish'); ?></label>
<tr><td>
<input type="datetime-local" name="publish" id="iPublish" value="<?= $this->printHtml($news->getPublish()->format('Y-m-d\TH:i:s')); ?>">
<tr><td><label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<tr><td>
<select id="iLanguages" name="lang">
<?php foreach ($languages as $code => $language) : $code = \strtolower(\substr($code, 1)); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $news->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
<tr><td>
<label class="checkbox" for="iComment">
<input id="iComment" type="checkbox" name="allow_comments" value="1">
<span class="checkmark"></span>
<?= $this->getHtml('AllowComments'); ?>
</label>
</table>
<div class="form-group">
<select name="status" id="iStatus">
<option value="<?= NewsStatus::DRAFT; ?>"<?= $news->getStatus() === NewsStatus::DRAFT ? ' selected' : ''; ?>><?= $this->getHtml('Draft'); ?>
<option value="<?= NewsStatus::VISIBLE; ?>"<?= $news->getStatus() === NewsStatus::VISIBLE ? ' selected' : ''; ?>><?= $this->getHtml('Visible'); ?>
</select>
</div>
<div class="form-group">
<label for="iPublish"><?= $this->getHtml('Publish'); ?></label>
<input type="datetime-local" name="publish" id="iPublish" value="<?= $this->printHtml($news->getPublish()->format('Y-m-d\TH:i:s')); ?>">
</div>
<div class="form-group">
<label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<select id="iLanguages" name="lang">
<?php foreach ($languages as $code => $language) : $code = \strtolower(\substr($code, 1)); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $news->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label class="checkbox" for="iComment">
<input id="iComment" type="checkbox" name="allow_comments" value="1">
<span class="checkmark"></span>
<?= $this->getHtml('AllowComments'); ?>
</label>
</div>
</div>
<div class="portlet-foot">
<table class="layout wf-100">
@ -94,40 +100,45 @@ echo $this->getData('nav')->render(); ?>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Categories'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tr><td><?= $this->getHtml('Type'); ?>
<tr><td>
<label class="radio" for="iNewsTypeArticle">
<input type="radio" name="type" id="iNewsTypeArticle" form="docForm" value="<?= NewsType::ARTICLE; ?>"<?= $news->getType() === NewsType::ARTICLE ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('News'); ?>
</label>
<tr><td>
<label class="radio" for="iNewsTypeHeadline">
<input type="radio" name="type" id="iNewsTypeHeadline" form="docForm" value="<?= NewsType::HEADLINE; ?>"<?= $news->getType() === NewsType::HEADLINE ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('Headline'); ?>
</label>
<tr><td>
<label class="radio" for="iNewsTypeLink">
<input type="radio" name="type" id="iNewsTypeLink" form="docForm" value="<?= NewsType::LINK; ?>"<?= $news->getType() === NewsType::LINK ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('Link'); ?>
</label>
<tr><td><?= $this->getHtml('Tags', 'Tag'); ?>
<tr><td><?= $this->getData('tagSelector')->render('iTag', 'tag', 'fEditor', false); ?>
</table>
<div class="form-group">
<label class="radio" for="iNewsTypeArticle">
<input type="radio" name="type" id="iNewsTypeArticle" form="docForm" value="<?= NewsType::ARTICLE; ?>"<?= $news->getType() === NewsType::ARTICLE ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('News'); ?>
</label>
</div>
<div class="form-group">
<label class="radio" for="iNewsTypeHeadline">
<input type="radio" name="type" id="iNewsTypeHeadline" form="docForm" value="<?= NewsType::HEADLINE; ?>"<?= $news->getType() === NewsType::HEADLINE ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('Headline'); ?>
</label>
</div>
<div class="form-group">
<label class="radio" for="iNewsTypeLink">
<input type="radio" name="type" id="iNewsTypeLink" form="docForm" value="<?= NewsType::LINK; ?>"<?= $news->getType() === NewsType::LINK ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('Link'); ?>
</label>
</div>
<div class="form-group">
<?= $this->getHtml('Tags', 'Tag'); ?>
<?= $this->getData('tagSelector')->render('iTag', 'tag', 'fEditor', false); ?>
</div>
</div>
</section>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts/Groups'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<div class="form-group">
<!-- @todo add form this belongs to -->
<!-- @todo make auto save on change for already created news article -->
<!-- @todo add default values (some can be removed/overwritten and some not?) -->
<tr><td><?= $this->getData('accGrpSelector')->render('iReceiver', 'receiver', false); ?>
</table>
<?= $this->getData('accGrpSelector')->render('iReceiver', 'receiver', false); ?>
</div>
</div>
</section>
</div>

View File

@ -1,5 +1,4 @@
<?php
/**
* Orange Management
*