<% if show_configuration_form? %>
<%= simple_form_for @ieducar_api_configuration, url: ieducar_api_configurations_path, method: :patch, html: { class: "smart-form" } do |f| %> <%= f.error_notification %>
<%= f.input :url %>
<%= f.input :unity_code %>
<%= f.input :token %>
<%= f.input :secret_token %>
<%= f.input :api_security_token, readonly: true %>
<% end %>
<% end %>
<% if @ieducar_api_configuration.persisted? %> <% if @ieducar_api_configuration.synchronization_in_progress? %> <%= link_to "#", class: 'btn bg-color-red txt-color-white pull-right', style: 'margin-top: 20px;' do %> Sincronizando <% end %> <% else %> <%= link_to t('.synchronize'), ieducar_api_configurations_synchronizations_path, method: 'post', class: 'btn bg-color-red txt-color-white pull-right', style: 'margin-top: 20px; margin-left: 10px;', data: { disable_with: t('.sending') } %> <% if current_user.admin? || current_user.can_change?(:full_synchronization) %> <%= link_to t('.synchronize_last_two_years'), ieducar_api_configurations_synchronizations_path(period: SynchronizationPeriods::LAST_TWO_YEARS), method: 'post', class: 'btn bg-color-orange txt-color-white pull-right', style: 'margin-top: 20px; margin-left: 10px;', data: { disable_with: t('.sending') } %> <%= link_to t('.synchronize_current_year'), ieducar_api_configurations_synchronizations_path(period: SynchronizationPeriods::CURRENT_YEAR), method: 'post', class: 'btn bg-color-blue txt-color-white pull-right', style: 'margin-top: 20px; margin-left: 10px;', data: { disable_with: t('.sending') } %> <% end %> <% end %> <% end %>

<%= t('ieducar_api_configuration.sync_title') %>

<%= render 'synchronizations', syncs: IeducarApiSynchronization.order(id: :desc).limit(10) %>
<%= javascript_pack_tag 'sync_status' %>