|
1 | 1 | <%- model_class = Collection -%> |
2 | | -<div class="row wrapper"> |
3 | | - <div class="col-md-12"> |
4 | | - <div class="page-header row"> |
5 | | - <%= page_title(t('.title', :default => [:'helpers.titles.curate', 'Curate %{type} in %{model} %{title}'], type: @item_class.table_name, model: model_class.model_name.human.titleize.downcase, title: @collection.title), class: 'col-md-8') %> |
6 | | - <div class="col-md-4" style="margin-top: 25px;"> |
7 | | - <%= label_tag :since, t('.new_items_since', default: ['%{count} new items since'], count: @items.length) %> |
8 | | - <input id="since" type="date" value="<%= @since.strftime('%Y-%m-%d') %>" pattern="\d{4}-\d{2}-\d{2}" onchange="params = new URLSearchParams(window.location.search); params.set(since, this.value); window.location.search=params.toString();" /> |
9 | | - <% if @item_class.name == "Event" %> |
10 | | - <%= label_tag :since, t('.show_past', default: ['show past events']) %> |
11 | | - <%= check_box_tag :past, true, @show_past.present?, onchange: "params = new URLSearchParams(window.location.search); this.checked ? params.set('past', true) : params.delete('past'); window.location.search = params.toString();" %> |
12 | | - <% end %> |
13 | | - </div> |
| 2 | +<div class="page-header"> |
| 3 | + <div class="row"> |
| 4 | + <%= page_title(t('.title', :default => [:'helpers.titles.curate', 'Curate %{type} in %{model} %{title}'], type: @item_class.table_name, model: model_class.model_name.human.titleize.downcase, title: @collection.title), class: 'col-md-8') %> |
| 5 | + <div class="col-md-4" style="margin-top: 25px;"> |
| 6 | + <%= label_tag :since, t('.new_items_since', default: ['%{count} new items since'], count: @items.length) %> |
| 7 | + <input id="since" type="date" value="<%= @since.strftime('%Y-%m-%d') %>" pattern="\d{4}-\d{2}-\d{2}" onchange="params = new URLSearchParams(window.location.search); params.set(since, this.value); window.location.search=params.toString();" /> |
| 8 | + <% if @item_class.name == "Event" %> |
| 9 | + <%= label_tag :since, t('.show_past', default: ['show past events']) %> |
| 10 | + <%= check_box_tag :past, true, @show_past.present?, onchange: "params = new URLSearchParams(window.location.search); this.checked ? params.set('past', true) : params.delete('past'); window.location.search = params.toString();" %> |
| 11 | + <% end %> |
14 | 12 | </div> |
15 | | - <%= form_with url: request.url, local: true, method: :patch do |f| %> |
16 | | - <table class="table table-striped table-hover collection_curation_table"> |
17 | | - <thead> |
18 | | - <tr> |
19 | | - <th></th> |
20 | | - <%- item_fields(@item_class).each do |field| -%> |
21 | | - <th><%= t field, default: field.to_s.titleize %></th> |
22 | | - <%- end %> |
23 | | - <th></th> |
24 | | - </tr> |
25 | | - </thead> |
26 | | - <tbody> |
27 | | - <% @items.each do |item| %> |
28 | | - <%- id = "item_#{item.id}" %> |
29 | | - <tr> |
30 | | - <td> |
31 | | - <%= label_tag id do %> |
32 | | - <%= hidden_field_tag "reviewed_item_ids[]", item.id %> |
33 | | - <input id="item_<%= item.id %>" type="checkbox" name="item_ids[]" value="<%= item.id %>" <%= @collection.send("#{@item_class.table_name.singularize}_ids").include?(item.id) ? 'checked' : '' %> /> |
34 | | - <% end %> |
35 | | - </td> |
36 | | - <%- item_fields(@item_class).each do |field| -%> |
37 | | - <td><label for="<%= id %>"><%= [item.send(field)].flatten.join(', ') %></label></td> |
38 | | - <% end %> |
39 | | - <td><%= link_to t('.link', default: [:'helpers.titles.link', 'Link']), item %></td> |
40 | | - </tr> |
41 | | - <% end %> |
42 | | - </tbody> |
43 | | - </table> |
| 13 | + </div> |
| 14 | +</div> |
44 | 15 |
|
45 | | - <div class="form-group actions"> |
46 | | - <%= f.submit class: 'btn btn-primary' %> |
47 | | - </div> |
| 16 | +<%= form_with url: request.url, local: true, method: :patch do |f| %> |
| 17 | + <table class="table table-striped table-hover collection_curation_table"> |
| 18 | + <thead> |
| 19 | + <tr> |
| 20 | + <th></th> |
| 21 | + <%- item_fields(@item_class).each do |field| -%> |
| 22 | + <th><%= t field, default: field.to_s.titleize %></th> |
| 23 | + <%- end %> |
| 24 | + <th></th> |
| 25 | + </tr> |
| 26 | + </thead> |
| 27 | + <tbody> |
| 28 | + <% @items.each do |item| %> |
| 29 | + <%- id = "item_#{item.id}" %> |
| 30 | + <tr> |
| 31 | + <td> |
| 32 | + <%= label_tag id do %> |
| 33 | + <%= hidden_field_tag "reviewed_item_ids[]", item.id %> |
| 34 | + <input id="item_<%= item.id %>" type="checkbox" name="item_ids[]" value="<%= item.id %>" <%= @collection.send("#{@item_class.table_name.singularize}_ids").include?(item.id) ? 'checked' : '' %> /> |
| 35 | + <% end %> |
| 36 | + </td> |
| 37 | + <%- item_fields(@item_class).each do |field| -%> |
| 38 | + <td><label for="<%= id %>"><%= [item.send(field)].flatten.join(', ') %></label></td> |
| 39 | + <% end %> |
| 40 | + <td><%= link_to t('.link', default: [:'helpers.titles.link', 'Link']), item %></td> |
| 41 | + </tr> |
48 | 42 | <% end %> |
| 43 | + </tbody> |
| 44 | + </table> |
| 45 | + |
| 46 | + <div class="form-group actions"> |
| 47 | + <%= f.submit class: 'btn btn-primary' %> |
49 | 48 | </div> |
50 | | -</div> |
| 49 | +<% end %> |
0 commit comments