afimb/chouette2

View on GitHub
app/views/shared/_ie_report_file.html.erb

Summary

Maintainability
Test Coverage
<p class="lead">
<p class="caption"><%= t(".title_default", {:job => job.class.model_name.human, :extension => job.filename_extension} ) %></p>
</p>
<div class="report results" data-refresh-interval="<%= job_refresh_interval(job) %>">
  <p>
    <form class="form-inline">
      <div class="form-group">
        <label><%= t("shared.ie_report.search") %></label>
        <input id="filter-file" type="text" class="form-control">
      </div>
      <div class="form-group">
        <label><%= t(".table.state") %></label>
        <select class="filter-file-status form-control">
          <option></option>
          <option value="ok"><%=t(".table.ok")%></option>
          <option value="error"><%=t(".table.error")%></option>
          <option value="ignored"><%=t(".table.ignored")%></option>
        </select>
      </div>
    </form>
  </p>
  <table id="table-file" class="table table-hover table-striped data-table" data-filter="#filter-file" data-page-size="20">
    <thead>
      <tr>
        <th class="state"><%= t(".table.state") %></th>
        <th class="name"><%= t(".table.name") %></th>
        <th class="error"><%= t(".table.error") %></th>
      </tr>
    </thead>
    <tbody>
      <% job.report.files.each do |file| %>
        <tr class="<%= file.status == 'ERROR' ? 'danger' : nil %>">
          <td data-value="<%= file.status.downcase %>"><%= t(".table.#{file.status.downcase}") %></td>
          <td><%= file.name %></td>
          <td><%= file.errors.map{|e| "#{e.code} : #{e.description}"}.join(' | ') if file.errors.present? %></td>
        </tr>
      <% end %>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="5"><ul class="pagination pagination-centered"></ul></td>
      </tr>
    </tfoot>
  </table>
</div>