Files
grecia/app/views/milestones/_milestone.html.erb
Javi Martín 2aabf79fb4 Rename methods to add auto links to HTML
The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
2019-10-08 18:46:20 +02:00

55 lines
1.5 KiB
Plaintext

<li>
<div class="milestone-content">
<% if milestone.publication_date.present? %>
<span class="milestone-date">
<strong>
<%= t("milestones.show.publication_date",
publication_date: l(milestone.publication_date.to_date)) %>
</strong>
</span>
<% end %>
<% if milestone.status.present? %>
<p>
<strong>
<%= t("milestones.show.status_changed") %>
</strong>
<br>
<span class="milestone-status">
<%= milestone.status.name %>
</span>
</p>
<% end %>
<%= image_tag(milestone.image_url(:large), { id: "image_#{milestone.id}", alt: milestone.image.title, class: "margin" }) if milestone.image.present? %>
<p>
<%= sanitize_and_auto_link milestone.description %>
</p>
<% if milestone.documents.present? %>
<div class="documents">
<div class="document-link text-left small">
<p>
<strong><%= t("shared.documentation") %></strong>
</p>
<% milestone.documents.each do |document| %>
<%= link_to document.title,
document.attachment.url,
target: "_blank",
rel: "nofollow" %><br>
<small>
<%= document.humanized_content_type %>&nbsp;|&nbsp;
<%= number_to_human_size(document.attachment_file_size, precision: 2) %>
</small>
<br>
<% end %>
</div>
</div>
<% end %>
</div>
</li>