Author: assaf
Date: Tue Jul  1 17:53:02 2008
New Revision: 673245

URL: http://svn.apache.org/viewvc?rev=673245&view=rev
Log:
Added OpenSearch support, which makes it abundantly clear we're in need of a 
favicon.

Added:
    ode/sandbox/singleshot/app/views/tasks/opensearch.builder
Modified:
    ode/sandbox/singleshot/app/controllers/tasks_controller.rb
    ode/sandbox/singleshot/app/views/layouts/application.html.erb
    ode/sandbox/singleshot/config/routes.rb

Modified: ode/sandbox/singleshot/app/controllers/tasks_controller.rb
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/controllers/tasks_controller.rb?rev=673245&r1=673244&r2=673245&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/controllers/tasks_controller.rb (original)
+++ ode/sandbox/singleshot/app/controllers/tasks_controller.rb Tue Jul  1 
17:53:02 2008
@@ -4,7 +4,7 @@
 
   verify :params=>:task, :only=>:update, :render=>{:text=>'Missing task', 
:status=>:bad_request}
   before_filter :set_task, :only=>[:show, :update, :complete, :destroy]
-
+  skip_filter :authenticate, :only=>[:opensearch]
 
   def index
     @title, @subtitle = 'Tasks', 'Tasks you are performing or can claim for 
your own.'
@@ -69,6 +69,10 @@
     end
   end
 
+  def opensearch
+    render :template=>'tasks/opensearch.builder', 
:content_type=>'application/opensearchdescription', :layout=>false
+  end
+
 
   def show
     @title = @task.title

Modified: ode/sandbox/singleshot/app/views/layouts/application.html.erb
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/layouts/application.html.erb?rev=673245&r1=673244&r2=673245&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/layouts/application.html.erb (original)
+++ ode/sandbox/singleshot/app/views/layouts/application.html.erb Tue Jul  1 
17:53:02 2008
@@ -4,9 +4,8 @@
     <%= javascript_include_tag :all, :cache=>true %>
     <%= stylesheet_link_tag 'default', :cache=>true %>
     <%= stylesheet_link_tag 'print', :media=>'print', :cache=>true %>
-    <% @alternate.each do |mime, url| %>
-      <%= auto_discovery_link_tag mime.to_sym, url %>
-    <% end if @alternate %>
+    <% @alternate.each do |mime, url| %><%= auto_discovery_link_tag 
mime.to_sym, url %><% end if @alternate %>
+      <link rel='search' type='application/opensearchdescription+xml' 
href='<%= open_search_url %>' title='Search your tasks list' />
   </head>
   <body>
     <div id='header'>

Added: ode/sandbox/singleshot/app/views/tasks/opensearch.builder
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/tasks/opensearch.builder?rev=673245&view=auto
==============================================================================
--- ode/sandbox/singleshot/app/views/tasks/opensearch.builder (added)
+++ ode/sandbox/singleshot/app/views/tasks/opensearch.builder Tue Jul  1 
17:53:02 2008
@@ -0,0 +1,5 @@
+xml.tag! 'OpenSearchDescription', 
'xmlns'=>'http://a9.com/-/spec/opensearch/1.1/' do
+  xml.tag! 'ShortName', 'Singleshot'
+  xml.tag! 'Description', 'Search your tasks list'
+  xml.tag! 'Url', 'type'=>'text/html', 
'template'=>search_url('q'=>'{searchTerms}')
+end

Modified: ode/sandbox/singleshot/config/routes.rb
URL: 
http://svn.apache.org/viewvc/ode/sandbox/singleshot/config/routes.rb?rev=673245&r1=673244&r2=673245&view=diff
==============================================================================
--- ode/sandbox/singleshot/config/routes.rb (original)
+++ ode/sandbox/singleshot/config/routes.rb Tue Jul  1 17:53:02 2008
@@ -13,6 +13,7 @@
     end
   end
   map.search '/search', :controller=>'tasks', :action=>'search'
+  map.open_search '/search/osd', :controller=>'tasks', :action=>'opensearch'
   map.with_options :controller=>'activity', :action=>'index' do |opts|
     opts.activity '/activity'
     opts.formatted_activity '/activity.:format'


Reply via email to