diff --git a/app/controllers/cor1440_gen/actividades_controller.rb b/app/controllers/cor1440_gen/actividades_controller.rb index 1f1204a..057263d 100644 --- a/app/controllers/cor1440_gen/actividades_controller.rb +++ b/app/controllers/cor1440_gen/actividades_controller.rb @@ -33,6 +33,10 @@ def atributos_show ] end + def registrar_en_bitacora + true + end + def otros_impedimentos_para_borrar_persona_ex_asistente(a) # Estar como víctima en un caso es impedimento if Sivel2Gen::Victima.where(persona_id: a.persona_id).count > 0 diff --git a/app/models/msip/persona.rb b/app/models/msip/persona.rb index 9e8a3e8..d9638f4 100644 --- a/app/models/msip/persona.rb +++ b/app/models/msip/persona.rb @@ -10,7 +10,9 @@ class Persona < ActiveRecord::Base foreign_key: "persona_id", validate: true, dependent: :destroy, - class_name: "::Aporte" + class_name: "::Aporte", + inverse_of: :persona + accepts_nested_attributes_for :aporte, allow_destroy: true, reject_if: :all_blank diff --git a/app/views/msip/personas/_aporte_campos.html.erb b/app/views/msip/personas/_aporte_campos.html.erb index 2d54b6e..315a294 100644 --- a/app/views/msip/personas/_aporte_campos.html.erb +++ b/app/views/msip/personas/_aporte_campos.html.erb @@ -44,6 +44,7 @@ class: 'btn btn-sm btn-danger', data: { turbo_frame: "aporte_#{f.index}", + turbo_method: :delete, disable_with: false } %> diff --git a/app/views/msip/personas/_campo_aportes.html.erb b/app/views/msip/personas/_campo_aportes.html.erb index 77857d2..db02404 100644 --- a/app/views/msip/personas/_campo_aportes.html.erb +++ b/app/views/msip/personas/_campo_aportes.html.erb @@ -21,9 +21,8 @@ <%= f.simple_fields_for :aporte, f.object.aporte.order([:anio,:mes]), child_index: params[:index] do |apo| %> - <%= render partial: "aporte_campos", - locals: {f: apo} - %> + x + <% end %> diff --git a/app/views/sivel2_gen/actos/_actos_tabla.html.erb b/app/views/sivel2_gen/actos/_actos_tabla.html.erb new file mode 100644 index 0000000..43fccfe --- /dev/null +++ b/app/views/sivel2_gen/actos/_actos_tabla.html.erb @@ -0,0 +1,46 @@ +<%= fields model: @caso do |form| %> +
+
+ <% if @caso && @caso.acto %> + <% index = 0 %> + <% @caso.acto.try(:each) do |acto| %> + +
+
+ <%= acto.presponsable.nombre %> +
+
+ <%= acto.categoria.supracategoria.tviolencia_id + acto.categoria.id.to_s + ' ' + acto.categoria.nombre %> +
+
+ <%if acto.persona.nombres == 'N' && acto.persona.apellidos == 'N' %> + <%= acto.persona.sin_identificacion %> + <% else %> + <%= acto.persona.nombres + ' ' + acto.persona.apellidos %> + <% end %> +
+
+ <% if acto.fecha %> + <%= acto.fecha %> + <% end %> +
+
+ <%= link_to "Eliminar", + sivel2_gen.eliminar_acto_path(id: acto.id, index: index), + formmethod: :delete, + formnovalidate: true, + class: 'btn btn-sm btn-danger', + data: { + turbo_frame: "acto_#{index}", + "turbo-stream": "turbo-stream", + "turbo-method": :delete, + turbo: true, + } %> +
+
+ <% index += 1 %> + <% end %> + <% end %> +
+
+<% end %> diff --git a/app/views/sivel2_gen/actos/_resto_campos_tabla.html.erb b/app/views/sivel2_gen/actos/_resto_campos_tabla.html.erb new file mode 100644 index 0000000..8012dc6 --- /dev/null +++ b/app/views/sivel2_gen/actos/_resto_campos_tabla.html.erb @@ -0,0 +1,8 @@ +
+ <%= date_field_tag "caso_acto_fecha", "", + "data-toggle": 'tooltip', + name: "caso[acto_fecha]", + title: "Fecha del acto de violencia. "\ + "Después no olvide presionar el botón Añadir Acto(s)." + %> +
diff --git a/app/views/sivel2_gen/actos/_resto_enc_tabla.html.erb b/app/views/sivel2_gen/actos/_resto_enc_tabla.html.erb new file mode 100644 index 0000000..8ec5478 --- /dev/null +++ b/app/views/sivel2_gen/actos/_resto_enc_tabla.html.erb @@ -0,0 +1 @@ +
Fecha