aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-12-15 12:34:18 +0100
committerGravatar GitHub <noreply@github.com> 2024-12-15 12:34:18 +0100
commit6b14a743ccfe5c14e15acac858c0906f4fccdf67 (patch)
tree0a464e2cd74e2ca6a2cdcb0161a2c100c596acbc
parent066d92be3216cd5d3427072cbc410c19bf53f400 (diff)
New state: favorite or unread (#7088)
* New state: favorite or unread https://github.com/FreshRSS/FreshRSS/discussions/7078#discussioncomment-11526292 * Experiment using this state by default * Rework state * Allow ANDS for typos * Revert change unrelated to this PR * Revert change of default state * Add option *unread_or_favorite* * Fix hide_read_feeds * i18n: it Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> * Update app/i18n/pl/conf.php Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com> * Update app/i18n/pl/conf.php Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com> * Fix i18n * Fix auto_remove_article * Fix mark_unread_enabled --------- Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com>
-rw-r--r--.typos.toml1
-rw-r--r--app/Models/Context.php28
-rw-r--r--app/Models/Entry.php4
-rw-r--r--app/Models/EntryDAO.php35
-rw-r--r--app/i18n/cs/conf.php3
-rw-r--r--app/i18n/de/conf.php3
-rw-r--r--app/i18n/el/conf.php5
-rw-r--r--app/i18n/en-us/conf.php5
-rw-r--r--app/i18n/en/conf.php5
-rw-r--r--app/i18n/es/conf.php3
-rw-r--r--app/i18n/fa/conf.php3
-rw-r--r--app/i18n/fi/conf.php3
-rw-r--r--app/i18n/fr/conf.php3
-rw-r--r--app/i18n/he/conf.php3
-rw-r--r--app/i18n/hu/conf.php3
-rw-r--r--app/i18n/id/conf.php3
-rw-r--r--app/i18n/it/conf.php3
-rw-r--r--app/i18n/ja/conf.php3
-rw-r--r--app/i18n/ko/conf.php3
-rw-r--r--app/i18n/lv/conf.php3
-rw-r--r--app/i18n/nl/conf.php3
-rw-r--r--app/i18n/oc/conf.php3
-rw-r--r--app/i18n/pl/conf.php3
-rw-r--r--app/i18n/pt-br/conf.php3
-rw-r--r--app/i18n/ru/conf.php3
-rw-r--r--app/i18n/sk/conf.php3
-rw-r--r--app/i18n/tr/conf.php3
-rw-r--r--app/i18n/zh-cn/conf.php3
-rw-r--r--app/i18n/zh-tw/conf.php3
-rw-r--r--app/layout/aside_feed.phtml8
-rw-r--r--app/layout/nav_menu.phtml7
-rw-r--r--app/views/configure/reading.phtml3
32 files changed, 104 insertions, 63 deletions
diff --git a/.typos.toml b/.typos.toml
index 7787efb4e..f6325e2e9 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -3,6 +3,7 @@ ot = "ot"
Ths2 = "Ths2"
[default.extend-words]
+ANDS = "ANDS"
referer = "referer"
[files]
diff --git a/app/Models/Context.php b/app/Models/Context.php
index f39fd0eca..eeb16f414 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -224,15 +224,15 @@ final class FreshRSS_Context {
self::$state = Minz_Request::paramInt('state') ?: FreshRSS_Context::userConf()->default_state;
$state_forced_by_user = Minz_Request::paramString('state') !== '';
- if (!$state_forced_by_user && !self::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
- if (FreshRSS_Context::userConf()->default_view === 'all') {
- self::$state |= FreshRSS_Entry::STATE_ALL;
+ if (!$state_forced_by_user) {
+ if (FreshRSS_Context::userConf()->show_fav_unread && (self::isCurrentGet('s') || self::isCurrentGet('T') || self::isTag())) {
+ self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
+ } elseif (FreshRSS_Context::userConf()->default_view === 'all') {
+ self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
+ } elseif (FreshRSS_Context::userConf()->default_view === 'unread_or_favorite') {
+ self::$state = FreshRSS_Entry::STATE_OR_NOT_READ | FreshRSS_Entry::STATE_OR_FAVORITE;
} elseif (FreshRSS_Context::userConf()->default_view === 'adaptive' && self::$get_unread <= 0) {
- self::$state |= FreshRSS_Entry::STATE_READ;
- }
- if (FreshRSS_Context::userConf()->show_fav_unread &&
- (self::isCurrentGet('s') || self::isCurrentGet('T') || self::isTag())) {
- self::$state |= FreshRSS_Entry::STATE_READ;
+ self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
}
}
@@ -553,16 +553,8 @@ final class FreshRSS_Context {
* - the "unread" state is enable
*/
public static function isAutoRemoveAvailable(): bool {
- if (!FreshRSS_Context::userConf()->auto_remove_article) {
- return false;
- }
- if (self::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
- return false;
- }
- if (!self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ)) {
- return false;
- }
- return true;
+ return FreshRSS_Context::userConf()->auto_remove_article && !self::isStateEnabled(FreshRSS_Entry::STATE_READ) &&
+ (self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) || self::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ));
}
/**
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 47d244bee..36ed11b40 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -9,6 +9,10 @@ class FreshRSS_Entry extends Minz_Model {
public const STATE_ALL = 3;
public const STATE_FAVORITE = 4;
public const STATE_NOT_FAVORITE = 8;
+ public const STATE_ANDS = self::STATE_READ | self::STATE_NOT_READ | self::STATE_FAVORITE | self::STATE_NOT_FAVORITE;
+ public const STATE_OR_NOT_READ = 32;
+ public const STATE_OR_FAVORITE = 64;
+ public const STATE_ORS = self::STATE_OR_NOT_READ | self::STATE_OR_FAVORITE;
/** @var numeric-string */
private string $id = '0';
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 23874a8e1..f9bf57220 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -1112,19 +1112,34 @@ SQL;
string $order = 'DESC', string $firstId = '', int $date_min = 0): array {
$search = ' ';
$values = [];
- if ($state & FreshRSS_Entry::STATE_NOT_READ) {
- if (!($state & FreshRSS_Entry::STATE_READ)) {
- $search .= 'AND ' . $alias . 'is_read=0 ';
+ if ($state & FreshRSS_Entry::STATE_ANDS) {
+ if ($state & FreshRSS_Entry::STATE_NOT_READ) {
+ if (!($state & FreshRSS_Entry::STATE_READ)) {
+ $search .= 'AND (' . $alias . 'is_read=0) ';
+ }
+ } elseif ($state & FreshRSS_Entry::STATE_READ) {
+ $search .= 'AND (' . $alias . 'is_read=1) ';
+ }
+ if ($state & FreshRSS_Entry::STATE_FAVORITE) {
+ if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) {
+ $search .= 'AND (' . $alias . 'is_favorite=1) ';
+ }
+ } elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
+ $search .= 'AND (' . $alias . 'is_favorite=0) ';
}
- } elseif ($state & FreshRSS_Entry::STATE_READ) {
- $search .= 'AND ' . $alias . 'is_read=1 ';
}
- if ($state & FreshRSS_Entry::STATE_FAVORITE) {
- if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) {
- $search .= 'AND ' . $alias . 'is_favorite=1 ';
+ if ($state & FreshRSS_Entry::STATE_ORS) {
+ if (trim($search) === '') {
+ $search = 'AND (1=0) ';
+ }
+ if ($state & FreshRSS_Entry::STATE_OR_NOT_READ) {
+ $search = rtrim($search, ') ');
+ $search .= ' OR ' . $alias . 'is_read=0) ';
+ }
+ if ($state & FreshRSS_Entry::STATE_OR_FAVORITE) {
+ $search = rtrim($search, ') ');
+ $search .= ' OR ' . $alias . 'is_favorite=1) ';
}
- } elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
- $search .= 'AND ' . $alias . 'is_favorite=0 ';
}
switch ($order) {
diff --git a/app/i18n/cs/conf.php b/app/i18n/cs/conf.php
index 1d4cdcce7..f05a2a16d 100644
--- a/app/i18n/cs/conf.php
+++ b/app/i18n/cs/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Počet zobrazených článků',
'active_category' => 'Aktivní kategorie',
- 'adaptive' => 'Vyberte zobrazení',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Zobrazit všechny články',
'all_categories' => 'Všechny kategorie',
'no_category' => 'Žádná kategorie',
'remember_categories' => 'Zapamatovat otevřené kategorie',
'unread' => 'Zobrazit pouze nepřečtené',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Použije se také na popisky',
'sides_close_article' => 'Kliknutí mimo oblast textu článku zavře článek',
diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php
index ef8ab55cb..9e0e9d813 100644
--- a/app/i18n/de/conf.php
+++ b/app/i18n/de/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Artikel zum Anzeigen',
'active_category' => 'Aktive Kategorie',
- 'adaptive' => 'Anzeige anpassen',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Alle Artikel zeigen',
'all_categories' => 'Alle Kategorien',
'no_category' => 'Keine Kategorie',
'remember_categories' => 'Geöffnete Kategorien merken',
'unread' => 'Nur ungelesene zeigen',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Auch auf Labels anwenden',
'sides_close_article' => 'Klick außerhalb des Artikel-Textes schließt den Artikel',
diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php
index 020aba5ad..e2f40c3dd 100644
--- a/app/i18n/el/conf.php
+++ b/app/i18n/el/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articles to display', // TODO
'active_category' => 'Active category', // TODO
- 'adaptive' => 'Adjust showing', // TODO
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Show all articles', // TODO
'all_categories' => 'All categories', // TODO
'no_category' => 'No category', // TODO
'remember_categories' => 'Remember open categories', // TODO
- 'unread' => 'Show only unread', // TODO
+ 'unread' => 'Show unreads', // TODO
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Applies also on labels', // TODO
'sides_close_article' => 'Clicking outside of article text area closes the article', // TODO
diff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.php
index 31fd4f217..37c24a2b5 100644
--- a/app/i18n/en-us/conf.php
+++ b/app/i18n/en-us/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articles to display', // IGNORE
'active_category' => 'Active category', // IGNORE
- 'adaptive' => 'Adjust showing', // IGNORE
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // IGNORE
'all_articles' => 'Show all articles', // IGNORE
'all_categories' => 'All categories', // IGNORE
'no_category' => 'No category', // IGNORE
'remember_categories' => 'Remember open categories', // IGNORE
- 'unread' => 'Show only unread', // IGNORE
+ 'unread' => 'Show unreads', // IGNORE
+ 'unread_or_favorite' => 'Show unreads and favorites', // IGNORE
),
'show_fav_unread_help' => 'Applies also on labels', // IGNORE
'sides_close_article' => 'Clicking outside of article text area closes the article', // IGNORE
diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php
index c46a7474e..1a2923a77 100644
--- a/app/i18n/en/conf.php
+++ b/app/i18n/en/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articles to display',
'active_category' => 'Active category',
- 'adaptive' => 'Adjust showing',
+ 'adaptive' => 'Show unreads if any, all articles otherwise',
'all_articles' => 'Show all articles',
'all_categories' => 'All categories',
'no_category' => 'No category',
'remember_categories' => 'Remember open categories',
- 'unread' => 'Show only unread',
+ 'unread' => 'Show unreads',
+ 'unread_or_favorite' => 'Show unreads and favourites',
),
'show_fav_unread_help' => 'Applies also on labels',
'sides_close_article' => 'Clicking outside of article text area closes the article',
diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php
index 167f9acbe..5efd6ff0e 100644
--- a/app/i18n/es/conf.php
+++ b/app/i18n/es/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Artículos a mostrar',
'active_category' => 'Categoría activa',
- 'adaptive' => 'Ajustar la visualización',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Mostrar todos los artículos',
'all_categories' => 'Todas las categorías',
'no_category' => 'Sin categoría',
'remember_categories' => 'Recordar categorías abiertas',
'unread' => 'Mostrar solo pendientes',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Se aplica también en las etiquetas',
'sides_close_article' => 'Pinchar fuera del área de texto del artículo lo cerrará',
diff --git a/app/i18n/fa/conf.php b/app/i18n/fa/conf.php
index d8084fae6..7b0cd006f 100644
--- a/app/i18n/fa/conf.php
+++ b/app/i18n/fa/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => ' مقالات برای نمایش',
'active_category' => ' دسته فعال',
- 'adaptive' => ' نمایش را تنظیم کنید',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => ' نمایش همه مقالات',
'all_categories' => ' همه دسته ها',
'no_category' => ' بدون دسته',
'remember_categories' => ' دسته بندی های باز را به خاطر بسپارید',
'unread' => ' فقط خوانده نشده را نشان دهد',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => ' روی برچسب ها نیز اعمال می شود',
'sides_close_article' => ' با کلیک کردن خارج از ناحیه متن مقاله',
diff --git a/app/i18n/fi/conf.php b/app/i18n/fi/conf.php
index 4d3ea1820..ba64b1fe5 100644
--- a/app/i18n/fi/conf.php
+++ b/app/i18n/fi/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Näytettävät artikkelit',
'active_category' => 'Käytössä oleva luokka',
- 'adaptive' => 'Säädä näkymää',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Näytä kaikki artikkelit',
'all_categories' => 'Kaikki luokat',
'no_category' => 'Ei luokkaa',
'remember_categories' => 'Muista avoinna olevat luokat',
'unread' => 'Näytä vain lukemattomat',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Koskee myös merkintöjä',
'sides_close_article' => 'Artikkeli sulkeutuu napsauttamalla sen ulkopuolelle',
diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php
index 783705f19..02f6695ce 100644
--- a/app/i18n/fr/conf.php
+++ b/app/i18n/fr/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articles à afficher',
'active_category' => 'La catégorie active',
- 'adaptive' => 'Adapter l’affichage',
+ 'adaptive' => 'Afficher les non lus s’il y en a, sinon tous les articles',
'all_articles' => 'Afficher tous les articles',
'all_categories' => 'Toutes les catégories',
'no_category' => 'Aucune catégorie',
'remember_categories' => 'Se souvenir des catégories dépliées',
'unread' => 'Afficher les non lus',
+ 'unread_or_favorite' => 'Afficher les non lus et les favoris',
),
'show_fav_unread_help' => 'S’applique aussi aux étiquettes',
'sides_close_article' => 'Cliquer hors de la zone de texte ferme l’article',
diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php
index 00ef4d1ab..0e212b966 100644
--- a/app/i18n/he/conf.php
+++ b/app/i18n/he/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'מאמרים להצגה',
'active_category' => 'Active category', // TODO
- 'adaptive' => 'תצוגה מתעדכנת',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'הצגת כל המאמרים',
'all_categories' => 'All categories', // TODO
'no_category' => 'No category', // TODO
'remember_categories' => 'Remember open categories', // TODO
'unread' => 'הצגת מאמרים שלא נקראו בלבד',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Applies also on labels', // TODO
'sides_close_article' => 'Clicking outside of article text area closes the article', // TODO
diff --git a/app/i18n/hu/conf.php b/app/i18n/hu/conf.php
index bb9c68a44..02904a4a2 100644
--- a/app/i18n/hu/conf.php
+++ b/app/i18n/hu/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Megjelenített cikkek',
'active_category' => 'Aktív kategória',
- 'adaptive' => 'Megjelenítés beállítása',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Mindegyik cikk megjelenítése',
'all_categories' => 'Mindegyik kategória',
'no_category' => 'Nincs kategória',
'remember_categories' => 'Emlékezzen a kibontott kategóriákra',
'unread' => 'Csak az olvasatlan cikkek',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'A címkékre is vonatkozik',
'sides_close_article' => 'A cikk szövegrészén kívüli kattintás bezárja a cikket',
diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php
index 4adebeb08..bf50cef8a 100644
--- a/app/i18n/id/conf.php
+++ b/app/i18n/id/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Artikel untuk ditampilkan',
'active_category' => 'Kategori aktif',
- 'adaptive' => 'Penyesuaian tampilan',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Tampilkan semua artikel',
'all_categories' => 'Semua kategori',
'no_category' => 'Tidak ada kategori',
'remember_categories' => 'Ingat kategori yang terbuka',
'unread' => 'Hanya tampilkan yang belum dibaca',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Berlaku juga pada label',
'sides_close_article' => 'Klik di luar area teks artikel untuk menutup artikel',
diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php
index 0309bab2e..3ed1887e2 100644
--- a/app/i18n/it/conf.php
+++ b/app/i18n/it/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articoli da visualizzare',
'active_category' => 'Categoria attiva',
- 'adaptive' => 'Adatta visualizzazione',
+ 'adaptive' => 'Mostra i non letti se ci sono o tutti gli articoli altrimenti',
'all_articles' => 'Mostra tutti gli articoli',
'all_categories' => 'Tutte le categorie',
'no_category' => 'Nessuna categoria',
'remember_categories' => 'Ricorda le categorie aperte',
'unread' => 'Mostra solo non letti',
+ 'unread_or_favorite' => 'Mostra i non letti e i preferiti',
),
'show_fav_unread_help' => 'Si applica anche alle etichette',
'sides_close_article' => 'Cliccare fuori dall’area di testo dell’articolo chiude l’articolo',
diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php
index 7deb4461e..65605e5cc 100644
--- a/app/i18n/ja/conf.php
+++ b/app/i18n/ja/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => '記事を表示する',
'active_category' => 'アクティブなカテゴリ',
- 'adaptive' => '表示を調整する',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'すべての記事を表示する',
'all_categories' => 'すべてのカテゴリ',
'no_category' => '未分類',
'remember_categories' => '前回開いたカテゴリ',
'unread' => '未読のみ表示する',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'ラベルも適用する',
'sides_close_article' => '記事の外をクリックすると記事を閉じるようにする',
diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php
index 4ebb27980..ce7892d3b 100644
--- a/app/i18n/ko/conf.php
+++ b/app/i18n/ko/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => '글 표시 방식',
'active_category' => '활성화 된 카테고리',
- 'adaptive' => '읽지 않은 글이 없으면 모든 글 표시',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => '모든 글 표시',
'all_categories' => '모든 카테고리',
'no_category' => '카테고리 없음',
'remember_categories' => '열린 카테고리 기억',
'unread' => '읽지 않은 글만 표시',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => '라벨에도 적용하기',
'sides_close_article' => '글 영역 바깥을 클릭하면 글 접기',
diff --git a/app/i18n/lv/conf.php b/app/i18n/lv/conf.php
index f568fe526..61bfb791e 100644
--- a/app/i18n/lv/conf.php
+++ b/app/i18n/lv/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Rādāmie raksti',
'active_category' => 'Aktīvā kategorija',
- 'adaptive' => 'Pielāgot rādīšanu',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Rādīt visus rakstus',
'all_categories' => 'Visas kategorijas',
'no_category' => 'Bez kategorijas',
'remember_categories' => 'Iegaumēt atvērtās kategorijas',
'unread' => 'Rādīt tikai nelasītos',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Attiecas arī uz birkām',
'sides_close_article' => 'Spiežot ārpus raksta teksta apgabala, raksts tiek aizvērts',
diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php
index 46a4105dc..5f5e96491 100644
--- a/app/i18n/nl/conf.php
+++ b/app/i18n/nl/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Artikelen om te tonen',
'active_category' => 'Actieve categorie',
- 'adaptive' => 'Pas weergave aan',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Bekijk alle artikelen',
'all_categories' => 'Alle categorieën',
'no_category' => 'Geen categorie',
'remember_categories' => 'Open categorieën herinneren',
'unread' => 'Bekijk alleen ongelezen',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Ook toepassen op labels',
'sides_close_article' => 'Sluit het artikel door buiten de artikeltekst te klikken',
diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php
index cc2c2b6cb..791998a9d 100644
--- a/app/i18n/oc/conf.php
+++ b/app/i18n/oc/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Articles de mostrar',
'active_category' => 'Activar categoria',
- 'adaptive' => 'Adaptar l’afichatge',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Mostrar totes los articles',
'all_categories' => 'Totas las categorias',
'no_category' => 'Cap de categoria',
'remember_categories' => 'Se remembrar de las categorias dobèrtas',
'unread' => 'Mostrar pas que los pas legits',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Aplicar tanben a las etiquetas',
'sides_close_article' => 'Clicar fòra de la zòna de tèxte tampa l’article',
diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php
index cc1c04bc8..26c2407c1 100644
--- a/app/i18n/pl/conf.php
+++ b/app/i18n/pl/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Wiadomości do wyświetlenia',
'active_category' => 'Aktualna',
- 'adaptive' => 'Dopasuj do sytuacji',
+ 'adaptive' => 'Pokaż istniejące nieprzeczytane artykuły, w przeciwnym razie wyświetl wszystkie',
'all_articles' => 'Wszystkie wiadomości',
'all_categories' => 'Wszystkie',
'no_category' => 'Żadna',
'remember_categories' => 'Pamiętaj otwarte kategorie',
'unread' => 'Tylko nieprzeczytane',
+ 'unread_or_favorite' => 'Pokaż nieprzeczytane i ulubione',
),
'show_fav_unread_help' => 'Stosuje się również do etykiet',
'sides_close_article' => 'Kliknięcie poza zawartością wiadomości zamyka widok wiadomości',
diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php
index ea82a10a0..9ad9bfdf0 100644
--- a/app/i18n/pt-br/conf.php
+++ b/app/i18n/pt-br/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Artigos para exibir',
'active_category' => 'Categoria ativa',
- 'adaptive' => 'Ajustar visualização',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Exibir todos os artigos',
'all_categories' => 'Exibir todas as categorias',
'no_category' => 'Nenhuma categoria',
'remember_categories' => 'lembrar de abrir as categorias',
'unread' => 'Exibir apenas não lido',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Aplicar também nas tags',
'sides_close_article' => 'Clicando fora da área do texto do artigo fecha o mesmo',
diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php
index f7e25498c..fa3475ca6 100644
--- a/app/i18n/ru/conf.php
+++ b/app/i18n/ru/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Какие статьи отображать',
'active_category' => 'Активную категорию',
- 'adaptive' => 'Адаптивно',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Показывать все статьи',
'all_categories' => 'Все категории',
'no_category' => 'Никакие категории',
'remember_categories' => 'Запоминать открытые категории',
'unread' => 'Только непрочитанные',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Также относится к меткам',
'sides_close_article' => 'Нажатия мышью за пределами текста статьи закрывают статью',
diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php
index b690e5c80..0c86af74a 100644
--- a/app/i18n/sk/conf.php
+++ b/app/i18n/sk/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Článkov na zobrazenie',
'active_category' => 'Aktívna kategória',
- 'adaptive' => 'Vyberte zobrazenie',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Zobraziť všetky články',
'all_categories' => 'Všetky kategórie',
'no_category' => 'Bez kategŕie',
'remember_categories' => 'Zapamätať otvorené kategórie',
'unread' => 'Zobraziť iba neprečítané',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Týka sa aj štítkov',
'sides_close_article' => 'Po kliknutí mimo textu článku sa článok zatvorí',
diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php
index 751dba7c1..c442def82 100644
--- a/app/i18n/tr/conf.php
+++ b/app/i18n/tr/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => 'Gösterilecek makaleler',
'active_category' => 'Mevcut kategori',
- 'adaptive' => 'Ayarlanmış gösterim',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => 'Tüm makaleleri göster',
'all_categories' => 'Tüm kategoriler',
'no_category' => 'Hiçbir kategori',
'remember_categories' => 'Açık kategorileri hatırla',
'unread' => 'Sadece okunmamış makaleleri göster',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => 'Etiketlerde de uygula',
'sides_close_article' => 'Makale dışında bir alana tıklamak makaleyi kapatır',
diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php
index 0256e010a..d2c939974 100644
--- a/app/i18n/zh-cn/conf.php
+++ b/app/i18n/zh-cn/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => '文章显示',
'active_category' => '活跃的分类',
- 'adaptive' => '自适应显示',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => '显示所有',
'all_categories' => '所有分类',
'no_category' => '无分类',
'remember_categories' => '记住打开的分类',
'unread' => '只显示未读',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => '同样适用于标签',
'sides_close_article' => '点击文章文本区域外关闭文章',
diff --git a/app/i18n/zh-tw/conf.php b/app/i18n/zh-tw/conf.php
index 338621317..1872956c9 100644
--- a/app/i18n/zh-tw/conf.php
+++ b/app/i18n/zh-tw/conf.php
@@ -257,12 +257,13 @@ return array(
'show' => array(
'_' => '文章顯示',
'active_category' => '啟用的分類',
- 'adaptive' => '智能顯示',
+ 'adaptive' => 'Show unreads if any, all articles otherwise', // TODO
'all_articles' => '顯示所有',
'all_categories' => '所有分類',
'no_category' => '無分類',
'remember_categories' => '記住打開的分類',
'unread' => '只顯示未讀',
+ 'unread_or_favorite' => 'Show unreads and favourites', // TODO
),
'show_fav_unread_help' => '同樣適用於標籤',
'sides_close_article' => '點擊文章區域外以關閉',
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index 7ca3bd3db..18a1a9939 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -3,11 +3,11 @@
/** @var FreshRSS_View $this */
$actual_view = Minz_Request::actionName();
$class = '';
- if (FreshRSS_Context::userConf()->hide_read_feeds &&
- FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
+ if (FreshRSS_Context::userConf()->hide_read_feeds &&
+ (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) || FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ)) &&
!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
- $class = ' state_unread';
- }
+ $class = ' state_unread';
+ }
$state_filter_manual = Minz_Request::paramString('state');
if ($state_filter_manual !== '') {
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index c4aff5c55..c45c5e70a 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -22,7 +22,9 @@
foreach ($states as $state_str => $state) {
$state_enabled = FreshRSS_Context::isStateEnabled($state);
$url_state = Minz_Request::currentRequest();
- $url_state['params']['state'] = FreshRSS_Context::getRevertState($state);
+ $reverted_state = FreshRSS_Context::getRevertState($state);
+ $reverted_state &= FreshRSS_Entry::STATE_ANDS; // Keep only the AND states
+ $url_state['params']['state'] = $reverted_state;
?>
<a id="toggle-<?= $state_str ?>"
class="btn <?= $state_enabled ? 'active' : '' ?>"
@@ -153,7 +155,8 @@
$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);
+ $mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) ||
+ (!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ));
?>
<li class="item separator">
<button class="as-link <?= $confirm ?>"
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 107057c64..86cfcfe20 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -29,9 +29,10 @@
<label class="group-name" for="default_view"><?= _t('conf.reading.show') ?></label>
<div class="group-controls">
<select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::userConf()->default_view ?>">
+ <option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
<option value="adaptive"<?= FreshRSS_Context::userConf()->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option>
+ <option value="unread_or_favorite"<?= FreshRSS_Context::userConf()->default_view === 'unread_or_favorite' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread_or_favorite') ?></option>
<option value="all"<?= FreshRSS_Context::userConf()->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option>
- <option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
</select>
</div>
</div>