def modal(id,
              header_text,
              header: "<button type='button' data-dismiss='modal' class='close'>&times;</button><h3>#{header_text}</h3>",
              footer_text: nil,
              footer: "<button class='btn' data-dismiss='modal' type='button'>#{footer_text||'Close'}</button>",
              width: nil,
              static: true,
              fullwidth: false,
              long: false,
              **options,
              &block)

      options.merge!(:'data-backdrop' => 'static', :'data-keyboard' => 'false') if static
      options.merge!(:'data-replace' => 'true') if long
      options.merge!(:'data-width' => width) if width
      options.merge!(id: id)

      div(merge_predef_class("modal hide fade #{fullwidth ? 'container' : ''}", options)) do
        content = ''
        content << div(class: 'modal-header') do
          header.html_safe
        end
        content << div(class: 'modal-body') do
          capture(&block) if block_given?
        end
        content << div(class: 'modal-footer') do
          footer.html_safe
        end
        content.html_safe
      end
    end
def modal(id,
              header_text,
              header: "<button type='button' data-dismiss='modal' class='close'>&times;</button><h3>#{header_text}</h3>",
              footer_text: nil,
              footer: "<button class='btn' data-dismiss='modal' type='button'>#{footer_text||'Close'}</button>",
              width: nil,
              static: true,
              fullwidth: false,
              long: false,
              **options,
              &block)

      options.merge!(:'data-backdrop' => 'static', :'data-keyboard' => 'false') if static
      options.merge!(:'data-replace' => 'true') if long
      options.merge!(:'data-width' => width) if width
      options.merge!(id: id)

      div(merge_predef_class("modal hide fade #{fullwidth ? 'container' : ''}", options)) do
        content = ''
        content << div(class: 'modal-header') do
          header.html_safe
        end
        content << div(class: 'modal-body') do
          capture(&block) if block_given?
        end
        content << div(class: 'modal-footer') do
          footer.html_safe
        end
        content.html_safe
      end
    end
Miscellaneous Lightweight utility components
 Public: Bootstrap modal component, wraps bootstrap-modal-rails gem to
         provide more features, see http://jschr.github.io/bootstrap-modal


 id          - String. HTML id attribute of the modal component.
 header_text - String. Text would be shown on the top of the modal.
 header      - String. Header of modal, a html string replaces
               default header.
 footer_text - String. Text would be shown on the bottom button of
               the modal. ( default: 'Close' )
 footer      - String. Footer of modal, a html string replaces default
               footer.
 width       - Integer. Width of modal.
 static      - Boolean. Static Background with Animation. ( default: true )
 fullwidth   - Boolean. Show full width modal. ( default: false )
 long        - Boolean. Show very long modal. ( default: false )
 options     - Other options can be accepted by div.
 block       - HTML block shows the content of the modal.

 Examples


 Returns the whole modal.