From f7d4d68953f913fa025d140674c6db56ed612c00 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 18 Oct 2009 17:57:18 +0200 Subject: re-activated admin overview screen - listing 20 recent changes and 20 current drafts. more to come --- app/controllers/admin_controller.rb | 8 +++-- app/views/admin/index.html.erb | 67 ++++++++++++++++++++++++++++++++++++- app/views/nodes/index.html.erb | 2 +- 3 files changed, 73 insertions(+), 4 deletions(-) (limited to 'app') 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 before_filter :login_required def index - @drafts = Page.drafts + @drafts = Node.all( + :limit => 20, + :order => "updated_at desc", + :conditions => ["draft_id IS NOT NULL"] + ) @recent_changes = Node.all( - :limit => 50, + :limit => 20, :order => "updated_at desc", :conditions => [ "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 @@ - +

+ recent changes + current drafts +

+ +
+

Recent Changes

+ +
+ + + + + + + + <% @recent_changes.each do |node| %> + "> + + + + + + + <% end %> +
IDTitleActionsLocked byRev.
<%= node.id %> +

<%= link_to title_for_node(node), node_path(node) %>

+

<%= link_to_path(node.unique_name, node.unique_name) %>

+
+ <%= link_to 'show', node_path(node) %> + <%= link_to 'Revisions', node_revisions_path(node) %> + + <%= node.lock_owner.login if node.lock_owner %> + + <%= node.draft ? node.draft.revision : node.head.revision %> +
+ +

Current Drafts

+ + + + + + + + + + <% @drafts.each do |node| %> + "> + + + + + + + <% end %>
IDTitleActionsLocked byRev.
<%= node.id %> +

<%= link_to title_for_node(node), node_path(node) %>

+

<%= link_to_path(node.unique_name, node.unique_name) %>

+
+ <%= link_to 'show', node_path(node) %> + <%= link_to 'Revisions', node_revisions_path(node) %> + + <%= node.lock_owner.login if node.lock_owner %> + + <%= node.draft ? node.draft.revision : node.head.revision %> +
\ 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 @@

Nodes

<%= will_paginate @nodes %> - +
-- cgit v1.3
ID Title