Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
AO3-5100 Rework Open Challenges pages #3192
Conversation
hatal175
added some commits
Nov 25, 2017
| @@ -44,25 +44,38 @@ def index | ||
| params[:sort_column] = "collections.created_at" if !valid_sort_column(params[:sort_column], 'collection') | ||
| params[:sort_direction] = 'DESC' if !valid_sort_direction(params[:sort_direction]) | ||
| sort = params[:sort_column] + " " + params[:sort_direction] | ||
| - @collections = Collection.sorted_and_filtered(sort, params[:collection_filters], params[:page]) | ||
| + @collections = Collection.sorted_and_filtered(params[:collection_filters], Proc.new { |query| query.order(sort) }, params[:page]) |
| - @challenge_collections = (Collection.signup_open("GiftExchange").limit(15) + Collection.signup_open("PromptMeme").limit(15)) | ||
| + @challenge_collections = (Collection.signup_open("GiftExchange").includes(:challenge).limit(15) + | ||
| + Collection.signup_open("PromptMeme").includes(:challenge).limit(15)). | ||
| + sort_by { |collection| collection.challenge.signups_close_at } |
houndci-bot
Dec 1, 2017
Align sort_by with (Collection.signup_open("GiftExchange").includes(:challenge).limit(15) + on line 55.
| + params[:collection_filters].delete("challenge_type") | ||
| + params[:collection_filters].delete("closed") | ||
| + | ||
| + @challenge_collections = Collection.sorted_and_filtered(params[:collection_filters], Proc.new { |query| query.signup_open(@challenge_type) }, params[:page]) |
| # build up the query with scopes based on the options the user specifies | ||
| query = Collection.top_level | ||
| if !filters[:title].blank? | ||
| # we get the matching collections out of autocomplete and use their ids | ||
| ids = Collection.autocomplete_lookup(search_param: filters[:title], | ||
| - autocomplete_prefix: (filters[:closed].blank? ? "autocomplete_collection_all" : (filters[:closed] ? "autocomplete_collection_closed" : "autocomplete_collection_open")) | ||
| - ).map {|result| Collection.id_from_autocomplete(result)} | ||
| + autocomplete_prefix: (filters[:closed].blank? ? "autocomplete_collection_all" : (filters[:closed] ? "autocomplete_collection_closed" : "autocomplete_collection_open")) |
| - autocomplete_prefix: (filters[:closed].blank? ? "autocomplete_collection_all" : (filters[:closed] ? "autocomplete_collection_closed" : "autocomplete_collection_open")) | ||
| - ).map {|result| Collection.id_from_autocomplete(result)} | ||
| + autocomplete_prefix: (filters[:closed].blank? ? "autocomplete_collection_all" : (filters[:closed] ? "autocomplete_collection_closed" : "autocomplete_collection_open")) | ||
| + ).map {|result| Collection.id_from_autocomplete(result)} |
houndci-bot
Dec 1, 2017
Align ) with (.
Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
Space between { and | missing.
Space missing inside }.
| @@ -66,6 +66,11 @@ | ||
| select("1", from: "gift_exchange_potential_match_settings_attributes_num_required_fandoms") | ||
| end | ||
| +When /^I set challenge close time to ([0-9]*) months?$/ do |months| | ||
| + current_date = DateTime.current |
| @@ -66,6 +66,11 @@ | ||
| select("1", from: "gift_exchange_potential_match_settings_attributes_num_required_fandoms") | ||
| end | ||
| +When /^I set challenge close time to ([0-9]*) months?$/ do |months| | ||
| + current_date = DateTime.current | ||
| + fill_in("Sign-up closes", with: "#{current_date.months_since(months.to_i)}") |
sarken
changed the title from
Ao3 5100
to
AO3-5100 Rework Open Challenges pages
Dec 1, 2017
sarken
added
the
Awaiting review
label
Dec 1, 2017
hatal175
added some commits
Dec 4, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hatal175 commentedDec 1, 2017
Issue
https://otwarchive.atlassian.net/browse/AO3-5100
Purpose
This does most of is described in the bug report.
I would like to request an opinion on whether the changes are what the author had in mind for this feature. Also an opinion for the changes themselves, maybe with regards to the filtering and their efficiency would be appreciated.
Testing
I've added some basic tests but the bug report describes the feature.
Credit
Tal.
Please use he.