From e9418758513fea6a83f63d31ecac316fdb6fc151 Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 27 Apr 2009 16:11:47 +0200 Subject: seperated admin overview into partials. included recent changes --- app/controllers/admin_controller.rb | 7 +++++++ app/views/admin/_drafts.html.erb | 25 +++++++++++++++++++++++ app/views/admin/_recent_changes.html.erb | 24 ++++++++++++++++++++++ app/views/admin/index.html.erb | 25 +++-------------------- public/stylesheets/admin.css | 35 ++++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 app/views/admin/_drafts.html.erb create mode 100644 app/views/admin/_recent_changes.html.erb diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d61de30..55c66cf 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -3,6 +3,13 @@ class AdminController < ApplicationController def index @drafts = Page.drafts + @recent_changes = Node.all( + :limit => 50, + :order => "updated_at desc", + :conditions => [ + "updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days + ] + ) end end diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb new file mode 100644 index 0000000..abda588 --- /dev/null +++ b/app/views/admin/_drafts.html.erb @@ -0,0 +1,25 @@ +

Drafts (<%= @drafts.size %>)

+
+ + + + + + + + + <% @drafts.each do |draft| %> + + + + + + + + <% end %> +
IDTitlePathauthor
<%= draft.id %><%= draft.title %><%= draft.node.unique_name %><%= draft.user.login rescue "" %> + <%= link_to 'Show', node_path(draft.node) %> + <%= link_to "Revisions", :controller => :revisions, :action => :diff, :id => draft.node.id %> + <%= link_to "Publish", publish_node_path(draft.node), :method => :put, :confirm => "Do you really want to publish?" %> +
+
\ No newline at end of file diff --git a/app/views/admin/_recent_changes.html.erb b/app/views/admin/_recent_changes.html.erb new file mode 100644 index 0000000..1bb14a6 --- /dev/null +++ b/app/views/admin/_recent_changes.html.erb @@ -0,0 +1,24 @@ +

Recent Changes

+
+ + + + + + + + + <% @recent_changes.each do |node| %> + + + + + + + + <% end %> +
Titlepathuserdate
<%= node.draft.try(:title) %><%= node.unique_name %><%= node.draft.user.login rescue "" %><%= node.updated_at.to_s(:db) %> + <%= link_to 'Show', node_path(node) %> + <%= link_to "Revisions", revision_path(:id => node.id) %> +
+
\ No newline at end of file diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index b40f92a..cf33774 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb @@ -1,22 +1,3 @@ -
-

Drafts

- - - - - - - - <% @drafts.each do |draft| %> - - - - - - - - - - <% end %> -
IDTitlePathLocked by
<%= draft.id %><%= draft.title %><%= draft.node.unique_name %><%= draft.node.lock_owner.login rescue "" %><%= link_to 'Show', node_path(draft.node) %><%= link_to "Diff revisions", :controller => :revisions, :action => :diff, :id => draft.node.id %><%= link_to "Publish", publish_node_path(draft.node), :method => :put, :confirm => "Do you really want to publish?" %>
-
\ No newline at end of file +<%= render :partial => 'drafts' %> + +<%= render :partial => 'recent_changes' %> \ No newline at end of file diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 513a443..52d657e 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -261,4 +261,39 @@ td.description { div#page_editor { margin-top: 0px; margin-left: 10px; +} + +div#draft_list { + border: 1px solid #000000; + padding: 5px; + overflow: auto; + height: 300px; +} + +div#draft_list table { + border-collapse: collapse; +} + +div#draft_list table tr.header:hover { + background-color: #ffffff; +} + +div#draft_list table td.actions { + text-transform: lowercase; + white-space: nowrap; +} + +div#draft_list table td.actions a { + letter-spacing: 1px; + padding-left: 5px; + padding-right: 5px; +} + +div#draft_list table tr:hover { + background-color: #f1f1f1; +} + +table tr.header { + height: 20px; + text-align: left; } \ No newline at end of file -- cgit v1.3