summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_controller.rb8
-rw-r--r--app/views/admin/index.html.erb67
-rw-r--r--app/views/nodes/index.html.erb2
3 files changed, 73 insertions, 4 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 538e7d7..0446387 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -5,9 +5,13 @@ class AdminController < ApplicationController
5 before_filter :login_required 5 before_filter :login_required
6 6
7 def index 7 def index
8 @drafts = Page.drafts 8 @drafts = Node.all(
9 :limit => 20,
10 :order => "updated_at desc",
11 :conditions => ["draft_id IS NOT NULL"]
12 )
9 @recent_changes = Node.all( 13 @recent_changes = Node.all(
10 :limit => 50, 14 :limit => 20,
11 :order => "updated_at desc", 15 :order => "updated_at desc",
12 :conditions => [ 16 :conditions => [
13 "updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days 17 "updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb
index bd0df0b..1e599aa 100644
--- a/app/views/admin/index.html.erb
+++ b/app/views/admin/index.html.erb
@@ -1,3 +1,68 @@
1<table id="admin_overview"> 1<p id="overview_toggle">
2 <a href="#" id="recent_changes_toggle" class="button">recent changes</a>
3 <a href="#" id="current_drafts_toggle" class="button">current drafts</a>
4</p>
5
6<div id="recent_changes_table">
2 7
8 <h1>Recent Changes</h1>
9
10 <table class="node_table">
11 <tr class="header">
12 <th class="node_id">ID</th>
13 <th class="title">Title</th>
14 <th class="actions">Actions</th>
15 <th class="editor">Locked by</th>
16 <th class="revision">Rev.</th>
17 </tr>
18 <% @recent_changes.each do |node| %>
19 <tr class="<%= cycle("even", "odd") %>">
20 <td class="node_id"><%= node.id %></td>
21 <td class="title">
22 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
23 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
24 </td>
25 <td class="actions">
26 <%= link_to 'show', node_path(node) %>
27 <%= link_to 'Revisions', node_revisions_path(node) %>
28 </td>
29 <td>
30 <%= node.lock_owner.login if node.lock_owner %>
31 </td>
32 <td>
33 <%= node.draft ? node.draft.revision : node.head.revision %>
34 </td>
35 </tr>
36 <% end %>
37 </table>
38</div>
39<h1>Current Drafts</h1>
40
41<table id="current_drafts_table" class="node_table">
42 <tr class="header">
43 <th class="node_id">ID</th>
44 <th class="title">Title</th>
45 <th class="actions">Actions</th>
46 <th class="editor">Locked by</th>
47 <th class="revision">Rev.</th>
48 </tr>
49 <% @drafts.each do |node| %>
50 <tr class="<%= cycle("even", "odd") %>">
51 <td class="node_id"><%= node.id %></td>
52 <td class="title">
53 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
54 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
55 </td>
56 <td class="actions">
57 <%= link_to 'show', node_path(node) %>
58 <%= link_to 'Revisions', node_revisions_path(node) %>
59 </td>
60 <td>
61 <%= node.lock_owner.login if node.lock_owner %>
62 </td>
63 <td>
64 <%= node.draft ? node.draft.revision : node.head.revision %>
65 </td>
66 </tr>
67 <% end %>
3</table> \ No newline at end of file 68</table> \ No newline at end of file
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb
index 46c58f6..bf01645 100644
--- a/app/views/nodes/index.html.erb
+++ b/app/views/nodes/index.html.erb
@@ -4,7 +4,7 @@
4<h1>Nodes</h1> 4<h1>Nodes</h1>
5 5
6<%= will_paginate @nodes %> 6<%= will_paginate @nodes %>
7 <table id="node_table"> 7 <table class="node_table">
8 <tr class="header"> 8 <tr class="header">
9 <th class="node_id">ID</th> 9 <th class="node_id">ID</th>
10 <th class="title">Title</th> 10 <th class="title">Title</th>