diff --git a/app/controllers/admin/dashboard/actions_controller.rb b/app/controllers/admin/dashboard/actions_controller.rb
index 07eae766c..18b452a61 100644
--- a/app/controllers/admin/dashboard/actions_controller.rb
+++ b/app/controllers/admin/dashboard/actions_controller.rb
@@ -25,7 +25,7 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
end
def edit; end
-
+
def update
if dashboard_action.update(dashboard_action_params)
redirect_to admin_dashboard_actions_path
@@ -54,10 +54,10 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
params
.require(:dashboard_action)
.permit(
- :title, :description, :short_description, :request_to_administrators, :day_offset,
- :required_supports, :order, :active, :action_type,
+ :title, :description, :short_description, :request_to_administrators, :day_offset,
+ :required_supports, :order, :active, :action_type, :published_proposal,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
- links_attributes: [:id, :label, :url, :open_in_new_tab, :_destroy]
+ links_attributes: [:id, :label, :url, :open_in_new_tab, :_destroy]
)
end
diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb
index 478d3c169..409af5736 100644
--- a/app/views/admin/dashboard/actions/_form.html.erb
+++ b/app/views/admin/dashboard/actions/_form.html.erb
@@ -33,6 +33,13 @@
+
+
+ <%= f.check_box :published_proposal, label: t("admin.dashboard.actions.form.published_proposal") %>
+
<%= t("admin.dashboard.actions.form.published_proposal_help_text") %>
+
+
+
<%= f.label :day_offset %>
diff --git a/app/views/admin/dashboard/actions/index.html.erb b/app/views/admin/dashboard/actions/index.html.erb
index 660fa7398..425e34860 100644
--- a/app/views/admin/dashboard/actions/index.html.erb
+++ b/app/views/admin/dashboard/actions/index.html.erb
@@ -11,6 +11,7 @@
<%= t("admin.dashboard.actions.index.action_title") %> |
<%= t("admin.dashboard.actions.index.action_type") %> |
<%= t("admin.dashboard.actions.index.action_active") %> |
+ <%= t("admin.dashboard.actions.index.published_proposal") %> |
<%= t("admin.dashboard.actions.index.day_offset") %> |
<%= t("admin.dashboard.actions.index.required_supports") %> |
<%= t("admin.dashboard.actions.index.order") %> |
@@ -30,6 +31,7 @@
<%= action.title %> |
<%= t("admin.dashboard.actions.action_type.#{action.action_type}") %> |
<%= active_human_readable(action.active) %> |
+ <%= active_human_readable(action.published_proposal) %> |
<%= number_with_delimiter(action.day_offset, delimiter: '.') %> |
<%= number_with_delimiter(action.required_supports, delimiter: '.') %> |
<%= action.order %> |
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index 0ee33f8a2..65a060dbb 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -337,6 +337,7 @@ en:
day_offset: Required days
action_active: Active
order: Order
+ published_proposal: Published proposal
new:
creating: New action for the proposals dashboard
back: Back to list
@@ -352,6 +353,8 @@ en:
day_offset_help_text: Enter 0 so that this value is not taken into account
required_supports_help_text: Enter 0 so that this value is not taken into account
order_help_text: Order to show to user
+ published_proposal: For published proposals?
+ published_proposal_help_text: Mark this checkbox to create the action only for published proposals
administrator_tasks:
index:
title: Pending tasks
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index a6ba7338e..9b0b746b7 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -337,6 +337,7 @@ es:
day_offset: Días necesarios
action_active: Activo
order: Orden
+ published_proposal: Propuesta publicada
new:
creating: Nueva acción para el dashboard de propuestas
back: Volver a la lista
@@ -350,6 +351,8 @@ es:
day_offset_help_text: Introduce 0 para que este valor no se tenga en cuenta
required_supports_help_text: Introduce 0 para que este valor no se tenga en cuenta
order_help_text: Orden para mostrar al usuario
+ published_proposal: ¿Para propuestas publicadas?
+ published_proposal_help_text: Marca este checkbox para crear la acción solo para propuestas publicadas
delete:
success: Acción borrada con éxito
administrator_tasks: