make attachments form openable by providing a local variable

By default, open the attachment for on the work package form
pull/2681/head
Florian Kraft 10 years ago
parent e9b0665a97
commit 8635582771
  1. 6
      app/views/attachments/_nested_form.html.erb
  2. 2
      app/views/work_packages/_form.html.erb

@ -39,11 +39,13 @@ an attachments_attributes= and not every model supports this we build a nested f
end
%>
<fieldset id="attachments" class="header_collapsible collapsible collapsed">
<% open ||= false %>
<fieldset id="attachments" class="header_collapsible collapsible<%= open ? '' : ' collapsed' %>">
<legend title="<%=l(:description_attachment_toggle)%>", onclick="toggleFieldset(this);">
<a href="javascript:"><%=l(:label_attachment_plural)%></a>
</legend>
<div style="display: none;">
<div <%= 'style="display: none;"' unless open %>>
<div id="attachments_fields">
<div class="grid-block" id="attachment_template">
<div class="form--field">

@ -74,7 +74,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% if work_package.new_record? %>
<hr class="form--separator -invisible">
<%= render :partial => 'attachments/nested_form' %>
<%= render :partial => 'attachments/nested_form', locals: { open: true } %>
<% end %>
<%= call_hook(:view_work_packages_form_details_bottom, { :issue => work_package, :form => f }) %>

Loading…
Cancel
Save