- click_remove = true if click_remove.nil?
- div_num ||= ""
- top_pad ||= false
- bottom_pad ||= false

%div{:id => "flash_msg_div#{div_num}", :style => ("display: none" unless @flash_array)}
  - if top_pad
    %div{:style => "padding-top: #{top_pad}px;"}
  - if @flash_array
    %div{:id      => "flash_text_div#{div_num}",
         :onclick => click_remove ? javascript_hide("flash_msg_div#{div_num}") : "",
         :title   => click_remove ? _("Click to remove messages") : ""}
      - @flash_array.each do |fl|
        - case fl[:level]
        - when :error
          .alert.alert-danger
            %span.pficon.pficon-error-circle-o
            %strong= h(fl[:message])
        - when :warning
          .alert.alert-warning
            %span.pficon-warning-triangle-o
            %strong= h(fl[:message])
        - when :info
          = render :partial => "layouts/info_msg",
                   :locals => {:message => h(fl[:message])}
        - else
          .alert.alert-success
            %span.pficon.pficon-ok
            %strong= h(fl[:message])
  - if bottom_pad
    %div{:style => "padding-top: #{bottom_pad}px;"}

- click_remove = true if click_remove.nil?
- div_num ||= ""
- top_pad ||= false
- bottom_pad ||= false

%div{:id => "flash_msg_div#{div_num}", :style => ("display: none" unless @flash_array)}
  - if top_pad
    %div{:style => "padding-top: #{top_pad}px;"}
  - if @flash_array
    %div{:id      => "flash_text_div#{div_num}"}
      - @flash_array.each do |fl|
        - case fl[:level]
        - when :error
          .alert.alert-danger.alert-dismissable
            %button.close{:data => {:dismiss => "alert"}}
              %span.pficon.pficon-close
            %span.pficon.pficon-error-circle-o
            %strong= h(fl[:message])
        - when :warning
          .alert.alert-warning.alert-dismissable
            %button.close{:data => {:dismiss => "alert"}}
              %span.pficon.pficon-close
            %span.pficon-warning-triangle-o
            %strong= h(fl[:message])
        - when :info
          = render :partial => "layouts/info_msg",
                   :locals => {:message => h(fl[:message])}
        - else
          .alert.alert-success.alert-dismissable
            %button.close{:data => {:dismiss => "alert"}}
              %span.pficon.pficon-close
            %span.pficon.pficon-ok
            %strong= h(fl[:message])
  - if bottom_pad
    %div{:style => "padding-top: #{bottom_pad}px;"}

Use PatternFly close button in flash messages
Use PatternFly close button in flash messages