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.
18 lines
296 B
Ruby
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
|