Fix request_to_administrators checkbox on admin dashboard actions
This commit is contained in:
@@ -24,7 +24,9 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def edit; end
|
||||
def edit
|
||||
dashboard_action
|
||||
end
|
||||
|
||||
def update
|
||||
if dashboard_action.update(dashboard_action_params)
|
||||
|
||||
@@ -7,4 +7,8 @@ module Admin::ProposalDashboardActionsHelper
|
||||
def default_actions
|
||||
%w[polls email poster]
|
||||
end
|
||||
|
||||
def css_for_resource(action)
|
||||
"hide" if action == "proposed_action"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
<%= f.check_box :active, label: ::Dashboard::Action.human_attribute_name(:active) %>
|
||||
</div>
|
||||
|
||||
<div id="request_to_administrators" class="small-12 column margin-bottom hide"
|
||||
<div id="request_to_administrators"
|
||||
class="small-12 column margin-bottom <%= css_for_resource(@dashboard_action.action_type) %>"
|
||||
data-toggler=".hide">
|
||||
<%= f.check_box :request_to_administrators, label: ::Dashboard::Action.human_attribute_name(:request_to_administrators) %>
|
||||
<%= f.check_box :request_to_administrators %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user