Merge branch 'develop' into groups-updates
* develop: Updated status component to use properStatus when going to status page Added floating action button to ui/index Removed floating action button from columns area Fix issue with notification badge number not showing on mobile Updated scrollable_list to use documentElement for (primary/only) scrolling functionality Added onScroll props to status_list Added timeline scrollTop action, added to status_list_container, scrollable_list Removed unnecessary scrollContainer in status, account_gallery Added missing isLoading prop to ScrollableList Updated scrollable_list intersectionObserverWrapper Updated floatingActionButton to only show if someone is logged in Updated timeline_queue_button_header Removed focus of compose/cw after submit or spoiler change Removed set height of 100% on body Removed unused redirect after compose submit Patch Fix for hidden poll choices and results on light theme. Updated notification badge number formatter Fixed status/repost functionality to show status if owned by given username admin tool for editing pro status of accounts
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
module Admin
|
||||
class AccountsController < BaseController
|
||||
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :unsilence, :unsuspend, :memorialize, :approve, :reject, :verify, :unverify, :add_donor_badge, :remove_donor_badge, :add_investor_badge, :remove_investor_badge]
|
||||
before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :unsilence, :unsuspend, :memorialize, :approve, :reject, :verify, :unverify, :add_donor_badge, :remove_donor_badge, :add_investor_badge, :remove_investor_badge, :edit_pro, :save_pro]
|
||||
before_action :require_remote_account!, only: [:subscribe, :unsubscribe, :redownload]
|
||||
before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject]
|
||||
|
||||
@@ -162,6 +162,17 @@ module Admin
|
||||
redirect_to admin_account_path(@account.id)
|
||||
end
|
||||
|
||||
def edit_pro
|
||||
authorize @account, :edit_pro?
|
||||
end
|
||||
|
||||
def save_pro
|
||||
authorize @account, :edit_pro?
|
||||
|
||||
@account.update!(pro_params)
|
||||
redirect_to edit_pro_admin_account_path(@account.id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_account
|
||||
@@ -196,5 +207,9 @@ module Admin
|
||||
:staff
|
||||
)
|
||||
end
|
||||
|
||||
def pro_params
|
||||
params.require(:account).permit(:is_pro, :pro_expires_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user