ThomasKoppensteiner/sidekiq-undertaker

View on GitHub
web/views/filter.erb

Summary

Maintainability
Test Coverage
<header class="row header">
  <div class="col-sm-12">
    <h3>
      <%= "<b>#{@total_dead}</b> dead #{@total_dead == 1 ? 'job' : 'jobs'}" %>
    </h3>
  </div>
</header>

<table class="table table-striped table-bordered table-white">
  <thead>
    <tr>
      <th style="width: 20%"><%= t('Jobs') %></th>
      <th style="width: 10%"><%= t('All') %></th>
      <th style="width: 10%"><%= t('1 hour') %></th>
      <th style="width: 10%"><%= t('3 hours') %></th>
      <th style="width: 10%"><%= t('1 day') %></th>
      <th style="width: 10%"><%= t('3 days') %></th>
      <th style="width: 10%"><%= t('1 week') %></th>
      <th style="width: 10%"><%= t('Older') %></th>
    </tr>
  </thead>
  <% @distribution.each do |group, bucket_counts| %>
      <tr>
        <td><a href='<%= "#{root_path}undertaker/morgue/#{group}/all/all/total_dead" %>'> <%= group %></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/total_dead" %>'><%= bucket_counts['total_dead']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/1_hour" %>'><%= bucket_counts['1_hour']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/3_hours" %>'><%= bucket_counts['3_hours']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/1_day" %>'><%= bucket_counts['1_day']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/3_days" %>'><%= bucket_counts['3_days']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/1_week" %>'><%= bucket_counts['1_week']%></a></td>
        <td><a href='<%= "#{root_path}undertaker/filter/#{group}/older" %>'><%= bucket_counts['older']%></a></td>
      </tr>
  <% end %>
</table>

<header class="row header">
  <div class="col-sm-12">
    <h3>
      Import Jobs
    </h3>
  </div>
</header>

<form enctype="multipart/form-data" method="post" action='<%="#{root_path}undertaker/import_jobs"%>'>
  <%= respond_to?(:csrf_tag) && csrf_tag %>
    <input type="file" id=upload_file" name="upload_file" >
    <button class="btn btn-danger" style="margin-top: 10px" type="submit">
      Import
    </button>
</form>