ajax_scaffold_generator 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -7
- data/MIT-LICENSE +20 -20
- data/README +5 -30
- data/ajax_scaffold_generator.rb +201 -201
- data/templates/add.gif +0 -0
- data/templates/ajax_scaffold.css +476 -479
- data/templates/ajax_scaffold.js +125 -125
- data/templates/controller.rb +135 -135
- data/templates/form.rhtml +3 -3
- data/templates/functional_test.rb +6 -6
- data/templates/indicator-small.gif +0 -0
- data/templates/indicator.gif +0 -0
- data/templates/lib_ajax_scaffold.rb +218 -218
- data/templates/partial_column_headings.rhtml +16 -16
- data/templates/partial_item.rhtml +22 -22
- data/templates/partial_new_edit.rhtml +39 -39
- data/templates/partial_pagination_links.rhtml +15 -15
- data/templates/rjs_cancel.rjs +11 -11
- data/templates/unit_test.rb +53 -53
- data/templates/view_component.rhtml +49 -49
- data/templates/warning.gif +0 -0
- metadata +2 -2
@@ -1,218 +1,218 @@
|
|
1
|
-
module AjaxScaffold
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
def
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
def
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
end
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
end
|
146
|
-
|
147
|
-
def
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
end
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
class ActiveRecord::Base
|
207
|
-
extend AjaxScaffold::Model::ClassMethods
|
208
|
-
|
209
|
-
@scaffold_columns = nil
|
210
|
-
def self.scaffold_columns
|
211
|
-
@scaffold_columns ||= build_scaffold_columns
|
212
|
-
end
|
213
|
-
|
214
|
-
@scaffold_columns_hash = nil
|
215
|
-
def self.scaffold_columns_hash
|
216
|
-
@scaffold_columns_hash ||= build_scaffold_columns_hash
|
217
|
-
end
|
218
|
-
end
|
1
|
+
module AjaxScaffold # :nodoc:
|
2
|
+
class ScaffoldColumn
|
3
|
+
attr_reader :name, :eval, :sort_sql, :label, :class_name, :sanitize
|
4
|
+
|
5
|
+
# Only options[:name] is required. It will infer the eval and sort values
|
6
|
+
# based on the given class.
|
7
|
+
def initialize(klass, options)
|
8
|
+
@name = options[:name]
|
9
|
+
@eval = options[:eval].nil? ? "#{Inflector.underscore(klass.to_s)}.#{@name}" : options[:eval]
|
10
|
+
@label = options[:label].nil? ? Inflector.titleize(@name) : options[:label]
|
11
|
+
@sortable = options[:sortable].nil? ? true : options[:sortable]
|
12
|
+
@sort_sql = options[:sort_sql].nil? ? "#{klass.table_name}.#{@name}" : options[:sort_sql] unless !@sortable
|
13
|
+
@class_name = options[:class_name].nil? ? "" : options[:class_name]
|
14
|
+
@sanitize = options[:sanitize].nil? ? true : options[:sanitize]
|
15
|
+
end
|
16
|
+
|
17
|
+
def sanitize?
|
18
|
+
@sanitize
|
19
|
+
end
|
20
|
+
|
21
|
+
def sortable?
|
22
|
+
@sortable
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
module Common
|
28
|
+
def current_sort(params)
|
29
|
+
session[params[:scaffold_id]][:sort]
|
30
|
+
end
|
31
|
+
|
32
|
+
def current_sort_direction(params)
|
33
|
+
session[params[:scaffold_id]][:sort_direction]
|
34
|
+
end
|
35
|
+
|
36
|
+
def current_page(params)
|
37
|
+
session[params[:scaffold_id]][:page]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Controller
|
42
|
+
|
43
|
+
def clear_flashes
|
44
|
+
if request.xhr?
|
45
|
+
flash.keys.each do |flash_key|
|
46
|
+
flash[flash_key] = nil
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def default_per_page
|
52
|
+
25
|
53
|
+
end
|
54
|
+
|
55
|
+
def store_or_get_from_session(id_key, value_key)
|
56
|
+
session[id_key][value_key] = params[value_key] if !params[value_key].nil?
|
57
|
+
params[value_key] ||= session[id_key][value_key]
|
58
|
+
end
|
59
|
+
|
60
|
+
def update_params(options)
|
61
|
+
@scaffold_id = params[:scaffold_id] ||= options[:default_scaffold_id]
|
62
|
+
session[@scaffold_id] ||= {:sort => options[:default_sort], :sort_direction => options[:default_sort_direction], :page => 1}
|
63
|
+
|
64
|
+
store_or_get_from_session(@scaffold_id, :sort)
|
65
|
+
store_or_get_from_session(@scaffold_id, :sort_direction)
|
66
|
+
store_or_get_from_session(@scaffold_id, :page)
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
module Helper
|
72
|
+
include AjaxScaffold::Common
|
73
|
+
|
74
|
+
def format_column(column_value, sanitize = true)
|
75
|
+
if column_empty?(column_value)
|
76
|
+
empty_column_text
|
77
|
+
elsif column_value.instance_of? Time
|
78
|
+
format_time(column_value)
|
79
|
+
elsif column_value.instance_of? Date
|
80
|
+
format_date(column_value)
|
81
|
+
else
|
82
|
+
sanitize ? h(column_value.to_s) : column_value.to_s
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def format_time(time)
|
87
|
+
time.strftime("%m/%d/%Y %I:%M %p")
|
88
|
+
end
|
89
|
+
|
90
|
+
def format_date(date)
|
91
|
+
date.strftime("%m/%d/%Y")
|
92
|
+
end
|
93
|
+
|
94
|
+
def column_empty?(column_value)
|
95
|
+
column_value.nil? || (column_value.empty? rescue false)
|
96
|
+
end
|
97
|
+
|
98
|
+
def empty_column_text
|
99
|
+
"-"
|
100
|
+
end
|
101
|
+
|
102
|
+
# Generates a temporary id for creating a new element
|
103
|
+
def generate_temporary_id
|
104
|
+
(Time.now.to_f*1000).to_i.to_s
|
105
|
+
end
|
106
|
+
|
107
|
+
def pagination_ajax_links(paginator, params)
|
108
|
+
pagination_links_each(paginator, {}) do |n|
|
109
|
+
link_to_remote n,
|
110
|
+
{ :url => params.merge(:page => n ),
|
111
|
+
:loading => "Element.show('#{loading_indicator_id(params.merge(:action => 'pagination'))}');",
|
112
|
+
:update => scaffold_content_id(params) },
|
113
|
+
{ :href => url_for(params.merge(:page => n )) }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def column_sort_direction(column_name, params)
|
118
|
+
if column_name && column_name == current_sort(params)
|
119
|
+
current_sort_direction(params) == "asc" ? "desc" : "asc"
|
120
|
+
else
|
121
|
+
"asc"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def column_class(column_name, column_value, sort_column, class_name = nil)
|
126
|
+
class_name = String.new
|
127
|
+
class_name += "empty " if column_empty?(column_value)
|
128
|
+
class_name += "sorted " if (!sort_column.nil? && column_name == sort_column)
|
129
|
+
class_name += "#{class_name} " unless class_name.nil?
|
130
|
+
class_name
|
131
|
+
end
|
132
|
+
|
133
|
+
def loading_indicator_tag(options)
|
134
|
+
image_tag "indicator.gif", :style => "display:none;", :id => loading_indicator_id(options), :alt => "loading indicator", :class => "loading-indicator"
|
135
|
+
end
|
136
|
+
|
137
|
+
# The following are a bunch of helper methods to produce the common scaffold view id's
|
138
|
+
|
139
|
+
def scaffold_content_id(options)
|
140
|
+
"#{options[:scaffold_id]}-content"
|
141
|
+
end
|
142
|
+
|
143
|
+
def scaffold_column_header_id(options)
|
144
|
+
"#{options[:scaffold_id]}-#{options[:column_name]}-column"
|
145
|
+
end
|
146
|
+
|
147
|
+
def scaffold_tbody_id(options)
|
148
|
+
"#{options[:scaffold_id]}-tbody"
|
149
|
+
end
|
150
|
+
|
151
|
+
def scaffold_messages_id(options)
|
152
|
+
"#{options[:scaffold_id]}-messages"
|
153
|
+
end
|
154
|
+
|
155
|
+
def empty_message_id(options)
|
156
|
+
"#{options[:scaffold_id]}-empty-message"
|
157
|
+
end
|
158
|
+
|
159
|
+
def element_row_id(options)
|
160
|
+
"#{options[:scaffold_id]}-#{options[:action]}-#{options[:id]}-row"
|
161
|
+
end
|
162
|
+
|
163
|
+
def element_cell_id(options)
|
164
|
+
"#{options[:scaffold_id]}-#{options[:action]}-#{options[:id]}-cell"
|
165
|
+
end
|
166
|
+
|
167
|
+
def element_form_id(options)
|
168
|
+
"#{options[:scaffold_id]}-#{options[:action]}-#{options[:id]}-form"
|
169
|
+
end
|
170
|
+
|
171
|
+
def loading_indicator_id(options)
|
172
|
+
if options[:id].nil?
|
173
|
+
"#{options[:scaffold_id]}-#{options[:action]}-loading-indicator"
|
174
|
+
else
|
175
|
+
"#{options[:scaffold_id]}-#{options[:action]}-#{options[:id]}-loading-indicator"
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def element_messages_id(options)
|
180
|
+
"#{options[:scaffold_id]}-#{options[:action]}-#{options[:id]}-messages"
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
module Model
|
185
|
+
module ClassMethods
|
186
|
+
|
187
|
+
def build_scaffold_columns
|
188
|
+
scaffold_columns = Array.new
|
189
|
+
content_columns.each do |column|
|
190
|
+
scaffold_columns << ScaffoldColumn.new(self, { :name => column.name })
|
191
|
+
end
|
192
|
+
scaffold_columns
|
193
|
+
end
|
194
|
+
|
195
|
+
def build_scaffold_columns_hash
|
196
|
+
scaffold_columns_hash = Hash.new
|
197
|
+
scaffold_columns.each do |scaffold_column|
|
198
|
+
scaffold_columns_hash[scaffold_column.name] = scaffold_column
|
199
|
+
end
|
200
|
+
scaffold_columns_hash
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
class ActiveRecord::Base
|
207
|
+
extend AjaxScaffold::Model::ClassMethods
|
208
|
+
|
209
|
+
@scaffold_columns = nil
|
210
|
+
def self.scaffold_columns
|
211
|
+
@scaffold_columns ||= build_scaffold_columns
|
212
|
+
end
|
213
|
+
|
214
|
+
@scaffold_columns_hash = nil
|
215
|
+
def self.scaffold_columns_hash
|
216
|
+
@scaffold_columns_hash ||= build_scaffold_columns_hash
|
217
|
+
end
|
218
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
<%% for scaffold_column in scaffold_columns %>
|
2
|
-
<%% column_sort_direction = column_sort_direction(scaffold_column.name, params) %>
|
3
|
-
<%% sort_params = params.merge(:controller => '<%= controller_file_path %>', :action => 'component_update', :sort => scaffold_column.name, :sort_direction => column_sort_direction, :page => 1) %>
|
4
|
-
<%% column_header_id = scaffold_column_header_id(sort_params.merge(:column_name => scaffold_column.name)) %>
|
5
|
-
<th id="<%%= column_header_id %>" <%%= "class=\"sorted #{current_sort_direction(params)}\"" if scaffold_column.name == current_sort(params) %>>
|
6
|
-
<%% if scaffold_column.sortable? %>
|
7
|
-
<%%= link_to_remote scaffold_column.label,
|
8
|
-
{ :url => sort_params,
|
9
|
-
:loading => "Element.addClassName('#{column_header_id}','loading');",
|
10
|
-
:update => scaffold_content_id(sort_params) },
|
11
|
-
{ :href => url_for(sort_params) } %>
|
12
|
-
<%% else %>
|
13
|
-
<p><%%= scaffold_column.label %></p>
|
14
|
-
<%% end %>
|
15
|
-
</th>
|
16
|
-
<%% end %>
|
1
|
+
<%% for scaffold_column in scaffold_columns %>
|
2
|
+
<%% column_sort_direction = column_sort_direction(scaffold_column.name, params) %>
|
3
|
+
<%% sort_params = params.merge(:controller => '<%= controller_file_path %>', :action => 'component_update', :sort => scaffold_column.name, :sort_direction => column_sort_direction, :page => 1) %>
|
4
|
+
<%% column_header_id = scaffold_column_header_id(sort_params.merge(:column_name => scaffold_column.name)) %>
|
5
|
+
<th id="<%%= column_header_id %>" <%%= "class=\"sorted #{current_sort_direction(params)}\"" if scaffold_column.name == current_sort(params) %>>
|
6
|
+
<%% if scaffold_column.sortable? %>
|
7
|
+
<%%= link_to_remote scaffold_column.label,
|
8
|
+
{ :url => sort_params,
|
9
|
+
:loading => "Element.addClassName('#{column_header_id}','loading');",
|
10
|
+
:update => scaffold_content_id(sort_params) },
|
11
|
+
{ :href => url_for(sort_params) } %>
|
12
|
+
<%% else %>
|
13
|
+
<p><%%= scaffold_column.label %></p>
|
14
|
+
<%% end %>
|
15
|
+
</th>
|
16
|
+
<%% end %>
|
17
17
|
<th></th>
|
@@ -3,34 +3,34 @@
|
|
3
3
|
<%% @options = params.merge(:controller => '<%= controller_file_path %>', :action => "view", :id => <%= singular_name %>.send("#{<%= model_name %>.primary_key}")) %>
|
4
4
|
|
5
5
|
<tr <%%= classAttr %> id="<%%= element_row_id(@options) %>" <%%= "style=\"display: none;\"" if hidden %>>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
<%% for scaffold_column in scaffold_columns %>
|
7
|
+
<%% column_value = eval(scaffold_column.eval) rescue nil %>
|
8
|
+
<td class="<%%= column_class(scaffold_column.name, column_value, current_sort(params), scaffold_column.class_name) %>" >
|
9
|
+
<%%= format_column(column_value, scaffold_column.sanitize?) %>
|
10
|
+
</td>
|
11
|
+
<%% end %>
|
12
12
|
<td class="actions">
|
13
13
|
<table cellpadding="0" cellspacing="0">
|
14
14
|
<tr>
|
15
15
|
<td class="indicator-container">
|
16
16
|
<%%= loading_indicator_tag(@options) %>
|
17
17
|
</td>
|
18
|
-
<td>
|
18
|
+
<td>
|
19
19
|
<%% edit_options = @options.merge(:action => 'edit') %>
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
20
|
+
<%%= link_to_remote "Edit",
|
21
|
+
{ :url => edit_options,
|
22
|
+
:loading => "Element.show('#{loading_indicator_id(@options)}');" },
|
23
|
+
{ :href => url_for(edit_options) } %>
|
24
|
+
</td>
|
25
|
+
<td>
|
26
|
+
<%% delete_options = @options.merge(:action => 'destroy') %>
|
27
|
+
<%%= link_to_remote "Delete",
|
28
|
+
{ :url => delete_options,
|
29
|
+
:confirm => 'Are you sure?',
|
30
|
+
:loading => "Element.show('#{loading_indicator_id(@options)}');" },
|
31
|
+
{ :href => url_for( delete_options ) } %>
|
32
|
+
</td>
|
33
|
+
</tr>
|
34
|
+
</table>
|
35
35
|
</td>
|
36
36
|
</tr>
|
@@ -1,40 +1,40 @@
|
|
1
|
-
<%% if not request.xhr? %>
|
2
|
-
<table class="ajax-scaffold" cellpadding="0" cellspacing="0">
|
3
|
-
<tbody>
|
4
|
-
<%% end %>
|
5
|
-
<tr id="<%%= element_row_id(@options) %>" <%%= "style=\"display:none;\"" if request.xhr? %>>
|
6
|
-
<td id="<%%= element_cell_id(@options) %>" class="<%%= @options[:action] %>" colspan="<%%= num_columns %>">
|
7
|
-
|
8
|
-
<%%= form_remote_tag :url => @options.merge(:controller => '<%= controller_file_path %>'),
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<%%= hidden_field_tag "scaffold_id", @options[:scaffold_id] %>
|
14
|
-
|
15
|
-
<h4><%%= Inflector.titleize(@options[:action]) %> <%= Inflector.titleize(singular_name) %></h4>
|
16
|
-
|
17
|
-
<%% if request.xhr? %>
|
18
|
-
<div id="<%%= element_messages_id(@options) %>" class="messages-container"></div>
|
19
|
-
<%% else %>
|
20
|
-
<%%= render :partial => 'form_messages' %>
|
21
|
-
<%% end %>
|
22
|
-
|
23
|
-
<%%= render :partial => 'form' %>
|
24
|
-
|
25
|
-
<p class="form-footer">
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<%%= end_form_tag %>
|
35
|
-
</td>
|
36
|
-
</tr>
|
37
|
-
<%% if not request.xhr? %>
|
38
|
-
</tbody>
|
39
|
-
</table>
|
1
|
+
<%% if not request.xhr? %>
|
2
|
+
<table class="ajax-scaffold" cellpadding="0" cellspacing="0">
|
3
|
+
<tbody>
|
4
|
+
<%% end %>
|
5
|
+
<tr id="<%%= element_row_id(@options) %>" <%%= "style=\"display:none;\"" if request.xhr? %>>
|
6
|
+
<td id="<%%= element_cell_id(@options) %>" class="<%%= @options[:action] %>" colspan="<%%= num_columns %>">
|
7
|
+
|
8
|
+
<%%= form_remote_tag :url => @options.merge(:controller => '<%= controller_file_path %>'),
|
9
|
+
:loading => "Element.show('#{loading_indicator_id(@options)}'); Form.disable('#{element_form_id(@options)}');",
|
10
|
+
:html => { :href => url_for(@options.merge(:controller => '<%= controller_file_path %>')),
|
11
|
+
:id => element_form_id(@options) } %>
|
12
|
+
|
13
|
+
<%%= hidden_field_tag "scaffold_id", @options[:scaffold_id] %>
|
14
|
+
|
15
|
+
<h4><%%= Inflector.titleize(@options[:action]) %> <%= Inflector.titleize(singular_name) %></h4>
|
16
|
+
|
17
|
+
<%% if request.xhr? %>
|
18
|
+
<div id="<%%= element_messages_id(@options) %>" class="messages-container"></div>
|
19
|
+
<%% else %>
|
20
|
+
<%%= render :partial => 'form_messages' %>
|
21
|
+
<%% end %>
|
22
|
+
|
23
|
+
<%%= render :partial => 'form' %>
|
24
|
+
|
25
|
+
<p class="form-footer">
|
26
|
+
<%%= submit_tag Inflector.titleize(@options[:action]), :class => "submit" %>
|
27
|
+
<%% cancel_params = @options.merge(:controller => '<%= controller_file_path %>', :action => 'cancel', :referring_action => @options[:action]) %>
|
28
|
+
<%%= link_to_remote "Cancel",
|
29
|
+
{ :url => cancel_params,
|
30
|
+
:loading => "Element.show('#{loading_indicator_id(@options)}');" },
|
31
|
+
{ :href => url_for(cancel_params) } %>
|
32
|
+
<%%= loading_indicator_tag @options %>
|
33
|
+
</p>
|
34
|
+
<%%= end_form_tag %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<%% if not request.xhr? %>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
40
|
<%% end %>
|
@@ -1,16 +1,16 @@
|
|
1
|
-
<%% pagination_params = params.merge(:controller => '<%= controller_file_path %>', :action => 'component_update') %>
|
2
|
-
<%% indicator_params = pagination_params.merge(:action => 'pagination') %>
|
3
|
-
<%%= loading_indicator_tag indicator_params %>
|
4
|
-
<%%= link_to_remote('Previous',
|
5
|
-
{ :url => pagination_params.merge(:page => paginator.current.previous),
|
6
|
-
:loading => "Element.show('#{loading_indicator_id(indicator_params)}');",
|
7
|
-
:update => scaffold_content_id(pagination_params) },
|
8
|
-
{ :href => url_for(pagination_params.merge(:page => paginator.current.previous)),
|
9
|
-
:class => "previous"}) if @paginator.current.previous %>
|
10
|
-
<%%= pagination_ajax_links @paginator, pagination_params %>
|
11
|
-
<%%= link_to_remote('Next',
|
12
|
-
{ :url => pagination_params.merge(:page => paginator.current.next),
|
13
|
-
:loading => "Element.show('#{loading_indicator_id(indicator_params)}');",
|
14
|
-
:update => scaffold_content_id(pagination_params) },
|
15
|
-
{ :href => url_for(pagination_params.merge(:page => paginator.current.next)),
|
1
|
+
<%% pagination_params = params.merge(:controller => '<%= controller_file_path %>', :action => 'component_update') %>
|
2
|
+
<%% indicator_params = pagination_params.merge(:action => 'pagination') %>
|
3
|
+
<%%= loading_indicator_tag indicator_params %>
|
4
|
+
<%%= link_to_remote('Previous',
|
5
|
+
{ :url => pagination_params.merge(:page => paginator.current.previous),
|
6
|
+
:loading => "Element.show('#{loading_indicator_id(indicator_params)}');",
|
7
|
+
:update => scaffold_content_id(pagination_params) },
|
8
|
+
{ :href => url_for(pagination_params.merge(:page => paginator.current.previous)),
|
9
|
+
:class => "previous"}) if @paginator.current.previous %>
|
10
|
+
<%%= pagination_ajax_links @paginator, pagination_params %>
|
11
|
+
<%%= link_to_remote('Next',
|
12
|
+
{ :url => pagination_params.merge(:page => paginator.current.next),
|
13
|
+
:loading => "Element.show('#{loading_indicator_id(indicator_params)}');",
|
14
|
+
:update => scaffold_content_id(pagination_params) },
|
15
|
+
{ :href => url_for(pagination_params.merge(:page => paginator.current.next)),
|
16
16
|
:class => "next"}) if @paginator.current.next %>
|