dust-generators 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/README.rdoc +18 -6
  2. data/TODO.txt +5 -0
  3. data/lib/dust/version.rb +2 -2
  4. data/lib/generators/dust/albums/USAGE +2 -4
  5. data/lib/generators/dust/albums/albums_generator.rb +138 -138
  6. data/lib/generators/dust/albums/templates/app/controllers/albums_controller.rb +18 -18
  7. data/lib/generators/dust/albums/templates/app/controllers/photos_controller.rb +37 -37
  8. data/lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb +9 -9
  9. data/lib/generators/dust/albums/templates/app/models/album.rb +50 -48
  10. data/lib/generators/dust/albums/templates/app/models/photo.rb +21 -21
  11. data/lib/generators/dust/albums/templates/app/views/albums/_form.html.haml +35 -0
  12. data/lib/generators/dust/albums/templates/app/views/albums/_search.html.haml +4 -0
  13. data/lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml +39 -0
  14. data/lib/generators/dust/albums/templates/app/views/albums/edit.html.haml +4 -0
  15. data/lib/generators/dust/albums/templates/app/views/albums/index.html.haml +35 -0
  16. data/lib/generators/dust/albums/templates/app/views/albums/manage.html.haml +47 -0
  17. data/lib/generators/dust/albums/templates/app/views/albums/new.html.haml +6 -0
  18. data/lib/generators/dust/albums/templates/app/views/albums/show.html.haml +42 -0
  19. data/lib/generators/dust/albums/templates/app/views/albums/show.js.haml +1 -0
  20. data/lib/generators/dust/albums/templates/app/views/photos/_form.html.haml +17 -0
  21. data/lib/generators/dust/albums/templates/app/views/photos/_photo.html.haml +22 -0
  22. data/lib/generators/dust/albums/templates/app/views/photos/_search.html.haml +5 -0
  23. data/lib/generators/dust/albums/templates/app/views/photos/array.js.haml +3 -0
  24. data/lib/generators/dust/albums/templates/app/views/photos/edit.html.haml +27 -0
  25. data/lib/generators/dust/albums/templates/app/views/photos/index.html.haml +85 -0
  26. data/lib/generators/dust/albums/templates/app/views/photos/new.html.haml +7 -0
  27. data/lib/generators/dust/albums/templates/app/views/photos/show.html.haml +24 -0
  28. data/lib/generators/dust/albums/templates/app/views/photos/show.js.haml +10 -0
  29. data/lib/generators/dust/albums/templates/app/views/view_albums/index.html.haml +25 -0
  30. data/lib/generators/dust/albums/templates/app/views/view_albums/show.html.haml +32 -0
  31. data/lib/generators/dust/albums/templates/javascripts/dust_album.js +22 -22
  32. data/lib/generators/dust/albums/templates/migration/albums_migration.rb +23 -21
  33. data/lib/generators/dust/albums/templates/stylesheets/dust_album.css +15 -3
  34. data/lib/generators/dust/albums/templates/stylesheets/dust_album_app.css +54 -3
  35. data/lib/generators/dust/scaffold/scaffold_generator.rb +20 -20
  36. data/lib/generators/dust/scaffold/templates/controller.rb +6 -6
  37. data/lib/generators/dust/scaffold/templates/migration.rb +2 -0
  38. data/lib/generators/dust/scaffold/templates/model.rb +10 -10
  39. data/lib/generators/dust/scaffold/templates/view_controller.rb +8 -8
  40. data/lib/generators/dust/scaffold/templates/views/erb/_search.html.erb +5 -5
  41. data/lib/generators/dust/scaffold/templates/views/front_end/{index.html.erb → erb/index.html.erb} +6 -6
  42. data/lib/generators/dust/scaffold/templates/views/front_end/erb/show.html.erb +17 -0
  43. data/lib/generators/dust/scaffold/templates/views/front_end/haml/index.html.haml +10 -0
  44. data/lib/generators/dust/scaffold/templates/views/front_end/haml/show.html.haml +15 -0
  45. data/lib/generators/dust/scaffold/templates/views/haml/_form.html.haml +7 -4
  46. data/lib/generators/dust/scaffold/templates/views/haml/_search.html.haml +5 -0
  47. data/lib/generators/dust/scaffold/templates/views/haml/edit.html.haml +1 -11
  48. data/lib/generators/dust/scaffold/templates/views/haml/index.html.haml +18 -23
  49. data/lib/generators/dust/scaffold/templates/views/haml/new.html.haml +1 -3
  50. data/lib/generators/dust/scaffold/templates/views/haml/show.html.haml +15 -13
  51. data/rails_generators/dust_albums/USAGE +2 -4
  52. data/rails_generators/dust_config/USAGE +3 -3
  53. data/rails_generators/dust_scaffold/USAGE +5 -5
  54. metadata +30 -26
  55. data/lib/generators/dust/albums/templates/app/views/albums/_form.html.erb +0 -52
  56. data/lib/generators/dust/albums/templates/app/views/albums/_search.html.erb +0 -6
  57. data/lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.erb +0 -39
  58. data/lib/generators/dust/albums/templates/app/views/albums/edit.html.erb +0 -5
  59. data/lib/generators/dust/albums/templates/app/views/albums/index.html.erb +0 -61
  60. data/lib/generators/dust/albums/templates/app/views/albums/manage.html.erb +0 -65
  61. data/lib/generators/dust/albums/templates/app/views/albums/new.html.erb +0 -6
  62. data/lib/generators/dust/albums/templates/app/views/albums/show.html.erb +0 -56
  63. data/lib/generators/dust/albums/templates/app/views/albums/show.js.erb +0 -1
  64. data/lib/generators/dust/albums/templates/app/views/photos/_form.html.erb +0 -23
  65. data/lib/generators/dust/albums/templates/app/views/photos/_photo.html.erb +0 -25
  66. data/lib/generators/dust/albums/templates/app/views/photos/_search.html.erb +0 -6
  67. data/lib/generators/dust/albums/templates/app/views/photos/array.js.erb +0 -3
  68. data/lib/generators/dust/albums/templates/app/views/photos/edit.html.erb +0 -28
  69. data/lib/generators/dust/albums/templates/app/views/photos/index.html.erb +0 -85
  70. data/lib/generators/dust/albums/templates/app/views/photos/new.html.erb +0 -7
  71. data/lib/generators/dust/albums/templates/app/views/photos/show.html.erb +0 -26
  72. data/lib/generators/dust/albums/templates/app/views/photos/show.js.erb +0 -9
  73. data/lib/generators/dust/albums/templates/app/views/view_albums/index.html.erb +0 -31
  74. data/lib/generators/dust/albums/templates/app/views/view_albums/show.html.erb +0 -31
  75. data/lib/generators/dust/scaffold/templates/views/front_end/show.html.erb +0 -17
