summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-09-12 13:14:06 +0200
committerhukl <contact@smyck.org>2009-09-12 13:14:06 +0200
commit49568b847db1acadb1c2186219b2488b5621f4d0 (patch)
tree56a45c1e26429f74d012a7b6c1967b05d5234b1d
parent1e110b74e2202ab0550550d0d446e7d29aba7146 (diff)
changed the ui click flow a bit
-rw-r--r--app/controllers/nodes_controller.rb2
-rw-r--r--app/models/node.rb4
-rw-r--r--app/views/nodes/edit.html.erb2
-rw-r--r--app/views/nodes/index.html.erb4
-rw-r--r--app/views/nodes/show.html.erb35
5 files changed, 37 insertions, 10 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index e442bd2..20aea5a 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -90,7 +90,7 @@ class NodesController < ApplicationController
90 flash[:notice] = "Cannot unlock" 90 flash[:notice] = "Cannot unlock"
91 end 91 end
92 92
93 redirect_to nodes_path 93 redirect_to :back
94 end 94 end
95 95
96 def move_to 96 def move_to
diff --git a/app/models/node.rb b/app/models/node.rb
index b23e43b..4e94efc 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -137,6 +137,10 @@ class Node < ActiveRecord::Base
137 self.save 137 self.save
138 end 138 end
139 139
140 def locked?
141 !self.lock_owner.nil?
142 end
143
140 def unlock! 144 def unlock!
141 self.lock_owner = nil 145 self.lock_owner = nil
142 self.save 146 self.save
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb
index c23381f..0635dac 100644
--- a/app/views/nodes/edit.html.erb
+++ b/app/views/nodes/edit.html.erb
@@ -48,7 +48,7 @@
48 </tr> 48 </tr>
49 <tr> 49 <tr>
50 <td class="description">Publish at</td> 50 <td class="description">Publish at</td>
51 <td><%= d.datetime_select :published_at %></td> 51 <td><%= d.datetime_select :published_at, :value => @draft.published_at %></td>
52 </tr> 52 </tr>
53 <tr> 53 <tr>
54 <td class="description">Template</td> 54 <td class="description">Template</td>
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb
index 2f6069f..0603c08 100644
--- a/app/views/nodes/index.html.erb
+++ b/app/views/nodes/index.html.erb
@@ -16,11 +16,11 @@
16 <tr class="<%= cycle("even", "odd") %>"> 16 <tr class="<%= cycle("even", "odd") %>">
17 <td class="node_id"><%= node.id %></td> 17 <td class="node_id"><%= node.id %></td>
18 <td class="title"> 18 <td class="title">
19 <h4><%= link_to title_for_node(node), edit_node_path(node) %></h4> 19 <h4><%= link_to title_for_node(node), node_path(node) %></h4>
20 <p><%= link_to_path(node.unique_name, node.unique_name) %></p> 20 <p><%= link_to_path(node.unique_name, node.unique_name) %></p>
21 </td> 21 </td>
22 <td class="actions"> 22 <td class="actions">
23 <%= link_to 'Preview', node_path(node) %> 23 <%= link_to 'show', node_path(node) %>
24 <%= link_to 'Revisions', :controller => :revisions, :action => :show, :id => node.id %> 24 <%= link_to 'Revisions', :controller => :revisions, :action => :show, :id => node.id %>
25 <%# link_to 'Destroy', node, :method => :delete, :confirm => "Are you sure you want to delete this node?" %> 25 <%# link_to 'Destroy', node, :method => :delete, :confirm => "Are you sure you want to delete this node?" %>
26 <%= link_to 'Unlock', unlock_node_path(node), :method => :put, :confirm => "Are you sure you want to unlock?" %> 26 <%= link_to 'Unlock', unlock_node_path(node), :method => :put, :confirm => "Are you sure you want to unlock?" %>
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
index 15547f9..8d8a985 100644
--- a/app/views/nodes/show.html.erb
+++ b/app/views/nodes/show.html.erb
@@ -1,26 +1,49 @@
1<% content_for :subnavigation do %> 1<% content_for :subnavigation do %>
2 <%= link_to 'Edit', edit_node_path(@node), :class => "unselected" %> 2 <%= link_to 'Edit', edit_node_path(@node), :class => "unselected" %>
3 <%= link_to 'Preview', preview_page_path(@page) %> 3 <%= link_to 'Preview', preview_page_path(@page) %>
4 <%= link_to 'Revisions', revision_path(params[:id]) %> 4 <%= link_to 'Revisions', revision_path(params[:id]) %>
5 <%= link_to 'Unlock', unlock_node_path(@node), :method => :put, :confirm => "Are you sure you want to unlock?" %>
5<% end %> 6<% end %>
6 7
7 8
8<div id="page_editor" class="show_node"> 9<div id="page_editor" class="show_node">
9 <table id="content"> 10 <table id="content">
10 <tr> 11 <tr>
11 <th class="description"></th> 12 <td class="description">Path</td>
12 <th class="content"></th> 13 <td><%= @page.public_link %></td>
13 </tr> 14 </tr>
14 <tr> 15 <tr>
15 <td class="description">Title</td> 16 <td class="description">Author</td>
17 <td><%= @page.user.try(:login) %></td>
18 </tr>
19 <% if @page.node.locked? %>
20 <tr>
21 <td class="description">Locked by</td>
22 <td><%= @page.node.lock_owner.login %></td>
23 </tr>
24 <% end %>
25 <tr>
26 <td class="description">Last updated</td>
27 <td><%= @page.updated_at %></td>
28 </tr>
29 <tr>
30 <td class="description">Published at</td>
31 <td><%= @page.published_at %></td>
32 </tr>
33 <tr>
34 <td class="description">Revision</td>
35 <td><%= @page.revision %></td>
36 </tr>
37 <tr>
38 <td class="description"><strong>Title</strong></td>
16 <td><%= @page.title %></td> 39 <td><%= @page.title %></td>
17 </tr> 40 </tr>
18 <tr> 41 <tr>
19 <td class="description">Abstract</td> 42 <td class="description"><strong>Abstract</strong></td>
20 <td><%= @page.abstract %></td> 43 <td><%= @page.abstract %></td>
21 </tr> 44 </tr>
22 <tr> 45 <tr>
23 <td class="description">Body</td> 46 <td class="description"><strong>Body</strong></td>
24 <td><%= @page.body %></td> 47 <td><%= @page.body %></td>
25 </tr> 48 </tr>
26 <tr> 49 <tr>