-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Append keywords in questions tag filter as GET URL parameters #897
Comments
@ananyo2012 -- any chance you could take this one on? I understand if you're busy!!! |
Sure Jeff I can work on this. In fact I was just onto other issues as well. Uh sorry to say it here I recently sent you a mail. Do have a look at it. |
Thanks and i got your email -- chatting w/ other staff about it today and |
I've created a start to this in #929 -- and key sections are: Controller logic: https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller.rb#L238-L268 The form itself is here: https://github.com/publiclab/plots2/blob/master/app/views/tag/_sorting.html.erb#L26-L46 |
@ryzokuken - if you're looking for new projects, this is also a key one I've been having trouble with. It seems to be related to a recurrence (for me) of bug #638, where no questions are shown: |
@jywarren Sure, I'll look into it. |
@ananyo2012, perhaps this'd be a good GCI candidate, esp. if you're familiar with this code? |
Yes this is a good one. Holds importance for improving the sort feature. I can improve documentation for this issue and then we can add this as a task. |
Closed, hooray! |
At https://publiclab.org/questions, when you add a "filter" of a given tag, the URL is not changed -- the added tag filters are stored in the session.
It's important that the keywords should be be appended to the url instead of being stored in the session. The routing should be more like:
https://publiclab.org/questions/spectrometry
and for multiple tags, perhaps:
https://publiclab.org/questions/spectrometry,second-tag,another
These would be fetched in the questions_controller via
params[:id].split(',')
-- here: https://github.com/publiclab/plots2/blob/master/app/controllers/questions_controller.rb. Theindex
,answered
,popular
,liked
action use this functionality presently.The sorting is done using the
sort_questions_by_tag
method in the application controller, where it sources from the session: https://github.com/publiclab/plots2/blob/master/app/controllers/application_controller.rb#L190-L200. This method is called in all the places mentioned above.The addition and deletion of tags from the session is done using the methods in tag_controller listed here: https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller.rb#L239-L267. So you need to modify these methods too.
The tag sorting interface (that generates the sessions, and would generate the URLs in our new plan) shown on the sidebar, is here: https://github.com/publiclab/plots2/blob/master/app/views/tag/_sorting.html.erb
That itself might be moved into this directory for easier management: https://github.com/publiclab/plots2/blob/master/app/views/questions/
Steps to solve
Summarizing the steps below
sort_questions_by_tag
method according to changes made and deprecate the use of session and use GET url parametersindex
,answered
,popular
,liked
actions in questions controller accordinglyThe text was updated successfully, but these errors were encountered: