admino 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/admino/table/resource_row.rb +1 -1
- data/lib/admino/version.rb +1 -1
- data/spec/admino/table/resource_row_spec.rb +21 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe0d128c8350787165c4d23c7e9615df3475b4a9
|
4
|
+
data.tar.gz: 7e5bf3ecf69f2f45152ac342d8effbbdff5bb41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed53f3c1ad99454097045f3662f92db7766cdaf24cba9f78165fb3a784ec58c9a733f2d4ec62cbeb5303f7c5672c94fc30f7a70fa36c7ced3d99e1748246ded
|
7
|
+
data.tar.gz: ae0e7e38ac6fa22b2e1ed394b2ccc2fd2ac198b204a5ec7362033716bf671408eb5d828e703a9bc26306fdda224f4b7901ab7cce2c135d8faad504a010325e54
|
data/CHANGELOG.md
CHANGED
@@ -93,7 +93,7 @@ module Admino
|
|
93
93
|
|
94
94
|
def complete_action_html_options(action_name, final_html_options)
|
95
95
|
if action_name
|
96
|
-
default_options =
|
96
|
+
default_options = action_html_options(action_name)
|
97
97
|
html_options = Showcase::Helpers::HtmlOptions.new(default_options)
|
98
98
|
|
99
99
|
action_html_options_method = "#{action_name}_action_html_options"
|
data/lib/admino/version.rb
CHANGED
@@ -53,6 +53,21 @@ module Admino
|
|
53
53
|
it 'uses it to build attributes' do
|
54
54
|
should have_tag(:td, with: { class: 'title' })
|
55
55
|
end
|
56
|
+
|
57
|
+
context 'with a class that implements a <action_name>_html_options' do
|
58
|
+
let(:row) { row_subclass.new(resource, view) }
|
59
|
+
let(:row_subclass) do
|
60
|
+
Class.new(ResourceRow) do
|
61
|
+
def column_html_options(action_name)
|
62
|
+
{ class: 'attribute' }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'renders them as attributes' do
|
68
|
+
should have_tag(:td, with: { class: 'attribute title' })
|
69
|
+
end
|
70
|
+
end
|
56
71
|
end
|
57
72
|
end
|
58
73
|
|
@@ -178,14 +193,18 @@ module Admino
|
|
178
193
|
let(:row) { row_subclass.new(resource, view) }
|
179
194
|
let(:row_subclass) do
|
180
195
|
Class.new(ResourceRow) do
|
181
|
-
def
|
196
|
+
def action_html_options(action_name)
|
182
197
|
{ class: 'button' }
|
183
198
|
end
|
199
|
+
|
200
|
+
def show_action_html_options
|
201
|
+
{ class: 'show-button' }
|
202
|
+
end
|
184
203
|
end
|
185
204
|
end
|
186
205
|
|
187
206
|
it 'renders them as attributes' do
|
188
|
-
should have_tag(:a, with: { class: 'foo button' })
|
207
|
+
should have_tag(:a, with: { class: 'foo show-button button' })
|
189
208
|
end
|
190
209
|
end
|
191
210
|
end
|