[ARVADOS] created: 13e4bacf309e86428e46385ed94e55915cdc4af2
git at public.curoverse.com
git at public.curoverse.com
Fri May 1 15:44:56 EDT 2015
at 13e4bacf309e86428e46385ed94e55915cdc4af2 (commit)
commit 13e4bacf309e86428e46385ed94e55915cdc4af2
Author: Radhika Chippada <radhika at curoverse.com>
Date: Fri May 1 15:43:35 2015 -0400
5735: use inline editing for project description x-editable textarea.
diff --git a/apps/workbench/app/assets/stylesheets/application.css.scss b/apps/workbench/app/assets/stylesheets/application.css.scss
index bb57d4b..f2d28e1 100644
--- a/apps/workbench/app/assets/stylesheets/application.css.scss
+++ b/apps/workbench/app/assets/stylesheets/application.css.scss
@@ -300,3 +300,11 @@ ul.nav.nav-tabs {
.hover-dropdown:hover .dropdown-menu {
display: block;
}
+
+.editable-inline,
+.editable-inline .form-group,
+.editable-inline .form-group .editable-input,
+.editable-inline .form-group .editable-input textarea,
+{
+ width: 98%!important;
+}
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index e826f88..4ee211b 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -274,11 +274,16 @@ module ApplicationHelper
"id" => span_id,
:class => "editable #{is_textile?( object, attr ) ? 'editable-textile' : ''}"
}.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-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></a>')
+
+ edit_button = raw('<a href="#" class="btn btn-xs btn-' + (htmloptions['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['btntext'] || '') + '</a>')
+
if htmloptions[:btnplacement] == :left
edit_button + ' ' + span_tag
+ elsif htmloptions['btnplacement'] == 'top'
+ edit_button + raw('<br/>') + span_tag
else
span_tag + ' ' + edit_button
end
diff --git a/apps/workbench/app/views/projects/_show_description.html.erb b/apps/workbench/app/views/projects/_show_description.html.erb
index 7260940..771217b 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' } %>
+ <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual', 'data-mode' => 'inline', 'btntext' => 'Edit', 'btnplacement' => 'top', 'btnclass' => 'primary', 'data-rows' => 10 } %>
</div>
<% end %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list