From bb9542de7e958e8e4110f79027bddedda8755f9c Mon Sep 17 00:00:00 2001 From: Kat <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:57:22 +0000 Subject: [PATCH] Update buttons --- .../rails_admin/main/_submit_buttons.html.erb | 25 +++++++++++++++++++ app/views/rails_admin/main/delete.html.erb | 21 ++++++++++++++++ app/views/rails_admin/main/index.html.erb | 24 ++++++++++-------- 3 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 app/views/rails_admin/main/_submit_buttons.html.erb create mode 100644 app/views/rails_admin/main/delete.html.erb diff --git a/app/views/rails_admin/main/_submit_buttons.html.erb b/app/views/rails_admin/main/_submit_buttons.html.erb new file mode 100644 index 000000000..241624c4e --- /dev/null +++ b/app/views/rails_admin/main/_submit_buttons.html.erb @@ -0,0 +1,25 @@ +
+
+ + + + <% if @action.enabled? && authorized?(:new, @abstract_model) %> + + <% end %> + <% if @action.enabled? && authorized?(:edit, @abstract_model) %> + + <% end %> + + +
+
diff --git a/app/views/rails_admin/main/delete.html.erb b/app/views/rails_admin/main/delete.html.erb new file mode 100644 index 000000000..59a01a377 --- /dev/null +++ b/app/views/rails_admin/main/delete.html.erb @@ -0,0 +1,21 @@ +

+ <%= t("admin.form.are_you_sure_you_want_to_delete_the_object", model_name: @abstract_model.pretty_name.downcase) %> + <%= @model_config.with(object: @object).object_label %> + <%= t("admin.form.all_of_the_following_related_items_will_be_deleted") %> +

+ +<%= form_for(@object, url: delete_path(model_name: @abstract_model.to_param, id: @object.id), html: { method: "delete" }) do %> + +
+ + +
+<% end %> diff --git a/app/views/rails_admin/main/index.html.erb b/app/views/rails_admin/main/index.html.erb index 98716a070..52cd63157 100644 --- a/app/views/rails_admin/main/index.html.erb +++ b/app/views/rails_admin/main/index.html.erb @@ -54,24 +54,28 @@

">
-
+
- " type="search" value="<%= query %>" autocomplete="off"> - - + +
+
"> + +
<% if @model_config.list.search_help.present? %>
<%= @model_config.list.search_help %>
<% end %>
-
+
<% if export_action %> - <%= govuk_link_to wording_for(:link, export_action), export_path(params.except("page")), class: "btn btn-info" %> + <%= govuk_button_link_to wording_for(:link, export_action), export_path(params.except("page")), class: "govuk-!-margin-bottom-0" %> <% end %>
@@ -168,7 +172,7 @@
- <%= link_to(t("admin.misc.show_all"), index_path(params.merge(all: true)), class: "show-all btn btn-light clearfix") unless total_count > 100 || total_count <= @objects.to_a.size %> + <%= link_to(t("admin.misc.show_all"), index_path(params.merge(all: true)), class: "govuk-button govuk-button--secondary") unless total_count > 100 || total_count <= @objects.to_a.size %>