toolsmith 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +11 -0
- data/lib/toolsmith/version.rb +1 -1
- data/lib/toolsmith/views/page_header.rb +10 -4
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.0.14
|
4
|
+
|
5
|
+
* Adds more flexibility to the PageHeader#button method to allow definition of button properties based on arguments.
|
6
|
+
For Example:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
header.button "Title", "/path", "icon"
|
10
|
+
```
|
11
|
+
|
12
|
+
This change is backwards compatible with the hash structure option.
|
13
|
+
|
3
14
|
## v0.0.13
|
4
15
|
|
5
16
|
* Add definition_list_for helper for creating lists with only attribute names.
|
data/lib/toolsmith/version.rb
CHANGED
@@ -11,14 +11,16 @@ module Toolsmith
|
|
11
11
|
@subtitle = args.first
|
12
12
|
end
|
13
13
|
|
14
|
-
def button(
|
15
|
-
|
16
|
-
buttons <<
|
14
|
+
def button(*args)
|
15
|
+
button_options = args.size >= 3 ? button_options(*args) : args.shift
|
16
|
+
buttons << button_options
|
17
|
+
|
18
|
+
button_options
|
17
19
|
end
|
18
20
|
|
19
21
|
def button_markup(options)
|
20
22
|
anchor_options = options.fetch(:anchor, {})
|
21
|
-
context.link_to options[:path], anchor_options.merge(class: "btn"
|
23
|
+
context.link_to options[:path], anchor_options.merge(class: "btn", title: options[:title]) do
|
22
24
|
content_tag :i, "", class: "icon-#{options[:icon]}"
|
23
25
|
end
|
24
26
|
end
|
@@ -51,6 +53,10 @@ module Toolsmith
|
|
51
53
|
end.html_join
|
52
54
|
end
|
53
55
|
end
|
56
|
+
|
57
|
+
def button_options(title, path, icon, options={})
|
58
|
+
options.merge(title: title, path: path, icon: icon)
|
59
|
+
end
|
54
60
|
end
|
55
61
|
end
|
56
62
|
end
|