diff options
| author | jpl | 2017-02-14 15:13:35 +0100 | 
|---|---|---|
| committer | jpl | 2017-02-14 15:22:39 +0100 | 
| commit | 95c84e2bbd743e7b2799550ef41a6dde91889aaa (patch) | |
| tree | ba9edad0b357296fd878ac005f27ee79c2e01484 /app/helpers/newapplication_helper.rb | |
| parent | d72d3a20e2faa2345d462ae64627b4cf46b6bb7b (diff) | |
| download | chouette-core-95c84e2bbd743e7b2799550ef41a6dde91889aaa.tar.bz2 | |
Refs #2600: adding definition list component
Diffstat (limited to 'app/helpers/newapplication_helper.rb')
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 20 | 
1 files changed, 20 insertions, 0 deletions
| diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index c13d64197..15c642ed7 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -235,6 +235,26 @@ module NewapplicationHelper      end    end +  # Definition list +  def definition_list title, test +    return unless test.present? + +    head = content_tag(:div, title, class: 'dl-head') + +    body = content_tag :div, class: 'dl-body' do +      cont = [] +      test.map do |k, v| +        cont << content_tag(:div, k, class: 'dl-term') +        cont << content_tag(:div, v, class: 'dl-def') +      end +      cont.join.html_safe +    end + +    content_tag :div, '', class: 'definition-list' do +      head + body +    end +  end +    # ModalBox Builder    def modalbox id, &block      content_tag(:div, '', class: 'modal fade', id: id, tabindex: 1, role: 'dialog') do | 
