Allow attaching an image to budget phases

Co-authored-by: decabeza <alberto@decabeza.es>
This commit is contained in:
Julian Herrero
2020-03-16 12:54:00 +01:00
committed by taitus
parent dcad390933
commit 43ad69bbaf
9 changed files with 56 additions and 5 deletions

View File

@@ -43,6 +43,13 @@
</div>
<% end %>
<% if feature?(:allow_images) %>
<div class="images small-12 column">
<%= render "images/nested_image", imageable: @phase, f: f %>
<p class="help-text"><%= t("admin.budget_phases.edit.image_description") %></p>
</div>
<% end %>
<div class="small-12 column">
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success" %>
</div>

View File

@@ -43,9 +43,17 @@
</div>
<div class="budget-phase">
<h3><%= phase.name %></h3>
<p><%= start_date(phase) %> - <%= end_date(phase) %></p>
<%= auto_link_already_sanitized_html(wysiwyg(phase.description)) %>
<div class="budget-phase-content">
<h3><%= phase.name %></h3>
<p><%= start_date(phase) %> - <%= end_date(phase) %></p>
<%= auto_link_already_sanitized_html(wysiwyg(phase.description)) %>
</div>
<% if phase.image.present? %>
<div class="budget-phase-image">
<%= image_tag phase.image.attachment.url(:large) %>
</div>
<% end %>
</div>
</div>
<% end %>