@@ -5,7 +5,7 @@ Description:
5
5
  on if you have a "spec" directory or not.
6
6
 
7
7
  IMPORTANT: This generator uses the "title" helper method which is generated
8
- by the nifty_layout generator. You may want to run that generator first.
8
+ by the dust_layout generator. You may want to run that generator first.
9
9
 
10
10
  Usage:
11
11
  Pass the name of the model, either CamelCased or under_scored, as the first
@@ -21,7 +21,7 @@ Usage:
21
21
  model's attributes. Timestamps are added by default, so you don't have to
22
22
  specify them by hand as 'created_at:datetime updated_at:datetime'.
23
23
 
24
- For example, `nifty_scaffold post name:string content:text hidden:boolean`
24
+ For example, `dust_scaffold post name:string content:text hidden:boolean`
25
25
  gives you a model with those three attributes, a controller that handles
26
26
  the create/show/update/destroy, forms to create and edit your posts, and
27
27
  an index that lists them all, as well as a map.resources :posts
@@ -32,20 +32,20 @@ Usage:
32
32
  mentioned. This option doesn't affect model attributes.
33
33
 
34
34
  Examples:
35
- script/generate nifty_scaffold post
35
+ script/generate dust_scaffold post
36
36
 
37
37
  Will create a controller called "posts" it will contain all seven
38
38
  CRUD actions along with the views. A model will NOT be created,
39
39
  instead it will look for an existing model and use those attributes.
40
40
 
41
- script/generate nifty_scaffold post name:string content:text index new edit
41
+ script/generate dust_scaffold post name:string content:text index new edit
42
42
 
43
43
  Will create a Post model and migration file with the name and content
44
44
  attributes. It will also create a controller with index, new, create,
45
45
  edit, and update actions. Notice the create and update actions are
46
46
  added automatically with new and edit.
47
47
 
48
- script/generate nifty_scaffold post ! show new
48
+ script/generate dust_scaffold post ! show new
49
49
 
50
50
  Creates a posts controller (no model) with index, edit, update, and
