aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-10-09 15:43:30 +0200
committerGravatar GitHub <noreply@github.com> 2022-10-09 15:43:30 +0200
commit648a876d77a7591eac6c4ad5f14b30988e18ce20 (patch)
tree5832c068fd7d4d0a1fa80096849dde18a25887d4 /app/views
parent72265c1eca41424f761246abc5a7fe84fd8bc0f9 (diff)
Add support for custom XPath date/time format (#4703)
* Add support for custom XPath date/time format #fix https://github.com/FreshRSS/FreshRSS/issues/4701 Improvement of https://github.com/FreshRSS/FreshRSS/pull/4220 * Format is not XPath * Remove TODOs in en-GB
Diffstat (limited to 'app/views')
-rw-r--r--app/views/helpers/export/opml.phtml1
-rw-r--r--app/views/helpers/feed/update.phtml9
-rw-r--r--app/views/subscription/add.phtml8
3 files changed, 18 insertions, 0 deletions
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index 677bb03b5..1ee030cdf 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -26,6 +26,7 @@ function feedsToOutlines($feeds, $excludeMutedFeeds = false): array {
$outline['frss:xPathItemUri'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemUri'] ?? null];
$outline['frss:xPathItemAuthor'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemAuthor'] ?? null];
$outline['frss:xPathItemTimestamp'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemTimestamp'] ?? null];
+ $outline['frss:xPathItemTimeformat'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemTimeformat'] ?? null];
$outline['frss:xPathItemThumbnail'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemThumbnail'] ?? null];
$outline['frss:xPathItemCategories'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemCategories'] ?? null];
$outline['frss:xPathItemUid'] = ['namespace' => FreshRSS_Export_Service::FRSS_NAMESPACE, 'value' => $xPathSettings['itemUid'] ?? null];
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 80782fc57..12437d8f0 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -466,6 +466,15 @@
</div>
</div>
<div class="form-group">
+ <label class="group-name" for="xPathItemTimeFormat"><small>
+ <?= _t('sub.feed.kind.html_xpath.item_timeFormat') ?></label>
+ <div class="group-controls">
+ <textarea class="w100" name="xPathItemTimeFormat" id="xPathItemTimeFormat" rows="2" cols="64" spellcheck="false"
+ data-leave-validation="<?= $xpath['itemTimeFormat'] ?? '' ?>"><?= $xpath['itemTimeFormat'] ?? '' ?></textarea>
+ <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timeFormat.help') ?></p>
+ </div>
+ </div>
+ <div class="form-group">
<label class="group-name" for="xPathItemCategories"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
<?= _t('sub.feed.kind.html_xpath.item_categories') ?></label>
<div class="group-controls">
diff --git a/app/views/subscription/add.phtml b/app/views/subscription/add.phtml
index a2b7f1289..800093bed 100644
--- a/app/views/subscription/add.phtml
+++ b/app/views/subscription/add.phtml
@@ -141,6 +141,14 @@
</div>
</div>
<div class="form-group">
+ <label class="group-name" for="xPathItemTimeFormat">
+ <?= _t('sub.feed.kind.html_xpath.item_timeFormat') ?></label>
+ <div class="group-controls">
+ <textarea name="xPathItemTimeFormat" id="xPathItemTimeFormat" rows="2" cols="64" spellcheck="false"></textarea>
+ <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timeFormat.help') ?></p>
+ </div>
+ </div>
+ <div class="form-group">
<label class="group-name" for="xPathItemCategories"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
<?= _t('sub.feed.kind.html_xpath.item_categories') ?></label>
<div class="group-controls">