summaryrefslogtreecommitdiff
path: root/app/views/nodes/_node_list.html.erb
blob: 458ab1ae94c3ee664578de29212cb89772a45a6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<%= form_tag url_for(controller: params[:controller], action: params[:action]), method: :get, class: "node_search_form" do %>
  <% Array(params[:kinds]).each do |kind| %>
    <%= hidden_field_tag "kinds[]", kind %>
  <% end %>
  <%= hidden_field_tag :tags, params[:tags] if params[:tags].present? %>
  <%= text_field_tag :q, params[:q], placeholder: t(".search_placeholder") %>
  <%= button_tag type: "submit", class: "action_button" do %>
    <%= icon("search", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.search") %>
  <% end %>
  <% if params[:q].present? || params[:kinds].present? || params[:tags].present? %>
    <%= link_to t("admin.common.reset"), url_for(controller: params[:controller], action: params[:action]) %>
  <% end %>
<% end %>

<%= will_paginate @nodes %>
<table class="node_table">
  <tr class="header">
    <th class="title"><%= t("admin.columns.title") %></th>
    <th class="actions"><%= t("admin.columns.actions") %></th>
    <th class="revision"><%= t("admin.columns.rev") %></th>
  </tr>
  <% @nodes.each do |node| %>
  <tr class="<%= cycle("even", "odd") %>">
    <td class="title">
      <div class="title_with_flags">
        <span class="flag_stack">
          <%= flag("lock", t(".flag_locked", :login => node.lock_owner.login),
                   :tier => :attention) if node.lock_owner %>
          <%= flag("calendar-clock",
                   t(".flag_embargo", :date => admin_datetime(node.head.published_at)),
                   :tier => :attention) if node.embargoed? %>
          <%= flag("file-pencil", t(".flag_draft")) if node.draft %>
          <%= flag("file-off", t(".flag_no_head")) unless node.head %>
        </span>
        <div class="title_body">
          <div class="node_title"><%= link_to title_for_node(node), node_path(node) %></div>
          <div class="node_path"><%= link_to_path(node.unique_name, node.unique_name) %></div>
        </div>
      </div>
    </td>
    <td class="actions">
      <div class="action_grid">
        <span class="action_item">
          <%= link_to node_path(node), "aria-label" => t("admin.common.show"),
                title: t("admin.common.show") do %>
            <%= icon("eye", library: "tabler", "aria-hidden": true) %>
          <% end %>
        </span>
        <span class="action_item">
          <%= link_to node_revisions_path(node), "aria-label" => t("admin.common.revisions"),
                title: t("admin.common.revisions") do %>
            <%= icon("history", library: "tabler", "aria-hidden": true) %>
          <% end %>
        </span>
      </div>
    </td>
    <td><%= node.head ? node.head.revision : t(".no_revision") %></td>
  </tr>
  <% end %>
</table>
<%= will_paginate @nodes %>