vidl-toolbox 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/toolbox/config.rb +3 -3
- data/lib/toolbox/sorting.rb +1 -0
- data/lib/toolbox/version.rb +1 -1
- data/public/stylesheets/toolbox.css +1 -1
- data/view/toolbox/_list_row.html.erb +4 -7
- metadata +1 -1
data/lib/toolbox/config.rb
CHANGED
@@ -142,11 +142,11 @@ module Toolbox
|
|
142
142
|
:name => { :required => true, :type => [Symbol] },
|
143
143
|
:model_name => { :required => true, :type => [String] }
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
# Holds the configuration for a from control
|
147
147
|
class ControlConfig < Config
|
148
148
|
define_options :model_method => { :type => [Symbol, Proc]},
|
149
|
-
:text_method => { :type => [Symbol]},
|
149
|
+
:text_method => { :type => [Symbol]},
|
150
150
|
:suppress_label => { :default => false },
|
151
151
|
:label => { :type => [String] },
|
152
152
|
:name => { :required => true, :type => [Symbol] },
|
@@ -165,7 +165,7 @@ module Toolbox
|
|
165
165
|
:suppress_link => { :default => false },
|
166
166
|
:suppress_sorting => { :default => false },
|
167
167
|
:suppress_context_menu => { :default => false},
|
168
|
-
:order_by => { :type => [String] },
|
168
|
+
:order_by => { :type => [String, Array] },
|
169
169
|
:label => { :type => [String] },
|
170
170
|
:join => {},
|
171
171
|
:suffix => {},
|
data/lib/toolbox/sorting.rb
CHANGED
@@ -26,6 +26,7 @@ module Toolbox
|
|
26
26
|
if field
|
27
27
|
if field.order_by
|
28
28
|
order_by_string = field.order_by
|
29
|
+
order_by_string = order_by_string.join(" #{dir}, ") if order_by_string.is_a? Array
|
29
30
|
else
|
30
31
|
order_by_string = quote_order_by(field.model_name.tableize, field.name.to_s)
|
31
32
|
end
|
data/lib/toolbox/version.rb
CHANGED
@@ -2,12 +2,9 @@
|
|
2
2
|
<% rec = list_row %>
|
3
3
|
<tr id="<%= dom_id(rec) %>">
|
4
4
|
<% field_renderers.each do |field_renderer| %>
|
5
|
-
<td class="record <%= classAttr %>"
|
5
|
+
<td class="record <%= classAttr %>" onclick="window.location.href='<%= polymorphic_url(rec) %>';">
|
6
|
+
<%= field_renderer.render_value(rec) %>
|
7
|
+
</td>
|
6
8
|
<% end %>
|
7
|
-
<td>
|
8
|
-
<%= link_to image_tag('toolbox/show.gif'), polymorphic_url(rec) %>
|
9
|
-
<%= link_to image_tag('toolbox/edit.gif'), edit_polymorphic_url(rec) %>
|
10
|
-
<%= context_menu_link rec
|
11
|
-
%>
|
12
|
-
</td>
|
9
|
+
<td><%= context_menu_link rec %></td>
|
13
10
|
</tr>
|