emory-libraries/dlp-selfdeposit

View on GitHub
app/views/hyrax/admin/workflows/index.html.erb

Summary

Maintainability
Test Coverage
<%# Hyrax v5.0.1 Override: L#54 swapping to document.deposito to pull the right value %>

<% provide :page_header do %>
  <h1><span class="fa fa-check-circle"></span> <%= t('.header') %></h1>
<% end %>

<div class="row">
  <div class="col-md-12">
    <div class="tabs">
      <%= render 'tabs' %>
      <div class="card">
        <div class="card-header">
          <span class="count-display">
            <% if @response.viewing_under_review? %>
              <%= I18n.t('hyrax.admin.workflows.index.works_under_review', total_count: @response.total_count).html_safe %>
            <% else %>
              <%= I18n.t('hyrax.admin.workflows.index.works_published', total_count: @response.total_count).html_safe %>
            <% end %>
          </span>
        </div>
        <div class="card-body">
          <div class="row">
            <div class="col-sm-12">
              <div class="sort-toggle mt-2">
                <%= form_tag hyrax.admin_workflows_path, method: :get, class: 'per_page' do %>
                  <fieldset class="col-12">
                    <legend class="sr-only"><%= t('hyrax.dashboard.my.sr.results_per_page') %></legend>
                    <%= label_tag :per_page do %>
                        Show <%= select_tag :per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page.map(&:to_s), h(params[:per_page])), title: "entries" %> per page
                    <% end %>
                    <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:per_page, :sort, :utf8)) %>
                  </fieldset>
                <% end %>
              </div>
            </div>
          </div>
          <h2 class="sr-only"><%= t('.works_listing') %></h2>
          <table class="table table-sm table-striped works-list">
            <thead>
              <tr>
                <th width="40%"><%= t(".heading.work") %></th>
                <th width="20%"><%= t(".heading.depositor") %></th>
                <th width="20%"><%= t(".heading.submission_date") %></th>
                <th width="20%"><%= t(".heading.status") %></th>
              </tr>
            </thead>
            <tbody>
              <% @response.docs.each do |document| %>
                <tr>
                  <td>
                    <%= link_to document, [main_app, document] %>
                  </td>
                  <td>
                    <%= safe_join([document.depositor], tag(:br)) %>
                  </td>
                  <td>
                    <%= document.date_modified %>
                  </td>
                  <td>
                    <span class="state state-pending"><%= document.workflow_state %></span>
                  </td>
                </tr>
              <% end %>
            </tbody>
          </table>
          <%= render 'hyrax/my/results_pagination' %>
        </div>
      </div>
    </div>
  </div>
</div>