Moves milestone image to a partial
This commit is contained in:
9
app/views/budgets/executions/_image.html.erb
Normal file
9
app/views/budgets/executions/_image.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<% investment.milestones.order(publication_date: :desc).limit(1).each do |milestone| %>
|
||||
<% if milestone.image.present? %>
|
||||
<%= image_tag milestone.image_url(:large), alt: milestone.image.title %>
|
||||
<% elsif investment.image.present? %>
|
||||
<%= image_tag investment.image_url(:thumb), alt: investment.image.title %>
|
||||
<% else %>
|
||||
<%= image_tag "budget_execution_no_image.jpg", alt: investment.title %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -7,15 +7,7 @@
|
||||
<div class="small-12 medium-6 large-4 column end margin-bottom">
|
||||
<div class="budget-execution">
|
||||
<%= link_to budget_investment_path(@budget, investment, anchor: "tab-milestones"), data: { 'equalizer-watch': true } do %>
|
||||
<% investment.milestones.order(publication_date: :desc).limit(1).each do |milestone| %>
|
||||
<% if milestone.image.present? %>
|
||||
<%= image_tag milestone.image_url(:large), alt: milestone.image.title %>
|
||||
<% elsif investment.image.present? %>
|
||||
<%= image_tag investment.image_url(:thumb), alt: investment.image.title %>
|
||||
<% else %>
|
||||
<%= image_tag "budget_execution_no_image.jpg", alt: investment.title %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render 'image', investment: investment %>
|
||||
<div class="budget-execution-info">
|
||||
<div class="budget-execution-content">
|
||||
<h5><%= investment.title %></h5>
|
||||
|
||||
Reference in New Issue
Block a user