Allow admin set published_proposal field

This commit is contained in:
taitus
2019-01-08 16:03:58 +01:00
parent 3048578c53
commit 082cc41a1e
5 changed files with 19 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
end end
def edit; end def edit; end
def update def update
if dashboard_action.update(dashboard_action_params) if dashboard_action.update(dashboard_action_params)
redirect_to admin_dashboard_actions_path redirect_to admin_dashboard_actions_path
@@ -54,10 +54,10 @@ class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
params params
.require(:dashboard_action) .require(:dashboard_action)
.permit( .permit(
:title, :description, :short_description, :request_to_administrators, :day_offset, :title, :description, :short_description, :request_to_administrators, :day_offset,
:required_supports, :order, :active, :action_type, :required_supports, :order, :active, :action_type, :published_proposal,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy], 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 end

View File

@@ -33,6 +33,13 @@
</div> </div>
</div> </div>
<div class="row expanded margin-top">
<div class="small-12 medium-12 column">
<%= f.check_box :published_proposal, label: t("admin.dashboard.actions.form.published_proposal") %>
<p class="help-text"><%= t("admin.dashboard.actions.form.published_proposal_help_text") %></p>
</div>
</div>
<div class="row expanded margin-top"> <div class="row expanded margin-top">
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 column">
<%= f.label :day_offset %> <%= f.label :day_offset %>

View File

@@ -11,6 +11,7 @@
<th><%= t("admin.dashboard.actions.index.action_title") %></th> <th><%= t("admin.dashboard.actions.index.action_title") %></th>
<th><%= t("admin.dashboard.actions.index.action_type") %></th> <th><%= t("admin.dashboard.actions.index.action_type") %></th>
<th class="text-center"><%= t("admin.dashboard.actions.index.action_active") %></th> <th class="text-center"><%= t("admin.dashboard.actions.index.action_active") %></th>
<th class="text-center"><%= t("admin.dashboard.actions.index.published_proposal") %></th>
<th class="text-center"><%= t("admin.dashboard.actions.index.day_offset") %></th> <th class="text-center"><%= t("admin.dashboard.actions.index.day_offset") %></th>
<th class="text-center"><%= t("admin.dashboard.actions.index.required_supports") %></th> <th class="text-center"><%= t("admin.dashboard.actions.index.required_supports") %></th>
<th class="text-center"><%= t("admin.dashboard.actions.index.order") %></th> <th class="text-center"><%= t("admin.dashboard.actions.index.order") %></th>
@@ -30,6 +31,7 @@
<td><%= action.title %></td> <td><%= action.title %></td>
<td><%= t("admin.dashboard.actions.action_type.#{action.action_type}") %></td> <td><%= t("admin.dashboard.actions.action_type.#{action.action_type}") %></td>
<td class="text-center"><%= active_human_readable(action.active) %></td> <td class="text-center"><%= active_human_readable(action.active) %></td>
<td class="text-center"><%= active_human_readable(action.published_proposal) %></td>
<td class="text-center"><%= number_with_delimiter(action.day_offset, delimiter: '.') %></td> <td class="text-center"><%= number_with_delimiter(action.day_offset, delimiter: '.') %></td>
<td class="text-center"><%= number_with_delimiter(action.required_supports, delimiter: '.') %></td> <td class="text-center"><%= number_with_delimiter(action.required_supports, delimiter: '.') %></td>
<td class="text-center"><%= action.order %></td> <td class="text-center"><%= action.order %></td>

View File

@@ -337,6 +337,7 @@ en:
day_offset: Required days day_offset: Required days
action_active: Active action_active: Active
order: Order order: Order
published_proposal: Published proposal
new: new:
creating: New action for the proposals dashboard creating: New action for the proposals dashboard
back: Back to list back: Back to list
@@ -352,6 +353,8 @@ en:
day_offset_help_text: Enter 0 so that this value is not taken into account 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 required_supports_help_text: Enter 0 so that this value is not taken into account
order_help_text: Order to show to user 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: administrator_tasks:
index: index:
title: Pending tasks title: Pending tasks

View File

@@ -337,6 +337,7 @@ es:
day_offset: Días necesarios day_offset: Días necesarios
action_active: Activo action_active: Activo
order: Orden order: Orden
published_proposal: Propuesta publicada
new: new:
creating: Nueva acción para el dashboard de propuestas creating: Nueva acción para el dashboard de propuestas
back: Volver a la lista 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 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 required_supports_help_text: Introduce 0 para que este valor no se tenga en cuenta
order_help_text: Orden para mostrar al usuario 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: delete:
success: Acción borrada con éxito success: Acción borrada con éxito
administrator_tasks: administrator_tasks: