Ability to attach an image to budgets

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 d78f2e03ad
commit dcad390933
11 changed files with 58 additions and 8 deletions

View File

@@ -36,6 +36,13 @@
<%= f.select :currency_symbol, currency_symbol_select_options %>
</div>
</div>
<% if feature?(:allow_images) %>
<div class="images small-12 column">
<%= render "/images/nested_image", imageable: budget, f: f %>
<p class="help-text"><%= t("admin.budgets.edit.image_description") %></p>
</div>
<% end %>
</fieldset>
<fieldset>

View File

@@ -1,4 +1,9 @@
<div class="budget-header">
<% if budget.image.present? %>
<div class="budget-header with-background-image"
style="background-image: url(<%= asset_url budget.image.attachment.url(:large) %>);">
<% else %>
<div class="budget-header">
<% end %>
<div class="row">
<div class="small-12 column text-center">
<span class="budget-title"><%= t("budgets.index.title") %></span>