aboutsummaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-03 20:48:04 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-03 20:48:04 +0200
commitd3f5bd840d513bc4820a919ef9e0f02b0263ff9c (patch)
tree2fa5d1a5711c4e52603924e0740b7c820621617f /app/layout
parent14e1b23e42b322b9c54475e4b69c1aa60c94e280 (diff)
Add mark-as-unread (#1995)
* Add mark-as-unread https://github.com/FreshRSS/FreshRSS/issues/1966 * Change sentence https://github.com/FreshRSS/FreshRSS/pull/1995#discussion_r214515954 * Enable mark-as-unread only when unread articles are shown In order to prevent erroneous marking-as-unread. We might find a better logic later. * Disable instead of hide mark-as-unread option To make it easier to discover
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/nav_menu.phtml19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index d1f3bed43..88f882db9 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -62,9 +62,10 @@
<?php
$get = FreshRSS_Context::currentGet();
$string_mark = _t('index.menu.mark_all_read');
- if ($get[0] == 'f') {
+ $string_unmark = _t('index.menu.mark_selection_unread');
+ if ($get[0] === 'f') {
$string_mark = _t('index.menu.mark_feed_read');
- } elseif ($get[0] == 'c') {
+ } elseif ($get[0] === 'c') {
$string_mark = _t('index.menu.mark_cat_read');
}
@@ -77,8 +78,12 @@
'idMax' => FreshRSS_Context::$id_max,
'search' => htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES),
'state' => FreshRSS_Context::$state,
- )
+ ),
);
+
+ $mark_unread_url = $mark_read_url;
+ $mark_unread_url['params']['is_read'] = false;
+ $mark_unread_url['params']['nextGet'] = $get;
?>
<div class="stick" id="nav_menu_read_all">
@@ -110,6 +115,7 @@
$mark_before_today['params']['idMax'] = $today . '000000';
$mark_before_one_week = $mark_read_url;
$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
+ $mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) or !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ);
?>
<li class="item">
<button class="as-link <?php echo $confirm; ?>"
@@ -123,6 +129,13 @@
formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>"
type="submit"><?php echo _t('index.menu.before_one_week'); ?></button>
</li>
+ <li class="separator"></li>
+ <li class="item">
+ <button class="as-link <?php echo $mark_unread_enabled ? $confirm : '" disabled="disabled'; ?>"
+ form="mark-read-menu"
+ formaction="<?php echo Minz_Url::display($mark_unread_url); ?>"
+ type="submit"><?php echo $string_unmark; ?></button>
+ </li>
</ul>
</div>
</form>