dust-generators 0.2.8 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/lib/dust/version.rb +2 -2
  2. data/lib/generators/dust/albums/templates/app/views/albums/show.html.haml +1 -1
  3. data/lib/generators/dust/scaffold/scaffold_generator.rb +24 -24
  4. data/lib/generators/dust/scaffold/templates/actions/create.rb +1 -1
  5. data/lib/generators/dust/scaffold/templates/actions/destroy.rb +2 -2
  6. data/lib/generators/dust/scaffold/templates/actions/edit.rb +1 -1
  7. data/lib/generators/dust/scaffold/templates/actions/index.rb +1 -1
  8. data/lib/generators/dust/scaffold/templates/actions/new.rb +1 -1
  9. data/lib/generators/dust/scaffold/templates/actions/show.rb +1 -1
  10. data/lib/generators/dust/scaffold/templates/actions/update.rb +2 -2
  11. data/lib/generators/dust/scaffold/templates/controller.rb +3 -2
  12. data/lib/generators/dust/scaffold/templates/migration.rb +2 -2
  13. data/lib/generators/dust/scaffold/templates/model.rb +13 -11
  14. data/lib/generators/dust/scaffold/templates/view_controller.rb +8 -6
  15. data/lib/generators/dust/scaffold/templates/views/front_end/haml/index.html.haml +6 -5
  16. data/lib/generators/dust/scaffold/templates/views/front_end/haml/show.html.haml +11 -11
  17. data/lib/generators/dust/scaffold/templates/views/haml/_form.html.haml +1 -1
  18. data/lib/generators/dust/scaffold/templates/views/haml/_search.html.haml +1 -1
  19. data/lib/generators/dust/scaffold/templates/views/haml/index.html.haml +2 -2
  20. data/lib/generators/dust/scaffold/templates/views/haml/show.html.haml +1 -1
  21. metadata +49 -174
  22. data/rails_generators/dust_albums/USAGE +0 -6
  23. data/rails_generators/dust_albums/dust_albums_generator.rb +0 -196
  24. data/rails_generators/dust_albums/templates/README +0 -5
  25. data/rails_generators/dust_albums/templates/app/controllers/albums_controller.rb +0 -56
  26. data/rails_generators/dust_albums/templates/app/controllers/photos_controller.rb +0 -89
  27. data/rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb +0 -17
  28. data/rails_generators/dust_albums/templates/app/helpers/albums_helper.rb +0 -2
  29. data/rails_generators/dust_albums/templates/app/helpers/photos_helper.rb +0 -2
  30. data/rails_generators/dust_albums/templates/app/helpers/view_albums_helper.rb +0 -2
  31. data/rails_generators/dust_albums/templates/app/models/album.rb +0 -42
  32. data/rails_generators/dust_albums/templates/app/models/photo.rb +0 -18
  33. data/rails_generators/dust_albums/templates/app/views/albums/_form.html.erb +0 -52
  34. data/rails_generators/dust_albums/templates/app/views/albums/_search.html.erb +0 -6
  35. data/rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb +0 -37
  36. data/rails_generators/dust_albums/templates/app/views/albums/edit.html.erb +0 -5
  37. data/rails_generators/dust_albums/templates/app/views/albums/index.html.erb +0 -61
  38. data/rails_generators/dust_albums/templates/app/views/albums/manage.html.erb +0 -65
  39. data/rails_generators/dust_albums/templates/app/views/albums/new.html.erb +0 -6
  40. data/rails_generators/dust_albums/templates/app/views/albums/show.html.erb +0 -56
  41. data/rails_generators/dust_albums/templates/app/views/albums/show.js.erb +0 -1
  42. data/rails_generators/dust_albums/templates/app/views/photos/_form.html.erb +0 -23
  43. data/rails_generators/dust_albums/templates/app/views/photos/_photo.html.erb +0 -25
  44. data/rails_generators/dust_albums/templates/app/views/photos/_search.html.erb +0 -6
  45. data/rails_generators/dust_albums/templates/app/views/photos/array.js.erb +0 -3
  46. data/rails_generators/dust_albums/templates/app/views/photos/edit.html.erb +0 -28
  47. data/rails_generators/dust_albums/templates/app/views/photos/index.html.erb +0 -85
  48. data/rails_generators/dust_albums/templates/app/views/photos/new.html.erb +0 -7
  49. data/rails_generators/dust_albums/templates/app/views/photos/show.html.erb +0 -26
  50. data/rails_generators/dust_albums/templates/app/views/photos/show.js.erb +0 -9
  51. data/rails_generators/dust_albums/templates/app/views/view_albums/index.html.erb +0 -31
  52. data/rails_generators/dust_albums/templates/app/views/view_albums/show.html.erb +0 -31
  53. data/rails_generators/dust_albums/templates/images/browse.png +0 -0
  54. data/rails_generators/dust_albums/templates/images/cancel.png +0 -0
  55. data/rails_generators/dust_albums/templates/images/save_position.png +0 -0
  56. data/rails_generators/dust_albums/templates/images/upload.png +0 -0
  57. data/rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb +0 -17
  58. data/rails_generators/dust_albums/templates/initializers/session_store_middleware.rb +0 -1
  59. data/rails_generators/dust_albums/templates/javascript/dragsort.js +0 -288
  60. data/rails_generators/dust_albums/templates/javascript/dust_album.js +0 -28
  61. data/rails_generators/dust_albums/templates/javascript/uploadify/jquery.uploadify.v2.1.0.js +0 -258
  62. data/rails_generators/dust_albums/templates/javascript/uploadify/swfobject.js +0 -4
  63. data/rails_generators/dust_albums/templates/javascript/uploadify/uploadify.swf +0 -0
  64. data/rails_generators/dust_albums/templates/migration/albums_migration.rb +0 -39
  65. data/rails_generators/dust_albums/templates/stylesheets/dust_album.css +0 -16
  66. data/rails_generators/dust_albums/templates/stylesheets/dust_album_app.css +0 -15
  67. data/rails_generators/dust_albums/templates/stylesheets/uploadify.css +0 -84
  68. data/rails_generators/dust_config/USAGE +0 -23
  69. data/rails_generators/dust_config/dust_config_generator.rb +0 -32
  70. data/rails_generators/dust_config/templates/config.yml +0 -8
  71. data/rails_generators/dust_config/templates/load_config.rb +0 -2
  72. data/rails_generators/dust_scaffold/USAGE +0 -51
  73. data/rails_generators/dust_scaffold/dust_scaffold_generator.rb +0 -291
  74. data/rails_generators/dust_scaffold/templates/actions/create.rb +0 -9
  75. data/rails_generators/dust_scaffold/templates/actions/destroy.rb +0 -6
  76. data/rails_generators/dust_scaffold/templates/actions/edit.rb +0 -3
  77. data/rails_generators/dust_scaffold/templates/actions/index.rb +0 -3
  78. data/rails_generators/dust_scaffold/templates/actions/new.rb +0 -3
  79. data/rails_generators/dust_scaffold/templates/actions/show.rb +0 -3
  80. data/rails_generators/dust_scaffold/templates/actions/update.rb +0 -9
  81. data/rails_generators/dust_scaffold/templates/controller.rb +0 -9
  82. data/rails_generators/dust_scaffold/templates/fixtures.yml +0 -9
  83. data/rails_generators/dust_scaffold/templates/helper.rb +0 -2
  84. data/rails_generators/dust_scaffold/templates/migration.rb +0 -20
  85. data/rails_generators/dust_scaffold/templates/model.rb +0 -37
  86. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/create.rb +0 -11
  87. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/destroy.rb +0 -6
  88. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/edit.rb +0 -4
  89. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/index.rb +0 -4
  90. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/new.rb +0 -4
  91. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/show.rb +0 -4
  92. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/update.rb +0 -11
  93. data/rails_generators/dust_scaffold/templates/tests/rspec/controller.rb +0 -8
  94. data/rails_generators/dust_scaffold/templates/tests/rspec/model.rb +0 -7
  95. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/create.rb +0 -13
  96. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/destroy.rb +0 -8
  97. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/edit.rb +0 -6
  98. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/index.rb +0 -6
  99. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/new.rb +0 -6
  100. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/show.rb +0 -6
  101. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/update.rb +0 -13
  102. data/rails_generators/dust_scaffold/templates/tests/shoulda/controller.rb +0 -5
  103. data/rails_generators/dust_scaffold/templates/tests/shoulda/model.rb +0 -7
  104. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/create.rb +0 -11
  105. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/destroy.rb +0 -6
  106. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/edit.rb +0 -4
  107. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/index.rb +0 -4
  108. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/new.rb +0 -4
  109. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/show.rb +0 -4
  110. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/update.rb +0 -11
  111. data/rails_generators/dust_scaffold/templates/tests/testunit/controller.rb +0 -5
  112. data/rails_generators/dust_scaffold/templates/tests/testunit/model.rb +0 -7
  113. data/rails_generators/dust_scaffold/templates/view_controller.rb +0 -17
  114. data/rails_generators/dust_scaffold/templates/views/erb/_form.html.erb +0 -16
  115. data/rails_generators/dust_scaffold/templates/views/erb/_search.html.erb +0 -6
  116. data/rails_generators/dust_scaffold/templates/views/erb/edit.html.erb +0 -4
  117. data/rails_generators/dust_scaffold/templates/views/erb/index.html.erb +0 -24
  118. data/rails_generators/dust_scaffold/templates/views/erb/new.html.erb +0 -5
  119. data/rails_generators/dust_scaffold/templates/views/erb/show.html.erb +0 -23
  120. data/rails_generators/dust_scaffold/templates/views/front_end/index.html.erb +0 -14
  121. data/rails_generators/dust_scaffold/templates/views/front_end/show.html.erb +0 -17
