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-1870 Add mass unassignment of fandoms in user wrangling page #3168
Conversation
| - assignment.destroy | ||
| - redirect_to tag_wranglers_path(media_id: params[:media_id], fandom_string: params[:fandom_string], wrangler_id: params[:wrangler_id]) | ||
| + assignments = WranglingAssignment.where(user_id: wrangler.id, fandom_id: params[:fandom_ids]) | ||
| + assignments.each { |f| f.destroy } |
sarken
added
the
Awaiting review
label
Nov 19, 2017
|
Thanks for looking at this! I've spoken to the Tag Wrangling chairs, and they have a couple of requests: First, they'd like validation that makes it so only an admin or the wrangler who owns the page (i.e. testy if it's ao3.org/tag_wranglers/testy) can deassign fandoms. Second, they'd like a confirmation step. For users with JavaScript enabled, that can be as simple as a confirmation dialogue asking, "Are you sure you want to deassign these fandoms?" For a non-JavaScript fallback, it should be something like the confirmation page for deleting multiple works:
Would you be able to make these changes? |
|
I believe so.
…
|
|
Does this limitation : "validation that makes it so only an admin or the wrangler who owns the page can deassign fandoms." apply to the wranglers page as well? Or should wranglers still be able to unassign fandoms from other wranglers from there? |
|
Thanks for asking! The Tag Wrangling chairs say the limitation shouldn't apply to the wranglers page.
|
| @@ -1,6 +1,8 @@ | ||
| class TagWranglersController < ApplicationController | ||
| before_action :check_user_status | ||
| - before_action :check_permission_to_wrangle | ||
| + before_action :check_permission_to_wrangle, except: [:destroy, :confirm_delete] |
| - before_action :check_permission_to_wrangle | ||
| + before_action :check_permission_to_wrangle, except: [:destroy, :confirm_delete] | ||
| + before_action :load_wrangler, except: [:index] | ||
| + before_action :load_assignments, only: [:destroy, :confirm_delete] |
| + @fandoms = @assignments.map(&:fandom) | ||
| + end | ||
| + | ||
| + def confirm_delete |
| - assignment.destroy | ||
| - redirect_to tag_wranglers_path(media_id: params[:media_id], fandom_string: params[:fandom_string], wrangler_id: params[:wrangler_id]) | ||
| + if request.format == "html" && params[:commit] == 'Unassign' | ||
| + render 'confirm_delete' and return |
| before_action :check_user_status | ||
| - before_action :check_permission_to_wrangle | ||
| + before_action :check_permission_to_wrangle, except: [:destroy, :confirm_delete] |

hatal175 commentedNov 18, 2017
Issue
https://otwarchive.atlassian.net/browse/AO3-1870
Purpose
Adding a mass unassignment option to user tag wrangling page.
Testing
I've added a few lines to a feature test. Also I'd appreciate an opinion on how the interface change looks.
Credit
Tal Hayon
Please use he.