Add CRUD Milestone on Admin::BudgetInvestment. Rename Checkpoint to Milestone.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<%= form_for [:admin, @investment.budget, @investment, @milestone] do |f| %>
|
||||
|
||||
<%= f.text_field :title, maxlength: Budget::Investment::Milestone.title_max_length %>
|
||||
<%= f.text_area :description %>
|
||||
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,5 @@
|
||||
<%= back_link_to admin_budget_budget_investment_path(@investment.budget, @investment) %>
|
||||
|
||||
<h2><%= t("admin.milestones.edit.title") %></h2>
|
||||
|
||||
<%= render '/admin/budget_investment_milestones/form' %>
|
||||
10
app/views/admin/budget_investment_milestones/new.html.erb
Normal file
10
app/views/admin/budget_investment_milestones/new.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="milestone-new row">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= back_link_to admin_budget_budget_investment_path(@investment.budget, @investment) %>
|
||||
|
||||
<h1><%= t("admin.milestones.new.creating") %></h1>
|
||||
|
||||
<%= render "form" %>
|
||||
</div>
|
||||
</div>
|
||||
32
app/views/admin/budget_investments/_milestones.html.erb
Normal file
32
app/views/admin/budget_investments/_milestones.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<% if @investment.milestones.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.milestones.index.table_id") %></th>
|
||||
<th><%= t("admin.milestones.index.table_title") %></th>
|
||||
<th><%= t("admin.milestones.index.table_description") %></th>
|
||||
<th><%= t("admin.milestones.index.table_actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @investment.milestones.each do |milestone| %>
|
||||
<tr id="<%= dom_id(milestone) %>" class="milestone">
|
||||
<td>
|
||||
<%= milestone.id %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to milestone.title, edit_admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone) %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= milestone.description %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.milestones.index.delete"), admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone),
|
||||
method: :delete,
|
||||
class: 'button hollow alert expanded' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
@@ -47,3 +47,12 @@
|
||||
<%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><%= t("admin.budget_investments.show.milestone") %></h2>
|
||||
|
||||
<%= render 'admin/budget_investments/milestones' %>
|
||||
|
||||
<p>
|
||||
<%= link_to t("admin.budget_investments.show.new_milestone"), new_admin_budget_budget_investment_budget_investment_milestone_path(@budget, @investment) %>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user