From 50029a72f33ad331ba9f56f461b99a0a1cce8464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Mon, 7 Aug 2023 12:26:20 -0500 Subject: [PATCH] =?UTF-8?q?usa=20botones=20gen=C3=A9ricos.=20https://gitla?= =?UTF-8?q?b.com/pasosdeJesus/sivel2=5Fgen/-/issues/548?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sivel2_gen/casos/_index_tabla.html.erb | 17 ++++++----------- app/views/sivel2_gen/casos/index.html.erb | 11 ++++------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/app/views/sivel2_gen/casos/_index_tabla.html.erb b/app/views/sivel2_gen/casos/_index_tabla.html.erb index 90e125499..c2e4d9249 100644 --- a/app/views/sivel2_gen/casos/_index_tabla.html.erb +++ b/app/views/sivel2_gen/casos/_index_tabla.html.erb @@ -90,22 +90,17 @@ <% vcaso = Sivel2Gen::Caso.where(id: caso.caso_id).take %> <% if can?(:solocambiaretiquetas, Sivel2Gen::Caso) || can?(:solocambiaretiquetas, caso) %> - <%= link_to 'Cambiar etiquetas', - sivel2_gen.edit_caso_path(caso.caso_id), :class => 'btn btn-sm' %> + <%= render partial: 'msip/modelos/boton_editar', + locals: {registro: vcaso, mas_clases: 'btn-sm'} %> <% elsif vcaso && can?(:edit, vcaso) %> - <%= link_to t('.edit', :default => t("helpers.links.edit")), - sivel2_gen.edit_caso_path(caso.caso_id), - "data-turbo": false, - :class => 'btn btn-sm' %> + <%= render partial: 'msip/modelos/boton_editar', + locals: {registro: vcaso, mas_clases: 'btn-sm'} %> <% end %> <%= render partial: 'sivel2_gen/casos/index_mas_acciones', locals: {caso: caso, registro: caso} %> <% if vcaso && can?(:destroy, vcaso) %> - <%= link_to t('.destroy', :default => t("helpers.links.destroy")), - sivel2_gen.caso_path(caso.caso_id), - :method => :delete, - :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Está seguro(a)?')) }, - :class => 'btn btn-sm btn-danger' %> + <%= render partial: 'msip/modelos/boton_eliminar', + locals: {registro: vcaso, mas_clases: 'btn-sm'} %> <% end %> diff --git a/app/views/sivel2_gen/casos/index.html.erb b/app/views/sivel2_gen/casos/index.html.erb index a65504dc7..3fbdec6b1 100644 --- a/app/views/sivel2_gen/casos/index.html.erb +++ b/app/views/sivel2_gen/casos/index.html.erb @@ -13,10 +13,8 @@
<% if @conscaso.size > 0 && current_usuario && can?(:new, Sivel2Gen::Caso) %> - <%= link_to t('.new', :default => t("helpers.links.new")), - sivel2_gen.new_caso_path, - :class => 'btn btn-primary' - %> + <%= render partial: 'msip/modelos/boton_nuevo', + locals: {ruta: sivel2_gen.new_caso_path} %> <% end %>
@@ -90,7 +88,6 @@ <% end %>
<% if current_usuario && can?(:new, Sivel2Gen::Caso) %> - <%= link_to t('.new', :default => t("helpers.links.new")), - sivel2_gen.new_caso_path, - :class => 'btn btn-primary' %> + <%= render partial: 'msip/modelos/boton_nuevo', + locals: {ruta: sivel2_gen.new_caso_path} %> <% end %>