summaryrefslogtreecommitdiff
path: root/app/views/admin/index.html.erb
blob: 2741db3f25b5ddc7b75bf15b8015b1a7226ad32c (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<div id="admin_wizard">
  <div class="admin_wizard_button"><%= link_to 'Create Update or Pressemitteilung', new_node_path, :only_path => false %></div>
  <div class="admin_wizard_button"><a href="#" id="admin_wizard_my_work" class="button">Continue my work</a></div>
  <div class="admin_wizard_button"><a href="#" id="admin_wizard_create_page" class="button">Add a page in the page tree</a></div>
  <div class="admin_wizard_button"><%= link_to("Upload a new asset", new_asset_path, :only_path => false) %></div>
</div>

<p id="overview_toggle">
  <a href="#" id="recent_changes_toggle" class="button">recent changes</a>
  <a href="#" id="my_work_toggle" class="button">my work</a>
  <a href="#" id="current_drafts_toggle" class="button">current drafts (<%= @drafts_count %>)</a>
  <a href="#" id="admin_sitemap_toggle" class="button">site map</a>
</p>

<div id="recent_changes_table">
  
  <h1>Recent Changes</h1>

  <table class="node_table">
    <tr class="header">
      <th class="node_id">ID</th>
      <th class="title">Title</th>
      <th class="actions">Actions</th>
      <th class="editor">Locked by</th>
      <th class="revision">Rev.</th>
    </tr>
    <% @recent_changes.each do |node| %>
    <tr class="<%= cycle("even", "odd") %>">
      <td class="node_id"><%= node.id %></td>
      <td class="title">
        <h4><%= link_to title_for_node(node), node_path(node) %></h4>
        <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
      </td>
      <td class="actions">
        <%= link_to 'show',      node_path(node) %>
        <%= link_to 'Revisions', node_revisions_path(node) %>
      </td>
      <td>
        <%= node.lock_owner.login if node.lock_owner %>
      </td>
      <td>
        <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
      </td>
    </tr>
    <% end %>
  </table>
</div>

<div id="my_work_table">
  
  <h1>My Work</h1>

  <table class="node_table">
    <tr class="header">
      <th class="node_id">ID</th>
      <th class="title">Title</th>
      <th class="actions">Actions</th>
      <th class="editor">Locked by</th>
      <th class="revision">Rev.</th>
    </tr>
    <% @mynodes.each do |node| %>
    <tr class="<%= cycle("even", "odd") %>">
      <td class="node_id"><%= node.id %></td>
      <td class="title">
        <h4><%= link_to title_for_node(node), node_path(node) %></h4>
        <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
      </td>
      <td class="actions">
        <%= link_to 'show',      node_path(node) %>
        <%= link_to 'Revisions', node_revisions_path(node) %>
      </td>
      <td>
        <%= node.lock_owner.login if node.lock_owner %>
      </td>
      <td>
        <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
      </td>
    </tr>
    <% end %>
  </table>
</div>

<div id="current_drafts_table">
  
  <h1>Current Drafts (<%= @drafts_count %>)</h1>
  
  <table class="node_table">
    <tr class="header">
      <th class="node_id">ID</th>
      <th class="title">Title</th>
      <th class="actions">Actions</th>
      <th class="editor">Locked by</th>
      <th class="revision">Rev.</th>
    </tr>
    <% @drafts.each do |node| %>
    <tr class="<%= cycle("even", "odd") %>">
      <td class="node_id"><%= node.id %></td>
      <td class="title">
        <h4><%= link_to title_for_node(node), node_path(node) %></h4>
        <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
      </td>
      <td class="actions">
        <%= link_to 'show',      node_path(node) %>
        <%= link_to 'Revisions', node_revisions_path(node) %>
      </td>
      <td>
        <%= node.lock_owner.login if node.lock_owner %>
      </td>
      <td>
        <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %>
      </td>
    </tr>
    <% end %>
  </table>
</div>

<div id="admin_sitemap_table">

  <h1>Sitemap</h1>

  <table class="node_table">
    <tr class="header">
      <th class="node_id">ID</th>
      <th class="title">Title</th>
      <th class="actions">Actions</th>
      <th class="editor">Locked by</th>
    </tr>
    <% @sitemap.each do |node| %>
    <% if !node.nil? %>
      <tr class="<%= cycle("even", "odd") %>">
      <td class="node_id" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"><%= node.id %></td>
      <td class="title"  style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;">
        <h4><%= link_to title_for_node(node), node_path(node) %></h4>
        <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
      </td>
      <td class="actions">
        <%= link_to 'create subpage', new_node_path(:parent_id => node.id) %>
        <%= link_to 'Revisions',      node_revisions_path(node) %>
      </td>
      <td>
        <%= node.lock_owner.login if node.lock_owner %>
      </td>
    </tr>
    <% end %>
    <% end %>
  </table>
</div>