aboutsummaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-06-14 08:58:33 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-06-14 09:04:31 +0200
commita7e833280954a537e12d5a3f4fa12a5b9e8412da (patch)
treea6705f67a706f3ee9e427e0dcd1d108b0ee64ef0 /app/layout
parent2b8dc666345d334f50bf2f4f32f0b127edb40c3a (diff)
Improve system of queries
- Coding style - More checks server side - Default query name is "Query n°X" - List of queries is moved into nav_menu, in a dropdown - Better system to remove fields in JS (to a.remove elements, give an attibute data-remove="id_to_remove") - Fix a bug in lib/Mine/Request.php (htmlspecialchars_utf8 can be applied on arrays now) - Few theme improvements - Add an element .no-mobile to apply to elements which should not appear on mobiles See https://github.com/marienfressinaud/FreshRSS/pull/498
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/aside_flux.phtml17
-rw-r--r--app/layout/nav_menu.phtml63
2 files changed, 44 insertions, 36 deletions
diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml
index 8f8d436e1..817dae676 100644
--- a/app/layout/aside_flux.phtml
+++ b/app/layout/aside_flux.phtml
@@ -36,23 +36,6 @@
</a>
</div>
</li>
-
- <?php
- $count = 0;
- foreach ($this->conf->queries as $query_conf):
- $count++;
- $name = $count;
- if (isset($query_conf['name'])) {
- $name = $query_conf['name'];
- unset($query_conf['name']);
- }
- $url_user_query = array('c' => 'index', 'a' => 'index', 'params' => $query_conf); ?>
- <li>
- <div class="category">
- <a data-unread="0" class="btn" href="<?php echo Minz_Url::display($url_user_query)?>"><?php echo $name?></a>
- </div>
- </li>
- <?php endforeach; ?>
<?php
foreach ($this->cat_aside as $cat) {
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index aadaadff9..a9cf02388 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -7,18 +7,20 @@
<?php } ?>
<?php if ($this->loginOk) { ?>
- <?php $url_state = $this->url;
- if ($this->state & FreshRSS_Entry::STATE_READ) {
- $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_READ;
- $checked = 'true';
- $class = 'active';
- } else {
- $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_READ;
- $checked = 'false';
- $class = '';
- }
- ?>
<div class="stick">
+ <?php
+ $url_state = $this->url;
+
+ if ($this->state & FreshRSS_Entry::STATE_READ) {
+ $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_READ;
+ $checked = 'true';
+ $class = 'active';
+ } else {
+ $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_READ;
+ $checked = 'false';
+ $class = '';
+ }
+ ?>
<a id="toggle-read"
class="btn <?php echo $class; ?>"
aria-checked="<?php echo $checked; ?>"
@@ -26,6 +28,7 @@
title="<?php echo Minz_Translate::t ('show_read'); ?>">
<?php echo FreshRSS_Themes::icon('read'); ?>
</a>
+
<?php
if ($this->state & FreshRSS_Entry::STATE_NOT_READ) {
$url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_READ;
@@ -44,6 +47,7 @@
title="<?php echo Minz_Translate::t ('show_not_reads'); ?>">
<?php echo FreshRSS_Themes::icon('unread'); ?>
</a>
+
<?php
if ($this->state & FreshRSS_Entry::STATE_FAVORITE) {
$url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_FAVORITE;
@@ -62,6 +66,7 @@
title="<?php echo Minz_Translate::t ('show_favorite'); ?>">
<?php echo FreshRSS_Themes::icon('starred'); ?>
</a>
+
<?php
if ($this->state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
$url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_FAVORITE;
@@ -80,6 +85,34 @@
title="<?php echo Minz_Translate::t ('show_not_favorite'); ?>">
<?php echo FreshRSS_Themes::icon('non-starred'); ?>
</a>
+
+ <div class="dropdown">
+ <div id="dropdown-query" class="dropdown-target"></div>
+
+ <a class="dropdown-toggle btn" href="#dropdown-query"><?php echo FreshRSS_Themes::icon('bookmark-add'); ?></a>
+ <ul class="dropdown-menu">
+ <li class="dropdown-close"><a href="#close">❌</a></li>
+
+ <li class="dropdown-header"><?php echo Minz_Translate::t('queries'); ?> <a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo FreshRSS_Themes::icon('configure'); ?></a></li>
+
+ <?php foreach ($this->conf->queries as $query) { ?>
+ <li class="item">
+ <a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a>
+ </li>
+ <?php } ?>
+
+ <?php if (count($this->conf->queries) > 0) { ?>
+ <li class="separator no-mobile"></li>
+ <?php } ?>
+
+ <?php
+ $url_query = $this->url;
+ $url_query['c'] = 'configure';
+ $url_query['a'] = 'addQuery';
+ ?>
+ <li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo Minz_Translate::t('add_query'); ?></a></li>
+ </ul>
+ </div>
</div>
<?php
$get = false;
@@ -233,14 +266,6 @@
<a class="btn" href="<?php echo Minz_Url::display ($url_order); ?>" title="<?php echo Minz_Translate::t ($title); ?>">
<?php echo FreshRSS_Themes::icon($icon); ?>
</a>
-
- <?php if ($this->loginOk) {
- $url_query = $this->url;
- $url_query['c'] = 'configure';
- $url_query['a'] = 'addQuery';
- ?>
- <a id="save_query" class="btn" href="<?php echo Minz_Url::display ($url_query); ?>"><?php echo FreshRSS_Themes::icon('bookmark-add'); ?></a>
- <?php } ?>
<?php if ($this->loginOk || Minz_Configuration::allowAnonymousRefresh()) { ?>
<a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a>