myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [1966] branches/event_logging/app/views/layouts:


From: noreply
Subject: [myexperiment-hackers] [1966] branches/event_logging/app/views/layouts: Subscriptions.
Date: Thu, 13 Nov 2008 12:44:06 -0500 (EST)

Revision
1966
Author
alekses6
Date
2008-11-13 12:44:06 -0500 (Thu, 13 Nov 2008)

Log Message

Subscriptions. Partials that get displayed within RSS feeds now have "category" metadata set.

Modified Paths

Diff

Modified: branches/event_logging/app/views/layouts/_announcement.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_announcement.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_announcement.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -2,6 +2,7 @@
   xm.title announcement.title
   xm.description white_list(announcement.body_html)
   xm.pubDate announcement.updated_at.rfc822
+  xm.category "Site Announcements"
   xm.guid [request.host_with_port, "announcement", announcement.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(announcement.user.name)
   xm.link announcement_url(announcement)

Modified: branches/event_logging/app/views/layouts/_blob.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_blob.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_blob.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -11,6 +11,8 @@
   # next line should be enabled when files become versioned
   # xm.version blob.current_version
   xm.pubDate blob.contribution.updated_at.rfc822
+  xm.category "Files [All]"
+  xm.category "Files [#{blob.content_type.strip}]"
   xm.guid [request.host_with_port, "blob", blob.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(blob.contribution.contributor.name || blob.contribution.contributor.title)
   xm.link file_url(blob)

Modified: branches/event_logging/app/views/layouts/_comment.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_comment.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_comment.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -14,6 +14,7 @@
   xm.description white_list(comment_desc + comment_body)
   
   xm.pubDate comment_instance.created_at.rfc822
+  xm.category "Comments"
   xm.guid [request.host_with_port, "comment", comment_instance.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(comment_maker.name)
   xm.link eval("#{item_type.downcase}_url(#{commented_item.id})") + "#comment_" + comment_instance.id.to_s

Modified: branches/event_logging/app/views/layouts/_group_announcement.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_group_announcement.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_group_announcement.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -2,6 +2,7 @@
   xm.title group_announcement.title
   xm.description white_list(group_announcement.body_html)
   xm.pubDate group_announcement.updated_at.rfc822
+  xm.category "Group Announcements"
   xm.guid [request.host_with_port, "announcement", group_announcement.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(group_announcement.user.name)
   xm.link group_announcement_url(group, group_announcement)

Modified: branches/event_logging/app/views/layouts/_network.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_network.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_network.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -2,6 +2,7 @@
   xm.title network.title
   xm.description white_list(network.description_html)
   xm.pubDate network.created_at.rfc822
+  xm.category "Groups"
   xm.guid [request.host_with_port, "network", network.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(network.owner.name)
   xm.link group_url(network)

Modified: branches/event_logging/app/views/layouts/_pack.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_pack.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_pack.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -9,6 +9,7 @@
   xm.description white_list(full_desc)
   
   xm.pubDate pack.contribution.updated_at.rfc822
+  xm.category "Packs"
   xm.guid [request.host_with_port, "pack", pack.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(pack.contribution.contributor.name || pack.contribution.contributor.title)
   xm.link pack_url(pack)

Modified: branches/event_logging/app/views/layouts/_pack_items.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_pack_items.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_pack_items.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -1,13 +1,34 @@
 pack.contributable_entries.each do |e|
-  show = e.available? ? thing_authorized?('show', e.contributable) : false
+  item_instance = e.contributable
+  show = e.available? ? thing_authorized?('show', item_instance) : false
   xm.item do
     if show
-      xm.title "#{visible_name(e.contributable_type)}: #{contributable_name(e.contributable_id, e.contributable_type)}"
+      # infer category metadata: for files and workflows fetch their type
+      item_visible_type = visible_name(e.contributable_type)
+      item_title_type = ""
+      item_categories = []
+      if item_visible_type == "File"
+        item_title_type = " [#{h(item_instance.content_type.strip)}]"
+        item_categories << "Files [All]"
+        item_categories << "Files" + item_title_type
+      elsif item_visible_type == "Workflow"
+        item_title_type = " [#{h(item_instance.type_display_name)}]"
+        item_categories << "Workflows [All]"
+        item_categories << "Workflows" + item_title_type
+      else
+        item_categories << item_visible_type.pluralize
+      end
       
+      xm.title "#{item_visible_type}: #{contributable_name_from_instance(item_instance)}" + item_title_type
+      
       # Description
       desc = ''
       desc += "<b>Comment:</b> #{h(e.comment)}" unless e.comment.blank?
       xm.description desc
+      
+      item_categories.each do |cat|
+        xm.category cat
+      end
     else
       if not e.available?
         xm.title "{The item this entry points to is not available. It may have been deleted.}"
@@ -41,6 +62,7 @@
     xm.description desc
       
     xm.pubDate e.updated_at.rfc822
+    xm.category "External Items"
     xm.guid [request.host_with_port, "pack", pack.id.to_s, "item", "remote", e.id.to_s].join(":"), "isPermaLink" => "false"
     xm.author contributor_name(e.user_id, 'User')
     xm.link pack_url(pack) + "#item_remote_#{e.id.to_s}"

Modified: branches/event_logging/app/views/layouts/_review.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_review.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_review.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -16,6 +16,7 @@
   xm.description white_list(review_desc + review_body)
   
   xm.pubDate review_instance.created_at.rfc822
+  xm.category "Reviews"
   xm.guid [request.host_with_port, "review", review_instance.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(review_maker.name)
   xm.link eval("#{item_type.downcase}_review_url(#{reviewed_item.id},#{review_instance.id})")

Modified: branches/event_logging/app/views/layouts/_tagging.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_tagging.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_tagging.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -13,6 +13,7 @@
   xm.description white_list("#{processed_tag_link} on #{item_icon}#{link_to item_name, contributable_url(tagging_instance.taggable_id, tagging_instance.taggable_type)} #{item_type} by #{name(tag_maker, nil, false)}")
   
   xm.pubDate tagging_instance.created_at.rfc822
+  xm.category "Tags"
   xm.guid [request.host_with_port, "tagging", tagging_instance.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(tag_maker.name)
   xm.link tag_url(tag_instance)

Modified: branches/event_logging/app/views/layouts/_workflow.rxml (1965 => 1966)


--- branches/event_logging/app/views/layouts/_workflow.rxml	2008-11-13 15:06:25 UTC (rev 1965)
+++ branches/event_logging/app/views/layouts/_workflow.rxml	2008-11-13 17:44:06 UTC (rev 1966)
@@ -10,6 +10,8 @@
 
   xm.version workflow.current_version
   xm.pubDate workflow.contribution.updated_at.rfc822
+  xm.category "Workflows [All]"
+  xm.category "Workflows [#{h(workflow.type_display_name)}]"
   xm.guid [request.host_with_port, "workflow", workflow.id.to_s].join(":"), "isPermaLink" => "false"
   xm.author h(workflow.contribution.contributor.name || workflow.contribution.contributor.title)
   xm.link workflow_url(workflow)

reply via email to

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