leonardo 1.8.1 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,7 +1,6 @@
1
- 1.8.1 (October 10th, 2011) Marco Mastrodonato
2
- * Updated rspec to pass index view test with two new controller helpers
3
- * Date managed with datepicker are now in year-month-day format and now works with sqlite3
4
- * Added autosubmit class by default. A new function in custom.js let you to autosubmit searches on filter fields change event
1
+ 1.8.2 (October 10th, 2011) Marco Mastrodonato
2
+ * List: Added id as first column
3
+ * Replaced String.any? with String.size>0 for ruby 1.9.2 support
5
4
 
6
5
  TODO:
7
6
  * Lists: Multiple selection and multiple operation
@@ -12,6 +11,13 @@ TODO:
12
11
 
13
12
 
14
13
 
14
+ 1.8.1 (October 10th, 2011) Marco Mastrodonato
15
+ * Updated rspec to pass index view test with two new controller helpers
16
+ * Date managed with datepicker are now in year-month-day format and now works with sqlite3
17
+ * Added autosubmit class by default. A new function in custom.js let you to autosubmit searches on filter fields change event
18
+
19
+
20
+
15
21
  1.8.0 (October 7th, 2011) Marco Mastrodonato
16
22
  * Added sortable columns
17
23
 
@@ -6,6 +6,7 @@
6
6
  <table class='user' cellspacing='0'>
7
7
  <thead>
8
8
  <tr>
9
+ <th>#</th>
9
10
  <%- attributes.each do |attribute| -%>
10
11
  <%- attr_name = case attribute.type when :references, :belongs_to then "#{attribute.name}_id" else attribute.name end -%>
11
12
  <th><%%= sortable :<%= attr_name %>, t('attributes.<%= singular_table_name %>.<%= attribute.name %>'), remote %></th>
@@ -18,6 +19,7 @@
18
19
  <tbody>
19
20
  <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| -%>
20
21
  <tr id="tr<%%= <%= singular_table_name %>.id %>" class="<%%= cycle("odd", "even")%>">
22
+ <td><%%= number_with_delimiter <%= singular_table_name %>.id %></td>
21
23
  <%- attributes.each do |attribute| -%>
22
24
  <td><%= attribute_to_erb(attribute, singular_table_name) -%></td>
23
25
  <%- end -%>
@@ -4,7 +4,7 @@ module Utility
4
4
  def self.export(params={})
5
5
  require 'fastercsv'
6
6
 
7
- return "" unless params[:collection] && params[:collection].any?
7
+ return "" unless params[:collection] && params[:collection].size>0
8
8
  collection = add_collection params[:collection]
9
9
 
10
10
  head = params[:head]
@@ -72,7 +72,7 @@ module Leonardo
72
72
  def attribute_to_erb(attribute, object)
73
73
  case attribute.type
74
74
  when :boolean then "<%= #{object}.#{attribute.name} ? style_image_tag(\"ico_v.png\", :class => \"ico_true\") : style_image_tag(\"ico_x.png\", :class => \"ico_false\") %>"
75
- when :references, :belongs_to then "<%= link_to((#{object}.#{attribute.name}.try(:name) || \"\#{t('models.#{attribute.name}')} \#{#{object}.#{attribute.name}.try(:id)}\"), #{object}.#{attribute.name}, :remote => @remote) %>"
75
+ when :references, :belongs_to then "<%= link_to(#{object}.#{attribute.name}.try(:name) || \"#\#{#{object}.#{attribute.name}.try(:id)}\"), #{object}.#{attribute.name}, :remote => @remote) %>"
76
76
  when :integer then "<%= number_with_delimiter #{object}.#{attribute.name} %>"
77
77
  when :decimal then "<%= number_to_currency #{object}.#{attribute.name} %>"
78
78
  when :float then "<%= number_with_precision #{object}.#{attribute.name} %>"
@@ -193,7 +193,7 @@ module Leonardo
193
193
  resource = singular_table_name
194
194
  end
195
195
 
196
- prefix_namespace = ":" if prefix_namespace.empty? && prefix_parent.any?
196
+ prefix_namespace = ":" if prefix_namespace.empty? && prefix_parent.size>0
197
197
 
198
198
  if nested?
199
199
  (base_namespaces(prefix_namespace) + parent_resources(prefix_parent)) << "#{prefix_resource}#{resource}"
@@ -53,7 +53,7 @@ end
53
53
 
54
54
  end
55
55
 
56
- conditions = conditions_fields.join(' and ').to_a + conditions_values
56
+ conditions = [conditions_fields.join(' and ')] + conditions_values
57
57
 
58
58
  request.format = :csv if params[:commit] == 'Csv'
59
59
 
data/template.rb CHANGED
@@ -6,6 +6,7 @@
6
6
  # USAGE: rails new yourappname -m template.rb
7
7
  #
8
8
  # -------------------------------------------------------
9
+ # 27-10-2011: Replaced String.any? with String.size>0 for ruby 1.9.2 support
9
10
  # 05-10-2011: Added ajax option
10
11
  # 25-08-2011: Added rspec generation
11
12
  #########################################################
@@ -121,8 +122,8 @@ end
121
122
  if leolay
122
123
  generate "leolay",
123
124
  "cloudy",
124
- ("--main_color=#{leolay_main_color}" if leolay_main_color.any?),
125
- ("--second_color=#{leolay_second_color}" if leolay_second_color.any?),
125
+ ("--main_color=#{leolay_main_color}" if leolay_main_color.size>0),
126
+ ("--second_color=#{leolay_second_color}" if leolay_second_color.size>0),
126
127
  (cancan ? "" : "--skip-authorization"),
127
128
  (devise ? "" : "--skip-authentication"),
128
129
  (ajax ? "" : "--skip-jquery_ui"),
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leonardo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 1
10
- version: 1.8.1
9
+ - 2
10
+ version: 1.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marco Mastrodonato
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-10 00:00:00 Z
18
+ date: 2011-10-27 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: A generator for creating Rails 3.1 applications ready to go. It generates the layout, the style, the internationalization and manage external gems for authentication, authorization and other. It also provides a customized scaffold to generates cool sites ajax ready in few minutes. If you find a bug please report to m.mastrodonato@gmail.com