aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-05-30 10:51:47 +0200
committerGravatar GitHub <noreply@github.com> 2022-05-30 10:51:47 +0200
commit98f9409155a95c4f63874251f34b5e5592255fd0 (patch)
tree1822d87fb6d2d5ac97a3007e519d711ee3a34eed
parent15cdb60ba07f9c83d0129677b117bd3e955e13e5 (diff)
Improved: Feed config: title, website url, feed url (#4258)
* do not display "website" in dropdown menu, when it is empty * feed name and URL required. input type = url * Update app/views/helpers/feed/update.phtml Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/views/helpers/feed/update.phtml Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * fix spaces and tabs * use classes indead of ID Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
-rw-r--r--app/layout/aside_feed.phtml2
-rw-r--r--app/views/helpers/feed/update.phtml7
-rw-r--r--p/scripts/main.js3
3 files changed, 7 insertions, 5 deletions
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index 62cb85df9..e02af8727 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -145,7 +145,7 @@
<?php if (FreshRSS_Auth::hasAccess()) { ?>
<li class="item"><a href="<?= _url('stats', 'repartition', 'id', '------') ?>"><?= _t('index.menu.stats') ?></a></li>
<?php } ?>
- <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?= _t('gen.action.see_website') ?></a></li>
+ <li class="item link website"><a target="_blank" rel="noreferrer" href="http://example.net/"><?= _t('gen.action.see_website') ?></a></li>
<?php if (FreshRSS_Auth::hasAccess()) { ?>
<li class="separator"></li>
<?php
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 9764b3f47..1acf570ea 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -35,7 +35,7 @@
<div class="form-group">
<label class="group-name" for="name"><?= _t('sub.feed.title') ?></label>
<div class="group-controls">
- <input type="text" name="name" id="name" class="w100" value="<?= $this->feed->name(true) ?>" />
+ <input type="text" name="name" id="name" class="w100" value="<?= $this->feed->name(true) ?>" required="required" />
</div>
</div>
<div class="form-group">
@@ -48,7 +48,7 @@
<label class="group-name" for="website"><?= _t('sub.feed.website') ?></label>
<div class="group-controls">
<div class="stick w100">
- <input type="text" name="website" id="website" value="<?= $this->feed->website() ?>" />
+ <input type="url" name="website" id="website" value="<?= $this->feed->website() ?>" />
<a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>" data-input="website" title="<?= _t('gen.action.open_url') ?>"><?= _i('link') ?></a>
</div>
</div>
@@ -57,10 +57,9 @@
<label class="group-name" for="url"><?= _t('sub.feed.url') ?></label>
<div class="group-controls">
<div class="stick w100">
- <input type="text" name="url" id="url" value="<?= $this->feed->url() ?>" />
+ <input type="url" name="url" id="url" value="<?= $this->feed->url() ?>" required="required" />
<a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>" data-input="url" title="<?= _t('gen.action.open_url') ?>"><?= _i('link') ?></a>
</div>
-
<a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?=
rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a>
</div>
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 03a04c989..035b66c53 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -846,6 +846,9 @@ function init_column_categories() {
a.href = '#dropdown-' + id;
div.querySelector('.dropdown-target').id = 'dropdown-' + id;
div.insertAdjacentHTML('beforeend', template);
+ if (feed_web.length < 1) {
+ div.querySelector('.item.link.website').remove();
+ }
const b = div.querySelector('button.confirm');
if (b) {
b.disabled = false;