From 07fd5084f73286391dba251e70de718b06ad4e9d Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Apr 2019 16:25:50 +0200 Subject: [PATCH] Show request to admins and short description only for resources --- app/views/admin/dashboard/actions/_form.html.erb | 15 +++++++++------ spec/shared/features/nested_documentable.rb | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb index 42b736237..3e2e6f185 100644 --- a/app/views/admin/dashboard/actions/_form.html.erb +++ b/app/views/admin/dashboard/actions/_form.html.erb @@ -5,7 +5,8 @@ <%= f.label :action_type %> <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> - <%= f.radio_button :action_type, action_type_value, label: false %> + <%= f.radio_button :action_type, action_type_value, label: false, + data: {toggle: "request_to_administrators short_description"} %> <%= f.label "action_type_#{action_type_value}", t("admin.dashboard.actions.action_type.#{action_type_value}") %> <% end %> @@ -15,7 +16,8 @@ <%= f.check_box :active, label: ::Dashboard::Action.human_attribute_name(:active) %> -
+
<%= f.check_box :request_to_administrators, label: ::Dashboard::Action.human_attribute_name(:request_to_administrators) %>
@@ -26,11 +28,12 @@ <%= f.label :title %> <%= f.text_field :title, label: false %> - <%= f.label :short_description %> - <%= f.text_field :short_description, label: false %> +
+ <%= f.label :short_description %> + <%= f.text_field :short_description, label: false %> +
- <%= f.cktext_area :description, - ckeditor: { language: I18n.locale } %> + <%= f.cktext_area :description, ckeditor: { language: I18n.locale } %>
diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb index 8c33d8763..b3febed10 100644 --- a/spec/shared/features/nested_documentable.rb +++ b/spec/shared/features/nested_documentable.rb @@ -371,7 +371,7 @@ end def documentable_fill_new_valid_dashboard_action fill_in :dashboard_action_title, with: "Dashboard title" - fill_in :dashboard_action_short_description, with: "Dashboard description" + fill_in_ckeditor :dashboard_action_description, with: "Dashboard description" end def documentable_fill_new_valid_budget_investment