<% content_for :js do %> <%= javascript_include_tag 'views/ieducar_api_exam_posting/force_posting' %> <% end %> <% ApiPostingTypes.to_a.each_with_index do |value, index| %> <% next if value.last == ApiPostingTypes::FINAL_RECOVERY && step != @steps.to_a.last %> <%= value.first %> <% api_posting = instance_variable_get("@step_#{step.id}_#{value.last}_posting") %> <% if api_posting %> <% if api_posting.status == ApiPostingStatus::STARTED %> Enviando <% if worker_batch = api_posting.worker_batch %> (<%= worker_batch.done_percentage %>%) <% end %> <% else %> <% if api_posting.message.present? %>

<%= api_posting.message %>

<% end %> <% if api_posting.error_message.present? %>

<%= current_user.admin? && api_posting.full_error_message.present? ? api_posting.full_error_message : api_posting.error_message %>

<% end %> <% if api_posting.warning_message.present? %>
<% api_posting.warning_message.each do |message| %>

<%= message.html_safe %>

<% end %>
<% end %> <% end %> <% else %> O envio das informações ainda não foi realizado <% end %> '> <%= link_to ieducar_api_exam_postings_path(step_column => step.id, post_type: value.last, force_posting: true), id: 'btn-posting-' + index.to_s + '-' + step.id.to_s, method: 'post', onclick: 'resend_posting(' + index.to_s + ',' + step.id.to_s + ')', class: 'btn', style: 'color: #717171; background-color: #f0f0f0; border-radius: 4px; border: 1px solid #c3c3c3' do %>
<%= image_tag 'repetir_envio.svg', "data-svg-fallback" => asset_path('repetir_envio.svg') %> Repetir envio
<% end %>
<% if api_posting.present? && api_posting.synchronization_in_progress? %> <%= link_to 'Enviar', '#', class: 'btn bg-color-red txt-color-white disabled' %> <% else %> <%= link_to 'Enviar', ieducar_api_exam_postings_path( step_column => step.id, post_type: value.last ), id: 'send-button', method: 'post', class: 'btn bg-color-red txt-color-white', data: { disable_with: 'Enviando...' } %> <% end %> <% end %>