summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/nodes_controller.rb10
-rw-r--r--app/views/layouts/application.html.erb3
-rw-r--r--app/views/nodes/_preview.html.erb5
-rw-r--r--app/views/nodes/show.html.erb6
-rwxr-xr-xpublic/stylesheets/styled.css13
5 files changed, 32 insertions, 5 deletions
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
40 end 40 end
41 41
42 def show 42 def show
43 @nodes = Node.find(params[:id]).children 43 @page = Node.find(params[:id]).draft
44
45 if @page
46 template = @page.valid_template
47 render(
48 :file => template,
49 :layout => "application"
50 )
51 end
44 end 52 end
45 53
46 def edit 54 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 @@
12 <![endif]--> 12 <![endif]-->
13 </head> 13 </head>
14 <body> 14 <body>
15 <%= render :partial => 'nodes/preview' if params[:action] == "show" %>
15 <div id="logo"> 16 <div id="logo">
16 <a href="index.html" title="Startseite"><img src="/images/chaosknot.gif" alt="Chaosknoten" /></a> 17 <a href="index.html" title="Startseite"><img src="/images/chaosknot.gif" alt="Chaosknoten" /></a>
17 </div> 18 </div>
18 <!-- HEAD --> 19 <!-- HEAD -->
19 <div id="header"> 20 <div id="header">
20 <div id="yellow"> 21 <div id="yellow">
21 </div> 22 </div>
diff --git a/app/views/nodes/_preview.html.erb b/app/views/nodes/_preview.html.erb
new file mode 100644
index 0000000..e8d7b9f
--- /dev/null
+++ b/app/views/nodes/_preview.html.erb
@@ -0,0 +1,5 @@
1<div id="preview_disclaimer">
2 <strong>Preview draft.</strong>
3 Clicking on links will redirected you to the public site.
4 <%= link_to 'Back to admin interface', nodes_path %>
5</div \ No newline at end of file
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index dd37c28..67dd7fc 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -1,5 +1,5 @@
1<h1>Node</h1> 1<h1>Node</h1>
2 2
3<%= @node.unique_name %> 3There is no draft to preview. Click <%= link_to 'edit', edit_node_path %> to
4 4create one or view the currently
5<%= link_to 'Edit', edit_node_path %> \ No newline at end of file 5<%= link_to_path 'published version', @node.unique_path %>. \ No newline at end of file
diff --git a/public/stylesheets/styled.css b/public/stylesheets/styled.css
index 707905e..d0312a7 100755
--- a/public/stylesheets/styled.css
+++ b/public/stylesheets/styled.css
@@ -13,6 +13,19 @@
13 * #eab407 = Content Headers 13 * #eab407 = Content Headers
14 * #fbb03b = Orange, Teaserbar Subheaders 14 * #fbb03b = Orange, Teaserbar Subheaders
15 */ 15 */
16
17body div#preview_disclaimer {
18 font-size: 16px;
19 background-color: #ff0000;
20 color: #ffffff;
21 padding-left: 20px;
22 padding-bottom: 5px;
23}
24
25body div#preview_disclaimer a {
26 color: #ffffff;
27 text-decoration: underline;
28}
16 29
17#wrapper { 30#wrapper {
18 margin:0; 31 margin:0;