diff options
| author | 2014-05-04 08:57:19 -0400 | |
|---|---|---|
| committer | 2014-05-04 17:23:53 -0400 | |
| commit | 8521c876d4b2ce69ff5d4313493017f26aa2cd6b (patch) | |
| tree | 36b2c4ee9f3237502a7f15c0a8e6c132ad7a53a7 /app/layout | |
| parent | 2f51556f775045689abcde413c765cd08b85058a (diff) | |
Add user queries
It's an intermediary step to remove the favorite button.
I add a button to store the current query as a favorite query. It redirects automatically to the configuration page where it is possible to name and remove user queries.
To make the queries more straigtforward, I removed the default behavior when searching for a string. This way, when we search for a string, the filter is not defaulted to all articles.
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_configure.phtml | 3 | ||||
| -rw-r--r-- | app/layout/aside_flux.phtml | 17 | ||||
| -rw-r--r-- | app/layout/header.phtml | 1 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 8 |
4 files changed, 29 insertions, 0 deletions
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 43adeb3c6..e66f2f64c 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -15,6 +15,9 @@ <li class="item<?php echo Minz_Request::actionName () == 'shortcut' ? ' active' : ''; ?>"> <a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a> </li> + <li class="item<?php echo Minz_Request::actionName () == 'queries' ? ' active' : ''; ?>"> + <a href="<?php echo _url ('configure', 'queries'); ?>"><?php echo Minz_Translate::t ('queries'); ?></a> + </li> <li class="separator"></li> <li class="item<?php echo Minz_Request::actionName () == 'users' ? ' active' : ''; ?>"> <a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a> diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 817dae676..8f8d436e1 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -36,6 +36,23 @@ </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/header.phtml b/app/layout/header.phtml index 08aa7715d..3eedc8ea7 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -72,6 +72,7 @@ if (Minz_Configuration::canLogIn()) { <li class="item"><a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a></li> <li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a></li> <li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a></li> + <li class="item"><a href="<?php echo _url ('configure', 'queries'); ?>"><?php echo Minz_Translate::t ('queries'); ?></a></li> <li class="separator"></li> <li class="item"><a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a></li> <li class="separator"></li> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 9990448ba..6db172904 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -241,6 +241,14 @@ <?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 endif; ?> + <?php $url_output['params']['output'] = 'rss'; ?> <a class="btn view_rss" target="_blank" href="<?php echo Minz_Url::display ($url_output); ?>" title="<?php echo Minz_Translate::t ('rss_view'); ?>"> <?php echo FreshRSS_Themes::icon('rss'); ?> |
