mishina2228/oanda-api-rails

View on GitHub
app/views/resque_schedules/index.html.erb

Summary

Maintainability
Test Coverage
<% title = t('helpers.title.list', models: ResqueSchedule.model_name.human.pluralize(I18n.locale)) %>
<% content_for(:html_title) {title} %>
<h1>
  <%= title %>
</h1>

<div class="setup-all-button">
  <%= button_to setup_all_resque_schedules_path,
                {class: 'btn btn-info', role: :button, method: :put} do %>
    <span class="show-when-enabled"><%= t('helpers.button.setup_all') %></span>
    <span class="show-when-disabled"><%= t('helpers.notice.processing') %></span>
  <% end %>
</div>
<table class='table table-bordered table-hover table-striped'>
<thead>
  <tr>
    <th><%= ResqueSchedule.human_attribute_name :name %></th>
    <th><%= ResqueSchedule.human_attribute_name :description %></th>
    <th><%= ResqueSchedule.human_attribute_name :cron %></th>
    <th><%= ResqueSchedule.human_attribute_name :enabled %></th>
  </tr>
  </thead>

  <tbody>
  <% @resque_schedules.each do |resque_schedule| %>
    <tr>
      <td><%= link_to resque_schedule.name, edit_resque_schedule_path(resque_schedule) %></td>
      <td><%= tag.span resque_schedule.description %></td>
      <td><%= tag.span resque_schedule.cron %></td>
      <td><%= tag.span check_icon(resque_schedule.enabled) %></td>
    </tr>
  <% end %>
  </tbody>
</table>

<br>

<h3>
  Actual Resque Schedules
  <%= image_tag('loading.gif', class: 'loading d-none') %>
</h3>
<pre class="resque-schedules">
  <code id="resque-schedules">
  </code>
</pre>