Extract budget investment's info to a component
This commit is contained in:
24
app/components/budgets/investments/info_component.html.erb
Normal file
24
app/components/budgets/investments/info_component.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<p class="investment-project-info">
|
||||
<%= l investment.created_at.to_date %>
|
||||
|
||||
<% if investment.author.hidden? || investment.author.erased? %>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="author">
|
||||
<%= t("budgets.investments.show.author_deleted") %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="author">
|
||||
<%= investment.author.name %>
|
||||
</span>
|
||||
<% if investment.author.official? %>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="label round level-<%= investment.author.official_level %>">
|
||||
<%= investment.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<span class="bullet"> • </span>
|
||||
<%= investment.heading.name %>
|
||||
</p>
|
||||
7
app/components/budgets/investments/info_component.rb
Normal file
7
app/components/budgets/investments/info_component.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Budgets::Investments::InfoComponent < ApplicationComponent
|
||||
attr_reader :investment
|
||||
|
||||
def initialize(investment)
|
||||
@investment = investment
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user