ajax_scaffold_generator 2.2.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/ajax_scaffold_generator.rb +97 -22
- data/templates/{style.css → ajax_scaffold.css} +451 -364
- data/templates/ajax_scaffold.js +126 -0
- data/templates/ajax_scaffold_helper.rb +95 -0
- data/templates/arrow_down.gif +0 -0
- data/templates/arrow_up.gif +0 -0
- data/templates/controller.rb +93 -42
- data/templates/error.gif +0 -0
- data/templates/form_scaffolding.rhtml +1 -1
- data/templates/helper.rb +2 -6
- data/templates/indicator.gif +0 -0
- data/templates/information.gif +0 -0
- data/templates/layout.rhtml +2 -1
- data/templates/lib_ajax_scaffold_util.rb +26 -0
- data/templates/lib_content_column_patch.rb +10 -0
- data/templates/partial_column_headings.rhtml +12 -0
- data/templates/partial_form_messages.rhtml +5 -0
- data/templates/partial_item.rhtml +30 -21
- data/templates/partial_messages.rhtml +10 -0
- data/templates/partial_new_edit.rhtml +38 -0
- data/templates/partial_pagination_links.rhtml +14 -0
- data/templates/rjs_create.rjs +17 -0
- data/templates/rjs_destroy.rjs +10 -0
- data/templates/rjs_edit.rjs +16 -0
- data/templates/rjs_new.rjs +14 -0
- data/templates/rjs_update.rjs +17 -0
- data/templates/view_component.rhtml +51 -0
- data/templates/view_list.rhtml +1 -59
- data/templates/warning.gif +0 -0
- metadata +22 -8
- data/templates/partial_form_errors.rhtml +0 -9
- data/templates/script.js +0 -423
- data/templates/view_edit.rhtml +0 -36
- data/templates/view_index.rhtml +0 -1
- data/templates/view_new.rhtml +0 -33
data/templates/view_edit.rhtml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
<%% if not request.xhr? %>
|
2
|
-
<table class="ajax-scaffold" cellpadding="0" cellspacing="0">
|
3
|
-
<tbody>
|
4
|
-
<%% end %>
|
5
|
-
<tr id="<%%= "edit-<%= singular_name %>-#{@<%= singular_name %>.id}" %>" class="edit" <%%= "style=\"display: none;\"" if request.xhr? %> >
|
6
|
-
<td colspan="<%%= num_columns %>">
|
7
|
-
<%%= form_remote_tag :url => { :controller => '<%= controller_file_name %>', :action => 'update', :id => @<%= singular_name %> },
|
8
|
-
:loading => "AjaxScaffold.updateOnLoading(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
9
|
-
:success => "AjaxScaffold.updateOnSuccess(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
10
|
-
:failure => "AjaxScaffold.updateOnFailure(request,'<%= singular_name %>',#{@<%= singular_name %>.id});",
|
11
|
-
:html => { :action => url_for(:controller => '<%= controller_file_name %>', :action => 'update', :id => @<%= singular_name %>),
|
12
|
-
:id => "edit-<%= singular_name %>-#{@<%= singular_name %>.id}-form" } %>
|
13
|
-
<h4>Edit <%= Inflector.titleize(singular_name) %></h4>
|
14
|
-
|
15
|
-
<%% # Its actually okay to leave both of these elements (ex: form_errors will only generate HTML when in fallback mode) %>
|
16
|
-
<%% if request.xhr? %>
|
17
|
-
<div id="<%%= "update-<%= singular_name %>-#{@<%= singular_name %>.id}-errors" %>" style="display: none;" ></div>
|
18
|
-
<%% else %>
|
19
|
-
<%%= render :partial => 'form_errors' %>
|
20
|
-
<%% end %>
|
21
|
-
|
22
|
-
<%%= render :partial => 'form' %>
|
23
|
-
|
24
|
-
<p>
|
25
|
-
<%%= submit_tag "Update", :class => "submit" %>
|
26
|
-
<%%= link_to_function "Cancel", "AjaxScaffold.updateOnCancel('<%= singular_name %>',#{@<%= singular_name %>.id});",
|
27
|
-
:href => url_for(:controller => '<%= controller_file_name %>', :action => 'return_to_main') %>
|
28
|
-
<%%= loading_indicator_tag '<%= singular_name %>', "update-#{@<%= singular_name %>.id}" %>
|
29
|
-
</p>
|
30
|
-
<%%= end_form_tag %>
|
31
|
-
</td>
|
32
|
-
</tr>
|
33
|
-
<%% if not request.xhr? %>
|
34
|
-
</tbody>
|
35
|
-
</table>
|
36
|
-
<%% end %>
|
data/templates/view_index.rhtml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<%%= render_component :controller => '<%= Inflector.underscore(controller_name) %>', :action => 'list' %>
|
data/templates/view_new.rhtml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
<%% if not request.xhr? %>
|
2
|
-
<table class="ajax-scaffold" cellpadding="0" cellspacing="0">
|
3
|
-
<tbody>
|
4
|
-
<%% end %>
|
5
|
-
<tr id="create-<%= singular_name %>-<%%= @temp_id %>" class="create" <%%= "style=\"display: none;\"" if request.xhr? %>>
|
6
|
-
<td colspan="<%%= num_columns %>">
|
7
|
-
<%%= form_remote_tag :url => { :controller => '<%= controller_file_name %>', :action => 'create' },
|
8
|
-
:loading => "AjaxScaffold.createOnLoading(request,'<%= singular_name %>',#{@temp_id});",
|
9
|
-
:success => "AjaxScaffold.createOnSuccess(request,'<%= singular_name %>',#{@temp_id});",
|
10
|
-
:failure => "AjaxScaffold.createOnFailure(request,'<%= singular_name %>',#{@temp_id});",
|
11
|
-
:html => { :action => url_for(:controller => '<%= controller_file_name %>', :action => 'create'),
|
12
|
-
:id => "create-<%= singular_name %>-#{@temp_id}-form" } %>
|
13
|
-
|
14
|
-
<h4>New <%= Inflector.titleize(singular_name) %></h4>
|
15
|
-
|
16
|
-
<%% # Its actually okay to leave both of these elements (ex: form_errors will only generate HTML when in fallback mode) %>
|
17
|
-
<%% if request.xhr? %>
|
18
|
-
<div id="<%%= "create-<%= singular_name %>-#{@temp_id}-errors" %>" style="display: none;" ></div>
|
19
|
-
<%% else %>
|
20
|
-
<%%= render :partial => 'form_errors' %>
|
21
|
-
<%% end %>
|
22
|
-
|
23
|
-
<%%= render :partial => 'form' %>
|
24
|
-
|
25
|
-
<p>
|
26
|
-
<%%= submit_tag "Create", :class => "submit" %>
|
27
|
-
<%%= link_to_function "Cancel", "AjaxScaffold.createOnCancel('<%= singular_name %>',#{@temp_id});",
|
28
|
-
:href => url_for(:controller => '<%= controller_file_name %>', :action => 'return_to_main') %>
|
29
|
-
<%%= loading_indicator_tag '<%= singular_name %>', "create-#{@temp_id}" %>
|
30
|
-
</p>
|
31
|
-
<%%= end_form_tag %>
|
32
|
-
</td>
|
33
|
-
</tr>
|