Note the CSS could probably be improved to avoid duplication with other button style definitions. However, that's fine because we're going to change the style of the links soon. For the same reason, I haven't bothered to style every single link the way it was until now.
74 lines
2.7 KiB
Plaintext
74 lines
2.7 KiB
Plaintext
<h2 class="inline-block"><%= t("admin.milestones.index.milestone") %></h2>
|
|
|
|
<%= link_to t("admin.progress_bars.manage"),
|
|
admin_polymorphic_path(milestoneable.progress_bars.new),
|
|
class: "button hollow float-right" %>
|
|
|
|
<% if milestoneable.milestone_tag_list.any? %>
|
|
<div>
|
|
<strong>
|
|
<%= t("admin.milestones.index.milestone_tags") %>:
|
|
</strong> <%= milestoneable.milestone_tag_list.sort.join(", ") %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if milestoneable.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_publication_date") %></th>
|
|
<th><%= t("admin.milestones.index.table_status") %></th>
|
|
<th><%= t("admin.milestones.index.image") %></th>
|
|
<th><%= t("admin.milestones.index.documents") %></th>
|
|
<th><%= t("admin.milestones.index.table_actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% milestoneable.milestones.order_by_publication_date.each do |milestone| %>
|
|
<tr id="<%= dom_id(milestone) %>" class="milestone">
|
|
<td class="text-center"><%= milestone.id %></td>
|
|
<td><%= milestone.title %></td>
|
|
<td class="small small-5"><%= milestone.description %></td>
|
|
<td class="small">
|
|
<%= l(milestone.publication_date.to_date) if milestone.publication_date.present? %>
|
|
</td>
|
|
<td class="small">
|
|
<%= milestone.status.present? ? milestone.status.name : "" %>
|
|
</td>
|
|
<td class="small">
|
|
<%= link_to t("admin.milestones.index.show_image"),
|
|
milestone.image_url(:large),
|
|
target: :_blank if milestone.image.present? %>
|
|
</td>
|
|
<td class="small">
|
|
<% if milestone.documents.present? %>
|
|
<% milestone.documents.each do |document| %>
|
|
<%= link_to document.title,
|
|
document.attachment.url,
|
|
target: "_blank",
|
|
rel: "nofollow" %><br>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<%= render Admin::TableActionsComponent.new(milestone,
|
|
destroy_text: t("admin.milestones.index.delete")
|
|
) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<p><%= t("admin.milestones.index.no_milestones") %></p>
|
|
<% end %>
|
|
|
|
<p>
|
|
<%= link_to t("admin.milestones.index.new_milestone"),
|
|
admin_polymorphic_path(milestoneable.milestones.new, action: :new),
|
|
class: "button hollow" %>
|
|
</p>
|