vidl-toolbox 0.0.2 → 0.0.3

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.
@@ -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 => {},
@@ -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
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Toolbox
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
@@ -9,7 +9,7 @@ td.record, td.record-title {
9
9
  tr:hover td.record {
10
10
  background-color: lightblue; /*#cc341f;*/
11
11
  color: black;
12
- /*cursor: pointer; */
12
+ cursor: pointer;
13
13
  /*border-left: solid 1px white;*/
14
14
  }
15
15
 
@@ -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 %>"><%= field_renderer.render_value(rec) %></td>
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>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidl-toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nyffenegger