ajax_scaffold_plugin 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/app/.DS_Store ADDED
Binary file
Binary file
@@ -17,4 +17,6 @@
17
17
  <% end %>
18
18
  </th>
19
19
  <% end %>
20
- <th></th>
20
+ <% unless @no_edit && @no_delete %>
21
+ <th></th>
22
+ <% end %>
@@ -130,7 +130,7 @@ module AjaxScaffold # :nodoc:
130
130
  # set up a few variables for use in the code generation
131
131
  singular_name = model_id.to_s
132
132
  class_name = options[:class_name] || singular_name.camelize
133
- plural_name = singular_name.pluralize
133
+ plural_name = eval("#{class_name}.table_name") || singular_name.pluralize
134
134
  rows_per_page = options[:rows_per_page] || 25
135
135
  suffix = options[:suffix] ? "_#{singular_name}" : ""
136
136
  prefix = options[:suffix] ? "#{plural_name}_" : ""
@@ -138,8 +138,8 @@ module AjaxScaffold # :nodoc:
138
138
  width = options[:width].nil? ? (options[:rel_width].nil? ? nil : options[:rel_width]*100 ) : options[:width]
139
139
 
140
140
  if (!width.nil?)
141
- dimensions = options[:width].nil? ? "%" : "px"
142
- width = width.to_s + dimensions
141
+ dimensions = options[:width].nil? ? "%" : "px"
142
+ width = width.to_s + dimensions
143
143
  end
144
144
 
145
145
  no_create, no_edit, no_delete = false, false, false
@@ -242,9 +242,7 @@ module AjaxScaffold # :nodoc:
242
242
  unless (no_create)
243
243
  module_eval <<-"end_eval", __FILE__, __LINE__
244
244
  def new#{suffix}
245
- @#{singular_name} = #{class_name}.new
246
- @successful = true
247
-
245
+ do_new#{suffix}
248
246
  return render#{suffix}_template(:action => 'new.rjs') if request.xhr?
249
247
 
250
248
  # Javascript disabled fallback
@@ -256,6 +254,11 @@ module AjaxScaffold # :nodoc:
256
254
  end
257
255
  end
258
256
 
257
+ def do_new#{suffix}
258
+ @#{singular_name} = #{class_name}.new
259
+ @successful = true
260
+ end
261
+
259
262
  def create#{suffix}
260
263
  begin
261
264
  do_create#{suffix}
@@ -284,8 +287,7 @@ module AjaxScaffold # :nodoc:
284
287
  module_eval <<-"end_eval", __FILE__, __LINE__
285
288
  def edit#{suffix}
286
289
  begin
287
- @#{singular_name} = #{class_name}.find(params[:id])
288
- @successful = !@#{singular_name}.nil?
290
+ do_edit#{suffix}
289
291
  rescue
290
292
  flash[:error], @successful = $!.to_s, false
291
293
  end
@@ -299,6 +301,11 @@ module AjaxScaffold # :nodoc:
299
301
  #{prefix}return_to_main
300
302
  end
301
303
  end
304
+
305
+ def do_edit#{suffix}
306
+ @#{singular_name} = #{class_name}.find(params[:id])
307
+ @successful = !@#{singular_name}.nil?
308
+ end
302
309
 
303
310
  def update#{suffix}
304
311
  begin
@@ -328,7 +335,7 @@ module AjaxScaffold # :nodoc:
328
335
  module_eval <<-"end_eval", __FILE__, __LINE__
329
336
  def destroy#{suffix}
330
337
  begin
331
- @successful = #{class_name}.find(params[:id]).destroy
338
+ do_destroy#{suffix}
332
339
  rescue
333
340
  flash[:error], @successful = $!.to_s, false
334
341
  end
@@ -338,6 +345,10 @@ module AjaxScaffold # :nodoc:
338
345
  # Javascript disabled fallback
339
346
  #{prefix}return_to_main
340
347
  end
348
+
349
+ def do_destroy#{suffix}
350
+ @successful = #{class_name}.find(params[:id]).destroy
351
+ end
341
352
  end_eval
342
353
  end
343
354
 
@@ -496,7 +507,7 @@ module ::ActionView #:nodoc:
496
507
  module AssetTagHelper