51
51
  destroy actions.
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 6
9
- version: 0.2.6
8
+ - 8
9
+ version: 0.2.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - rossnelson
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-05-07 00:00:00 -05:00
17
+ date: 2011-06-28 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -88,6 +88,7 @@ files:
88
88
  - LICENSE.txt
89
89
  - README.rdoc
90
90
  - Rakefile
91
+ - TODO.txt
91
92
  - lib/dust/version.rb
92
93
  - lib/generators/dust.rb
93
94
  - lib/generators/dust/albums/USAGE
@@ -100,26 +101,26 @@ files:
100
101
  - lib/generators/dust/albums/templates/app/helpers/view_albums_helper.rb
101
102
  - lib/generators/dust/albums/templates/app/models/album.rb
102
103
  - lib/generators/dust/albums/templates/app/models/photo.rb
103
- - lib/generators/dust/albums/templates/app/views/albums/_form.html.erb
104
- - lib/generators/dust/albums/templates/app/views/albums/_search.html.erb
105
- - lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.erb
106
- - lib/generators/dust/albums/templates/app/views/albums/edit.html.erb
107
- - lib/generators/dust/albums/templates/app/views/albums/index.html.erb
108
- - lib/generators/dust/albums/templates/app/views/albums/manage.html.erb
109
- - lib/generators/dust/albums/templates/app/views/albums/new.html.erb
110
- - lib/generators/dust/albums/templates/app/views/albums/show.html.erb
111
- - lib/generators/dust/albums/templates/app/views/albums/show.js.erb
112
- - lib/generators/dust/albums/templates/app/views/photos/_form.html.erb
113
- - lib/generators/dust/albums/templates/app/views/photos/_photo.html.erb
114
- - lib/generators/dust/albums/templates/app/views/photos/_search.html.erb
115
- - lib/generators/dust/albums/templates/app/views/photos/array.js.erb
116
- - lib/generators/dust/albums/templates/app/views/photos/edit.html.erb
117
- - lib/generators/dust/albums/templates/app/views/photos/index.html.erb
118
- - lib/generators/dust/albums/templates/app/views/photos/new.html.erb
119
- - lib/generators/dust/albums/templates/app/views/photos/show.html.erb
120
- - lib/generators/dust/albums/templates/app/views/photos/show.js.erb
121
- - lib/generators/dust/albums/templates/app/views/view_albums/index.html.erb
122
- - lib/generators/dust/albums/templates/app/views/view_albums/show.html.erb
104
+ - lib/generators/dust/albums/templates/app/views/albums/_form.html.haml
105
+ - lib/generators/dust/albums/templates/app/views/albums/_search.html.haml
106
+ - lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml
107
+ - lib/generators/dust/albums/templates/app/views/albums/edit.html.haml
108
+ - lib/generators/dust/albums/templates/app/views/albums/index.html.haml
109
+ - lib/generators/dust/albums/templates/app/views/albums/manage.html.haml
110
+ - lib/generators/dust/albums/templates/app/views/albums/new.html.haml
111
+ - lib/generators/dust/albums/templates/app/views/albums/show.html.haml
112
+ - lib/generators/dust/albums/templates/app/views/albums/show.js.haml
113
+ - lib/generators/dust/albums/templates/app/views/photos/_form.html.haml
114
+ - lib/generators/dust/albums/templates/app/views/photos/_photo.html.haml
115
+ - lib/generators/dust/albums/templates/app/views/photos/_search.html.haml
116
+ - lib/generators/dust/albums/templates/app/views/photos/array.js.haml
117
+ - lib/generators/dust/albums/templates/app/views/photos/edit.html.haml
118
+ - lib/generators/dust/albums/templates/app/views/photos/index.html.haml
119
+ - lib/generators/dust/albums/templates/app/views/photos/new.html.haml
120
+ - lib/generators/dust/albums/templates/app/views/photos/show.html.haml
121
+ - lib/generators/dust/albums/templates/app/views/photos/show.js.haml
122
+ - lib/generators/dust/albums/templates/app/views/view_albums/index.html.haml
123
+ - lib/generators/dust/albums/templates/app/views/view_albums/show.html.haml
123
124
  - lib/generators/dust/albums/templates/images/browse.png
124
125
  - lib/generators/dust/albums/templates/images/cancel.png
125
126
  - lib/generators/dust/albums/templates/images/save_position.png
@@ -187,9 +188,12 @@ files:
187
188
  - lib/generators/dust/scaffold/templates/views/erb/index.html.erb
188
189
  - lib/generators/dust/scaffold/templates/views/erb/new.html.erb
