OSDN Git Service

add long text custom field support.
authorAkira Saito <akrstjp@users.sourceforge.jp>
Sun, 22 Feb 2015 15:35:52 +0000 (00:35 +0900)
committerAkira Saito <akrstjp@users.sourceforge.jp>
Sun, 22 Feb 2015 15:35:52 +0000 (00:35 +0900)
app/controllers/quick_edit_issues_controller.rb
app/views/hooks/_quick_edit_context.html.erb
app/views/quick_edit_issues/_input_dialog.html.erb

index 0271bcf..0143335 100644 (file)
@@ -60,7 +60,8 @@ private
     validation_pattern = get_field_validation_pattern(field_type)
     help_message = get_field_help_message(field_type)
     ret =
-      { :caption => caption,
+      { :attribute_name => attribute_name.to_sym,
+        :caption => caption,
         :target_specifier => target_specifier,
         :field_type => field_type,
         :default_value => default_value,
@@ -70,6 +71,8 @@ private
   end
 
   def get_input_dialog_params_for_custom_fields(issue, target_specifier, custom_field)
+    attribute_name = parse_target_specifier(target_specifier)[0]
+
     caption = custom_field.name
     field_type = custom_field.field_format.to_sym
     default_value = issue.editable_custom_field_values.detect {|v| v.custom_field_id == custom_field.id}
@@ -78,7 +81,8 @@ private
     help_message = get_field_help_message(field_type)
 
     ret =
-      { :caption => caption,
+      { :attribute_name => attribute_name.to_sym,
+        :caption => caption,
         :target_specifier => target_specifier,
         :field_type => field_type,
         :default_value => default_value,
index 7071a05..d98f49c 100644 (file)
@@ -3,7 +3,7 @@
    extend IssueRelationsHelper
    custom_fields = @issues.map(&:available_custom_fields).reduce(:&).select do |f|
      #concat f.field_format
-     %w(string date int).include?(f.field_format)
+     %w(string date int text).include?(f.field_format)
    end
 
    first_issue = @issues.first
index 15cf6c1..d8e640e 100644 (file)
@@ -31,7 +31,9 @@
            cols="80"
            rows="10"
            style="vertical-align:middle;"><%= @dialog_params[:default_value] %></textarea>
+    <% if @dialog_params[:attribute_name].to_sym == :description %>
     <%= wikitoolbar_for 'new_value' %>
+    <% end %>
     <% else %>
     <input id="new_value"
            name="<%= @dialog_params[:target_specifier] %>"
 
 <script>
 //<![CDATA[
+  <%
+  %>
   $(".ui-autocomplete").css("z-index",200);
   var width = <%= (@dialog_params[:field_type] == :int || @dialog_params[:field_type] == :date) ? 480 : 707 %>;
-  var height = <%= ((@dialog_params[:field_type] == :text) ? 445 : 280) + ((@dialog_params[:description].nil?) ? 0 : 50) %>;
+  var height = <%= ((@dialog_params[:field_type] == :text) ? 414 : 280) + ((@dialog_params[:description].nil?) ? 0 : 50) + ((@dialog_params[:attribute_name]==:description)?31:0)%>;
   $("#quick_edit_input_dialog").dialog({
      modal: true,
      closeOnEscape: false,