From 00fe407be045a5b6cf8269965c0fd35a44094741 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 8 Mar 2009 22:31:00 +0100 Subject: added date selector for published_at. Also removed the part that reset the published_at attribute to Time.now. Some cleanups --- app/views/nodes/edit.html.erb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/views/nodes') diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 929bbf6a..d230f5cd 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -13,6 +13,11 @@ <%= f.error_messages %> <% fields_for @draft do |d| %> + +

+ <%= d.label :published_at %>
+ <%= d.datetime_select :published_at %> +

<%= d.label :template_name %> <%= d.select :template_name, custom_page_templates %> -- cgit v1.3 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 --- app/views/nodes/index.html.erb | 4 ++++ public/stylesheets/admin.css | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'app/views/nodes') diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 833ffed8..a2a42b1a 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb @@ -11,6 +11,7 @@ Path Actions Locked by + Rev. <% @nodes.each do |node| %> "> @@ -29,6 +30,9 @@ <%= "#{node.draft.user.login}" if node.draft && node.draft.user %> + + <%= node.head.revision if node.head %> + <% end %> diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 5fe88f12..3e67231b 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 'app/views/nodes') diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 81ead620..f82ab82a 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 1446e141..e6317fdc 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" %>

- +