diff options
| author | hukl <contact@smyck.org> | 2009-02-21 14:55:39 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-21 14:55:39 +0100 |
| commit | 55800bf0565f392a48b6d3a673da60525aad423b (patch) | |
| tree | 0f7ae35bf76e34a35b74ab4ee1dfc3242d127e27 | |
| parent | 4c3d622b3795836e1e7be4df303ee256a88b2812 (diff) | |
wiring together some views to make basic navigation
in the admin interface possible
| -rw-r--r-- | app/controllers/nodes_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/sessions_controller.rb | 2 | ||||
| -rw-r--r-- | app/views/admin/index.html.erb | 5 | ||||
| -rw-r--r-- | app/views/layouts/admin.html.erb | 7 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 13 |
5 files changed, 14 insertions, 15 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 6d400bc..7e2b733 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -58,6 +58,8 @@ class NodesController < ApplicationController | |||
| 58 | 58 | ||
| 59 | def publish | 59 | def publish |
| 60 | @node.publish_draft! | 60 | @node.publish_draft! |
| 61 | flash[:notice] = "Draft has been published" | ||
| 62 | redirect_to node_path | ||
| 61 | end | 63 | end |
| 62 | 64 | ||
| 63 | def move_to | 65 | def move_to |
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index dd86ea9..779e260 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb | |||
| @@ -17,7 +17,7 @@ class SessionsController < ApplicationController | |||
| 17 | reset_session | 17 | reset_session |
| 18 | 18 | ||
| 19 | self.current_user = user | 19 | self.current_user = user |
| 20 | redirect_back_or_default('/') # TODO: insert appropriate path to cms main page | 20 | redirect_back_or_default('/de/admin') # TODO: insert appropriate path to cms main page |
| 21 | flash[:notice] = "Logged in successfully" | 21 | flash[:notice] = "Logged in successfully" |
| 22 | else | 22 | else |
| 23 | note_failed_signin | 23 | note_failed_signin |
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index 0a9874f..e23e69b 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb | |||
| @@ -1,5 +1,2 @@ | |||
| 1 | <h1>Admin#index</h1> | 1 | <h1>Admin#index</h1> |
| 2 | <p>Find me in app/views/admin/index.html.erb</p> | 2 | <p>Find me in app/views/admin/index.html.erb</p> \ No newline at end of file |
| 3 | |||
| 4 | |||
| 5 | <%= link_to 'nodes', :controller => :nodes, :action => :index %> \ No newline at end of file | ||
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 93ac0a5..2bde5dd 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb | |||
| @@ -25,7 +25,12 @@ | |||
| 25 | 25 | ||
| 26 | <body> | 26 | <body> |
| 27 | <div id="navigation"> | 27 | <div id="navigation"> |
| 28 | <%= I18n.locale %> <%= language_selector %> | 28 | <%= I18n.locale %> <%= language_selector %> | |
| 29 | |||
| 30 | <%= link_to 'Nodes', nodes_path %> | ||
| 31 | </div> | ||
| 32 | <div id="flash"> | ||
| 33 | <%= flash[:notice] %> | ||
| 29 | </div> | 34 | </div> |
| 30 | <div id="content"> | 35 | <div id="content"> |
| 31 | <%= yield :layout %> | 36 | <%= yield :layout %> |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index bbf11c0..dd37c28 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -1,10 +1,5 @@ | |||
| 1 | <h1>Nodes</h1> | 1 | <h1>Node</h1> |
| 2 | 2 | ||
| 3 | <table> | 3 | <%= @node.unique_name %> |
| 4 | <% @nodes.each do |node| %> | 4 | |
| 5 | <tr> | 5 | <%= link_to 'Edit', edit_node_path %> \ No newline at end of file |
| 6 | <td><%= link_to node.unique_name, node_path(node) %></td> | ||
| 7 | <td><%= link_to 'Edit', edit_node_path(node) %></td> | ||
| 8 | </tr> | ||
| 9 | <% end %> | ||
| 10 | </table> \ No newline at end of file | ||
