bootstrap_2_helpers 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f592470b40de41ae8127b026455acff727c02ab6
4
- data.tar.gz: 917da21d98d128915c835e58823d3ffc4ed1e376
3
+ metadata.gz: bc4938e203f45de7b2525fe72cf2f42554db7397
4
+ data.tar.gz: ee20eb6cdb7af95604a6520b7d267b7ebe156912
5
5
  SHA512:
6
- metadata.gz: df5dbed9e228430fc5c6d1056539beda07588c2c5112b594c47f8201550b3364c6b5e042e3bcbe12cebcb900212d5492f8e63a8a3623e4177ba8755f7ad2ac3d
7
- data.tar.gz: 27498156f5994bca36c741100a125936a55c09555b100dcb52356e894d7b0a17c7b43bb8e11580f37dbbb52d8e8ab12a70bd3c5f41141886812bbaf027961992
6
+ metadata.gz: dab565ead0e62ae0e6fed97368509db826e530823007ab4986c6a8c17e278e653859ade93a1b134a7184736b4fd00301a2fc18c64a748c4760d0930054b079db
7
+ data.tar.gz: dcc203c98183b826313e1232fd952afaea02283c8645e263db10709f0c072ae6d94e4c8c571fb3a715aa36f2807901684cb39bdf7385c5c8e7a6bd596c501618
@@ -1,15 +1,16 @@
1
- module BootstrapFlashHelper
1
+ module BootstrapFlashHelper
2
+ AVALIABLE_TYPES = %i(info success warning danger)
2
3
  def bootstrap_flash
3
4
  flash_messages = []
4
5
  flash.each do |type, message|
5
6
  # Skip Devise :timeout and :timedout flags
6
7
  next if type == :timeout
7
8
  next if type == :timedout
8
- type = :success if type == :notice
9
- type = :error if type == :alert
9
+ type = :error if type == :danger
10
+ use_type = AVALIABLE_TYPES.include?(type) ? type : :info
10
11
  text = content_tag(:div,
11
12
  content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") +
12
- message, :class => "alert fade in alert-#{type}")
13
+ message, :class => "alert fade in alert-#{use_type}")
13
14
  flash_messages << text if message
14
15
  end
15
16
  flash_messages.join("\n").html_safe
@@ -1,5 +1,4 @@
1
1
  module FlashBlockHelper
2
- AVAIABLE_TYPES = %w[info success warning danger]
3
2
  def flash_block
4
3
  output = ''
5
4
  flash.each do |type, message|
@@ -10,7 +9,6 @@ module FlashBlockHelper
10
9
  end
11
10
 
12
11
  def flash_container(type, message)
13
- use_type = AVAIABLE_TYPES.include?(type.to_s) ? type : 'info'
14
12
  raw(content_tag(:div, :class => "alert alert-#{use_type}") do
15
13
  content_tag(:a, raw("&times;"),:class => 'close', :data => {:dismiss => 'alert'}) +
16
14
  message
@@ -1,3 +1,3 @@
1
1
  module Bootstrap2Helpers
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_2_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvokka