From 2aab7eaa19dcd2d86012f71954b8543572f8eaa5 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 8 Mar 2009 22:57:29 +0100 Subject: added revision column to nodes overview --- public/stylesheets/admin.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 5fe88f1..3e67231 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -22,7 +22,7 @@ th { } th.title { - width: 400px; + width: 370px; } th.path { @@ -37,6 +37,10 @@ th.editor { width: 120px; } +th.revision { + width: 30px; +} + td { padding: 3px; } -- cgit v1.3 From e055502fe81469d1f96f41e3dbf70d2ed9ac33fe Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 8 Mar 2009 23:45:52 +0100 Subject: added basic preview feature. If a draft exists, the show action renders a proper preview. If not the default show template is rendered. --- app/controllers/nodes_controller.rb | 10 +++++++++- app/views/layouts/application.html.erb | 3 ++- app/views/nodes/_preview.html.erb | 5 +++++ app/views/nodes/show.html.erb | 6 +++--- public/stylesheets/styled.css | 13 +++++++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 app/views/nodes/_preview.html.erb (limited to 'public') diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 81ead62..f82ab82 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -40,7 +40,15 @@ class NodesController < ApplicationController end def show - @nodes = Node.find(params[:id]).children + @page = Node.find(params[:id]).draft + + if @page + template = @page.valid_template + render( + :file => template, + :layout => "application" + ) + end end def edit diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1446e14..e6317fd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,10 +12,11 @@ + <%= render :partial => 'nodes/preview' if params[:action] == "show" %> - +