@@ -1,4 +0,0 @@
1
- it "index action should render index template" do
2
- get :index
3
- response.should render_template(:index)
4
- end
@@ -1,4 +0,0 @@
1
- it "new action should render new template" do
2
- get :new
3
- response.should render_template(:new)
4
- end
@@ -1,4 +0,0 @@
1
- it "show action should render show template" do
2
- get :show, :id => <%= class_name %>.first
3
- response.should render_template(:show)
4
- end
@@ -1,11 +0,0 @@
1
- it "update action should render edit template when model is invalid" do
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- put :update, :id => <%= class_name %>.first
4
- response.should render_template(:edit)
5
- end
6
-
7
- it "update action should redirect when model is valid" do
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- put :update, :id => <%= class_name %>.first
10
- response.should redirect_to(<%= item_path_for_spec('url') %>)
11
- end
@@ -1,8 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe <%= plural_class_name %>Controller do
4
- fixtures :all
5
- render_views
6
-
7
- <%= controller_methods 'tests/rspec/actions' %>
8
- end
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe <%= class_name %> do
4
- it "should be valid" do
5
- <%= class_name %>.new.should be_valid
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- context "create action" do
2
- should "render new template when model is invalid" do
3
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
4
- post :create
5
- assert_template 'new'
6
- end
7
-
8
- should "redirect when model is valid" do
9
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
10
- post :create
11
- assert_redirected_to <%= item_path_for_test('url') %>
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- context "destroy action" do
2
- should "destroy model and redirect to index action" do
3
- <%= singular_name %> = <%= class_name %>.first
4
- delete :destroy, :id => <%= singular_name %>
5
- assert_redirected_to <%= items_path('url') %>
6
- assert !<%= class_name %>.exists?(<%= singular_name %>.id)
7
- end
8
- end
@@ -1,6 +0,0 @@
1
- context "edit action" do
2
- should "render edit template" do
3
- get :edit, :id => <%= class_name %>.first
4
- assert_template 'edit'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "index action" do
2
- should "render index template" do
3
- get :index
4
- assert_template 'index'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "new action" do
2
- should "render new template" do
3
- get :new
4
- assert_template 'new'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "show action" do
2
- should "render show template" do
3
- get :show, :id => <%= class_name %>.first
4
- assert_template 'show'
5
- end
6
- end
@@ -1,13 +0,0 @@
1
- context "update action" do
2
- should "render edit template when model is invalid" do
3
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
4
- put :update, :id => <%= class_name %>.first
5
- assert_template 'edit'
6
- end
7
-
8
- should "redirect when model is valid" do
9
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
10
- put :update, :id => <%= class_name %>.first
11
- assert_redirected_to <%= item_path_for_test('url') %>
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= plural_class_name %>ControllerTest < ActionController::TestCase
4
- <%= controller_methods 'tests/shoulda/actions' %>
5
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= class_name %>Test < ActiveSupport::TestCase
4
- should "be valid" do
5
- assert <%= class_name %>.new.valid?
6
- end
7
- end
@@ -1,11 +0,0 @@
1
- def test_create_invalid
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- post :create
4
- assert_template 'new'
5
- end
6
-
7
- def test_create_valid
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- post :create
10
- assert_redirected_to <%= item_path_for_test('url') %>
11
- end
@@ -1,6 +0,0 @@
1
- def test_destroy
2
- <%= singular_name %> = <%= class_name %>.first
3
- delete :destroy, :id => <%= singular_name %>
4
- assert_redirected_to <%= items_path('url') %>
5
- assert !<%= class_name %>.exists?(<%= singular_name %>.id)
6
- end
@@ -1,4 +0,0 @@
1
- def test_edit
2
- get :edit, :id => <%= class_name %>.first
3
- assert_template 'edit'
4
- end
@@ -1,4 +0,0 @@
1
- def test_index
2
- get :index
3
- assert_template 'index'
4
- end
@@ -1,4 +0,0 @@
1
- def test_new
2
- get :new
3
- assert_template 'new'
4
- end
@@ -1,4 +0,0 @@
1
- def test_show
2
- get :show, :id => <%= class_name %>.first
3
- assert_template 'show'
4
- end
@@ -1,11 +0,0 @@
1
- def test_update_invalid
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- put :update, :id => <%= class_name %>.first
4
- assert_template 'edit'
5
- end
6
-
7
- def test_update_valid
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- put :update, :id => <%= class_name %>.first
10
- assert_redirected_to <%= item_path_for_test('url') %>
11
- end
@@ -1,5 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= plural_class_name %>ControllerTest < ActionController::TestCase
4
- <%= controller_methods 'tests/testunit/actions' %>
5
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= class_name %>Test < ActiveSupport::TestCase
4
- def test_should_be_valid
5
- assert <%= class_name %>.new.valid?
6
- end
7
- end
@@ -1,17 +0,0 @@
1
- <%- first_attribute = attributes.first -%>
2
- class View<%= plural_class_name %>Controller < ApplicationController
3
-
4
- def index
5
- @<%= plural_name %> = <%= class_name %>.page(params[:search], params[:page])
6
- end
7
-
8
- def show
9
- if <%= class_name %>.find_by_<%= first_attribute.name %>(params[:filename]) == nil
10
- @<%= singular_name %> = <%= class_name %>.find(:first)
11
- render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404
12
- else
13
- @<%= singular_name %> = <%= class_name %>.find_by_<%= first_attribute.name %>(params[:filename])
14
- end
15
- end
16
-
17
- end
@@ -1,16 +0,0 @@
1
- <%% content_for :head do -%>
2
- <%%= javascript_include_tag :ckeditor %>
3
- <%% end -%>
4
-
5
- <%% form_for @<%= singular_name %>, :validations => true do |f| %>
6
- <%%= f.error_messages %>
7
- <%- for attribute in attributes -%>
8
- <div class="item">
9
- <%%= f.label :<%= attribute.name %> %><br />
10
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => 'field' %>
11
- </div>
12
- <%- end -%>
13
- <div class="item">
14
- <p><%%= f.submit %></p>
15
- </div>
16
- <%% end %>
@@ -1,6 +0,0 @@
1
- <div id="searchbox">
2
- <%% form_tag <%= plural_name %>_path, :method => 'get' do %>
3
- <%%= text_field_tag :search, params[:search], :class => "input-text", :placeholder => 'Search <%= plural_name.capitalize %>' %>
4
- <%%= image_submit_tag "admin/blank.png", :class => "image-submit"%>
5
- <%% end %>
6
- </div>
@@ -1,4 +0,0 @@
1
- <%% title "Edit <%= singular_name.titleize %>" %>
2
- <%% heading "Edit <%= singular_name.titleize %>" %>
3
-
4
- <%= render_form %>
@@ -1,24 +0,0 @@
1
- <%% title "<%= plural_name.titleize %>" %>
2
- <%- first_attribute = attributes.first -%>
3
- <div class="button_bar">
4
- <%%= render :partial => 'search' %>
5
- <%%= link_to 'new page', new_<%= singular_name %>_path, :class => 'newfile tip', :title => "New <%= singular_name.titleize %>" %>
6
- </div>
7
-
8
- <%%= will_paginate @<%= plural_name %> %>
9
-
10
- <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
11
- <div class="item">
12
- <div style='float:right'>
13
- <%%= link_to '', edit_<%= singular_name %>_path(<%= singular_name %>), :class => 'edit tip', :title => "Edit This Item" %>
14
- <%%= link_to '', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete, :class => 'destroy tip', :title => "Destroy This Item" %>
15
- </div>
16
-
17
- <h3><%%= link_to <%= singular_name %>.<%= first_attribute.name %>, <%= singular_name %> %></h3>
18
- <p>
19
- <%%= link_to "Preview <%= singular_name.titleize %>", <%= singular_name %>, :class => 'remote_iframe' %>
20
- </p>
21
- </div>
22
- <%% end -%>
23
-
24
- <%%= will_paginate @<%= plural_name %> %>
@@ -1,5 +0,0 @@
1
- <%% title "New <%= singular_name.titleize %>" %>
2
- <%% heading "New <%= singular_name.titleize %>" %>
3
-
4
- <%= render_form %>
5
-
@@ -1,23 +0,0 @@
1
- <%% title "<%= singular_name.titleize %>" %>
2
- <%- first_attribute = attributes.first -%>
3
-
4
- <div class="item">
5
- <div style='float:right'>
6
- <%- if action? :edit -%>
7
- <%%=link_to '', edit_<%= singular_name %>_path(@<%= singular_name %>), :class => 'edit tip', :title => "Edit This Item" %>
8
- <%- end -%>
9
- <%- if action? :destroy -%>
10
- <%%=link_to "", @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete, :class => 'destroy tip', :title => "Destroy This Item" %>
11
- <%- end -%>
12
- </div>
13
- <h3><%%= link_to @<%= singular_name %>.<%= first_attribute.name %>, @<%= singular_name %> %></h3>
14
- <p>
15
- <%%= link_to "Preview <%= singular_name.titleize %>", @<%= singular_name %>, :class => 'remote_iframe' %>
16
- </p>
17
- <%- for attribute in attributes -%>
18
- <p>
19
- <strong><%= attribute.column.human_name.titleize %>:</strong>
20
- <%%= @<%= singular_name %>.<%= attribute.name %> %>
21
- </p>
22
- <%- end -%>
23
- </div>
@@ -1,14 +0,0 @@
1
- <%% title "<%= plural_name.titleize %>" %>
2
- <%- first_attribute = attributes.first -%>
3
-
4
- <%%= will_paginate @<%= plural_name %> %>
5
-
6
- <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
7
- <div class="item">
8
-
9
- <h3><%%= link_to <%= singular_name %>.<%= first_attribute.name %>, view_<%= singular_name %>_path(<%= singular_name %>.<%= first_attribute.name %>) %></h3>
10
-
11
- </div>
12
- <%% end -%>
13
-
14
- <%%= will_paginate @<%= plural_name %> %>
@@ -1,17 +0,0 @@
1
- <%- first_attribute = attributes.first -%>
2
- <%% title @<%= singular_name %>.title %>
3
-
4
- <%% content_tag :div, :class => "page_#{@<%= singular_name %>.id}" do %>
5
-
6
- <%% heading @<%= singular_name %>.<%= first_attribute.name %> %>
7
- <%%= @<%= singular_name %>.<%= first_attribute.name %> %>
8
-
9
- <%% end %>
10
-
11
- <%% if permitted_to? :manage, :<%= plural_name %> %>
12
- <p>
13
- <%%= link_to "Edit", edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
14
- <%%= link_to "Destroy", @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %> |
15
- <%%= link_to "View All", <%= plural_name %>_path %>
16
- </p>
17
- <%% end %>