Repository URL to install this package:
|
Version:
1.0.0 ▾
|
<%#
# Index
This view is the template for the index page.
It is responsible for rendering the search bar, header and pagination.
It renders the `_table` partial to display details about the resources.
## Local variables:
- `page`:
An instance of [Administrate::Page::Collection][1].
Contains helper methods to help display a table,
and knows which attributes should be displayed in the resource's table.
- `resources`:
An instance of `ActiveRecord::Relation` containing the resources
that match the user's search criteria.
By default, these resources are passed to the table partial to be displayed.
- `search_term`:
A string containing the term the user has searched for, if any.
- `show_search_bar`:
A boolean that determines if the search bar should be shown.
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection
%>
<% content_for(:title) do %>
Annotations
<% if params[:code_id].present? %>
for code "<%= DiscourseAnnotator::Code.find_by(id: params[:code_id]).name %>"
<% end %>
<% end %>
<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title) %>
</h1>
<% if show_search_bar %>
<%= render('search', search_term: search_term, resource_name: 'Annotations') %>
<% end %>
</header>
<section class="main-content__body main-content__body--flush">
<div class="annotator-filter-nav">
<%= render '/lib/filter_user',
name: 'Creator',
filter: :creator_id,
users: User.where(id: DiscourseAnnotator::Annotation.select(:creator_id)).order(:username) %>
<%= render '/lib/filter_include_sub_codes' if params[:code_id].present? %>
</div>
<div style="border:1px solid #dfe0e1; background: #F6F7F7; margin:20px 35px; padding:10px;">
<%= render 'bulk_editing_form' %>
</div>
<%= render(
"collection",
collection_presenter: page,
collection_field_name: resource_name,
page: page,
resources: resources,
table_title: "page-title"
) %>
<%#= paginate resources, param_name: '_page' %>
<%= paginate resources %>
</section>