ajax_scaffold_generator 1.0.0 → 2.0.0

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.
data/templates/style.css CHANGED
@@ -1,74 +1,324 @@
1
- body { background-color: #fff; color: #333; }
2
-
3
- body, p, ol, ul, td {
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- }
8
-
9
- pre {
10
- background-color: #eee;
11
- padding: 10px;
12
- font-size: 11px;
13
- }
14
-
15
- a { color: #000; }
16
- a:visited { color: #666; }
17
- a:hover { color: #fff; background-color:#000; }
18
-
19
- .fieldWithErrors {
20
- padding: 2px;
21
- background-color: red;
22
- display: table;
23
- }
24
-
25
- #ErrorExplanation {
26
- width: 400px;
27
- border: 2px solid 'red';
28
- padding: 7px;
29
- padding-bottom: 12px;
30
- margin-bottom: 20px;
31
- background-color: #f0f0f0;
32
- }
33
-
34
- #ErrorExplanation h2 {
35
- text-align: left;
36
- font-weight: bold;
37
- padding: 5px 5px 5px 15px;
38
- font-size: 12px;
39
- margin: -7px;
40
- background-color: #c00;
41
- color: #fff;
42
- }
43
-
44
- #ErrorExplanation p {
45
- color: #333;
46
- margin-bottom: 0;
47
- padding: 5px;
48
- }
49
-
50
- #ErrorExplanation ul li {
51
- font-size: 12px;
52
- list-style: square;
53
- }
54
-
55
- div.uploadStatus {
56
- margin: 5px;
57
- }
58
-
59
- div.progressBar {
60
- margin: 5px;
61
- }
62
-
63
- div.progressBar div.border {
64
- background-color: #fff;
65
- border: 1px solid grey;
66
- width: 100%;
67
- }
68
-
69
- div.progressBar div.background {
70
- background-color: #333;
71
- height: 18px;
72
- width: 0%;
73
- }
74
-
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-wrapper {
11
+ margin: 5px 0;
12
+ }
13
+
14
+
15
+ table.list {
16
+ width: 100%;
17
+ }
18
+
19
+ .list-header {
20
+ position: relative;
21
+ background: #005CB8;
22
+ clear: both;
23
+ }
24
+
25
+ * html .list-header {
26
+ height: 1%;
27
+ }
28
+
29
+ .list-header div.actions a {
30
+ color: #fff;
31
+ background: url(/images/add.gif) 1px 50% no-repeat;
32
+ font-size: 13px;
33
+ font-family: Trebuchet MS;
34
+ font-weight: bold;
35
+ text-decoration: none;
36
+ padding: 1px 2px 1px 19px;
37
+ }
38
+
39
+ .list-header div.actions a:hover {
40
+ background: #378CDF url(/images/add.gif) 1px 50% no-repeat;
41
+ }
42
+
43
+ .list-header h2 {
44
+ color: #fff;
45
+ padding: 3px 5px;
46
+ margin: 0;
47
+ font-size: 18px;
48
+ font-weight: normal;
49
+ font-family: Verdana, sans-serif;
50
+ }
51
+
52
+ .list-header .actions {
53
+ position: absolute;
54
+ right: 5px;
55
+ bottom: 2px;
56
+ }
57
+
58
+ table.list a {
59
+ color: #0066CC;
60
+ }
61
+
62
+ table.list tr.header {
63
+ background: #C5DBF7;
64
+ }
65
+
66
+ table.list th {
67
+ font-size: 11px;
68
+ padding: 2px;
69
+ color: #fff;
70
+ background: #555;
71
+ letter-spacing: 0;
72
+ font-family: Arial, sans-serif;
73
+ text-align: left;
74
+ padding-left: 5px;
75
+ }
76
+
77
+ table.list td {
78
+ padding: 5px 4px;
79
+ border-bottom: solid 1px #C5DBF7;
80
+ color: #333;
81
+ font-family: Verdana, sans-serif;
82
+ font-size: 11px;
83
+ background-color: #E6F2FF;
84
+ }
85
+
86
+ table.list tr.even td {
87
+ background-color: #fff;
88
+ }
89
+
90
+
91
+ table.list .edit td,
92
+ table.list .create td {
93
+ padding: 0;
94
+ padding: 4px;
95
+ }
96
+
97
+ table.list td.action {
98
+ padding: 0;
99
+ padding-right: 2px;
100
+ }
101
+
102
+ table.list td a {
103
+ font-family: Verdana, sans-serif;
104
+ font-size: 11px;
105
+ font-weight: bold;
106
+ letter-spacing: -1px;
107
+ padding: 2px;
108
+ line-height: 18px;
109
+ }
110
+
111
+ table.list td a:hover {
112
+ background: #ff8;
113
+ }
114
+
115
+ .list-wrapper .list-footer {
116
+ text-align: right;
117
+ background: #005CB8;
118
+ padding: 2px 0;
119
+ border-bottom: none;
120
+ }
121
+
122
+ table.list tfoot a {
123
+ color: #fff;
124
+ font-size: 12px;
125
+ font-weight: bold;
126
+ letter-spacing: 0;
127
+ font-family: Arial, sans-serif;
128
+ }
129
+
130
+ table.list tfoot a:hover {
131
+ color: #0066CC;
132
+ }
133
+
134
+ table.list .edit td,
135
+ table.list .create td {
136
+ background: #DAFFCD;
137
+ }
138
+
139
+ table.list .edit td,
140
+ table.list .create td {
141
+ border-top: solid 2px #fff;
142
+ border-bottom: solid 2px #fff;
143
+ }
144
+
145
+ table.list .actions div {
146
+ width: 95px;
147
+ right: 0;
148
+ text-align: right;
149
+ float: right;
150
+ padding-right: 2px;
151
+ }
152
+
153
+ /* Messages */
154
+
155
+ table.list .empty-message td {
156
+ background: #e8e8e8;
157
+ text-align: center;
158
+ color: #666;
159
+ }
160
+
161
+ table.list .error-message td {
162
+ border-bottom: solid 1px #fff;
163
+ background: #f66;
164
+ color: #333;
165
+ font-size: 11px;
166
+ font-weight: bold;
167
+ }
168
+
169
+ table.list .error-message p {
170
+ padding-left: 19px;
171
+ background: url(/images/error.gif) 0 0 no-repeat;
172
+ }
173
+
174
+ table.list .error-message td.actions {
175
+ background: #f66;
176
+ text-align: right;
177
+ }
178
+
179
+ table.list .error-message td.actions a {
180
+ color: #333;
181
+ }
182
+
183
+ /* Error Styling */
184
+
185
+ table.list #errorExplanation {
186
+ background: #fcc;
187
+ margin: 2px 7px;
188
+ border: solid 1px #f66;
189
+ }
190
+
191
+ table.list #errorExplanation h2 {
192
+ padding: 2px 5px 3px 20px;
193
+ color: #333;
194
+ font-size: 11px;
195
+ margin: 0;
196
+ letter-spacing: 0;
197
+ font-family: Verdana;
198
+ background: #f66 url(/images/error.gif) 2px 1px no-repeat;
199
+ }
200
+
201
+ table.list #errorExplanation ul {
202
+ margin: 0;
203
+ padding: 2px 2px 4px 25px;
204
+ }
205
+
206
+ table.list #errorExplanation p {
207
+ font-size: 11px;
208
+ padding: 2px 5px;
209
+ font-family: Verdana;
210
+ margin: 0;
211
+ }
212
+
213
+ table.list #errorExplanation ul li {
214
+ font-size: 11px;
215
+ margin: 0;
216
+ font-family: Verdana;
217
+ padding: 0;
218
+ }
219
+
220
+ table.list .fieldWithErrors input {
221
+ border: solid 1px #f00;
222
+ }
223
+
224
+ /* Loading Indicator */
225
+
226
+ .list-wrapper .loading-indicator {
227
+ vertical-align: bottom;
228
+ margin: 0;
229
+ }
230
+
231
+ .list-wrapper .list-header .loading-indicator,
232
+ .list-wrapper .edit .loading-indicator,
233
+ .list-wrapper .create .loading-indicator {
234
+ vertical-align: bottom;
235
+ margin-bottom: 3px;
236
+ }
237
+
238
+ /* Form Styling */
239
+
240
+ .list-wrapper fieldset {
241
+ border: none;
242
+ }
243
+
244
+ table.list label.required{
245
+ font-weight: bold;
246
+ }
247
+
248
+ table.list label.example {
249
+ font-size: 11px;
250
+ font-family: arial;
251
+ color: #888;
252
+ }
253
+
254
+ table.list h4 {
255
+ padding: 2px;
256
+ margin: 0;
257
+ color: #1F7F00;
258
+ font-size: 16px;
259
+ letter-spacing: -1px;
260
+ font-family: Georgia, Arial, sans-serif;
261
+ }
262
+
263
+ .list-wrapper .submit {
264
+ font-weight: bold;
265
+ font-size: 14px;
266
+ font-family: Arial, sans-serif;
267
+ letter-spacing: 0;
268
+ margin: 0;
269
+ margin-top: 5px;
270
+ }
271
+
272
+ table.list .edit a,
273
+ table.list .create a {
274
+ font-size: 14px;
275
+ font-weight: bold;
276
+ font-family: Arial, sans-serif;
277
+ letter-spacing: 0;
278
+ }
279
+
280
+ table.list p {
281
+ clear: both;
282
+ }
283
+
284
+ table.list div.row {
285
+ clear: both;
286
+ float: none;
287
+ padding: 2px;
288
+ margin-left: 5px;
289
+ }
290
+
291
+ table.list div.form-element {
292
+ float: left;
293
+ margin-right: 10px;
294
+ margin-bottom: 2px;
295
+ }
296
+
297
+ table.list label {
298
+ display: block;
299
+ font-family: Verdana, sans-serif;
300
+ color: #555;
301
+ font-size: 11px;
302
+ padding-bottom: 1px;
303
+ }
304
+
305
+ table.list input,
306
+ table.list select {
307
+ font-size: 16px;
308
+ font-weight: bold;
309
+ font-family: Arial, sans-serif;
310
+ letter-spacing: -1px;
311
+ }
312
+
313
+ table.list .form-element input {
314
+ padding: 1px;
315
+ border: solid 1px #1F7F00;
316
+ }
317
+
318
+ table.list textarea {
319
+ height: 65px;
320
+ font-family: Arial, sans-serif;
321
+ font-size: 12px;
322
+ padding: 1px;
323
+ border: solid 1px #1F7F00;
324
+ }
@@ -0,0 +1,22 @@
1
+ <tr id="<%%= "edit-<%= singular_name %>-#{@<%= singular_name %>.id}" %>" class="edit" style="display: none;">
2
+ <td colspan="<%%= num_columns %>">
3
+ <%%= form_remote_tag :url => { :controller => '<%= controller_name %>', :action => 'update', :id => @<%= singular_name %> },
4
+ :loading => "AjaxScaffold.updateOnLoading(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
5
+ :success => "AjaxScaffold.updateOnSuccess(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
6
+ :failure => "AjaxScaffold.updateOnFailure(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
7
+ :complete => "AjaxScaffold.updateOnComplete(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
8
+ :html => { :id => "<%= singular_name %>-#{@<%= singular_name %>.id}-form" } %>
9
+ <h4>Edit <%= Inflector.titleize(singular_name) %></h4>
10
+
11
+ <div id="<%%= "update-<%= singular_name %>-#{@<%= singular_name %>.id}-errors" %>" style="display: none;" ></div>
12
+
13
+ <%%= render :partial => 'form' %>
14
+
15
+ <p>
16
+ <%%= submit_tag "Update", :class => "submit" %>
17
+ <%%= link_to_function "Cancel", "AjaxScaffold.updateOnCancel('<%= singular_name %>',#{@<%= singular_name %>.id});" %>
18
+ <%%= loading_indicator_tag '<%= singular_name %>', "update-#{@<%= singular_name %>.id}" %>
19
+ </p>
20
+ <%%= end_form_tag %>
21
+ </td>
22
+ </tr>
@@ -0,0 +1 @@
1
+ <%%= render_component :controller => '<%= singular_name %>', :action => 'list' %>
@@ -1,15 +1,53 @@
1
- <h1>Listing <%= plural_name %></h1>
2
-
3
- <div id="add_<%= singular_name %>">
4
- <%%= link_to_function 'New <%= singular_name %>', "<%= plural_name %>Block.add()" %>
5
- </div>
6
-
7
- <div id="add_<%= singular_name %>_dialog" style="display: none">
8
- <%%= render :partial => 'new' %>
9
- </div>
10
-
11
- <div id="<%= plural_name %>">
12
- <%% for @<%= singular_name %> in @<%= plural_name %>%>
13
- <%%= render :partial => 'item' %>
14
- <%% end -%>
15
- </div>
1
+ <div id="<%= singular_name %>-list-wrapper" class="list-wrapper">
2
+ <div id="<%= singular_name %>-list-header" class="list-header">
3
+ <h2><%= Inflector.titleize(plural_name) %></h2>
4
+
5
+ <div class="actions">
6
+ <%%= loading_indicator_tag '<%= singular_name %>', "new" %>
7
+ <%%= link_to_remote "Create New",
8
+ :url => { :controller => '<%= controller_name %>', :action => 'new' },
9
+ :loading => "AjaxScaffold.newOnLoading(request,'<%= singular_name %>');",
10
+ :success => "AjaxScaffold.newOnSuccess(request,'<%= singular_name %>');",
11
+ :failure => "AjaxScaffold.newOnFailure(request,'<%= singular_name %>');",
12
+ :complete => "AjaxScaffold.newOnComplete(request,'<%= singular_name %>');",
13
+ :class => "create" %>
14
+
15
+ </div>
16
+
17
+ </div>
18
+ <table id="<%= singular_name %>-list" class="list" cellpadding="0" cellspacing="0">
19
+ <thead>
20
+ <tr class="header">
21
+ <%% for column in <%= model_name %>.content_columns %>
22
+ <th><%%= column.human_name %></th>
23
+ <%% end %>
24
+ <th></th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <tr id="<%= singular_name %>-error-message" class="error-message" style="display:none;">
29
+ <td colspan="<%%= num_columns - 1 %>">
30
+ <p>An error has occurred</p>
31
+ </td>
32
+ <td class="actions">
33
+ <%%= link_to_function "Close", "AjaxScaffold.hideError('<%= singular_name %>');" %>
34
+ </td>
35
+ </tr>
36
+ <tr id="<%= singular_name %>-empty-message" class="empty-message" <%%= " style=\"display:none;\" " if !@<%= plural_name %>.empty? %>>
37
+ <td colspan="<%%= num_columns %>">No Entries</td>
38
+ </tr>
39
+ </tbody>
40
+ <tbody id="<%= singular_name %>-list-body">
41
+ <%% if !@<%= plural_name %>.empty? %>
42
+ <%%= render :partial => '<%= singular_name %>', :collection => @<%= plural_name %> %>
43
+ <%% end %>
44
+ </tbody>
45
+ </table>
46
+ </div>
47
+
48
+ <script type="text/javascript">
49
+ <%% if !@<%= plural_name %>.empty? %>
50
+ AjaxScaffold.stripeTable('<%= singular_name %>');
51
+ <%% end %>
52
+ Rico.Corner.round('<%= singular_name %>-list-wrapper', {color: '#005CB8', bgColor: '#fff', compact: true});
53
+ </script>
@@ -0,0 +1,22 @@
1
+ <tr id="create-<%= singular_name %>-<%%= @temp_id %>" class="create" style="display: none;">
2
+ <td colspan="<%%= num_columns %>">
3
+ <%%= form_remote_tag :url => { :controller => '<%= controller_name %>', :action => 'create' },
4
+ :loading => "AjaxScaffold.createOnLoading(request,'<%= singular_name %>',#{@temp_id});",
5
+ :success => "AjaxScaffold.createOnSuccess(request,'<%= singular_name %>',#{@temp_id});",
6
+ :complete => "AjaxScaffold.createOnComplete(request,'<%= singular_name %>',#{@temp_id});",
7
+ :failure => "AjaxScaffold.createOnFailure(request,'<%= singular_name %>',#{@temp_id});" %>
8
+
9
+ <h4>New <%= Inflector.titleize(singular_name) %></h4>
10
+
11
+ <div id="<%%= "create-<%= singular_name %>-#{@temp_id}-errors" %>" style="display: none;" ></div>
12
+
13
+ <%%= render :partial => 'form' %>
14
+
15
+ <p>
16
+ <%%= submit_tag "Create", :class => "submit" %>
17
+ <%%= link_to_function "Cancel", "AjaxScaffold.createOnCancel('<%= singular_name %>',#{@temp_id});" %>
18
+ <%%= loading_indicator_tag '<%= singular_name %>', "create-#{@temp_id}" %>
19
+ </p>
20
+ <%%= end_form_tag %>
21
+ </td>
22
+ </tr>
metadata CHANGED
@@ -1,19 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: ajax_scaffold_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2005-11-30 00:00:00 +01:00
8
- summary: "[Rails] Ajax scaffold."
6
+ version: 2.0.0
7
+ date: 2006-02-20
8
+ summary: Ajax scaffold generator is a rails generator for ajaxified scaffolds
9
9
  require_paths:
