Plots2: Refining /stats preset ranges routes

Created on 5 Mar 2019  路  6Comments  路  Source: publiclab/plots2

Where to look

https://github.com/publiclab/plots2/blob/master/app/views/stats/index.html.erb#L16-L19
Right now on selecting an option the url is /stats?options= which is defined in this line https://github.com/publiclab/plots2/blob/master/app/controllers/stats_controller.rb#L12

Change to be made

On post the url should be /stats?start=&end=

enhancement help wanted

All 6 comments

Hi, I'm new here and would like to work on this!

Hi @thefifthisa, awesome go ahead. Feel free to ask for help here if you are stuck.

Thanks @cesswairimu! To clarify, will I need to create the post method? I only see get here.

@thefifthisa oh yeah I see..I guess it has always been a get. I believe adding a post is not necessary. We want the filter period dropdown to be using the same params as we used in the date selector. That is start and end..
stats
This will mean explicitly setting start and end...end will be Time.now for all the options and start will be Time.now -1.month for month and so on..also another way would be to make the select options urls go for example past week will have the the link /stats?start=<%= Time.now - 1.week %> &end=<%= Time.now %> not sure if making the the options url is possible yet . Hope this helps

@thefifthisa R u still working on this ? Else I'd love to take this up. Thanks :)

This was fix. closing it. Thanks all

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bronwen9 picture bronwen9  路  3Comments

jywarren picture jywarren  路  3Comments

divyabaid16 picture divyabaid16  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

keshavsethi picture keshavsethi  路  3Comments