usefull_table 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@ ToDo
|
|
3
3
|
- Add tip to cell
|
4
4
|
- Add option :excel => false to column to remove from excel export
|
5
5
|
- Add option [:export][:type] => :xls, :xlsx, :pdf, :all, [:xls, :xlsx]
|
6
|
+
- Add option [:export][:table] => true to have a backup of the table
|
7
|
+
- Add :if => Proc.new to condition column presence
|
8
|
+
|
9
|
+
BugToFix
|
10
|
+
- : link :name=> "pippo", body_type => icon, :url => "my_url" do not render default icons if not passed in yml
|
6
11
|
|
7
12
|
BugToFix
|
8
13
|
1.0.1 (June 29, 2012)
|
data/Gemfile
CHANGED
@@ -1,27 +1,14 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
#gem "acts_as_xls", :path => "/home/apps/rails_apps/gems/acts_as_xls"
|
5
|
-
#gem "acts_as_monitor", :path => "/home/apps/rails_apps/gems/acts_as_monitor"
|
6
|
-
gem "rails", "3.0.9"
|
7
|
-
#gem "in_place_editing"
|
3
|
+
gem "rails", "3.0.14"
|
8
4
|
|
9
|
-
group :development do
|
10
|
-
gem "acts_as_monitor", :path => "/home/
|
11
|
-
gem "acts_as_xls", :path => "/home/
|
5
|
+
group :development, :test do
|
6
|
+
gem "acts_as_monitor", :path => "/home/www/gems/acts_as_monitor"
|
7
|
+
gem "acts_as_xls", :path => "/home/www/gems/acts_as_xls"
|
12
8
|
gem "meta_search"
|
13
9
|
gem "will_paginate"
|
14
10
|
gem "ruby-debug"
|
15
|
-
end
|
16
|
-
|
17
|
-
group :test do
|
18
|
-
gem "acts_as_monitor", :path => "/home/apps/rails_apps/gems/acts_as_monitor"
|
19
|
-
gem "acts_as_xls", :path => "/home/apps/rails_apps/gems/acts_as_xls"
|
20
11
|
gem "capybara", ">= 0.4.0"
|
21
|
-
gem "meta_search"
|
22
|
-
gem "will_paginate"
|
23
|
-
gem "ruby-debug"
|
24
12
|
end
|
25
13
|
|
26
|
-
|
27
14
|
gemspec
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
=UsefullTable
|
2
|
-
table_for generate a full-optionals table, with excel export, columns ordering, links, inline
|
3
|
-
but don't warry because a rich set of defaults, make its use very simple
|
2
|
+
table_for generate a full-optionals table, with excel export, columns ordering, links, inline editing and monitoring (ActsAsMonitor https://github.com/skylord73/acts_as_monitor)
|
3
|
+
but don't warry because a rich set of defaults, make its use very simple!
|
4
4
|
|
5
5
|
for a working sample please refer to test/dummy
|
6
6
|
|
@@ -166,7 +166,6 @@ Create a link to something, using Icons or CustomText
|
|
166
166
|
<% t.link :name => "Custom Link", :body_typ => :icon, :url => Proc.new {|object| my_link_home_path(object) }"%> #icon link with icon name = usefull_table_cusom_link.png or localization in usefull_table.icons.custom_link
|
167
167
|
|
168
168
|
===Options
|
169
|
-
|
170
169
|
:url =>
|
171
170
|
- Proc
|
172
171
|
- "my_custom_static_url"
|
@@ -2,54 +2,53 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
2
2
|
# GET <%= route_url %>
|
3
3
|
# GET <%= route_url %>.xml
|
4
4
|
def index
|
5
|
-
|
6
|
-
|
5
|
+
@search = <%=class_name%>.search(params[:search])
|
6
|
+
@<%= plural_table_name %> = @search.paginate(:page => params[:page])
|
7
7
|
|
8
|
-
respond_to do |format|
|
9
|
-
format.html # index.html.erb
|
10
|
-
format.xml { render :xml => @<%= plural_table_name %> }
|
11
|
-
end
|
8
|
+
respond_to do |format|
|
9
|
+
format.html # index.html.erb
|
10
|
+
format.xml { render :xml => @<%= plural_table_name %> }
|
11
|
+
end
|
12
12
|
end
|
13
13
|
|
14
|
-
# GET <%= route_url %>/1
|
15
|
-
# GET <%= route_url %>/1.xml
|
16
|
-
def show
|
17
|
-
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
14
|
+
# GET <%= route_url %>/1
|
15
|
+
# GET <%= route_url %>/1.xml
|
16
|
+
def show
|
17
|
+
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
18
18
|
|
19
|
-
respond_to do |format|
|
20
|
-
format.html # show.html.erb
|
21
|
-
format.xml { render :xml => @<%= singular_table_name %> }
|
22
|
-
end
|
23
|
-
end
|
19
|
+
respond_to do |format|
|
20
|
+
format.html # show.html.erb
|
21
|
+
format.xml { render :xml => @<%= singular_table_name %> }
|
22
|
+
end
|
23
|
+
end
|
24
24
|
|
25
|
-
# GET <%= route_url %>/new
|
25
|
+
# GET <%= route_url %>/new
|
26
26
|
# GET <%= route_url %>/new.xml
|
27
27
|
def new
|
28
28
|
@<%= singular_table_name %> = <%= orm_class.build(class_name) %>
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.xml { render :xml => @<%= singular_table_name %> }
|
32
|
+
end
|
33
|
+
end
|
29
34
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# GET <%= route_url %>/1/edit
|
37
|
-
def edit
|
38
|
-
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
39
|
-
end
|
35
|
+
# GET <%= route_url %>/1/edit
|
36
|
+
def edit
|
37
|
+
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
38
|
+
end
|
40
39
|
|
41
|
-
# POST <%= route_url %>
|
42
|
-
# POST <%= route_url %>.xml
|
40
|
+
# POST <%= route_url %>
|
41
|
+
# POST <%= route_url %>.xml
|
43
42
|
def create
|
44
43
|
@<%= singular_table_name %> = <%= orm_class.build(class_name, "params[:#{singular_table_name}]") %>
|
45
44
|
|
46
|
-
respond_to do |format|
|
47
|
-
if @<%= orm_instance.save %>
|
48
|
-
format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_name %> was successfully created.') }
|
45
|
+
respond_to do |format|
|
46
|
+
if @<%= orm_instance.save %>
|
47
|
+
format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_name %> was successfully created.') }
|
49
48
|
format.xml { render :xml => @<%= singular_table_name %>, :status => :created, :location => @<%= singular_table_name %> }
|
50
|
-
else
|
51
|
-
format.html { render :action => "new" }
|
52
|
-
|
49
|
+
else
|
50
|
+
format.html { render :action => "new" }
|
51
|
+
format.xml { render :xml => @<%= orm_instance.errors %>, :status => :unprocessable_entity }
|
53
52
|
end
|
54
53
|
end
|
55
54
|
end
|
@@ -59,9 +58,9 @@ format.html { render :action => "new" }
|
|
59
58
|
def update
|
60
59
|
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
61
60
|
|
62
|
-
respond_to do |format|
|
63
|
-
if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
|
64
|
-
format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_name %> was successfully updated.') }
|
61
|
+
respond_to do |format|
|
62
|
+
if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
|
63
|
+
format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_name %> was successfully updated.') }
|
65
64
|
format.xml { head :ok }
|
66
65
|
else
|
67
66
|
format.html { render :action => "edit" }
|
@@ -70,15 +69,15 @@ format.html { redirect_to(@<%= singular_table_name %>, :notice => '<%= human_nam
|
|
70
69
|
end
|
71
70
|
end
|
72
71
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
@<%= orm_instance.destroy %>
|
72
|
+
# DELETE <%= route_url %>/1
|
73
|
+
# DELETE <%= route_url %>/1.xml
|
74
|
+
def destroy
|
75
|
+
@<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
|
76
|
+
@<%= orm_instance.destroy %>
|
78
77
|
|
79
|
-
respond_to do |format|
|
80
|
-
format.html { redirect_to(<%= index_helper %>_url) }
|
81
|
-
|
82
|
-
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to(<%= index_helper %>_url) }
|
80
|
+
format.xml { head :ok }
|
81
|
+
end
|
83
82
|
end
|
84
83
|
end
|
@@ -201,7 +201,7 @@ module UsefullTable
|
|
201
201
|
# <% t.show :url => Proc.new {|object| home_path(object) }"%>
|
202
202
|
# <% t.destroy :url => Proc.new {|object| home_path(object) }"%>
|
203
203
|
# <% t.link :name => "Custom Link", :url => Proc.new {|object| my_link_home_path(object) }"%> #text link (Custom Link) to url
|
204
|
-
# <% t.link :name =>
|
204
|
+
# <% t.link :name =>"Custom Link", :body_type => :icon, :url => Proc.new {|object| my_link_home_path(object) }"%> #icon link with icon name = usefull_table_cusom_link.png or localization in usefull_table.icons.custom_link
|
205
205
|
#
|
206
206
|
#==Options
|
207
207
|
# :url => Proc or string
|
@@ -375,6 +375,7 @@ module UsefullTable
|
|
375
375
|
out_html = attribute_inline(obj,attribute,a) if attribute[:inline] == true
|
376
376
|
when :link
|
377
377
|
#url = attribute[:url].kind_of?(Proc) ? attribute[:url].call(obj) : attribute[:url]
|
378
|
+
#Rails::logger.info("TableBuilder#body a=#{a.inspect}, item=#{obj.BollaXENrDoC} or #{obj.activity.id}, id_bolla=#{obj.id}, attribute=#{attribute.inspect}")
|
378
379
|
out_html = a.blank? ? a : @template.link_to(a, attribute[:url].kind_of?(Proc) ? attribute[:url].call(obj) : attribute[:url] )
|
379
380
|
#out_html = @template.link_to(a, url)
|
380
381
|
when :flag
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usefull_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrea Bignozzi
|
@@ -15,27 +15,26 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
19
|
-
default_executable:
|
18
|
+
date: 2012-07-13 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
22
|
none: false
|
24
23
|
requirements:
|
25
24
|
- - "="
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
hash:
|
26
|
+
hash: 27
|
28
27
|
segments:
|
29
28
|
- 3
|
30
29
|
- 0
|
31
|
-
-
|
32
|
-
version: 3.0.
|
30
|
+
- 14
|
31
|
+
version: 3.0.14
|
33
32
|
type: :runtime
|
34
|
-
|
33
|
+
requirement: *id001
|
35
34
|
prerelease: false
|
36
|
-
|
35
|
+
name: rails
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
|
-
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
40
39
|
requirements:
|
41
40
|
- - ">="
|
@@ -45,9 +44,9 @@ dependencies:
|
|
45
44
|
- 0
|
46
45
|
version: "0"
|
47
46
|
type: :runtime
|
48
|
-
|
47
|
+
requirement: *id002
|
49
48
|
prerelease: false
|
50
|
-
|
49
|
+
name: acts_as_xls
|
51
50
|
description: Table Helper with Excel export, inline editing and monitoring funxtions
|
52
51
|
email:
|
53
52
|
- skylord73@gmail.com
|
@@ -85,7 +84,6 @@ files:
|
|
85
84
|
- Gemfile
|
86
85
|
- README.rdoc
|
87
86
|
- CHANGELOG.md
|
88
|
-
has_rdoc: true
|
89
87
|
homepage:
|
90
88
|
licenses: []
|
91
89
|
|
@@ -115,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
113
|
requirements: []
|
116
114
|
|
117
115
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.8.24
|
119
117
|
signing_key:
|
120
118
|
specification_version: 3
|
121
119
|
summary: Table Helper with Excel export, inline editing and monitoring funxtions
|