Change BudgetInvestmentStatus to Milestone::Status
Generalize the BudgetInvestmentStatus model to Milestone::Status so it is not specific to budget investments, but can be used for any entity which has milestones. This is in preparation to make the Milestone model polymorphic and usable by entities other than budget investments.
This commit is contained in:
10
app/views/admin/milestone_statuses/_form.html.erb
Normal file
10
app/views/admin/milestone_statuses/_form.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<%= form_for [:admin, @status] do |f| %>
|
||||
<%= render 'shared/errors', resource: @status %>
|
||||
|
||||
<%= f.text_field :name %>
|
||||
<%= f.text_area :description %>
|
||||
|
||||
<div class="margin-top">
|
||||
<%= f.submit class: "button success" %>
|
||||
</div>
|
||||
<% end %>
|
||||
5
app/views/admin/milestone_statuses/edit.html.erb
Normal file
5
app/views/admin/milestone_statuses/edit.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= back_link_to admin_milestone_statuses_path %>
|
||||
|
||||
<h2><%= t("admin.statuses.edit.title") %></h2>
|
||||
|
||||
<%= render '/admin/milestone_statuses/form' %>
|
||||
41
app/views/admin/milestone_statuses/index.html.erb
Normal file
41
app/views/admin/milestone_statuses/index.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<h2 class="inline-block"><%= t("admin.statuses.index.title") %></h2>
|
||||
|
||||
<%= link_to t("admin.statuses.index.new_status"),
|
||||
new_admin_milestone_status_path,
|
||||
class: "button float-right margin-right" %>
|
||||
|
||||
<% if @statuses.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.statuses.index.table_name") %></th>
|
||||
<th><%= t("admin.statuses.index.table_description") %></th>
|
||||
<th><%= t("admin.statuses.index.table_actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @statuses.each do |status| %>
|
||||
<tr id="<%= dom_id(status) %>" class="milestone_status">
|
||||
<td>
|
||||
<%= status.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= status.description %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.statuses.index.edit"),
|
||||
edit_admin_milestone_status_path(status),
|
||||
method: :get, class: "button hollow" %>
|
||||
<%= link_to t("admin.statuses.index.delete"),
|
||||
admin_milestone_status_path(status),
|
||||
method: :delete, class: "button hollow alert" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<div data-alert class="callout primary margin-top clear">
|
||||
<%= t("admin.statuses.index.empty_statuses") %>
|
||||
</div>
|
||||
<% end %>
|
||||
5
app/views/admin/milestone_statuses/new.html.erb
Normal file
5
app/views/admin/milestone_statuses/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= back_link_to admin_milestone_statuses_path %>
|
||||
|
||||
<h2><%= t("admin.statuses.new.title") %></h2>
|
||||
|
||||
<%= render '/admin/milestone_statuses/form' %>
|
||||
Reference in New Issue
Block a user