189
190
  - lib/generators/dust/scaffold/templates/views/erb/show.html.erb
190
- - lib/generators/dust/scaffold/templates/views/front_end/index.html.erb
191
- - lib/generators/dust/scaffold/templates/views/front_end/show.html.erb
191
+ - lib/generators/dust/scaffold/templates/views/front_end/erb/index.html.erb
192
+ - lib/generators/dust/scaffold/templates/views/front_end/erb/show.html.erb
193
+ - lib/generators/dust/scaffold/templates/views/front_end/haml/index.html.haml
194
+ - lib/generators/dust/scaffold/templates/views/front_end/haml/show.html.haml
192
195
  - lib/generators/dust/scaffold/templates/views/haml/_form.html.haml
196
+ - lib/generators/dust/scaffold/templates/views/haml/_search.html.haml
193
197
  - lib/generators/dust/scaffold/templates/views/haml/edit.html.haml
194
198
  - lib/generators/dust/scaffold/templates/views/haml/index.html.haml
195
199
  - lib/generators/dust/scaffold/templates/views/haml/new.html.haml
@@ -310,7 +314,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
310
314
  requirements:
311
315
  - - ">="
312
316
  - !ruby/object:Gem::Version
313
- hash: 901423407419320698
317
+ hash: -2483976356437539142
314
318
  segments:
315
319
  - 0
316
320
  version: "0"
