myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3421] branches/contextualisation/app: DRYing


From: noreply
Subject: [myexperiment-hackers] [3421] branches/contextualisation/app: DRYing
Date: Fri, 15 Feb 2013 09:35:40 +0000 (UTC)

Revision
3421
Author
fbacall
Date
2013-02-15 09:35:39 +0000 (Fri, 15 Feb 2013)

Log Message

DRYing

Modified Paths

Diff

Modified: branches/contextualisation/app/helpers/application_helper.rb (3420 => 3421)


--- branches/contextualisation/app/helpers/application_helper.rb	2013-02-14 15:56:55 UTC (rev 3420)
+++ branches/contextualisation/app/helpers/application_helper.rb	2013-02-15 09:35:39 UTC (rev 3421)
@@ -1583,4 +1583,19 @@
     @layout = layout || {"layout" => Conf.page_template, "stylesheets" => [Conf.stylesheet]}
   end
 
+
+  def context_prefix(context)
+    case context
+    when User
+      prefix = "#{context.name}'"
+      prefix << 's' if context.name[-1] != 's'
+    when Network
+      prefix = context.name
+    else
+      prefix = ''
+    end
+
+    prefix
+  end
+
 end

Modified: branches/contextualisation/app/views/blobs/index.rhtml (3420 => 3421)


--- branches/contextualisation/app/views/blobs/index.rhtml	2013-02-14 15:56:55 UTC (rev 3420)
+++ branches/contextualisation/app/views/blobs/index.rhtml	2013-02-15 09:35:39 UTC (rev 3421)
@@ -1,15 +1,4 @@
-<%
-  case @context
-  when User
-    prefix = "address@hidden'"
-    prefix << 's' if @context.name[-1] != 's'
-  when Network
-    prefix = @context.name
-  else
-    prefix = ""
-  end
-%>
-<h1><%= prefix -%> Files</h1>
+<h1><%= context_prefix(@context) -%> Files</h1>
 
 <%= render :partial => "content/index" -%>
 

Modified: branches/contextualisation/app/views/packs/index.rhtml (3420 => 3421)


--- branches/contextualisation/app/views/packs/index.rhtml	2013-02-14 15:56:55 UTC (rev 3420)
+++ branches/contextualisation/app/views/packs/index.rhtml	2013-02-15 09:35:39 UTC (rev 3421)
@@ -20,17 +20,6 @@
 		<center><%= image_tag 'packs.png' -%></center>
 	</div>
 </div>
-<%
-  case @context
-  when User
-    prefix = "address@hidden'"
-    prefix << 's' if @context.name[-1] != 's'
-  when Network
-    prefix = @context.name
-  else
-    prefix = ""
-  end
-%>
-<h1><%= prefix -%> Packs</h1>
+<h1><%= context_prefix(@context) -%> Packs</h1>
 
 <%= render :partial => "content/index" -%>

Modified: branches/contextualisation/app/views/workflows/index.rhtml (3420 => 3421)


--- branches/contextualisation/app/views/workflows/index.rhtml	2013-02-14 15:56:55 UTC (rev 3420)
+++ branches/contextualisation/app/views/workflows/index.rhtml	2013-02-15 09:35:39 UTC (rev 3421)
@@ -1,15 +1,4 @@
-<%
-  case @context
-  when User
-    prefix = "address@hidden'"
-    prefix << 's' if @context.name[-1] != 's'
-  when Network
-    prefix = @context.name
-  else
-    prefix = ""
-  end
-%>
-<h1><%= prefix -%> Workflows</h1>
+<h1><%= context_prefix(@context) -%> Workflows</h1>
 
 <%= render :partial => "content/index" -%>
 

reply via email to

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