Only hide fields in the project form for projects/new

pull/3613/head
Peter Lehwess 9 years ago
parent c57b90adc4
commit f0c911a0ac
  1. 2
      app/views/copy_projects/copy_from_admin.html.erb
  2. 3
      app/views/projects/_edit.html.erb
  3. 8
      app/views/projects/_form.html.erb
  4. 5
      app/views/projects/form/_project_attributes.html.erb
  5. 5
      app/views/projects/new.html.erb

@ -34,7 +34,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= labelled_tabular_form_for @copy_project, url: { action: 'copy', coming_from: 'admin' } do |f| %>
<%= hidden_field_tag :coming_from, 'admin' %>
<%= render :partial => 'projects/form', :locals => { :f => f, :project => @copy_project, :renderTypes => true } %>
<%= render :partial => 'projects/form', :locals => { :f => f, :project => @copy_project, :renderTypes => true, :show_all_fields => true } %>
<%= render :partial => "copy_projects/copy_settings/copy_associations", :locals => { :project => @project } %>

@ -30,7 +30,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%= render partial: 'form', locals: {
f: f,
project: @altered_project,
renderTypes: false
renderTypes: false,
show_all_fields: true
} %>
<%= f.button l(:button_update), class: 'button -highlight -with-icon icon-yes' %>

@ -33,7 +33,7 @@ See doc/COPYRIGHT.rdoc for more details.
<section class="form--section">
<%= render partial: "projects/form/project_attributes",
locals: { project: project, form: f } %>
locals: { project: project, form: f, show_all_fields: show_all_fields } %>
<%= call_hook(:view_projects_form, project: project, form: f) %>
</section>
@ -45,7 +45,7 @@ See doc/COPYRIGHT.rdoc for more details.
</section>
<% end %>
<% if project.persisted? %>
<% if show_all_fields %>
<section class="form--section">
<%= render partial: "projects/form/modules", locals: { form: f } %>
</section>
@ -53,14 +53,14 @@ See doc/COPYRIGHT.rdoc for more details.
<%= javascript_tag 'observeProjectModules();' %>
<% end %>
<% if (project.persisted? && project.module_enabled?('work_package_tracking')) && renderTypes %>
<% if ((show_all_fields && project.module_enabled?('work_package_tracking') ) && renderTypes) %>
<section class="form--section">
<%= render partial: 'projects/form/types',
locals: { f: f, project: project } %>
</section>
<% end %>
<% if project.persisted? %>
<% if show_all_fields %>
<section class="form--section">
<%= render partial: 'projects/form/custom_fields',
locals: {

@ -33,13 +33,14 @@ See doc/COPYRIGHT.rdoc for more details.
locals: { form: form } %>
<%= render partial: "projects/form/attributes/responsible_id",
locals: { form: form } %>
<% unless show_all_fields %>
<fieldset id="advanced-settings" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:label_show_hide)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l(:label_advanced_settings) %></a>
</legend>
<div style="display:none;">
<% end %>
<%= render partial: "projects/form/attributes/parent_id",
locals: { form: form } %>
<%= render partial: "projects/form/attributes/description",
@ -50,5 +51,7 @@ See doc/COPYRIGHT.rdoc for more details.
locals: { form: form } %>
<%= render partial: "projects/form/attributes/is_public",
locals: { form: form } %>
<% unless show_all_fields %>
</div>
</fieldset>
<% end %>

@ -29,7 +29,10 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title l("label_project_new") %>
<%= toolbar title: l(:label_project_new) %>
<%= labelled_tabular_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f, :project => @project, :renderTypes => true } %>
<%= render :partial => 'form', :locals => { :f => f,
:project => @project,
:renderTypes => true,
:show_all_fields => false } %>
<%= styled_button_tag l(:button_create), class: '-highlight -with-icon icon-yes' %>
<%= javascript_tag "Form.Element.focus('project_name');" %>
<% end %>

Loading…
Cancel
Save