@@ -1,52 +0,0 @@
1
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
2
-
3
- <%% form_for @<%=parent_singular_name%>, :validations => true do |f| %>
4
- <%%= f.error_messages %>
5
-
6
- <div class="item">
7
- <p>
8
- <%%= f.label :active %>
9
- <%%= f.check_box :active %>
10
- </p>
11
- </div>
12
-
13
- <div class="item">
14
- <p>
15
- <%%= f.label :nav, "Navigation Link" %><br />
16
- <%%= f.text_field :nav, :class => 'field' %>
17
- </p>
18
- </div>
19
-
20
- <div class="item">
21
- <p>
22
- <%%= f.label :title %><br />
23
- <%%= f.text_field :title, :class => 'field' %>
24
- </p>
25
- </div>
26
-
27
- <div class="item">
28
- <p>
29
- <%%= f.label :heading %><br />
30
- <%%= f.text_field :heading, :class => 'field' %>
31
- </p>
32
- </div>
33
-
34
- <div class="item">
35
- <p>
36
- <%%= f.label :filename %><br />
37
- <%%= f.text_field :filename, :class => 'field' %>
38
- </p>
39
- </div>
40
-
41
- <div class="item">
42
- <p>
43
- <%%= f.label :desc %><br />
44
- <%%= f.text_area :desc, :class => 'field' %>
45
- </p>
46
- </div>
47
-
48
- <div class="item">
49
- <p><%%= f.submit %></p>
50
- </div>
51
-
52
- <%% end %>
@@ -1,6 +0,0 @@
1
- <div id="searchbox">
2
- <%%= form_tag <%=parent_plural_name%>_path, :method => 'get' do %>
3
- <%%= text_field_tag :search, params[:search], :class => "input-text", :placeholder => 'Search <%=parent_plural_class_name%>' %>
4
- <%%= image_submit_tag "admin/blank.png", :class => "image-submit"%>
5
- <%%end %>
6
- </div>
@@ -1,39 +0,0 @@
1
-
2
- <%%= javascript_include_tag "uploadify/swfobject", "uploadify/jquery.uploadify.v2.1.0" %>
3
- <%%- session_key = Rails.application.config.session_options[:key] -%>
4
- <script type="text/javascript" charset="utf-8">
5
-
6
- $(document).ready(function() {
7
- $('#<%=child_singular_name%>_file').click(function(event) {
8
- event.preventDefault();
9
- });
10
-
11
- $('#<%=child_singular_name%>_file').uploadify({
12
- 'uploader' : '/javascripts/uploadify/uploadify.swf',
13
- 'script' : '/<%=child_plural_name%>',
14
- 'multi' : true,
15
- 'auto' : false,
16
- 'buttonText' : 'Find',
17
- 'buttonImg' : '/images/browse.png',
18
- 'cancelImg' : '/images/cancel.png',
19
- 'wmode' : 'transparent',
20
- height : 26, // The height of the flash button
21
- width : 101, // The width of the flash button
22
- onComplete : function(event, queueID, fileObj, response, data) { var dat = eval('(' +
23
- response + ')');$.getScript(dat.<%=child_singular_name%>);},
24
- scriptData: {
25
- '_http_accept': 'application/javascript',
26
- 'format' : 'json',
27
- '_method': 'post',
28
- '<%%= session_key %>' : encodeURIComponent('<%%= u cookies[session_key] %>'),
29
- 'authenticity_token': encodeURIComponent('<%%= u form_authenticity_token %>'),
30
- '<%=parent_singular_name%>_id' : '<%%= @<%=parent_singular_name%>.id %>'
31
- }
32
- });
33
-
34
- $('#<%=child_singular_name%>_submit').click(function(event){
35
- event.preventDefault();
36
- $('#<%=child_singular_name%>_file').uploadifyUpload();
37
- });
38
- });
39
- </script>
@@ -1,5 +0,0 @@
1
- <%%title "Edit <%=parent_class_name%>" %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
-
5
- <%%= render :partial => 'form' %>
@@ -1,61 +0,0 @@
1
- <%% title "<%=parent_plural_class_name%>" %>
2
- <%% heading "<%=parent_plural_class_name%>" %>
3
-
4
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
5
-
6
- <div class="button_bar">
7
- <%%= render :partial => 'search' %>
8
- <%%=link_to('new <%=parent_singular_name%>', new_<%=parent_singular_name%>_path, :class => 'newfile tip', :title => "New <%=parent_class_name%>")%>
9
- </div>
10
-
11
- <div class='<%=child_singular_name%>list'>
12
-
13
- <%%= will_paginate @<%=parent_plural_name%> %>
14
-
15
- <table class="<%=child_plural_name%>">
16
- <tr style='color:#222;'>
17
- <th></th>
18
- <th>
19
- <%=parent_class_name%> Title
20
- </th>
21
- <th>
22
- Created At
23
- </th>
24
- <th></th>
25
- </tr>
26
- <%% @<%=parent_plural_name%>.each do |<%=parent_singular_name%>| %>
27
- <tr class='<%%= cycle('odd', 'even')%>'>
28
-
29
- <td>
30
- <%% if <%=parent_singular_name%>.<%=child_plural_name%>.empty? %>
31
- <%%= link_to "add <%=child_plural_name%> to #{<%=parent_singular_name%>.title}", <%=parent_singular_name%> %>
32
- <%% else %>
33
- <%% @<%=child_singular_name%> = <%=parent_singular_name%>.<%=child_plural_name%>.find(:first) %>
34
- <%%= link_to image_tag(@<%=child_singular_name%>.file.url(:thumb)), <%=parent_singular_name%> %>
35
- <%% end -%>
36
- </td>
37
- <td>
38
- <%%= <%=parent_singular_name%>.title%>
39
- </td>
40
- <td>
41
- <%%= <%=parent_singular_name%>.created_at.to_s(:m_d_y) %>
42
- </td>
43
- <td>
44
- <div class="ui-widget ui-helper-clearfix" style='float:right'>
45
- <%%=link_to "", edit_<%=parent_singular_name%>_path(<%=parent_singular_name%>), :class => 'ui-icon ui-icon-pencil edit tip' %>
46
- <%%=link_to "", <%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete, :class => 'ui-icon ui-icon-close destroy tip', :title => "Destroy This Item" %>
47
- </div>
48
- </td>
49
- </tr>
50
- <%% end %>
51
-
52
- </table>
53
-
54
-
55
- </div>
56
-
57
- <div class="clear"></div>
58
-
59
- <%%= will_paginate @<%=parent_plural_name%> %>
60
-
61
-
@@ -1,65 +0,0 @@
1
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
2
-
3
- <script type="text/javascript" charset="utf-8">
4
- $(document).ready(function() {
5
- $(function () { // this line makes sure this code runs on page load
6
- $('.checkall').click(function () {
7
- $(this).parents('form:eq(0)').find(':checkbox').attr('checked', this.checked);
8
- });
9
- });
10
- });
11
- </script>
12
-
13
- <div class='<%=child_singular_name%>list'>
14
- <h1><%%= link_to @<%=parent_singular_name%>.title, <%=parent_singular_name%>_path(@<%=parent_singular_name%>) %></h1>
15
-
16
- <%% form_tag '/destroy-<%=child_plural_name%>' do %>
17
-
18
- <table class='<%=child_plural_name%>'>
19
- <tr style='color:#222;'>
20
- <th>
21
-
22
- </th>
23
- <th></th>
24
- <th>
25
- File Name
26
- </th>
27
- <th>
28
- File Size
29
- </th>
30
- <th>
31
- Created At
32
- </th>
33
- </tr>
34
- <%% @<%=parent_singular_name%>.<%=child_plural_name%>.each do |<%=child_singular_name%>| %>
35
- <tr class='<%%= cycle('odd', 'even')%>'>
36
- <td>
37
- <%%= check_box_tag "<%=child_singular_name%>_ids[]", <%=child_singular_name%>.id %>
38
- </td>
39
- <td>
40
- <%%= image_tag(<%=child_singular_name%>.file.url(:thumb), :height => "60") %>
41
-
42
- <div style="display:none"><div id="<%%=<%=child_singular_name%>.id%>"><%%= image_tag(<%=child_singular_name%>.file.url(:original)) %></div></div>
43
- </td>
44
- <td>
45
- <%%= <%=child_singular_name%>.file_file_name %>
46
- </td>
47
- <td>
48
- <%%= number_to_human_size(<%=child_singular_name%>.file_file_size) %>
49
- </td>
50
- <td>
51
- <%%= <%=child_singular_name%>.created_at.to_s(:m_d_y) %>
52
- </td>
53
- </tr>
54
- <%% end %>
55
- <tr class='odd'>
56
- <td colspan='5'>
57
- <input type="checkbox" class="checkall"> Check all
58
- <%%= submit_tag "Delete checked" %>
59
- </td>
60
- </tr>
61
- </table>
62
-
63
- <%% end -%>
64
-
65
- </div>
@@ -1,6 +0,0 @@
1
- <%% title "New <%=parent_class_name%>" %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
-
5
- <%%= render :partial => 'form' %>
6
-
@@ -1,56 +0,0 @@
1
- <%% title h(@<%=parent_singular_name%>.title) %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
-
5
-
6
- <%% content_for :head do %>
7
- <%%= javascript_include_tag 'dragsort', 'dust_<%=parent_singular_name%>' %>
8
- <%% end -%>
9
-
10
- <%%= render :partial => "upload_script" %>
11
-
12
- <div class="item">
13
-
14
- <div class='manage'>
15
- <%%= link_to "", edit_<%=parent_singular_name%>_path(@<%=parent_singular_name%>), :class => 'edit' %>
16
- <%%= link_to "", @<%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete, :class => 'destroy' %>
17
- </div>
18
-
19
- <h1>
20
- <%%= link_to @<%=parent_singular_name%>.title, view_<%=parent_singular_name%>_path(@<%=parent_singular_name%>.filename) %>
21
- </h1>
22
- <%%= simple_format(h(@<%=parent_singular_name%>.desc)) %>
23
-
24
- </div>
25
-
26
- <div class="item">
27
- <div class="manage">
28
- <br />
29
- <%%= link_to image_tag('save_position.png'), <%=child_plural_name%>_path, :id => 'order_<%=child_plural_name%>' %>
30
- </div>
31
-
32
- <h3 id="<%=child_plural_name%>_count"><%%= pluralize(@<%=parent_singular_name%>.<%=child_plural_name%>.size, "<%=child_class_name%>")%> <%% unless @<%=parent_singular_name%>.<%=child_plural_name%>.empty? %> | <%%= link_to "Select <%=child_plural_class_name%> For Deletion", manage_<%=child_plural_name%>_path(@<%=parent_singular_name%>, :format => 'html'), :class => 'settings' %> <%% end %> </h3>
33
- <p>Drag <%=child_plural_name%> to reorder them. Don't forget to hit the save order button when your done.</p>
34
- <ul id="uploads">
35
- <%%= render :partial => @<%=parent_singular_name%>.<%=child_plural_name%>.roots, :<%=child_singular_name%> => @<%=child_singular_name%> %>
36
- </ul>
37
-
38
- <div class="clear"></div>
39
- </div>
40
-
41
- <%% content_for :left do -%>
42
-
43
- <div id="uploadify">
44
- <h3>Add <%=child_plural_class_name%> to <%%= @<%=parent_singular_name%>.title.titleize %></h3>
45
- <%% form_for @new_<%=child_singular_name%>, :html => {:multipart => true} do |f| %>
46
-
47
- <%%= f.hidden_field :<%=parent_singular_name%>_id, "value" => @<%=parent_singular_name%>.id %>
48
- <div class="uploadifyButtons">
49
- <%%= image_submit_tag "upload.png", :id => "<%=child_singular_name%>_submit", :name => 'commit' %> <%%= f.file_field :file %>
50
- <div class='clear'></div>
51
- </div>
52
- <%% end %>
53
- </div>
54
-
55
- <%% end -%>
56
-
@@ -1 +0,0 @@
1
- $('#uploads').html("<%%= escape_javascript(render(@<%=parent_singular_name%>.<%=child_plural_name%>.roots, :<%=child_singular_name%> => @<%=child_singular_name%>)) %>");
@@ -1,23 +0,0 @@
1
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
2
-
3
- <%% form_for @<%=child_singular_name%>, :validations => true do |f| %>
4
- <%%= f.error_messages %>
5
- <div class="item">
6
- <p>
7
- <%%= f.label :title %><br />
8
- <%%= f.text_field :title, :class => 'field' %>
9
- </p>
10
- </div>
11
-
12
- <div class="item">
13
- <p>
14
- <%%= f.label :desc %><br />
15
- <%%= f.text_area :desc, :class => 'field' %>
16
- </p>
17
- </div>
18
-
19
- <div class="item">
20
- <p><%%= f.submit %></p>
21
- </div>
22
-
23
- <%% end %>
@@ -1,25 +0,0 @@
1
- <li id="<%%= "<%=child_singular_name%>_#{<%=child_singular_name%>.id}" %>">
2
- <div class="<%=child_singular_name%> <%%= "<%=child_singular_name%>_#{<%=child_singular_name%>.id}" %>">
3
- <script type="text/javascript" charset="utf-8">
4
- $("a.settings").fancybox({
5
- 'showCloseButton' : false,
6
- 'transitionIn' : 'elastic',
7
- 'transitionOut' : 'elastic',
8
- 'speedIn' : 400,
9
- 'speedOut' : 200,
10
- 'hideOnContentClick': false,
11
- 'overlayOpacity' : 0.6,
12
- 'overlayColor' : '#000',
13
- 'opacity' : 'true'
14
- });
15
- </script>
16
- <%%= image_tag <%=child_singular_name%>.file.url(:thumb), :height => '50' %>
17
- <p>
18
- <%%= truncate <%=child_singular_name%>.title, :length => 23 %> <br />
19
- <%% unless <%=child_singular_name%>.date_shot.blank? %>
20
- (<%%= <%=child_singular_name%>.date_shot %>)
21
- <%% end -%>
22
- <%%= link_to "Edit <%=child_class_name%>", edit_<%=child_singular_name%>_path(<%=child_singular_name%>.id, :format => 'html', :edit => "<%=child_singular_name%>"), :class => "settings", :title => "<%=child_class_name%> Settings" %>
23
- </p>
24
- </div>
25
- </li>
@@ -1,6 +0,0 @@
1
- <div id="searchbox">
2
- <%% form_tag <%=child_plural_name%>_path, :method => 'get' do %>
3
- <%%= text_field_tag :search, params[:search], :class => "input-text", :placeholder => 'Search <%=child_plural_class_name%>' %>
4
- <%%= image_submit_tag "admin/blank.png", :class => "image-submit"%>
5
- <%% end %>
6
- </div>
@@ -1,3 +0,0 @@
1
- $('#status').html('<%%= escape_javascript(flash.delete(:notice)) %>');
2
- $('#status').fadeIn().delay(2000).slideUp('4000', 'easeInOutBack');
3
- $.fancybox.hideActivity();
@@ -1,28 +0,0 @@
1
- <%%title "Edit <%=child_class_name%>" %>
2
-
3
- <%%if params[:edit] == '<%=child_singular_name%>' %>
4
- <script type="text/javascript" charset="utf-8">
5
-
6
- var options = {
7
- success: showFlash,
8
- data: {format: 'js'},
9
- clearForm: true
10
- };
11
-
12
- $('.edit_<%=child_singular_name%>').ajaxForm(options);
13
-
14
- $("#<%=child_singular_name%>_submit").click(function () {
15
- $("#fancybox-inner").fadeTo("slow", 0.1);
16
- $.fancybox.showActivity();
17
- });
18
-
19
- function showFlash() {
20
- $("#status").html("Success, Your settings have been saved");
21
- $('#status').fadeIn().delay(2000).slideUp('slow');
22
- $.fancybox.close();
23
- $("#fancybox-inner").fadeTo("slow", 1);
24
- }
25
- </script>
26
- <%%end -%>
27
-
28
- <%%= render :partial => 'form' %>
@@ -1,85 +0,0 @@
1
- <%% title "<%=child_plural_class_name%>" %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
- <%%= javascript( 'uploadify/jquery.uploadify.v2.1.0' ) %>
5
-
6
- <script type="text/javascript" charset="utf-8">
7
- $(document).ready(function() {
8
- $(function () { // this line makes sure this code runs on page load
9
- $('.checkall').click(function () {
10
- $(this).parents('form:eq(0)').find(':checkbox').attr('checked', this.checked);
11
- });
12
- });
13
- });
14
- </script>
15
-
16
- <div class="button_bar">
17
- <%%= render :partial => 'search' %>
18
- </div>
19
-
20
-
21
- <%%= will_paginate @<%=child_plural_name%> %>
22
-
23
- <%% @<%=child_singular_name%>_<%=parent_plural_name%>.sort.each do |title, <%=child_plural_name%>| %>
24
- <div class='<%=child_singular_name%>list'>
25
- <h1><%%= link_to title, <%=parent_singular_name%>_path(<%=child_plural_name%>.first.<%=parent_singular_name%>) %></h1>
26
-
27
- <%% form_for :<%=child_singular_name%>, :url => {:action => 'destroy'} do %>
28
-
29
- <table class='<%=child_plural_name%>'>
30
- <tr style='color:#222;'>
31
- <th>
32
-
33
- </th>
34
- <th></th>
35
- <th>
36
- File Name
37
- </th>
38
- <th>
39
- File Size
40
- </th>
41
- <th>
42
- Created At
43
- </th>
44
- </tr>
45
- <%% for <%=child_singular_name%> in <%=child_plural_name%> %>
46
- <%%= hidden_field_tag :<%=parent_singular_name%>_id, <%=child_singular_name%>.<%=parent_singular_name%>.id %>
47
- <tr class='<%%= cycle('odd', 'even')%>'>
48
- <td>
49
- <%%= check_box_tag "<%=child_singular_name%>_ids[]", <%=child_singular_name%>.id %>
50
- </td>
51
- <td>
52
- <%%= link_to image_tag(<%=child_singular_name%>.file.url(:thumb), :height => "30"), <%=child_singular_name%>.file.url(:original), :rel => title, :id => 'single_image' %>
53
-
54
- <div style="display:none"><div id="<%%=<%=child_singular_name%>.id%>"><%%= image_tag(<%=child_singular_name%>.file.url(:original)) %></div></div>
55
- </td>
56
- <td>
57
- <%%= <%=child_singular_name%>.file_file_name %>
58
- </td>
59
- <td>
60
- <%%= number_to_human_size(<%=child_singular_name%>.file_file_size) %>
61
- </td>
62
- <td>
63
- <%%= <%=child_singular_name%>.created_at.to_s(:m_d_y) %>
64
- </td>
65
- </tr>
66
- <%% end %>
67
- <tr class='odd'>
68
- <td colspan='5'>
69
- <input type="checkbox" class="checkall"> Check all
70
- <%%= submit_tag "Delete checked" %>
71
- </td>
72
- </tr>
73
- </table>
74
-
75
-
76
- <%% end -%>
77
-
78
- </div>
79
-
80
-
81
-
82
- <%% end %>
83
-
84
- <%%= will_paginate @<%=child_plural_name%> %>
85
-
@@ -1,7 +0,0 @@
1
- <%% title "New <%=child_class_name%>" %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
-
5
- <%%= render :partial => 'form' %>
6
-
7
- <p><%%= link_to "Back to List", <%=child_plural_name%>_path %></p>
@@ -1,26 +0,0 @@
1
- <%% title "<%=child_class_name%>" %>
2
-
3
- <%%= stylesheet( 'dust_<%=parent_singular_name%>','<%=parent_singular_name%>_uploadify') %>
4
-
5
- <p>
6
- <strong>Title:</strong>
7
- <%%=h @<%=child_singular_name%>.title %>
8
- </p>
9
- <p>
10
- <strong>Desc:</strong>
11
- <%%=h @<%=child_singular_name%>.desc %>
12
- </p>
13
- <p>
14
- <strong>Date Shot:</strong>
15
- <%%=h @<%=child_singular_name%>.date_shot %>
16
- </p>
17
- <p>
18
- <strong>Location:</strong>
19
- <%%=h @<%=child_singular_name%>.location %>
20
- </p>
21
-
22
- <p>
23
- <%%= link_to "Edit", edit_<%=child_singular_name%>_path(@<%=child_singular_name%>) %> |
24
- <%%= link_to "Destroy", @<%=child_singular_name%>, :confirm => 'Are you sure?', :method => :delete %> |
25
- <%%= link_to "View All", <%=child_plural_name%>_path %>
26
- </p>