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 +- public/javascripts/admin_interface.js | 21 +++++++++++ public/stylesheets/admin.css | 26 ++++++++------ 5 files changed, 109 insertions(+), 15 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 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 %> - +
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 7aeb0b1..66e9a96 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js @@ -21,6 +21,27 @@ $(document).ready(function () { move_to_search.initialize_search(); } + if ($('#recent_changes_toggle').length != 0) { + $('#current_drafts_table').hide(); + $('#recent_changes_toggle').attr("class", "selected"); + + $('#recent_changes_toggle').bind("click", function(){ + $('#recent_changes_toggle').attr("class", "selected"); + $('#current_drafts_toggle').attr("class", "unselected"); + $('#recent_changes_table').show(); + $('#current_drafts_table').hide(); + return false; + }); + + $('#current_drafts_toggle').bind("click", function(){ + $('#recent_changes_toggle').attr("class", "unselected"); + $('#current_drafts_toggle').attr("class", "selected"); + $('#current_drafts_table').show(); + $('#recent_changes_table').hide(); + return false; + }); + } + $(".with_editor").tinymce({ script_url : '/javascripts/tiny_mce/tiny_mce.js', theme: "advanced", diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 6fa5b59..921e83d 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -93,7 +93,11 @@ div.pagination span.current, div.pagination a:hover { background-color: #000000; } -#main_navigation a, #sub_navigation a, #metadata a, input[type=submit]{ +#main_navigation a, +#sub_navigation a, +#metadata a, +input[type=submit], +#overview_toggle a { letter-spacing: 1px; padding-left: 5px; padding-right: 5px; @@ -116,53 +120,53 @@ div.pagination span.current, div.pagination a:hover { background-color: #ff9600; } -#navigation a.selected, #metadata a.selected { +#navigation a.selected, #metadata a.selected, #overview_toggle a.selected { color: #ffffff; background-color: #000000; } /* Nodes */ -table#node_table { +table.node_table { width: 899px; border-collapse: collapse; } -table#node_table tr { +table.node_table tr { height: 65px; border-bottom: 1px solid #000000; } -table#node_table th.title { +table.node_table th.title { width: 450px; } -table#node_table tr.header { +table.node_table tr.header { height: 20px; text-align: left; } -table#node_table td { +table.node_table td { padding-top: 0px; padding-bottom: 0px; padding-right: 25px; padding-left: 0px; } -table#node_table .node_id { +table.node_table .node_id { padding-left: 10px; padding-right: 15px; } -table#node_table tr.header:hover { +table.node_table tr.header:hover { background-color: #ffffff; } -table#node_table tr:hover { +table.node_table tr:hover { background-color: #f1f1f1; } -table#node_table .actions { +table.node_table .actions { text-transform: lowercase; } -- cgit v1.3
ID Title