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| %> <%= labelled_tabular_form_for @copy_project, url: { action: 'copy', coming_from: 'admin' } do |f| %>
<%= hidden_field_tag :coming_from, 'admin' %> <%= 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 } %> <%= 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: { <%= render partial: 'form', locals: {
f: f, f: f,
project: @altered_project, project: @altered_project,
renderTypes: false renderTypes: false,
show_all_fields: true
} %> } %>
<%= f.button l(:button_update), class: 'button -highlight -with-icon icon-yes' %> <%= 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"> <section class="form--section">
<%= render partial: "projects/form/project_attributes", <%= 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) %> <%= call_hook(:view_projects_form, project: project, form: f) %>
</section> </section>
@ -45,7 +45,7 @@ See doc/COPYRIGHT.rdoc for more details.
</section> </section>
<% end %> <% end %>
<% if project.persisted? %> <% if show_all_fields %>
<section class="form--section"> <section class="form--section">
<%= render partial: "projects/form/modules", locals: { form: f } %> <%= render partial: "projects/form/modules", locals: { form: f } %>
</section> </section>
@ -53,14 +53,14 @@ See doc/COPYRIGHT.rdoc for more details.
<%= javascript_tag 'observeProjectModules();' %> <%= javascript_tag 'observeProjectModules();' %>
<% end %> <% 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"> <section class="form--section">
<%= render partial: 'projects/form/types', <%= render partial: 'projects/form/types',
locals: { f: f, project: project } %> locals: { f: f, project: project } %>
</section> </section>
<% end %> <% end %>
<% if project.persisted? %> <% if show_all_fields %>
<section class="form--section"> <section class="form--section">
<%= render partial: 'projects/form/custom_fields', <%= render partial: 'projects/form/custom_fields',
locals: { locals: {

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

@ -29,7 +29,10 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title l("label_project_new") %> <% html_title l("label_project_new") %>
<%= toolbar title: l(:label_project_new) %> <%= toolbar title: l(:label_project_new) %>
<%= labelled_tabular_form_for @project do |f| %> <%= 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' %> <%= styled_button_tag l(:button_create), class: '-highlight -with-icon icon-yes' %>
<%= javascript_tag "Form.Element.focus('project_name');" %> <%= javascript_tag "Form.Element.focus('project_name');" %>
<% end %> <% end %>

Loading…
Cancel
Save