10
- - "."
11
- email: maurycypw@gmail.com
12
- homepage: http://www.rubyonrails.org/show/Generators
10
+ - lib
11
+ email:
12
+ homepage:
13
13
  rubyforge_project:
14
- description: "This is the generator for a Ruby on Rails framework, that creates scaffold for
15
- AJAX applications."
16
- autorequire:
14
+ description: Ajax scaffold generator is a rails generator for ajaxified scaffolds
15
+ autorequire: rails_generator/generators/components/scaffold/scaffold_generator
17
16
  default_executable:
18
17
  bindir: bin
19
18
  has_rdoc: false
@@ -25,41 +24,35 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
24
  version: 0.0.0
26
25
  version:
27
26
  platform: ruby
28
- signing_key:
29
- cert_chain:
30
- authors:
31
- - Maurycy Pawlowski-Wieronski
27
+ authors: []
32
28
  files:
29
+ - README
33
30
  - MIT-LICENSE
34
- - USAGE
35
31
  - ajax_scaffold_generator.rb
36
- - templates/controller.rb
37
- - templates/form.rhtml
38
- - templates/form_scaffolding.rhtml
39
- - templates/functional_test.rb
40
- - templates/helper.rb
41
- - templates/layout.rhtml
42
- - templates/partial_edit.rhtml
43
- - templates/partial_error.rhtml
44
- - templates/partial_item.rhtml
45
- - templates/partial_new.rhtml
46
- - templates/script.js
47
- - templates/style.css
32
+ - templates/
33
+ - templates/view_new.rhtml
48
34
  - templates/view_list.rhtml
35
+ - templates/view_index.rhtml
36
+ - templates/view_edit.rhtml
37
+ - templates/style.css
38
+ - templates/script.js
39
+ - templates/rico_corner.js
40
+ - templates/partial_item.rhtml
41
+ - templates/partial_form_errors.rhtml
42
+ - templates/layout.rhtml
43
+ - templates/indicator.gif
44
+ - templates/helper.rb
45
+ - templates/functional_test.rb
46
+ - templates/form_scaffolding.rhtml
47
+ - templates/form.rhtml
48
+ - templates/error.gif
49
+ - templates/controller.rb
50
+ - templates/add.gif
49
51
  test_files: []
50
52
  rdoc_options: []
51
53
  extra_rdoc_files: []
52
54
  executables: []
53
55
  extensions: []
54
- requirements: []
55
- dependencies:
56
- - !ruby/object:Gem::Dependency
57
- name: rails
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Version::Requirement
60
- requirements:
61
- -
62
- - ">="
63
- - !ruby/object:Gem::Version
64
- version: 0.10.0
65
- version:
56
+ requirements:
57
+ - none
58
+ dependencies: []
@@ -1,13 +0,0 @@
1
- <div id="<%%= "edit_<%= singular_name %>_error_#{@<%= singular_name %>.id}" %>">
2
- <%%= render :partial => 'error' %>
3
- </div>
4
-
5
- <%%= form_remote_tag :url => { :action => 'edit', :id => @<%= singular_name %> },
6
- :update => { :success => "<%= singular_name %>_#{@<%= singular_name %>.id}", :failure => "edit_<%= singular_name %>_error_#{@<%= singular_name %>.id}" },
7
- :success => "<%= plural_name %>Block.editSuccess(#{@<%= singular_name %>.id})",
8
- :html => { :id => "edit_<%= singular_name %>_form_#{@<%= singular_name %>.id}" } %>
9
- <%%= render :partial => 'form' %>
10
- <%%= submit_tag "Update" %>
11
- <%%= end_form_tag %>
12
-
13
- <%%= link_to_function 'Cancel', "<%= plural_name %>Block.editCancel(#{@<%= singular_name %>.id})" %>
@@ -1,3 +0,0 @@
1
- <%% unless @<%= singular_name %>.nil? %>
2
- <%%= error_messages_for '<%= singular_name %>' %>
3
- <%% end -%>
@@ -1,13 +0,0 @@
1
- <div id="add_<%= singular_name %>_error">
2
- <%%= render :partial => 'error' %>
3
- </div>
4
-
5
- <%%= form_remote_tag :url => { :action => 'new' },
6
- :success => '<%= plural_name %>Block.addSuccess(request)',
7
- :failure => '<%= plural_name %>Block.addFailure(request)',
8
- :html => { :id => 'add_<%= singular_name %>_form' } %>
9
- <%%= render :partial => 'form' %>
10
- <%%= submit_tag "Create" %>
11
- <%%= end_form_tag %>
12
-
13
- <%%= link_to_function 'Cancel', '<%= plural_name %>Block.addCancel()' %>