summaryrefslogtreecommitdiff
path: root/app/views/admin/index.html.erb
blob: bdb555ec87d0c788c002363201718699ce40561b (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<h1>cccms dashboard</h1>
<div id="dashboard_search">
  <%= form_tag admin_search_path, method: :get do %>
    <%= text_field_tag :search_term, nil, id: "dashboard_search_term", placeholder: "Search nodes and tags…", autocomplete: "off" %>
  <% end %>
  <div id="dashboard_search_results" class="search_results"></div>
</div>

<div id="dashboard_signposts" class="button_row">
  <%= link_to new_node_path, class: "action_button" do %>
    <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create post
  <% end %>
  <%= link_to chapters_nodes_path, class: "action_button" do %>
    <%= icon("map-pin", library: "tabler", "aria-hidden": true) %> Find a chapter
  <% end %>
  <%= link_to new_asset_path, class: "action_button" do %>
    <%= icon("upload", library: "tabler", "aria-hidden": true) %> Upload asset
  <% end %>
  <%= link_to sitemap_nodes_path, class: "action_button" do %>
    <%= icon("list-tree", library: "tabler", "aria-hidden": true) %> Add a page in the page tree
  <% end %>
</div>

<div id="dashboard_widgets">
  <div class="dashboard_widget">
    <h3>Drafts and autosaves</h3>
    <ul>
      <% @drafts.each do |node| %>
        <li>
          <div>
            <%= link_to title_for_node(node), node_path(node) %>
            <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span>
          </div>
          <span class="dashboard_widget_meta">
            <% if (editor = node_last_editor(node)) %><%= editor %>, <% end %><%= relative_time_phrase(node.updated_at) %>
          </span>
        </li>
      <% end %>
    </ul>
    <%= link_to "See all drafts →", drafts_nodes_path %>
  </div>

  <div class="dashboard_widget">
    <h3>Recent changes</h3>
    <ul>
    <% @recent_changes.each do |node| %>
      <li>
        <div>
          <%= link_to title_for_node(node), node_path(node) %>
          <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span>
        </div>
        <span class="dashboard_widget_meta">
          <%= (editor = node_head_editor(node)) ? t("published_by", editor: editor) : t("published") %>, <%= relative_time_phrase(node.head.updated_at) %>
        </span>
      </li>
    <% end %>
    </ul>
    <%= link_to "See all recent changes →", recent_nodes_path %>
  </div>
</div>

<div id="dashboard_housekeeping">
  <h3>Housekeeping</h3>
  <div class="button_row">
    <%= link_to nodes_path, class: "action_button" do %>
      <%= icon("list", library: "tabler", "aria-hidden": true) %> Nodes
    <% end %>
    <%= link_to events_path, class: "action_button" do %>
      <%= icon("calendar", library: "tabler", "aria-hidden": true) %> Events
    <% end %>
    <%= link_to assets_path, class: "action_button" do %>
      <%= icon("folder", library: "tabler", "aria-hidden": true) %> Assets
    <% end %>
    <%= link_to users_path, class: "action_button" do %>
      <%= icon("users", library: "tabler", "aria-hidden": true) %> Users
    <% end %>
    <%= link_to menu_items_path, class: "action_button" do %>
      <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> Navigation
    <% end %>
  </div>
</div>