Add CRUD Milestone on Admin::BudgetInvestment. Rename Checkpoint to Milestone.

This commit is contained in:
taitus
2017-06-22 13:25:17 +02:00
parent beeb5412d7
commit f220952883
20 changed files with 277 additions and 33 deletions

View File

@@ -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 %>

View File

@@ -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' %>

View 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>

View 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 %>

View File

@@ -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>