myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [1964] branches/event_logging: Subscriptions.


From: noreply
Subject: [myexperiment-hackers] [1964] branches/event_logging: Subscriptions.
Date: Thu, 13 Nov 2008 09:50:31 -0500 (EST)

Revision
1964
Author
alekses6
Date
2008-11-13 09:50:31 -0500 (Thu, 13 Nov 2008)

Log Message

Subscriptions. Added "News" tab and RSS feed for individual workflows.

Modified Paths

Added Paths

Diff

Modified: branches/event_logging/app/controllers/workflows_controller.rb (1963 => 1964)


--- branches/event_logging/app/controllers/workflows_controller.rb	2008-11-13 14:24:44 UTC (rev 1963)
+++ branches/event_logging/app/controllers/workflows_controller.rb	2008-11-13 14:50:31 UTC (rev 1964)
@@ -4,7 +4,7 @@
 # See license.txt for details.
 
 class WorkflowsController < ApplicationController
-  before_filter :login_required, :except => [:index, :show, :download, :named_download, :launch, :search, :all]
+  before_filter :login_required, :except => [:index, :show, :download, :named_download, :launch, :search, :all, :news]
   
   before_filter :find_workflows, : [:all]
   before_filter :find_workflows_rss, : [:index]
@@ -230,6 +230,16 @@
       format.html # show.rhtml
     end
   end
+  
+  # GET /workflows/1/news.rss
+  def news
+    respond_to do |format|
+      format.html { redirect_to workflow_path(params[:id]) }
+      format.rss do 
+        render :action ="" 'news.rxml', :layout => false
+      end
+    end
+  end
 
   # GET /workflows/new
   def new

Added: branches/event_logging/app/views/workflows/news.rxml (0 => 1964)


--- branches/event_logging/app/views/workflows/news.rxml	                        (rev 0)
+++ branches/event_logging/app/views/workflows/news.rxml	2008-11-13 14:50:31 UTC (rev 1964)
@@ -0,0 +1,11 @@
+xml.rss "version" => "2.0", 'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/", 'xmlns:atom' => "http://www.w3.org/2005/Atom" do
+  xml.channel do
+    xml.title "myExperiment.org - News and Status Updates for \"#{contributable_name_from_instance(@workflow)}\" Workflow"
+    xml.link workflow_url(@workflow)
+    xml.language "en-us"
+    xml.ttl "60"
+    xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href ="" "http://#{request.host_with_port}/open_search.xml"
+    xml.description "RSS feed listing the status updates for #{contributable_name_from_instance(@workflow)} Workflow on myExperiment.org"
+    render(:partial => "layouts/news_entry", :collection => news_from_log_for_contributable(@workflow, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_RSS_ENTRY_COUNT, nil), :locals => { :xm => xml })
+  end
+end
\ No newline at end of file

Modified: branches/event_logging/app/views/workflows/show.rhtml (1963 => 1964)


--- branches/event_logging/app/views/workflows/show.rhtml	2008-11-13 14:24:44 UTC (rev 1963)
+++ branches/event_logging/app/views/workflows/show.rhtml	2008-11-13 14:50:31 UTC (rev 1964)
@@ -50,12 +50,14 @@
 	|
 	<br/>
 	|
-	<a href=""  (<%= @workflow.citations.length -%>)</a>
+	<a href="" 
 	|
-	<a href=""  History</a>
+	<a href=""  (<%= @workflow.citations.length -%>)</a>
 	|
+	<a href=""  History</a>
+	|
 	<% if logged_in? and @workflow.owner?(current_user) %>
-	  <a href="" 
+	  <a href="" 
 	  |
 	<% end %>
 	<%= link_to "Reviews (address@hidden)", "#reviews" %>
@@ -300,6 +302,19 @@
 
 <div id="tabsContainer" class="tabsContainer"></div>
 
+<a name="news"></a>
+<div class="tabContainer">
+  <div class="tabTitle"><%= feed_icon_tag("\"#{contributable_name_from_instance(@workflow)}\" Workflow news", formatted_news_workflow_path(@workflow, :rss)) -%> News</div>
+  <div class="tabContent">  
+    <% benchmark "Workflow page news feed" do %>
+      <% viewer_id = (logged_in? ? current_user.id : "public") -%>
+			<% cache_timeout({ :controller => 'news', :action ="" 'workflow', :id => @workflow.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
+			  <%= render :partial => "layouts/news", :locals => { :collection => news(@workflow, true, Time.now, Time.now-DEFAULT_CONTRIBUTABLE_NEWS_TIMEFRAME, DEFAULT_CONTRIBUTABLE_NEWS_COUNT, current_user) } %>
+      <% end -%>
+		<% end %>
+  </div>
+</div>
+
 <a name="citations"></a>
 <%= render :partial => "contributions/citations_tab", :locals => { :item => @workflow } %>
 

Modified: branches/event_logging/config/environment_private.rb.pre (1963 => 1964)


--- branches/event_logging/config/environment_private.rb.pre	2008-11-13 14:24:44 UTC (rev 1963)
+++ branches/event_logging/config/environment_private.rb.pre	2008-11-13 14:50:31 UTC (rev 1964)
@@ -120,6 +120,6 @@
 LATEST_GROUPS_RSS_ENTRY_COUNT = 10
 
 # various feeds on "home" page
-# (DEFAULT_RSS_ENTRY_COUNT is currently used for "latest tags|comments|reviews"; RSS news feed for Files)
+# (DEFAULT_RSS_ENTRY_COUNT is currently used for "latest tags|comments|reviews"; RSS news feed for Files, Workflows)
 DEFAULT_RSS_ENTRY_COUNT = 20
 LATEST_UPDATED_ITEMS_RSS_ENTRY_COUNT = 25
\ No newline at end of file

Modified: branches/event_logging/config/routes.rb (1963 => 1964)


--- branches/event_logging/config/routes.rb	2008-11-13 14:24:44 UTC (rev 1963)
+++ branches/event_logging/config/routes.rb	2008-11-13 14:50:31 UTC (rev 1964)
@@ -75,7 +75,8 @@
                  :comment => :post, 
                  :comment_delete => :delete, 
                  :rate => :post, 
-                 :tag => :post, 
+                 :tag => :post,
+                 :news => :get,
                  :create_version => :post, 
                  :destroy_version => :delete, 
                  :edit_version => :get, 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]