summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-17 11:24:31 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-17 11:24:31 +0200
commit6e140d82b033e1304d7495d990ec0295fa7ffaa1 (patch)
tree62d0aff4bb319c0946d6560dbea964496f82c59b
parentfc5cae981f906bc887eaf053b1826f9153210423 (diff)
parent9fec7f328b077993499c282ccb59414fb50ca84f (diff)
Merge branch 'aledeg-reading-conf' into dev
-rw-r--r--app/Models/Configuration.php13
-rw-r--r--app/Models/Entry.php2
-rw-r--r--app/Models/EntryDAO.php3
-rw-r--r--app/i18n/en.php2
-rw-r--r--app/i18n/fr.php2
-rw-r--r--app/views/configure/reading.phtml19
6 files changed, 32 insertions, 9 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index e4408df73..352e70f4f 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -141,7 +141,18 @@ class FreshRSS_Configuration {
}
}
public function _default_view ($value) {
- $this->data['default_view'] = $value === FreshRSS_Entry::STATE_ALL ? FreshRSS_Entry::STATE_ALL : FreshRSS_Entry::STATE_NOT_READ;
+ switch ($value) {
+ case FreshRSS_Entry::STATE_ALL:
+ // left blank on purpose
+ case FreshRSS_Entry::STATE_NOT_READ:
+ // left blank on purpose
+ case FreshRSS_Entry::STATE_NOT_READ_STRICT:
+ $this->data['default_view'] = $value;
+ break;
+ default:
+ $this->data['default_view'] = FreshRSS_Entry::STATE_ALL;
+ break;
+ }
}
public function _display_posts ($value) {
$this->data['display_posts'] = ((bool)$value) && $value !== 'no';
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 0bf1f2616..5f1c8abc4 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -6,6 +6,8 @@ class FreshRSS_Entry extends Minz_Model {
const STATE_NOT_READ = 2;
const STATE_FAVORITE = 4;
const STATE_NOT_FAVORITE = 8;
+ const STATE_READ_STRICT = 16;
+ const STATE_NOT_READ_STRICT = 32;
private $id = 0;
private $guid;
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 75a8aeba4..dee49212d 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -338,6 +338,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
elseif ($state & FreshRSS_Entry::STATE_READ) {
$where .= 'AND e1.is_read=1 ';
}
+ elseif ($state & FreshRSS_Entry::STATE_NOT_READ_STRICT) {
+ $where .= 'AND e1.is_read=0 ';
+ }
if ($state & FreshRSS_Entry::STATE_FAVORITE) {
if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) {
$where .= 'AND e1.is_favorite=1 ';
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 0c6d0e94f..562697585 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -92,6 +92,7 @@ return array (
'rss_view' => 'RSS feed',
'show_all_articles' => 'Show all articles',
'show_not_reads' => 'Show only unread',
+ 'show_adaptive' => 'Adjust showing',
'show_read' => 'Show only read',
'show_favorite' => 'Show only favorites',
'show_not_favorite' => 'Show all but favorites',
@@ -271,6 +272,7 @@ return array (
'articles_per_page' => 'Number of articles per page',
'number_divided_when_unfolded' => 'Divided by 2 during loading of unfolded articles.',
'default_view' => 'Default view',
+ 'articles_to_display' => 'Articles to display',
'sort_order' => 'Sort order',
'auto_load_more' => 'Load next articles at the page bottom',
'display_articles_unfolded' => 'Show articles unfolded by default',
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index 403638c99..9516f66cb 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -92,6 +92,7 @@ return array (
'rss_view' => 'Flux RSS',
'show_all_articles' => 'Afficher tous les articles',
'show_not_reads' => 'Afficher les non lus',
+ 'show_adaptive' => 'Adapter l’affichage',
'show_read' => 'Afficher les lus',
'show_favorite' => 'Afficher les favoris',
'show_not_favorite' => 'Afficher tout sauf les favoris',
@@ -271,6 +272,7 @@ return array (
'articles_per_page' => 'Nombre d’articles par page',
'number_divided_when_unfolded' => 'Divisé par 2 lors du chargement d’articles dépliés.',
'default_view' => 'Vue par défaut',
+ 'articles_to_display' => 'Articles à afficher',
'sort_order' => 'Ordre de tri',
'auto_load_more' => 'Charger les articles suivants en bas de page',
'display_articles_unfolded' => 'Afficher les articles dépliés par défaut',
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 87dff91a6..3dd457a2b 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -34,14 +34,17 @@
<option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>
<option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>
</select>
- <label class="radio" for="radio_all">
- <input type="radio" name="default_view" id="radio_all" value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' checked="checked"' : ''; ?> />
- <?php echo Minz_Translate::t ('show_all_articles'); ?>
- </label>
- <label class="radio" for="radio_not_read">
- <input type="radio" name="default_view" id="radio_not_read" value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' checked="checked"' : ''; ?> />
- <?php echo Minz_Translate::t ('show_not_reads'); ?>
- </label>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="group-name" for="view_mode"><?php echo _t('articles_to_display'); ?></label>
+ <div class="group-controls">
+ <select name="default_view" id="default_view">
+ <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_adaptive'); ?></option>
+ <option value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' selected="selected"' : ''; ?>><?php echo _t('show_all_articles'); ?></option>
+ <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ_STRICT; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ_STRICT ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></option>
+ </select>
</div>
</div>