OSDN Git Service

allow add notes without the field value. refs #35392
[quickedit/quick_edit.git] / app / views / quick_edit_issues / _input_dialog.html.erb
index bd746f5..7b485f5 100644 (file)
@@ -4,6 +4,7 @@
   dialog_size[1] += 130 if @dialog_params[:field_type] == :text
   dialog_size[1] += 160 # for notes
   dialog_size[1] += 25 if @dialog_params[:attribute_name]==:description
+  dialog_size[1] -= 160 if @dialog_params[:attribute_name].to_sym == :notes
   dialog_size[1] += 50 unless @dialog_params[:description].nil?
 
   textarea_size = parse_size(Setting.plugin_quick_edit['textarea_size'], 10...256, 80, 10...256, 10)
 
       <%= form_tag({:controller=>'issues', :action=>:bulk_update}) do %>
       <div class="box" style="overflow: auto">
-        <span><%= @dialog_params[:caption] %>:</span>
-        <% case @dialog_params[:field_type] %>
-        <% when :date %>
-        <input id="new_value"
-               type="text" 
-               size="15"
-               value="<%= @dialog_params[:default_value] %>"></input>
-        <%= calendar_for('new_value') %>
-        <% when :int, :float %>
-        <input id="new_value"
-               type="text" 
-               size="15"
-               value="<%= @dialog_params[:default_value] %>"></input>
-          <% if @dialog_params[:target_specifier] == "issue[parent_issue_id]" %>
-          <%= javascript_tag "observeAutocompleteField('new_value', '#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>
-          <%= javascript_tag "setPredecessorFieldsVisibility();" %>
-          <% end %>
-        <% when :text %>
-        <textarea id="new_value"
-               class="full_width"
-               cols="<%= textarea_size[0] %>"
-               rows="<%= textarea_size[1] %>"
-               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"
-               type="text"
-               class="full_width"
-               size="80"
-               value="<%= @dialog_params[:default_value] %>"></input>
-             <% end %>
-        <% unless @dialog_params[:clear_pseudo_value].nil? %>
-          <input id="clear" name="clear" type="checkbox" value="<%= @dialog_params[:clear_pseudo_value] %>" data-disables="#new_value"><%= l(:button_clear) %></input>
-        <% end %>
-
-        <% if !@dialog_params[:description].nil? %>
-        <pre style="border: 1px solid #e0e0e0; padding: 3px; overflow:auto; height: 2.8em; margin-top: 10px; margin-bottom: 0px;"><%= @dialog_params[:description] %></pre>
-        <% end %>
-
-        <fieldset style="margin-top: 10px;">
-          <legend><%= l(:field_notes) %></legend>
-          <textarea id="notes_for_edit"
-                    name="notes"
+        <% if @dialog_params[:attribute_name].to_sym == :notes %>
+          <span><%= @dialog_params[:caption] %>(Add only):</span>
+          <textarea id="new_value"
+                    name="new_value"
                     class="full_width"
                     rows="5"
                     style="vertical-align:middle"></textarea>
-          <%= wikitoolbar_for :notes_for_edit %>
-          <input id="issue_private_notes_for_edit"
+          <%= wikitoolbar_for :new_value %>
+          <input id="issue_private_notes"
                  name="issue[private_notes]"
                  type="checkbox"
                  value="1"/>
-          <label for="issue_private_notes_for_edit"><%= l(:field_private_notes) %></label>
-        </fieldset>
+          <label for="issue_private_notes"><%= l(:field_private_notes) %></label>
+        <% else %>
+          <span><%= @dialog_params[:caption] %>:</span>
+          <% case @dialog_params[:field_type] %>
+          <% when :date %>
+          <input id="new_value"
+                 type="text" 
+                 size="15"
+                 value="<%= @dialog_params[:default_value] %>"></input>
+          <%= calendar_for('new_value') %>
+          <% when :int, :float %>
+          <input id="new_value"
+                 type="text" 
+                 size="15"
+                 value="<%= @dialog_params[:default_value] %>"></input>
+            <% if @dialog_params[:target_specifier] == "issue[parent_issue_id]" %>
+            <%= javascript_tag "observeAutocompleteField('new_value', '#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>
+            <%= javascript_tag "setPredecessorFieldsVisibility();" %>
+            <% end %>
+          <% when :text %>
+          <textarea id="new_value"
+                 class="full_width"
+                 cols="<%= textarea_size[0] %>"
+                 rows="<%= textarea_size[1] %>"
+                 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"
+                 type="text"
+                 class="full_width"
+                 size="80"
+                 value="<%= @dialog_params[:default_value] %>"></input>
+               <% end %>
+          <% unless @dialog_params[:clear_pseudo_value].nil? %>
+            <input id="clear" name="clear" type="checkbox" value="<%= @dialog_params[:clear_pseudo_value] %>" data-disables="#new_value"><%= l(:button_clear) %></input>
+          <% end %>
+
+          <% if !@dialog_params[:description].nil? %>
+          <pre style="border: 1px solid #e0e0e0; padding: 3px; overflow:auto; height: 2.8em; margin-top: 10px; margin-bottom: 0px;"><%= @dialog_params[:description] %></pre>
+          <% end %>
+
+          <fieldset style="margin-top: 10px;">
+            <legend><%= l(:field_notes) %></legend>
+            <textarea id="notes_for_edit"
+                      name="notes"
+                      class="full_width"
+                      rows="5"
+                      style="vertical-align:middle"></textarea>
+            <%= wikitoolbar_for :notes_for_edit %>
+            <input id="issue_private_notes_for_edit"
+                   name="issue[private_notes]"
+                   type="checkbox"
+                   value="1"/>
+            <label for="issue_private_notes_for_edit"><%= l(:field_private_notes) %></label>
+          </fieldset>
+        <% end %>
         <% @dialog_params[:issue_ids].each do |id| %>
         <input id="ids" name="ids[]" type="hidden" value="<%= id %>"></input>
         <% end %>