semantic-rails-ui 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: e1dd48b12b6bc61b458c32e225e82b3fb3fe3a4f
4
- data.tar.gz: ddd68df407b59777cc1a2ffdb924e09c5273e345
3
+ metadata.gz: 58ca5b1b5fcbfd401eba23d722f93d04321d8dca
4
+ data.tar.gz: 4cd8edc27229b3d9cb22d8021dcb6ee621e33840
5
5
  SHA512:
6
- metadata.gz: 5db74ac2b66e4b8a403be3ae5b47cdfec8d263ad07f2c00282e7316a7ed88342de6b136139aee43631b17c664a2777412dcaba5b5aba6695238a1f72ab4911d4
7
- data.tar.gz: 22a9271187e3ad2e9cceef3dc7428f2dc79140ae1d7ded7dd2841ce9e21d14d9a65ab8906e4faaa2c8f9e23ad4578a7f693b04809c4b3bef940211b852d07531
6
+ metadata.gz: 65eebce97e2bcfe5b3c5c884bd2381c11034f816e0ba5220f7f628dfd9ac1d46f4ba3cc671ece8207a8ea6c5e5cb6ccf92ac25cdb498f5c1fb944ff019f23c18
7
+ data.tar.gz: d35c91b6398438e00cad638b16e7a2cbeacd58fefb5c5634b3faa30c655fd15d2c08f6f9320590aa33bbf744e924b13953f5c8ca46fb774f0adadcb742de9af6
@@ -6,8 +6,27 @@ module SemanticRailsUi
6
6
  # </h1>
7
7
  def ui_icon_header(title, icon_name)
8
8
  content_tag :h1, class: "ui header" do
9
- content_tag(:i, '', class: "#{icon_name} icon") + content_tag(:div, title, class: "content")
9
+ ui_icon(icon_name) + content_tag(:div, title, class: "content")
10
10
  end
11
11
  end
12
+
13
+ def ui_flash_messages
14
+ content_tag :div, class: "messages" do
15
+ messages = ""
16
+ flash.each do |name, msg|
17
+ messages += content_tag :div, class: "ui #{name} message" do
18
+ ui_icon("close") + content_tag(:div, class: "ui header") do
19
+ icon_name = name == 'error' || name == 'warning' ? :warning : :info
20
+ ui_icon("#{icon_name} circle") + content_tag(:div, msg, class: "content")
21
+ end
22
+ end
23
+ end
24
+ messages.html_safe
25
+ end
26
+ end
27
+
28
+ def ui_icon(icon_name)
29
+ content_tag(:i, '', class: "#{icon_name} icon")
30
+ end
12
31
  end
13
32
  end
@@ -1,3 +1,3 @@
1
1
  module SemanticRailsUi
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic-rails-ui
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
  - Igor Jancev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-10 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler