ajax_scaffold_generator 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -20
- data/README +28 -28
- data/ajax_scaffold_generator.rb +123 -123
- data/templates/controller.rb +61 -61
- data/templates/form.rhtml +4 -4
- data/templates/functional_test.rb +88 -88
- data/templates/helper.rb +12 -12
- data/templates/layout.rhtml +15 -15
- data/templates/partial_item.rhtml +24 -24
- data/templates/script.js +425 -327
- data/templates/style.css +345 -324
- data/templates/view_edit.rhtml +1 -1
- data/templates/view_index.rhtml +1 -1
- data/templates/view_list.rhtml +57 -52
- data/templates/view_new.rhtml +2 -1
- metadata +5 -3
data/templates/style.css
CHANGED
@@ -1,324 +1,345 @@
|
|
1
|
-
.list-wrapper form,
|
2
|
-
.list-wrapper table,
|
3
|
-
.list-wrapper p,
|
4
|
-
.list-wrapper div,
|
5
|
-
.list-wrapper fieldset {
|
6
|
-
margin: 0;
|
7
|
-
padding: 0;
|
8
|
-
}
|
9
|
-
|
10
|
-
.list
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
font-
|
34
|
-
font-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
font-
|
49
|
-
font-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
background-color: #
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
padding:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
}
|
114
|
-
|
115
|
-
.list
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
}
|
129
|
-
|
130
|
-
table.list
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
table.list .error-message
|
170
|
-
|
171
|
-
background:
|
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
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
font-
|
217
|
-
padding:
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
}
|
262
|
-
|
263
|
-
.list-wrapper
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
table.list
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
font-size:
|
322
|
-
|
323
|
-
|
324
|
-
|
1
|
+
.list-wrapper form,
|
2
|
+
.list-wrapper table,
|
3
|
+
.list-wrapper p,
|
4
|
+
.list-wrapper div,
|
5
|
+
.list-wrapper fieldset {
|
6
|
+
margin: 0;
|
7
|
+
padding: 0;
|
8
|
+
}
|
9
|
+
|
10
|
+
table.list a {
|
11
|
+
color: #0066CC;
|
12
|
+
}
|
13
|
+
|
14
|
+
.list-wrapper {
|
15
|
+
margin: 5px 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
table.list {
|
19
|
+
width: 100%;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Header Styling
|
23
|
+
======================== */
|
24
|
+
|
25
|
+
.list-header {
|
26
|
+
position: relative;
|
27
|
+
background: #005CB8;
|
28
|
+
}
|
29
|
+
|
30
|
+
.list-header div.actions a {
|
31
|
+
color: #fff;
|
32
|
+
background: url(/images/add.gif) 1px 50% no-repeat;
|
33
|
+
font-size: 13px;
|
34
|
+
font-family: Trebuchet MS;
|
35
|
+
font-weight: bold;
|
36
|
+
text-decoration: none;
|
37
|
+
padding: 1px 2px 1px 19px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.list-header div.actions a:hover {
|
41
|
+
background: #378CDF url(/images/add.gif) 1px 50% no-repeat;
|
42
|
+
}
|
43
|
+
|
44
|
+
.list-header h2 {
|
45
|
+
color: #fff;
|
46
|
+
padding: 3px 5px;
|
47
|
+
margin: 0;
|
48
|
+
font-size: 18px;
|
49
|
+
font-weight: normal;
|
50
|
+
font-family: Verdana, sans-serif;
|
51
|
+
}
|
52
|
+
|
53
|
+
.list-header .actions {
|
54
|
+
position: absolute;
|
55
|
+
right: 5px;
|
56
|
+
bottom: 2px;
|
57
|
+
}
|
58
|
+
|
59
|
+
/* Table Column Headers
|
60
|
+
============================= */
|
61
|
+
|
62
|
+
|
63
|
+
table.list tr.header {
|
64
|
+
background: #C5DBF7;
|
65
|
+
}
|
66
|
+
|
67
|
+
table.list th {
|
68
|
+
font-size: 11px;
|
69
|
+
padding: 2px;
|
70
|
+
color: #fff;
|
71
|
+
background: #555;
|
72
|
+
letter-spacing: 0;
|
73
|
+
font-family: Arial, sans-serif;
|
74
|
+
text-align: left;
|
75
|
+
padding-left: 5px;
|
76
|
+
}
|
77
|
+
|
78
|
+
/* Table Body Styling
|
79
|
+
============================= */
|
80
|
+
|
81
|
+
table.list td {
|
82
|
+
padding: 5px 4px;
|
83
|
+
border-bottom: solid 1px #C5DBF7;
|
84
|
+
color: #333;
|
85
|
+
font-family: Verdana, sans-serif;
|
86
|
+
font-size: 11px;
|
87
|
+
background-color: #E6F2FF;
|
88
|
+
}
|
89
|
+
|
90
|
+
table.list tr.even td {
|
91
|
+
background-color: #fff;
|
92
|
+
}
|
93
|
+
|
94
|
+
|
95
|
+
table.list .edit td,
|
96
|
+
table.list .create td {
|
97
|
+
padding: 0;
|
98
|
+
padding: 4px;
|
99
|
+
}
|
100
|
+
|
101
|
+
table.list td.action {
|
102
|
+
padding: 0;
|
103
|
+
padding-right: 2px;
|
104
|
+
}
|
105
|
+
|
106
|
+
table.list td a {
|
107
|
+
font-family: Verdana, sans-serif;
|
108
|
+
font-size: 11px;
|
109
|
+
font-weight: bold;
|
110
|
+
letter-spacing: -1px;
|
111
|
+
padding: 2px;
|
112
|
+
line-height: 18px;
|
113
|
+
}
|
114
|
+
|
115
|
+
table.list td a:hover {
|
116
|
+
background: #ff8;
|
117
|
+
}
|
118
|
+
|
119
|
+
table.list .edit td,
|
120
|
+
table.list .create td {
|
121
|
+
background: #DAFFCD;
|
122
|
+
}
|
123
|
+
|
124
|
+
table.list .edit td,
|
125
|
+
table.list .create td {
|
126
|
+
border-top: solid 2px #fff;
|
127
|
+
border-bottom: solid 2px #fff;
|
128
|
+
}
|
129
|
+
|
130
|
+
table.list .actions div {
|
131
|
+
width: 95px;
|
132
|
+
right: 0;
|
133
|
+
text-align: right;
|
134
|
+
float: right;
|
135
|
+
padding-right: 2px;
|
136
|
+
}
|
137
|
+
|
138
|
+
/* List Footer Styling
|
139
|
+
========================== */
|
140
|
+
|
141
|
+
.list-wrapper .list-footer {
|
142
|
+
text-align: right;
|
143
|
+
background: #005CB8;
|
144
|
+
padding: 2px 0;
|
145
|
+
border-bottom: none;
|
146
|
+
}
|
147
|
+
|
148
|
+
table.list tfoot a {
|
149
|
+
color: #fff;
|
150
|
+
font-size: 12px;
|
151
|
+
font-weight: bold;
|
152
|
+
letter-spacing: 0;
|
153
|
+
font-family: Arial, sans-serif;
|
154
|
+
}
|
155
|
+
|
156
|
+
table.list tfoot a:hover {
|
157
|
+
color: #0066CC;
|
158
|
+
}
|
159
|
+
|
160
|
+
/* Messages
|
161
|
+
========================= */
|
162
|
+
|
163
|
+
table.list .empty-message td {
|
164
|
+
background: #e8e8e8;
|
165
|
+
text-align: center;
|
166
|
+
color: #666;
|
167
|
+
}
|
168
|
+
|
169
|
+
table.list .error-message td {
|
170
|
+
border-bottom: solid 1px #fff;
|
171
|
+
background: #f66;
|
172
|
+
color: #333;
|
173
|
+
font-size: 11px;
|
174
|
+
font-weight: bold;
|
175
|
+
}
|
176
|
+
|
177
|
+
table.list .error-message p {
|
178
|
+
padding-left: 19px;
|
179
|
+
background: url(/images/error.gif) 0 0 no-repeat;
|
180
|
+
}
|
181
|
+
|
182
|
+
table.list .error-message td.actions {
|
183
|
+
background: #f66;
|
184
|
+
text-align: right;
|
185
|
+
}
|
186
|
+
|
187
|
+
table.list .error-message td.actions a {
|
188
|
+
color: #333;
|
189
|
+
}
|
190
|
+
|
191
|
+
/* Error Styling
|
192
|
+
========================== */
|
193
|
+
|
194
|
+
table.list #errorExplanation {
|
195
|
+
background: #fcc;
|
196
|
+
margin: 2px 7px;
|
197
|
+
border: solid 1px #f66;
|
198
|
+
}
|
199
|
+
|
200
|
+
table.list #errorExplanation h2 {
|
201
|
+
padding: 2px 5px 3px 20px;
|
202
|
+
color: #333;
|
203
|
+
font-size: 11px;
|
204
|
+
margin: 0;
|
205
|
+
letter-spacing: 0;
|
206
|
+
font-family: Verdana;
|
207
|
+
background: #f66 url(/images/error.gif) 2px 1px no-repeat;
|
208
|
+
}
|
209
|
+
|
210
|
+
table.list #errorExplanation ul {
|
211
|
+
margin: 0;
|
212
|
+
padding: 2px 2px 4px 25px;
|
213
|
+
}
|
214
|
+
|
215
|
+
table.list #errorExplanation p {
|
216
|
+
font-size: 11px;
|
217
|
+
padding: 2px 5px;
|
218
|
+
font-family: Verdana;
|
219
|
+
margin: 0;
|
220
|
+
}
|
221
|
+
|
222
|
+
table.list #errorExplanation ul li {
|
223
|
+
font-size: 11px;
|
224
|
+
margin: 0;
|
225
|
+
font-family: Verdana;
|
226
|
+
padding: 0;
|
227
|
+
}
|
228
|
+
|
229
|
+
table.list .fieldWithErrors input {
|
230
|
+
border: solid 1px #f00;
|
231
|
+
}
|
232
|
+
|
233
|
+
/* Loading Indicators
|
234
|
+
============================== */
|
235
|
+
|
236
|
+
.list-wrapper .loading-indicator {
|
237
|
+
vertical-align: bottom;
|
238
|
+
margin: 0;
|
239
|
+
}
|
240
|
+
|
241
|
+
.list-wrapper .list-header .loading-indicator,
|
242
|
+
.list-wrapper .edit .loading-indicator,
|
243
|
+
.list-wrapper .create .loading-indicator {
|
244
|
+
vertical-align: bottom;
|
245
|
+
margin-bottom: 3px;
|
246
|
+
}
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
/* Form Styling
|
252
|
+
============================== */
|
253
|
+
|
254
|
+
.list-wrapper .submit {
|
255
|
+
font-weight: bold;
|
256
|
+
font-size: 14px;
|
257
|
+
font-family: Arial, sans-serif;
|
258
|
+
letter-spacing: 0;
|
259
|
+
margin: 0;
|
260
|
+
margin-top: 5px;
|
261
|
+
}
|
262
|
+
|
263
|
+
.list-wrapper fieldset {
|
264
|
+
border: none;
|
265
|
+
}
|
266
|
+
|
267
|
+
table.list label.required{
|
268
|
+
font-weight: bold;
|
269
|
+
}
|
270
|
+
|
271
|
+
table.list label.example {
|
272
|
+
font-size: 11px;
|
273
|
+
font-family: arial;
|
274
|
+
color: #888;
|
275
|
+
}
|
276
|
+
|
277
|
+
table.list h4 {
|
278
|
+
padding: 2px;
|
279
|
+
margin: 0;
|
280
|
+
color: #1F7F00;
|
281
|
+
font-size: 16px;
|
282
|
+
letter-spacing: -1px;
|
283
|
+
font-family: Georgia, Arial, sans-serif;
|
284
|
+
}
|
285
|
+
|
286
|
+
table.list .edit a,
|
287
|
+
table.list .create a {
|
288
|
+
font-size: 14px;
|
289
|
+
font-weight: bold;
|
290
|
+
font-family: Arial, sans-serif;
|
291
|
+
letter-spacing: 0;
|
292
|
+
}
|
293
|
+
|
294
|
+
table.list p {
|
295
|
+
clear: both;
|
296
|
+
}
|
297
|
+
|
298
|
+
table.list div.row {
|
299
|
+
clear: both;
|
300
|
+
float: none;
|
301
|
+
padding: 2px;
|
302
|
+
margin-left: 5px;
|
303
|
+
}
|
304
|
+
|
305
|
+
table.list div.form-element {
|
306
|
+
float: left;
|
307
|
+
margin-right: 10px;
|
308
|
+
margin-bottom: 2px;
|
309
|
+
}
|
310
|
+
|
311
|
+
table.list label {
|
312
|
+
display: block;
|
313
|
+
font-family: Verdana, sans-serif;
|
314
|
+
color: #555;
|
315
|
+
font-size: 11px;
|
316
|
+
padding-bottom: 1px;
|
317
|
+
}
|
318
|
+
|
319
|
+
table.list input,
|
320
|
+
table.list select {
|
321
|
+
font-size: 16px;
|
322
|
+
font-weight: bold;
|
323
|
+
font-family: Arial, sans-serif;
|
324
|
+
letter-spacing: -1px;
|
325
|
+
}
|
326
|
+
|
327
|
+
table.list .form-element input {
|
328
|
+
padding: 1px;
|
329
|
+
border: solid 1px #1F7F00;
|
330
|
+
}
|
331
|
+
|
332
|
+
table.list textarea {
|
333
|
+
height: 65px;
|
334
|
+
font-family: Arial, sans-serif;
|
335
|
+
font-size: 12px;
|
336
|
+
padding: 1px;
|
337
|
+
border: solid 1px #1F7F00;
|
338
|
+
}
|
339
|
+
|
340
|
+
/* IE hacks
|
341
|
+
==================================== */
|
342
|
+
|
343
|
+
* html .list-header {
|
344
|
+
height: 1%;
|
345
|
+
}
|
data/templates/view_edit.rhtml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:success => "AjaxScaffold.updateOnSuccess(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
6
6
|
:failure => "AjaxScaffold.updateOnFailure(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
7
7
|
:complete => "AjaxScaffold.updateOnComplete(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
8
|
-
:html => { :id => "
|
8
|
+
:html => { :id => "edit-<%= singular_name %>-#{@<%= singular_name %>.id}-form" } %>
|
9
9
|
<h4>Edit <%= Inflector.titleize(singular_name) %></h4>
|
10
10
|
|
11
11
|
<div id="<%%= "update-<%= singular_name %>-#{@<%= singular_name %>.id}-errors" %>" style="display: none;" ></div>
|
data/templates/view_index.rhtml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<%%= render_component :controller => '<%=
|
1
|
+
<%%= render_component :controller => '<%= Inflector.underscore(controller_name) %>', :action => 'list' %>
|