From edd450502f74dcbe8175dfddee8b50d14424a390 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 13 Jun 2009 15:42:13 +0200 Subject: added js search widget with clickable results that will take the user to the brand new "show" version of the page. so the user doesn't create new revisions and locks all the time when he / she only wants to take a look at it. --- app/controllers/admin_controller.rb | 2 +- app/controllers/nodes_controller.rb | 8 -------- app/views/layouts/admin.html.erb | 29 +++++++++++++++++---------- app/views/nodes/edit.html.erb | 7 ++++++- app/views/nodes/show.html.erb | 40 ++++++++++++++++++++++++++++--------- 5 files changed, 57 insertions(+), 29 deletions(-) (limited to 'app') diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 8d7d2ea..517506f 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -19,7 +19,7 @@ class AdminController < ApplicationController format.html format.js do render( :json => @results.map do |node| - {:id => node.id, :title => node.title} + {:id => node.id, :title => node.title, :edit_path => node_path(node)} end ) diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 1c7278c..09d0c52 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -40,14 +40,6 @@ class NodesController < ApplicationController def show @page = Node.find(params[:id]).pages.last - - if @page - template = @page.valid_template - render( - :file => template, - :layout => "application" - ) - end end def edit diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index fea6b5a..1c985d9 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -11,6 +11,7 @@ <%= javascript_include_tag 'tiny_mce/tiny_mce.js' %> <%= javascript_include_tag 'admin_search.js' %> <%= javascript_include_tag 'admin_interface.js' %> + <%= javascript_include_tag 'jquery.hotkeys' %>