[ARVADOS] updated: fe7d9a6cd96c7fadf869482e3bc99b2c18980248

git at public.curoverse.com git at public.curoverse.com
Tue May 5 14:13:10 EDT 2015


Summary of changes:
 apps/workbench/app/helpers/application_helper.rb            | 13 ++++++++-----
 .../workbench/app/views/projects/_show_description.html.erb |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

       via  fe7d9a6cd96c7fadf869482e3bc99b2c18980248 (commit)
       via  bd2023d19080f6f1b88a3ca94b7d7efc49ac0ef0 (commit)
      from  7d12bf89586e96ba827c75fa4bee86cce0fc20cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fe7d9a6cd96c7fadf869482e3bc99b2c18980248
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Tue May 5 14:12:54 2015 -0400

    5735: add comment

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index eea7fbc..572ec5e 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -222,6 +222,9 @@ module ApplicationHelper
     return_value
   end
 
+  # Render an editable attribute with the attrvalue of the attr.
+  # The htmloptions are added to the editable element's list of attributes.
+  # The nonhtml_options are only used to customize the display of the element.
   def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={}, nonhtml_options={})
     attrvalue = object.send(attr) if attrvalue.nil?
     if not object.attribute_editable?(attr)
diff --git a/apps/workbench/app/views/projects/_show_description.html.erb b/apps/workbench/app/views/projects/_show_description.html.erb
index a779565..443f359 100644
--- a/apps/workbench/app/views/projects/_show_description.html.erb
+++ b/apps/workbench/app/views/projects/_show_description.html.erb
@@ -1,5 +1,5 @@
 <% if @object.respond_to? :description %>
   <div class="arv-description-as-subtitle">
-    <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual', 'data-mode' => 'inline', 'data-rows' => 10, 'data-btntext' => 'Edit', 'data-btnclass' => 'primary', btnplacement: :top }, { btntext: 'Edit', btnclass: 'primary', btnplacement: :top } %>
+    <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual', 'data-mode' => 'inline', 'data-rows' => 10 }, { btntext: 'Edit', btnclass: 'primary', btnplacement: :top } %>
   </div>
 <% end %>

commit bd2023d19080f6f1b88a3ca94b7d7efc49ac0ef0
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Tue May 5 13:53:28 2015 -0400

    5735: add a new nonhtml_options parameter to render_editable_attribute method,
    which can be used to pass any non data-* custom attributes that are useful in
    customizing the rendering of the editable attribute.

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index c1b92b4..eea7fbc 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -222,7 +222,7 @@ module ApplicationHelper
     return_value
   end
 
-  def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={})
+  def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={}, nonhtml_options={})
     attrvalue = object.send(attr) if attrvalue.nil?
     if not object.attribute_editable?(attr)
       if attrvalue && attrvalue.length > 0
@@ -273,16 +273,16 @@ module ApplicationHelper
       "data-value" => attrvalue,
       "id" => span_id,
       :class => "editable #{is_textile?( object, attr ) ? 'editable-textile' : ''}"
-    }.merge(htmloptions.reject {|k, v| k.to_s.start_with?('btn') }).merge(ajax_options)
+    }.merge(htmloptions).merge(ajax_options)
 
     edit_tiptitle = 'edit'
     edit_tiptitle = 'Warning: do not use hyphens in the repository name as they will be stripped' if (object.class.to_s == 'Repository' and attr == 'name')
 
-    edit_button = raw('<a href="#" class="btn btn-xs btn-' + (htmloptions['data-btnclass'] || 'default') + ' btn-nodecorate" data-toggle="x-editable tooltip" data-toggle-selector="#' + span_id + '" data-placement="top" title="' + (htmloptions[:tiptitle] || edit_tiptitle) + '"><i class="fa fa-fw fa-pencil"></i>' + (htmloptions['data-btntext'] || '') + '</a>')
+    edit_button = raw('<a href="#" class="btn btn-xs btn-' + (nonhtml_options[:btnclass] || 'default') + ' btn-nodecorate" data-toggle="x-editable tooltip" data-toggle-selector="#' + span_id + '" data-placement="top" title="' + (htmloptions[:tiptitle] || edit_tiptitle) + '"><i class="fa fa-fw fa-pencil"></i>' + (nonhtml_options[:btntext] || '') + '</a>')
 
-    if htmloptions[:btnplacement] == :left
+    if nonhtml_options[:btnplacement] == :left
       edit_button + ' ' + span_tag
-    elsif htmloptions[:btnplacement] == :top
+    elsif nonhtml_options[:btnplacement] == :top
       edit_button + raw('<br/>') + span_tag
     else
       span_tag + ' ' + edit_button
diff --git a/apps/workbench/app/views/projects/_show_description.html.erb b/apps/workbench/app/views/projects/_show_description.html.erb
index dbd830b..a779565 100644
--- a/apps/workbench/app/views/projects/_show_description.html.erb
+++ b/apps/workbench/app/views/projects/_show_description.html.erb
@@ -1,5 +1,5 @@
 <% if @object.respond_to? :description %>
   <div class="arv-description-as-subtitle">
-    <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual', 'data-mode' => 'inline', 'data-rows' => 10, 'data-btntext' => 'Edit', 'data-btnclass' => 'primary', btnplacement: :top } %>
+    <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual', 'data-mode' => 'inline', 'data-rows' => 10, 'data-btntext' => 'Edit', 'data-btnclass' => 'primary', btnplacement: :top }, { btntext: 'Edit', btnclass: 'primary', btnplacement: :top } %>
   </div>
 <% end %>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list