aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Julien-Pierre Avérous <github@sourcemac.com> 2020-02-13 19:22:35 +0200
committerGravatar GitHub <noreply@github.com> 2020-02-13 18:22:35 +0100
commitd30ac40772ec1b4706922afd8acab8448af39a9e (patch)
tree6b7cec8455a542875959a09f7bdcc7a2af285fa1 /app/views
parent4ddd1821bb0fc1186937551d59100294b8833727 (diff)
Enhance content path feature (#2778)
- Add a maintenance section to be able to clear cache and force reload a feed. - Add an icon next to path field to show a pop-up with the result of the content path. Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Marien Fressinaud <dev@marienfressinaud.fr>
Diffstat (limited to 'app/views')
-rw-r--r--app/views/feed/contentSelectorPreview.phtml36
-rw-r--r--app/views/helpers/feed/update.phtml21
2 files changed, 56 insertions, 1 deletions
diff --git a/app/views/feed/contentSelectorPreview.phtml b/app/views/feed/contentSelectorPreview.phtml
new file mode 100644
index 000000000..3bb27859a
--- /dev/null
+++ b/app/views/feed/contentSelectorPreview.phtml
@@ -0,0 +1,36 @@
+<?php FreshRSS::preLayout(); ?>
+<!DOCTYPE html>
+<html class="preview_background" lang="<?= FreshRSS_Context::$user_conf->language ?>" xml:lang="<?= FreshRSS_Context::$user_conf->language ?>">
+ <head>
+ <?= self::headStyle() ?>
+ <script src="<?= Minz_Url::display('/scripts/preview.js?' . @filemtime(PUBLIC_PATH . '/scripts/preview.js')) ?>"></script>
+ </head>
+ <body class="preview_background">
+ <?php if ($this->fatalError != '') { ?>
+ <p class="alert alert-warn"><?= $this->fatalError ?></p>
+ <?php } else { ?>
+ <?php if ($this->selectorSuccess === false) { ?>
+ <p class="alert alert-warn">
+ <?= _t('feedback.sub.feed.selector_preview.no_result') ?>
+ </p>
+ <?php } ?>
+
+ <div class="preview_controls">
+ <label for="freshrss_rendered">
+ <input type="radio" id="freshrss_rendered" name="freshrss_type" checked="checked" />
+ <?= _t('sub.feed.selector_preview.show_rendered') ?>
+ </label>
+
+ <label for="freshrss_raw">
+ <input type="radio" id="freshrss_raw" name="freshrss_type" />
+ <?= _t('sub.feed.selector_preview.show_raw') ?>
+ </label>
+ </div>
+
+ <div class="content large">
+ <div dir="auto" id="freshrss_rendered_view"><?= $this->htmlContent ?></div>
+ <pre id="freshrss_raw_view" hidden="hidden"> <?= htmlspecialchars($this->htmlContent) ?></pre>
+ </div>
+ <?php } ?>
+ </body>
+</html>
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 4bc9d62a8..0a3852e22 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -274,7 +274,10 @@
<div class="form-group">
<label class="group-name" for="path_entries"><?= _t('sub.feed.css_path') ?></label>
<div class="group-controls">
- <input type="text" name="path_entries" id="path_entries" class="extend" value="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+ <div class="stick">
+ <input type="text" name="path_entries" id="path_entries" class="extend" value="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+ <a id="popup-preview-selector" class="btn" href="<?= _url('feed', 'contentSelectorPreview', 'id', $this->feed->id(), 'selector', 'selector-token') ?>"><?= _i('look') ?></a>
+ </div>
<?= _i('help') ?> <?= _t('sub.feed.css_help') ?>
</div>
</div>
@@ -354,5 +357,21 @@
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
</div>
</div>
+
+ <legend><?= _t('sub.feed.maintenance.title') ?></legend>
+ <div class="form-group">
+ <div class="group-controls">
+ <a class="btn btn-important" href="<?= _url('feed', 'clearCache', 'id', $this->feed->id()) ?>">
+ <?= _t('sub.feed.maintenance.clear_cache') ?>
+ </a>
+ <?= _i('help') ?> <?= _t('sub.feed.maintenance.clear_cache_help') ?>
+ </div>
+ <div class="group-controls">
+ <a class="btn btn-important" href="<?= _url('feed', 'reload', 'id', $this->feed->id()) ?>">
+ <?= _t('sub.feed.maintenance.reload_articles') ?>
+ </a>
+ <?= _i('help') ?> <?= _t('sub.feed.maintenance.reload_articles_help') ?>
+ </div>
+ </div>
</form>
</div>