-
-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User queries #498
User queries #498
Conversation
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.
J'essayerai de tester de ces jours-ci |
public function queriesAction () { | ||
if (Minz_Request::isPost ()) { | ||
$params = Minz_Request::params(); | ||
$this->view->conf->_queries ($params['queries']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no user query, then $params['queries']
is undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you'll save an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the current code generates a warning.
You need something like:
$this->view->conf->_queries (isset($params['queries']) ? $params['queries'] : array());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird because I don't have any warning. That's why I kept the code that way.
Sorry for that messy PR. I forgot to watch the logs. |
Wow! That's really interesting ! :D I will continue your work if you want: there is some part of code I want to modify and I would like to improve a bit the interface ;) |
Thanks. |
I have done a lot of work tonight. I will commit tomorrow because I need to sleep before check my code ;) In few words:
|
- 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 #498
It is merged! Hope you will like my improvements :) A tip: do more work server side, default query name was given only in the view. It is better to do that on the server. |
Good job 👍 |
I was thinking about that yesterday. Filters cannot replace this button for two reasons:
|
I can also better like to keep the existing "favourites" buttons. |
- Menu button is a down arrow - Bookmark icon has moved near of "add a query" See #498
Done :) |
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 straightforward, 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.
See #376