OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/helpers/toolbar_helper.rb

29 lines
677 B

module ToolbarHelper
def toolbar(title:, subtitle: '', &block)
content_tag :div, class: 'toolbar-container' do
content_tag :div, id: 'toolbar' do
dom_title(title, subtitle) + dom_toolbar do
yield if block_given?
end
end
end
end
protected
def dom_title(title, subtitle)
content_tag :div, class: 'title-container' do
heading = content_tag(:h2, title, title: title)
next heading if subtitle.blank?
heading + content_tag(:p, subtitle, class: 'subtitle')
end
end
def dom_toolbar(&block)
return '' unless block_given?
content_tag :ul, id: 'toolbar-items' do
yield
end
end
end