aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2021-11-11 19:57:05 +0100
committerGravatar GitHub <noreply@github.com> 2021-11-11 19:57:05 +0100
commit26afec23794c251ff86b3ff51140c4bc992e1d89 (patch)
treed89300d141c81c23c0d98aa5f1158c8eec870c46 /app/views
parent181a54289ad4b2e05003ceb9b3f71f2adef4143d (diff)
Fix label management (#3959)
* disable inputs * fix create empty tags * Update app/Controllers/tagController.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/views/tag/index.phtml Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Small additional checks Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views')
-rw-r--r--app/views/tag/index.phtml17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/views/tag/index.phtml b/app/views/tag/index.phtml
index 55db61b67..eb6eefdb1 100644
--- a/app/views/tag/index.phtml
+++ b/app/views/tag/index.phtml
@@ -13,7 +13,7 @@
<div class="form-group">
<label class="group-name" for="new_label_name"><?= _t('sub.tag.name') ?></label>
<div class="group-controls">
- <input id="new_label_name" name="name" type="text" autocomplete="off"/>
+ <input id="new_label_name" name="name" type="text" autocomplete="off" required="required" />
</div>
</div>
@@ -25,12 +25,17 @@
</form>
<h2><?= _t('sub.title.rename_label') ?></h2>
+ <?php
+ $disabled = '';
+ if (count($this->tags) < 1) {
+ $disabled = ' disabled="disabled"';
+ } ?>
<form id="rename_tag" method="post" action="<?= _url('tag', 'rename') ?>" autocomplete="off">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<div class="form-group">
<label class="group-name" for="id_tag"><?= _t('sub.tag.old_name') ?></label>
<div class="group-controls">
- <select name="id_tag" id="id_tag">
+ <select name="id_tag" id="id_tag"<?= $disabled?>>
<?php foreach ($this->tags as $tag): ?>
<option value="<?= $tag->id() ?>"><?= $tag->name() ?></option>
<?php endforeach; ?>
@@ -40,13 +45,15 @@
<div class="form-group">
<label class="group-name" for="rename_new_name"><?= _t('sub.tag.new_name') ?></label>
<div class="group-controls">
- <input id="rename_new_name" name="name" type="text" autocomplete="off"/>
+ <input id="rename_new_name" name="name" type="text" autocomplete="off"<?= $disabled?>/>
</div>
</div>
<div class="form-group form-actions">
<div class="group-controls">
+ <?php if (!$disabled) { ?>
<button type="submit" class="btn btn-attention confirm"><?= _t('gen.action.rename') ?></button>
+ <?php } ?>
</div>
</div>
</form>
@@ -57,7 +64,7 @@
<div class="form-group">
<label class="group-name" for="id_tag_delete"><?= _t('sub.tag.name') ?></label>
<div class="group-controls">
- <select name="id_tag" id="id_tag_delete">
+ <select name="id_tag" id="id_tag_delete"<?= $disabled?>>
<?php foreach ($this->tags as $tag): ?>
<option value="<?= $tag->id() ?>"><?= $tag->name() ?></option>
<?php endforeach; ?>
@@ -67,7 +74,9 @@
<div class="form-group form-actions">
<div class="group-controls">
+ <?php if (!$disabled) { ?>
<button type="submit" class="btn btn-attention confirm"><?= _t('gen.action.remove') ?></button>
+ <?php } ?>
</div>
</div>
</form>