From 55800bf0565f392a48b6d3a673da60525aad423b Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 21 Feb 2009 14:55:39 +0100 Subject: wiring together some views to make basic navigation in the admin interface possible --- app/controllers/nodes_controller.rb | 2 ++ app/controllers/sessions_controller.rb | 2 +- app/views/admin/index.html.erb | 5 +---- app/views/layouts/admin.html.erb | 7 ++++++- app/views/nodes/show.html.erb | 13 ++++--------- 5 files changed, 14 insertions(+), 15 deletions(-) (limited to 'app') 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 def publish @node.publish_draft! + flash[:notice] = "Draft has been published" + redirect_to node_path end 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 reset_session self.current_user = user - redirect_back_or_default('/') # TODO: insert appropriate path to cms main page + redirect_back_or_default('/de/admin') # TODO: insert appropriate path to cms main page flash[:notice] = "Logged in successfully" else 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 @@

Admin#index

-

Find me in app/views/admin/index.html.erb

- - -<%= link_to 'nodes', :controller => :nodes, :action => :index %> \ No newline at end of file +

Find me in app/views/admin/index.html.erb

\ 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 @@ +
+ <%= flash[:notice] %>
<%= 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 @@ -

Nodes

+

Node

- - <% @nodes.each do |node| %> - - - - - <% end %> -
<%= link_to node.unique_name, node_path(node) %><%= link_to 'Edit', edit_node_path(node) %>
\ No newline at end of file +<%= @node.unique_name %> + +<%= link_to 'Edit', edit_node_path %> \ No newline at end of file -- cgit v1.3