[ARVADOS] updated: 206d9314b7851ec1ad9590ce4aabfb72ff739406

git at public.curoverse.com git at public.curoverse.com
Wed Aug 13 08:51:34 EDT 2014


Summary of changes:
 .../app/assets/stylesheets/application.css.scss    |  4 ----
 apps/workbench/app/helpers/application_helper.rb   | 23 ++++++++++++++++------
 2 files changed, 17 insertions(+), 10 deletions(-)

       via  206d9314b7851ec1ad9590ce4aabfb72ff739406 (commit)
       via  13456171654b7db0c1ce731d826780b5f69714d4 (commit)
      from  41f3658885062525b4f389ac626a1365d951af77 (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 206d9314b7851ec1ad9590ce4aabfb72ff739406
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Wed Aug 13 08:44:55 2014 -0400

    3354: Also render specified attributes as textile when content is read-only

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 102655c..f09e0fb 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -143,9 +143,12 @@ module ApplicationHelper
     if !object.attribute_editable?(attr, :ever) or
         (!object.editable? and
          !object.owner_uuid.in?(my_projects.collect(&:uuid)))
-      return ((attrvalue && attrvalue.length > 0 && attrvalue) ||
-              (attr == 'name' and object.andand.default_name) ||
-              '(none)')
+      if attrvalue && attrvalue.length > 0
+        return render_textile_if_textile( object, attr, attrvalue )
+      else
+        return (attr == 'name' and object.andand.default_name) ||
+                '(none)'
+      end
     end
 
     input_type = 'text'
@@ -158,9 +161,8 @@ module ApplicationHelper
       input_type = 'text'
     end
 
-    is_textile = object.textile_attributes.andand.include?(attr)
     attrvalue = attrvalue.to_json if attrvalue.is_a? Hash or attrvalue.is_a? Array
-    rendervalue = is_textile ? render_content_from_database(attrvalue) : attrvalue
+    rendervalue = render_textile_if_textile( object, attr, attrvalue )
 
     ajax_options = {
       "data-pk" => {
@@ -188,7 +190,7 @@ module ApplicationHelper
       "data-toggle" => "manual",
       "data-value" => attrvalue,
       "id" => span_id,
-      :class => "editable #{is_textile ? 'editable-textile' : ''}"
+      :class => "editable #{is_textile?( object, attr ) ? 'editable-textile' : ''}"
     }.merge(htmloptions).merge(ajax_options)
     edit_button = raw('<a href="#" class="btn btn-xs btn-default btn-nodecorate" data-toggle="x-editable tooltip" data-toggle-selector="#' + span_id + '" data-placement="top" title="' + (htmloptions[:tiptitle] || 'edit') + '"><i class="fa fa-fw fa-pencil"></i></a>')
     if htmloptions[:btnplacement] == :left
@@ -446,4 +448,13 @@ module ApplicationHelper
       nil
     end
   end
+
+private
+  def is_textile?( object, attr )
+    is_textile = object.textile_attributes.andand.include?(attr)
+  end
+
+  def render_textile_if_textile( object, attr, attrvalue )
+    is_textile?( object, attr ) ? render_content_from_database(attrvalue) : attrvalue
+  end
 end

commit 13456171654b7db0c1ce731d826780b5f69714d4
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Wed Aug 13 08:44:24 2014 -0400

    3354: Put edit (pencil) icon _below_ textile rather than to the right of it.

diff --git a/apps/workbench/app/assets/stylesheets/application.css.scss b/apps/workbench/app/assets/stylesheets/application.css.scss
index 7d87dc3..c986f03 100644
--- a/apps/workbench/app/assets/stylesheets/application.css.scss
+++ b/apps/workbench/app/assets/stylesheets/application.css.scss
@@ -244,7 +244,3 @@ div.pane-content iframe {
   width: 100%;
   border: none;
 }
-
-span.editable-textile {
-  display: inline-block;
-}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list