From 82f16e71d49350c1ad4aa48773db5d0f45a55c6c Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 2 Mar 2009 20:29:25 +0100 Subject: introducing page templates - need to add edit capabilities renamed the custom template folder forgot one fix for the new custom template path page templates refined renamed page attribute template to template_name as i suspected it to be a reserved word. it still didn't work until i discovered that simon defined the accessible attributes! That costed me 40 minutes of lifetime. But he apologized ;) tests for public and custom page templates --- app/views/content/render_page.html.erb | 7 ------- app/views/custom/page_templates/public/no_date_and_author.html.erb | 6 ++++++ app/views/custom/page_templates/public/render_page.html.erb | 7 +++++++ app/views/custom/partials/_sidebar_title_only.html.erb | 3 +++ app/views/custom_templates/partials/_sidebar_title_only.html.erb | 3 --- app/views/nodes/edit.html.erb | 5 ++++- 6 files changed, 20 insertions(+), 11 deletions(-) delete mode 100644 app/views/content/render_page.html.erb create mode 100644 app/views/custom/page_templates/public/no_date_and_author.html.erb create mode 100644 app/views/custom/page_templates/public/render_page.html.erb create mode 100644 app/views/custom/partials/_sidebar_title_only.html.erb delete mode 100644 app/views/custom_templates/partials/_sidebar_title_only.html.erb (limited to 'app/views') diff --git a/app/views/content/render_page.html.erb b/app/views/content/render_page.html.erb deleted file mode 100644 index 4c21667..0000000 --- a/app/views/content/render_page.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -
-

<%= @page.title %>

-

<%= date_for_page @page %>, <%= @page.user.try(:login) %>

-
-

<%= @page.abstract %>

- <%= aggregate?(@page.body) %> -
\ No newline at end of file diff --git a/app/views/custom/page_templates/public/no_date_and_author.html.erb b/app/views/custom/page_templates/public/no_date_and_author.html.erb new file mode 100644 index 0000000..4eda744 --- /dev/null +++ b/app/views/custom/page_templates/public/no_date_and_author.html.erb @@ -0,0 +1,6 @@ +
+

<%= @page.title %>

+
+

<%= @page.abstract %>

+ <%= aggregate?(@page.body) %> +
\ No newline at end of file diff --git a/app/views/custom/page_templates/public/render_page.html.erb b/app/views/custom/page_templates/public/render_page.html.erb new file mode 100644 index 0000000..4c21667 --- /dev/null +++ b/app/views/custom/page_templates/public/render_page.html.erb @@ -0,0 +1,7 @@ +
+

<%= @page.title %>

+

<%= date_for_page @page %>, <%= @page.user.try(:login) %>

+
+

<%= @page.abstract %>

+ <%= aggregate?(@page.body) %> +
\ No newline at end of file diff --git a/app/views/custom/partials/_sidebar_title_only.html.erb b/app/views/custom/partials/_sidebar_title_only.html.erb new file mode 100644 index 0000000..819d9ae --- /dev/null +++ b/app/views/custom/partials/_sidebar_title_only.html.erb @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/app/views/custom_templates/partials/_sidebar_title_only.html.erb b/app/views/custom_templates/partials/_sidebar_title_only.html.erb deleted file mode 100644 index 819d9ae..0000000 --- a/app/views/custom_templates/partials/_sidebar_title_only.html.erb +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 64d4756..929bbf6 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -13,7 +13,10 @@ <%= f.error_messages %> <% fields_for @draft do |d| %> -

+

+ <%= d.label :template_name %> + <%= d.select :template_name, custom_page_templates %> +

<%= d.label :title %>
<%= d.text_field :title %> -- cgit v1.3