@ -28,98 +28,123 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
++#%>
<h2><%= l(:label_bulk_edit_selected_work_packages) %></h2>
<h2><%= l(:label_bulk_edit_selected_work_packages) %></h2>
<ul><%= @work_packages.collect {|i| content_tag('li', link_to(h("#{i.type} ##{i.id}"), work_package_path(i)) + h(": #{i.subject}")) }.join("\n").html_safe %></ul>
<ul><%= @work_packages.collect {|i| content_tag('li', link_to(h("#{i.type} ##{i.id}"), work_package_path(i)) + h(": #{i.subject}")) }.join("\n").html_safe %></ul>
<%= form_tag(url_for(controller: '/work_packages/bulk', action: :update, ids: @work_packages),
<%= styled_ form_tag(url_for(controller: '/work_packages/bulk', action: :update, ids: @work_packages),
method: :put) do %>
method: :put) do %>
<%= @work_packages.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
<%= @work_packages.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
<div class="box tabular ">
<section class="form--section ">
<fieldset class="attributes ">
<fieldset class="form--fieldset ">
<legend><%= l(:label_change_properties) %></legend>
<legend class="form--fieldset-legend" ><%= l(:label_change_properties) %></legend>
<div class="grid-block">
<div class="grid-block">
<div class="grid-content">
<div class="grid-content">
<p>
<div class="form--field">
<label for="work_package_type_id"><%= WorkPackage.human_attribute_name(:type) %></label>
<label class="form--label" for="work_package_type_id"><%= WorkPackage.human_attribute_name(:type) %></label>
<%= select_tag('work_package[type_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@types, :id, :name)) %>
<div class="form--field-container">
</p>
<%= styled_select_tag('work_package[type_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@types, :id, :name)) %>
</div>
</div>
<% if @available_statuses.any? %>
<% if @available_statuses.any? %>
<p>
<div class="form--field">
<label for='status_id'><%= WorkPackage.human_attribute_name(:status) %></label>
<label class="form--label" for='status_id'><%= WorkPackage.human_attribute_name(:status) %></label>
<%= select_tag('work_package[status_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@available_statuses, :id, :name)) %>
<div class="form--field-container">
</p>
<%= styled_select_tag('work_package[status_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@available_statuses, :id, :name)) %>
</div>
</div>
<% end %>
<% end %>
<p>
<div class="form--field">
<label for='work_package_priority_id'><%= WorkPackage.human_attribute_name(:priority) %></label>
<label class="form--label" for='work_package_priority_id'><%= WorkPackage.human_attribute_name(:priority) %></label>
<%= select_tag('work_package[priority_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(IssuePriority.all, :id, :name)) %>
<div class="form--field-container">
</p>
<%= styled_select_tag('work_package[priority_id]', "<option value=\"\">#{l(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(IssuePriority.all, :id, :name)) %>
<p>
</div>
<label for='work_package_assigned_to_id'><%= WorkPackage.human_attribute_name(:assigned_to) %></label>
</div>
<%= select_tag('work_package[assigned_to_id]', content_tag('option', l(:label_no_change_option), :value => '') +
<div class="form--field">
<label class="form--label" for='work_package_assigned_to_id'><%= WorkPackage.human_attribute_name(:assigned_to) %></label>
<div class="form--field-container">
<%= styled_select_tag('work_package[assigned_to_id]', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_nobody), :value => 'none') +
content_tag('option', l(:label_nobody), :value => 'none') +
options_from_collection_for_select(@assignables, :id, :name)) %>
options_from_collection_for_select(@assignables, :id, :name)) %>
</p>
</div>
<p>
</div>
<label for='work_package_responsible_id'><%= WorkPackage.human_attribute_name(:responsible) %></label>
<div class="form--field">
<%= select_tag('work_package[responsible_id]', content_tag('option', l(:label_no_change_option), :value => '') +
<label class="form--label" for='work_package_responsible_id'><%= WorkPackage.human_attribute_name(:responsible) %></label>
<div class="form--field-container">
<%= styled_select_tag('work_package[responsible_id]', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_nobody), :value => 'none') +
content_tag('option', l(:label_nobody), :value => 'none') +
options_from_collection_for_select(@responsibles, :id, :name)) %>
options_from_collection_for_select(@responsibles, :id, :name)) %>
</p>
</div>
</div>
<% if @project %>
<% if @project %>
<p>
<div class="form--field">
<label for='category_id'><%= WorkPackage.human_attribute_name(:category) %></label>
<label class="form--label" for='category_id'><%= WorkPackage.human_attribute_name(:category) %></label>
<%= select_tag('work_package[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
<div class="form--field-container">
<%= styled_select_tag('work_package[category_id]', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_none), :value => 'none') +
content_tag('option', l(:label_none), :value => 'none') +
options_from_collection_for_select(@project.categories, :id, :name)) %>
options_from_collection_for_select(@project.categories, :id, :name)) %>
</p>
</div>
</div>
<% end %>
<% end %>
<% #TODO: allow editing versions when multiple projects %>
<% #TODO: allow editing versions when multiple projects %>
<% if @project %>
<% if @project %>
<p>
<div class="form--field">
<label for='work_package_fixed_version_id'><%= WorkPackage.human_attribute_name(:fixed_version) %></label>
<label class="form--label" for='work_package_fixed_version_id'><%= WorkPackage.human_attribute_name(:fixed_version) %></label>
<%= select_tag('work_package[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') +
<div class="form--field-container">
<%= styled_select_tag('work_package[fixed_version_id]', content_tag('option', l(:label_no_change_option), :value => '') +
content_tag('option', l(:label_none), :value => 'none') +
content_tag('option', l(:label_none), :value => 'none') +
version_options_for_select(@project.shared_versions.open.sort)) %>
version_options_for_select(@project.shared_versions.open.sort)) %>
</p>
</div>
</div>
<% end %>
<% end %>
<% @custom_fields.each do |custom_field| %>
<% @custom_fields.each do |custom_field| %>
<p >
<div class="form--field" >
<%= blank_custom_field_label_tag('work_package', custom_field) %>
<%= blank_custom_field_label_tag('work_package', custom_field) %>
<div class="form--field-container">
<%= custom_field_tag_for_bulk_edit('work_package', custom_field) %>
<%= custom_field_tag_for_bulk_edit('work_package', custom_field) %>
</p>
</div>
</div>
<% end %>
<% end %>
<%= call_hook(:view_work_packages_bulk_edit_details_bottom, { work_packages: @work_packages }) %>
<%= call_hook(:view_work_packages_bulk_edit_details_bottom, { work_packages: @work_packages }) %>
</div>
</div>
<div class="grid-content">
<div class="grid-content">
<% if @project && User.current.allowed_to?(:manage_subtasks, @project) %>
<% if @project && User.current.allowed_to?(:manage_subtasks, @project) %>
<p>
<div class="form--field">
<label for='work_package_parent_id'><%= WorkPackage.human_attribute_name(:parent) %></label>
<label class="form--label" for='work_package_parent_id'><%= WorkPackage.human_attribute_name(:parent) %></label>
<%= text_field_tag 'work_package[parent_id]', '', :size => 10 %>
<div class="form--field-container">
</p>
<%= styled_text_field_tag 'work_package[parent_id]', '', :size => 10 %>
</div>
</div>
<div id="parent_work_package_candidates" class="autocomplete"></div>
<div id="parent_work_package_candidates" class="autocomplete"></div>
<%= javascript_tag "observeParentIssueField('#{work_packages_auto_complete_path(project_id: @project.id)}')" %>
<%= javascript_tag "observeParentIssueField('#{work_packages_auto_complete_path(project_id: @project.id)}')" %>
<% end %>
<% end %>
<p>
<div class="form--field">
<label for='work_package_start_date'><%= WorkPackage.human_attribute_name(:start_date) %></label>
<label class="form--label" for='work_package_start_date'><%= WorkPackage.human_attribute_name(:start_date) %></label>
<%= text_field_tag 'work_package[start_date]', '', :size => 10 %><%= calendar_for('work_package_start_date') %>
<div class="form--field-container">
</p>
<%= styled_text_field_tag 'work_package[start_date]', '', :size => 10 %><%= calendar_for('work_package_start_date') %>
<p>
</div>
<label for='work_package_due_date'><%= WorkPackage.human_attribute_name(:due_date) %></label>
</div>
<%= text_field_tag 'work_package[due_date]', '', :size => 10 %><%= calendar_for('work_package_due_date') %>
<div class="form--field">
</p>
<label class="form--label" for='work_package_due_date'><%= WorkPackage.human_attribute_name(:due_date) %></label>
<div class="form--field-container">
<%= styled_text_field_tag 'work_package[due_date]', '', :size => 10 %><%= calendar_for('work_package_due_date') %>
</div>
</div>
<% if WorkPackage.use_field_for_done_ratio? %>
<% if WorkPackage.use_field_for_done_ratio? %>
<p>
<div class="form--field">
<label for='work_package_done_ratio'><%= WorkPackage.human_attribute_name(:done_ratio) %></label>
<label class="form--label" for='work_package_done_ratio'><%= WorkPackage.human_attribute_name(:done_ratio) %></label>
<%= select_tag 'work_package[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %>
<div class="form--field-container">
</p>
<%= styled_select_tag 'work_package[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
</div>
</fieldset>
</fieldset>
<fieldset><legend><%= Journal.human_attribute_name(:notes) %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= Journal.human_attribute_name(:notes) %></legend>
<%= label_tag 'notes', Journal.human_attribute_name(:notes), :class => 'hidden-for-sighted' %>
<%= label_tag 'notes', Journal.human_attribute_name(:notes), :class => 'hidden-for-sighted' %>
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit',
<%= styled_ text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit',
:'data-wp_autocomplete_url' => work_packages_auto_complete_path(:project_id => @project, :format => :json) %>
:'data-wp_autocomplete_url' => work_packages_auto_complete_path(:project_id => @project, :format => :json) %>
<%= wikitoolbar_for 'notes' %>
<%= wikitoolbar_for 'notes' %>
<p><%= send_notification_option %></p>
<p><%= send_notification_option %></p>
</fieldset>
</fieldset>
</div >
</section >
<p><%= submit_tag l(:button_submit), class: 'button -highlight' %></p>
<p><%= styled_s ubmit_tag l(:button_submit), class: '-highlight' %></p>
<% end %>
<% end %>