summaryrefslogtreecommitdiff
path: root/app/controllers/admin_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r--app/controllers/admin_controller.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 7c1375a..f3cc221 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -6,12 +6,15 @@ class AdminController < ApplicationController
6 6
7 def index 7 def index
8 @drafts = Node.all( 8 @drafts = Node.all(
9 :limit => 20, 9 :limit => 50,
10 :order => "updated_at desc", 10 :order => "updated_at desc",
11 :conditions => ["draft_id IS NOT NULL"] 11 :conditions => ["draft_id IS NOT NULL"]
12 ) 12 )
13 @drafts_count = Node.count(
14 :conditions => ["draft_id IS NOT NULL"]
15 )
13 @recent_changes = Node.all( 16 @recent_changes = Node.all(
14 :limit => 20, 17 :limit => 50,
15 :order => "updated_at desc", 18 :order => "updated_at desc",
16 :conditions => [ 19 :conditions => [
17 "updated_at < ? AND updated_at > ? AND parent_id IS NOT NULL", Time.now, Time.now-14.days 20 "updated_at < ? AND updated_at > ? AND parent_id IS NOT NULL", Time.now, Time.now-14.days
@@ -24,6 +27,17 @@ class AdminController < ApplicationController
24 @sitemap_depth[node.id] = level 27 @sitemap_depth[node.id] = level
25 end 28 end
26 @sitemap = all_nodes.to_a.sort! { |node1,node2| node1.lft <=> node2.lft }.delete_if { |node| node.update? } 29 @sitemap = all_nodes.to_a.sort! { |node1,node2| node1.lft <=> node2.lft }.delete_if { |node| node.update? }
30
31 @mypages = Page.all(
32 :conditions => [ "user_id = ? or editor_id = ?", @current_user, @current_user]
33 )
34
35 @mynodes = Node.all(
36 :order => "updated_at desc",
37 :joins => :pages,
38 :conditions => [ "pages.user_id = ? or pages.editor_id = ?", @current_user, @current_user ]
39 ).uniq.first(50)
40
27 end 41 end
28 42
29 def search 43 def search