497
508
  # produces all the includes in one shot
498
509
  def ajax_scaffold_includes
499
- js = javascript_include_tag(:defaults, 'dhtml_history', 'rico_corner', 'ajax_scaffold')
510
+ js = javascript_include_tag(:defaults, 'rico_corner', 'ajax_scaffold', 'dhtml_history')
500
511
  css = stylesheet_link_tag('ajax_scaffold')
501
512
  js + "\n" + css
502
513
  end
data/public/.DS_Store ADDED
Binary file
Binary file
@@ -922,11 +922,11 @@ window.dhtmlHistory.create();
922
922
 
923
923
  /** Create init methods for ajax_table */
924
924
  function initialize() {
925
- // initialize our DHTML history
926
- dhtmlHistory.initialize();
927
- // subscribe to DHTML history change
928
- // events
929
- dhtmlHistory.addListener(handleHistoryChange);
925
+ // initialize our DHTML history
926
+ dhtmlHistory.initialize();
927
+ // subscribe to DHTML history change
928
+ // events
929
+ dhtmlHistory.addListener(handleHistoryChange);
930
930
  }
931
931
 
932
932
  /** Our callback to receive history
@@ -20,6 +20,10 @@ padding: 0;
20
20
  margin: 5px 0;
21
21
  }
22
22
 
23
+ * html .ajax-scaffold {
24
+ height: 1%;
25
+ }
26
+
23
27
  .ajax-scaffold table {
24
28
  width: 100%;
25
29
  }
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ajax_scaffold_plugin
5
5
  version: !ruby/object:Gem::Version
6
- version: 3.2.1
7
- date: 2006-09-19 00:00:00 -06:00
6
+ version: 3.2.2
7
+ date: 2006-10-03 00:00:00 +01:00
8
8
  summary: Ajax Scaffold plugin is a rails plugin for ajaxified scaffolds
9
9
  require_paths:
10
10
  - lib
@@ -36,14 +36,6 @@ files:
36
36
  - app/
37
37
  - app/views
38
38
  - app/views/ajax_scaffold
39
- - app/views/ajax_scaffold/_row.rhtml
40
- - app/views/ajax_scaffold/_pagination_links.rhtml
41
- - app/views/ajax_scaffold/_new_edit.rhtml
42
- - app/views/ajax_scaffold/_messages.rhtml
43
- - app/views/ajax_scaffold/_form_messages.rhtml
44
- - app/views/ajax_scaffold/_form.rhtml
45
- - app/views/ajax_scaffold/_column_totals.rhtml
46
- - app/views/ajax_scaffold/_column_headings.rhtml
47
39
  - app/views/ajax_scaffold/update.rjs
48
40
  - app/views/ajax_scaffold/table.rhtml
49
41
  - app/views/ajax_scaffold/new.rjs
@@ -52,6 +44,16 @@ files:
52
44
  - app/views/ajax_scaffold/destroy.rjs
53
45
  - app/views/ajax_scaffold/create.rjs
54
46
  - app/views/ajax_scaffold/cancel.rjs
47
+ - app/views/ajax_scaffold/_row.rhtml
48
+ - app/views/ajax_scaffold/_pagination_links.rhtml
49
+ - app/views/ajax_scaffold/_new_edit.rhtml
50
+ - app/views/ajax_scaffold/_messages.rhtml
51
+ - app/views/ajax_scaffold/_form_messages.rhtml
52
+ - app/views/ajax_scaffold/_form.rhtml
53
+ - app/views/ajax_scaffold/_column_totals.rhtml
54
+ - app/views/ajax_scaffold/_column_headings.rhtml
55
+ - app/views/.DS_Store
56
+ - app/.DS_Store
55
57
  - lib/
56
58
  - lib/base
57
59
  - lib/base/ajax_scaffold.rb
@@ -69,7 +71,9 @@ files:
69
71
  - public/images/arrow_up.gif
70
72
  - public/images/arrow_down.gif
71
73
  - public/images/add.gif
74
+ - public/images/.DS_Store
72
75
  - public/blank.html
76
+ - public/.DS_Store
73
77
  - tasks/
74
78
  - tasks/ajax_scaffold_tasks.rake
75
79
  - test/