summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-10 23:48:26 +0100
committerhukl <contact@smyck.org>2009-03-10 23:48:26 +0100
commitd987886a9a94c6bad53ff7c7a241b85ea0b57de7 (patch)
tree0bc31ca476e48631b9f19c3ff48c1a5f3ddac037
parentf0582c5604a264d955a35a5986882d5a61d6acbc (diff)
added list of drafts to admin overview
-rw-r--r--app/controllers/admin_controller.rb1
-rw-r--r--app/views/admin/index.html.erb20
2 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 6694ad6..06c5390 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -2,6 +2,7 @@ class AdminController < ApplicationController
2 before_filter :login_required 2 before_filter :login_required
3 3
4 def index 4 def index
5 @drafts = Page.find(:all, :include => [:node, :user], :conditions => ["nodes.draft_id = pages.id"])
5 end 6 end
6 7
7end 8end
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb
index e69de29..00a5c09 100644
--- a/app/views/admin/index.html.erb
+++ b/app/views/admin/index.html.erb
@@ -0,0 +1,20 @@
1<div id="draft_list">
2 <h2>Drafts</h2>
3 <table>
4 <tr>
5 <th>ID</th>
6 <th>Title</th>
7 <th>Path</th>
8 <th>Locked by</th>
9 </tr>
10 <% @drafts.each do |draft| %>
11 <tr>
12 <td><%= draft.id %></td>
13 <td><%= draft.title %></td>
14 <td><%= draft.node.unique_name %></td>
15 <td><%= draft.user.login rescue "" %></td>
16 <td><%= link_to 'Show', node_path(draft.node) %></td>
17 </tr>
18 <% end %>
19 </table>
20</div> \ No newline at end of file