Files
nairobi/app/components/admin/budget_headings/headings_component.rb
Javi Martín 4d0638d5df Specify group in the "No headings" message
Since the message might appear several times on the same page, it's
useful to give a bit more context. Besides, usability tests show that
when there's a group with no headings, there's no clear indication on
the page that the group is actually a group and not a heading.

We're also adding some emphasis to the group name in the "Showing
headings" message, to be consistent with the emphasis we've
added the the group name in the "No headings" message.
2021-10-25 18:34:19 +02:00

18 lines
296 B
Ruby

class Admin::BudgetHeadings::HeadingsComponent < ApplicationComponent
attr_reader :headings
def initialize(headings)
@headings = headings
end
private
def group
@group ||= headings.proxy_association.owner
end
def budget
@budget ||= group.budget
end
end