forked from e621ng/e621ng
Fix set maintainer links
This commit is contained in:
parent
9582ab23c5
commit
c9496797cf
@ -52,6 +52,7 @@ class PostSetMaintainersController < ApplicationController
|
||||
check_approve_access(@maintainer)
|
||||
|
||||
@maintainer.approve!
|
||||
redirect_to :back, notice: "You are now a maintainer for the set."
|
||||
end
|
||||
|
||||
def deny
|
||||
@ -59,6 +60,7 @@ class PostSetMaintainersController < ApplicationController
|
||||
raise User::PrivilegeError unless @maintainer.user_id == CurrentUser.id
|
||||
|
||||
@maintainer.deny!
|
||||
redirect_to :back, notice: "You have declined the set maintainer invite."
|
||||
end
|
||||
|
||||
def block
|
||||
@ -66,6 +68,7 @@ class PostSetMaintainersController < ApplicationController
|
||||
check_block_access(@maintainer)
|
||||
|
||||
@maintainer.block!
|
||||
redirect_to :back, notice: "You will not receive further invites for this set."
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -12,11 +12,11 @@ class PostSetMaintainer < ApplicationRecord
|
||||
def notify_maintainer
|
||||
body = "\"#{post_set.creator.name}\":/users/#{post_set.creator_id} invited you to be a maintainer of the \"#{post_set.name}\":/post_sets/#{post_set_id} set. This would allow you to add and remove posts from it.
|
||||
|
||||
\"Click here\":/post_set_maintainers/approve/#{id} to approve the request and become a maintainer.
|
||||
\"Click here\":/post_set_maintainers/#{id}/approve to approve the request and become a maintainer.
|
||||
|
||||
\"Click here\":/post_set_maintainers/deny/#{id} to deny the request.
|
||||
\"Click here\":/post_set_maintainers/#{id}/deny to deny the request.
|
||||
|
||||
\"Click here\":/post_set_maintainers/block/#{id} to deny the request and prevent yourself from being invited to this set again in the future."
|
||||
\"Click here\":/post_set_maintainers/#{id}/block to deny the request and prevent yourself from being invited to this set again in the future."
|
||||
Dmail.create_automated(
|
||||
to_id: user_id,
|
||||
title: "You were invite to be a maintainer of #{post_set.name}",
|
||||
|
@ -394,9 +394,9 @@ Rails.application.routes.draw do
|
||||
end
|
||||
resources :post_set_maintainers do
|
||||
member do
|
||||
post :approve
|
||||
post :block
|
||||
post :deny
|
||||
get :approve
|
||||
get :block
|
||||
get :deny
|
||||
end
|
||||
end
|
||||
resource :email do
|
||||
|
Loading…
Reference in New Issue
Block a user