Set a default hidden title value on milestones admin form, and avoid showing it to the user

This commit is contained in:
Bertocq
2017-12-15 16:39:03 +01:00
parent 900d8a00b1
commit 01b9aa82d6
2 changed files with 1 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
<%= form_for [:admin, @investment.budget, @investment, @milestone] do |f| %>
<%= f.text_field :title, maxlength: Budget::Investment::Milestone.title_max_length %>
<%= f.hidden_field :title, value: l(Time.current, format: :datetime), maxlength: Budget::Investment::Milestone.title_max_length %>
<%= f.text_area :description, rows: 5 %>
<%= f.text_field :publication_date,
value: @milestone.publication_date.present? ? l(@milestone.publication_date.to_date) : nil,

View File

@@ -11,7 +11,6 @@
<% @investment.milestones.each do |milestone| %>
<li>
<div class="milestone-content">
<h3><%= milestone.title %></h3>
<% if milestone.publication_date.present? %>
<span class="milestone-date">
<strong><%= t("budgets.investments.show.milestone_publication_date",