fetty-generators 1.7.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/Gemfile +2 -0
  2. data/README.rdoc +42 -36
  3. data/Rakefile +1 -3
  4. data/lib/generators/fetty.rb +160 -10
  5. data/lib/generators/fetty/authentication/USAGE +4 -0
  6. data/lib/generators/fetty/authentication/authentication_generator.rb +171 -0
  7. data/lib/generators/fetty/authentication/templates/controllers/reset_passwords_controller.rb +45 -0
  8. data/lib/generators/fetty/authentication/templates/controllers/sessions_controller.rb +30 -0
  9. data/lib/generators/fetty/authentication/templates/controllers/users_controller.rb +78 -0
  10. data/lib/generators/fetty/authentication/templates/helpers/reset_passwords_helper.rb +2 -0
  11. data/lib/generators/fetty/authentication/templates/helpers/sessions_helper.rb +2 -0
  12. data/lib/generators/fetty/authentication/templates/helpers/users_helper.rb +2 -0
  13. data/lib/generators/fetty/authentication/templates/lib/sessions_authentication.rb +53 -0
  14. data/lib/generators/fetty/authentication/templates/lib/users_authentication.rb +110 -0
  15. data/lib/generators/fetty/authentication/templates/mailers/setup_mail.rb +11 -0
  16. data/lib/generators/fetty/authentication/templates/mailers/user_mailer.rb +14 -0
  17. data/lib/generators/fetty/authentication/templates/models/active_record/create_users.rb +17 -0
  18. data/lib/generators/fetty/authentication/templates/models/active_record/user.rb +15 -0
  19. data/lib/generators/fetty/authentication/templates/models/mongoid/user.rb +23 -0
  20. data/lib/generators/fetty/authentication/templates/spec/controllers/reset_passwords_controller_spec.rb +93 -0
  21. data/lib/generators/fetty/authentication/templates/spec/controllers/sessions_controller_spec.rb +61 -0
  22. data/lib/generators/fetty/authentication/templates/spec/controllers/users_controller_spec.rb +158 -0
  23. data/lib/generators/fetty/authentication/templates/spec/models/user_spec.rb +108 -0
  24. data/lib/generators/fetty/authentication/templates/spec/routing/reset_passwords_routing_spec.rb +21 -0
  25. data/lib/generators/fetty/authentication/templates/spec/routing/sessions_routing_spec.rb +17 -0
  26. data/lib/generators/fetty/authentication/templates/spec/routing/users_routing_spec.rb +37 -0
  27. data/lib/generators/fetty/authentication/templates/spec/support/user_factories.rb +6 -0
  28. data/lib/generators/fetty/authentication/templates/views/layouts/application.html.erb +33 -0
  29. data/lib/generators/fetty/authentication/templates/views/reset_passwords/edit.html.erb +19 -0
  30. data/lib/generators/fetty/authentication/templates/views/reset_passwords/new.html.erb +14 -0
  31. data/lib/generators/fetty/authentication/templates/views/sessions/new.html.erb +22 -0
  32. data/lib/generators/fetty/authentication/templates/views/user_mailer/user_activation.text.erb +4 -0
  33. data/lib/generators/fetty/authentication/templates/views/user_mailer/user_forgot_password.text.erb +7 -0
  34. data/lib/generators/fetty/authentication/templates/views/users/_table.html.erb +23 -0
  35. data/lib/generators/fetty/authentication/templates/views/users/edit.html.erb +21 -0
  36. data/lib/generators/fetty/authentication/templates/views/users/index.html.erb +7 -0
  37. data/lib/generators/fetty/authentication/templates/views/users/index.js.erb +1 -0
  38. data/lib/generators/fetty/authentication/templates/views/users/new.html.erb +23 -0
  39. data/lib/generators/fetty/authentication/templates/views/users/show.html.erb +19 -0
  40. data/lib/generators/fetty/messages/USAGE +4 -0
  41. data/lib/generators/fetty/messages/messages_generator.rb +136 -0
  42. data/lib/generators/fetty/messages/templates/assets/javascripts/jquery.tokeninput.js +718 -0
  43. data/lib/generators/fetty/messages/templates/assets/javascripts/messages.js +19 -0
  44. data/lib/generators/fetty/messages/templates/assets/stylesheets/messages.css +87 -0
  45. data/lib/generators/fetty/messages/templates/assets/stylesheets/token-input-facebook.css +122 -0
  46. data/lib/generators/fetty/messages/templates/controllers/messages_controller.rb +109 -0
  47. data/lib/generators/fetty/messages/templates/helpers/messages_helper.rb +2 -0
  48. data/lib/generators/fetty/messages/templates/lib/users_messages.rb +67 -0
  49. data/lib/generators/fetty/messages/templates/models/active_record/create_messages.rb +24 -0
  50. data/lib/generators/fetty/messages/templates/models/active_record/message.rb +67 -0
  51. data/lib/generators/fetty/messages/templates/models/mongoid/message.rb +81 -0
  52. data/lib/generators/fetty/messages/templates/spec/controllers/messages_controller_spec.rb +78 -0
  53. data/lib/generators/fetty/messages/templates/spec/models/message_spec.rb +53 -0
  54. data/lib/generators/fetty/messages/templates/spec/routing/messages_routing_spec.rb +61 -0
  55. data/lib/generators/fetty/messages/templates/spec/support/message_factories.rb +8 -0
  56. data/lib/generators/fetty/messages/templates/views/_head.html.erb +20 -0
  57. data/lib/generators/fetty/messages/templates/views/_messages.html.erb +56 -0
  58. data/lib/generators/fetty/messages/templates/views/_tabs_panel.html.erb +11 -0
  59. data/lib/generators/fetty/messages/templates/views/index.html.erb +10 -0
  60. data/lib/generators/fetty/messages/templates/views/index.js.erb +1 -0
  61. data/lib/generators/fetty/messages/templates/views/new.html.erb +26 -0
  62. data/lib/generators/fetty/messages/templates/views/show.html.erb +35 -0
  63. data/lib/generators/fetty/scaffold/USAGE +2 -52
  64. data/lib/generators/fetty/scaffold/scaffold_generator.rb +96 -329
  65. data/lib/generators/fetty/scaffold/templates/controllers/active_record/controller.rb +60 -0
  66. data/lib/generators/fetty/scaffold/templates/controllers/mongoid/controller.rb +60 -0
  67. data/lib/generators/fetty/scaffold/templates/helpers/helper.rb +2 -0
  68. data/lib/generators/fetty/scaffold/templates/models/active_record/migration.rb +16 -0
  69. data/lib/generators/fetty/scaffold/templates/models/active_record/model.rb +10 -0
  70. data/lib/generators/fetty/scaffold/templates/models/mongoid/model.rb +16 -0
  71. data/lib/generators/fetty/scaffold/templates/test/rspec/controller.rb +98 -0
  72. data/lib/generators/fetty/scaffold/templates/test/rspec/factories.rb +26 -0
  73. data/lib/generators/fetty/scaffold/templates/test/rspec/helper.rb +15 -0
  74. data/lib/generators/fetty/scaffold/templates/test/rspec/model.rb +9 -0
  75. data/lib/generators/fetty/scaffold/templates/test/rspec/request.rb +11 -0
  76. data/lib/generators/fetty/scaffold/templates/test/rspec/routing.rb +41 -0
  77. data/lib/generators/fetty/scaffold/templates/test/test_unit/controller.rb +62 -0
  78. data/lib/generators/fetty/scaffold/templates/{fixtures.yml → test/test_unit/fixtures.yml} +2 -0
  79. data/lib/generators/fetty/scaffold/templates/test/test_unit/helper.rb +4 -0
  80. data/lib/generators/fetty/scaffold/templates/test/test_unit/model.rb +7 -0
  81. data/lib/generators/fetty/scaffold/templates/views/_form.html.erb +20 -0
  82. data/lib/generators/fetty/scaffold/templates/views/_table.html.erb +48 -0
  83. data/lib/generators/fetty/scaffold/templates/views/edit.html.erb +13 -0
  84. data/lib/generators/fetty/scaffold/templates/views/index.html.erb +15 -0
  85. data/lib/generators/fetty/scaffold/templates/views/{erb/index.js.erb → index.js.erb} +0 -0
  86. data/lib/generators/fetty/scaffold/templates/views/new.html.erb +9 -0
  87. data/lib/generators/fetty/scaffold/templates/views/show.html.erb +28 -0
  88. data/lib/generators/fetty/setup/USAGE +3 -20
  89. data/lib/generators/fetty/setup/setup_generator.rb +122 -61
  90. data/lib/generators/fetty/setup/templates/ability.rb +0 -0
  91. data/lib/generators/fetty/setup/templates/ckeditor.rb +54 -0
  92. data/lib/generators/fetty/setup/templates/ckeditor.tar.gz +0 -0
  93. data/lib/generators/fetty/setup/templates/escape_utils.rb +7 -0
  94. data/lib/generators/fetty/setup/templates/file_uploader.rb +15 -0
  95. data/lib/generators/fetty/setup/templates/image_uploader.rb +48 -0
  96. data/lib/generators/fetty/setup/templates/spec_helper.rb +44 -0
  97. data/lib/generators/fetty/views/USAGE +5 -0
  98. data/lib/generators/fetty/{layout/templates/stylesheet.css → views/templates/application.css} +184 -166
  99. data/lib/generators/fetty/views/templates/application.html.erb +23 -0
  100. data/lib/generators/fetty/{layout → views}/templates/application.js +0 -0
  101. data/lib/generators/fetty/views/templates/application_helper.rb +10 -0
  102. data/lib/generators/fetty/views/templates/down_arrow.gif +0 -0
  103. data/lib/generators/fetty/{layout → views}/templates/error_messages_helper.rb +0 -0
  104. data/lib/generators/fetty/{layout → views}/templates/layout_helper.rb +0 -0
  105. data/lib/generators/fetty/views/templates/up_arrow.gif +0 -0
  106. data/lib/generators/fetty/views/views_generator.rb +51 -0
  107. data/lib/generators/scaffold.rb +204 -0
  108. metadata +126 -111
  109. data/LICENSE +0 -20
  110. data/lib/generators/fetty/layout/USAGE +0 -26
  111. data/lib/generators/fetty/layout/layout_generator.rb +0 -44
  112. data/lib/generators/fetty/layout/templates/layout.html.erb +0 -32
  113. data/lib/generators/fetty/layout/templates/layout.html.haml +0 -34
  114. data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.erb +0 -23
  115. data/lib/generators/fetty/layout/templates/no-devise-links-layout.html.haml +0 -23
  116. data/lib/generators/fetty/layout/templates/stylesheet.sass +0 -163
  117. data/lib/generators/fetty/scaffold/templates/actions/create.rb +0 -8
  118. data/lib/generators/fetty/scaffold/templates/actions/destroy.rb +0 -5
  119. data/lib/generators/fetty/scaffold/templates/actions/edit.rb +0 -3
  120. data/lib/generators/fetty/scaffold/templates/actions/index.rb +0 -10
  121. data/lib/generators/fetty/scaffold/templates/actions/new.rb +0 -3
  122. data/lib/generators/fetty/scaffold/templates/actions/show.rb +0 -3
  123. data/lib/generators/fetty/scaffold/templates/actions/update.rb +0 -8
  124. data/lib/generators/fetty/scaffold/templates/controller.rb +0 -7
  125. data/lib/generators/fetty/scaffold/templates/helper.rb +0 -2
  126. data/lib/generators/fetty/scaffold/templates/migration.rb +0 -16
  127. data/lib/generators/fetty/scaffold/templates/model.rb +0 -7
  128. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/create.rb +0 -11
  129. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/destroy.rb +0 -6
  130. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/edit.rb +0 -4
  131. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/index.rb +0 -4
  132. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/new.rb +0 -4
  133. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/show.rb +0 -4
  134. data/lib/generators/fetty/scaffold/templates/tests/rspec/actions/update.rb +0 -11
  135. data/lib/generators/fetty/scaffold/templates/tests/rspec/controller.rb +0 -8
  136. data/lib/generators/fetty/scaffold/templates/tests/rspec/model.rb +0 -7
  137. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/create.rb +0 -13
  138. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/destroy.rb +0 -8
  139. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/edit.rb +0 -6
  140. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/index.rb +0 -6
  141. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/new.rb +0 -6
  142. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/show.rb +0 -6
  143. data/lib/generators/fetty/scaffold/templates/tests/shoulda/actions/update.rb +0 -13
  144. data/lib/generators/fetty/scaffold/templates/tests/shoulda/controller.rb +0 -5
  145. data/lib/generators/fetty/scaffold/templates/tests/shoulda/model.rb +0 -7
  146. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/create.rb +0 -11
  147. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/destroy.rb +0 -6
  148. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/edit.rb +0 -4
  149. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/index.rb +0 -4
  150. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/new.rb +0 -4
  151. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/show.rb +0 -4
  152. data/lib/generators/fetty/scaffold/templates/tests/testunit/actions/update.rb +0 -11
  153. data/lib/generators/fetty/scaffold/templates/tests/testunit/controller.rb +0 -5
  154. data/lib/generators/fetty/scaffold/templates/tests/testunit/model.rb +0 -7
  155. data/lib/generators/fetty/scaffold/templates/views/erb/_form.html.erb +0 -22
  156. data/lib/generators/fetty/scaffold/templates/views/erb/_table.html.erb +0 -50
  157. data/lib/generators/fetty/scaffold/templates/views/erb/edit.html.erb +0 -12
  158. data/lib/generators/fetty/scaffold/templates/views/erb/index.html.erb +0 -13
  159. data/lib/generators/fetty/scaffold/templates/views/erb/new.html.erb +0 -9
  160. data/lib/generators/fetty/scaffold/templates/views/erb/show.html.erb +0 -26
  161. data/lib/generators/fetty/scaffold/templates/views/haml/_form.html.haml +0 -8
  162. data/lib/generators/fetty/scaffold/templates/views/haml/_table.html.haml +0 -33
  163. data/lib/generators/fetty/scaffold/templates/views/haml/edit.html.haml +0 -14
  164. data/lib/generators/fetty/scaffold/templates/views/haml/index.html.haml +0 -12
  165. data/lib/generators/fetty/scaffold/templates/views/haml/index.js.haml +0 -1
  166. data/lib/generators/fetty/scaffold/templates/views/haml/new.html.haml +0 -8
  167. data/lib/generators/fetty/scaffold/templates/views/haml/show.html.haml +0 -23
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010 Fajri Fachriansyah
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,26 +0,0 @@
1
- Description:
2
- The fetty_layout generator creates a basic layout, stylesheet and
3
- helper which will give some structure to a starting Rails app.
4
-
5
- The generator takes one argument which will be the name of the
6
- layout and stylesheet files. If no argument is passed then it defaults
7
- to "application".
8
-
9
- The helper module includes some methods which can be called in any
10
- template or partial to set variables to be used in the layout, such as
11
- page title, javascript/stylesheet and also includes Devise SignIn and SignUp
12
- link buttons.
13
-
14
- Examples:
15
- rails generate fetty:layout
16
-
17
- Layout: app/views/layouts/application.html.erb
18
- Stylesheet: public/stylesheets/application.css
19
- Helper: app/helpers/layout_helper.rb
20
-
21
-
22
- rails generate fetty:layout --haml
23
-
24
- Layout: app/views/layouts/application.html.haml
25
- Stylesheet: public/stylesheets/sass/application.sass
26
- Helper: app/helpers/layout_helper.rb
@@ -1,44 +0,0 @@
1
- require 'generators/fetty'
2
-
3
- module Fetty
4
- module Generators
5
- class LayoutGenerator < Base
6
- argument :layout_name, :type => :string, :default => 'application', :banner => 'layout_name'
7
-
8
- class_option :haml, :desc => 'Generate HAML for view, and SASS for stylesheet.', :type => :boolean
9
- class_option :with_devise_links, :desc => 'Generate Devise links in your application layout.', :type => :boolean, :default => true
10
-
11
- def create_layout
12
- %w( "app/views/layouts/application.html.erb" "app/views/layouts/#{file_name}.html.haml" "app/views/layouts/#{file_name}.html.erb" ).each do |path|
13
- FileUtils.rm path if file_exists?(path)
14
- end
15
-
16
- if options.haml?
17
- if options.with_devise_links?
18
- template 'layout.html.haml', "app/views/layouts/#{file_name}.html.haml"
19
- else
20
- template 'no-devise-links-layout.html.haml', "app/views/layouts/#{file_name}.html.haml"
21
- end
22
- copy_file 'stylesheet.sass', "public/stylesheets/sass/#{file_name}.sass"
23
- else
24
- if options.with_devise_links?
25
- template 'layout.html.erb', "app/views/layouts/#{file_name}.html.erb"
26
- else
27
- template 'no-devise-links-layout.html.erb', "app/views/layouts/#{file_name}.html.erb"
28
- end
29
- copy_file 'stylesheet.css', "public/stylesheets/#{file_name}.css"
30
- end
31
- copy_file 'layout_helper.rb', 'app/helpers/layout_helper.rb'
32
- copy_file 'error_messages_helper.rb', 'app/helpers/error_messages_helper.rb'
33
- copy_file 'application.js', 'public/javascripts/application.js'
34
- end
35
-
36
- private
37
-
38
- def file_name
39
- layout_name.underscore
40
- end
41
-
42
- end
43
- end
44
- end
@@ -1,32 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
5
- <%%= stylesheet_link_tag "<%= file_name %>" %>
6
- <%%= javascript_include_tag :defaults %>
7
- <%%= csrf_meta_tag %>
8
- <%%= yield(:head) %>
9
- </head>
10
- <body>
11
- <div id="container">
12
- <%% flash.each do |name, msg| %>
13
- <%%= content_tag(:div, :id => "flash_#{name}", :class => "flash closable") do %>
14
- <%%=h msg %>
15
- <%%= content_tag(:span, "[close]", :title => "close", :class => "closelink") %>
16
- <%% end %>
17
- <%% end %>
18
-
19
- <div id="loginbox">
20
- <%% if user_signed_in? %>
21
- Signed in as <%%= current_user.email %> Not You?
22
- <%%= link_to "Sign out", destroy_user_session_path %>
23
- <%% else %>
24
- <%%= link_to "Sign up", new_user_registration_path %> or <%%= link_to "sign in", new_user_session_path %>
25
- <%% end %>
26
- </div>
27
-
28
- <%%= content_tag :h1, yield(:title) if show_title? %>
29
- <%%= yield %>
30
- </div>
31
- </body>
32
- </html>
@@ -1,34 +0,0 @@
1
- !!!
2
- %html
3
-
4
- %head
5
- %title
6
- = yield(:title) || "Untitled"
7
- %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
8
- = stylesheet_link_tag "application"
9
- = javascript_include_tag :defaults
10
- = csrf_meta_tag
11
- = yield(:head)
12
-
13
- %body
14
- #container
15
- - flash.each do |name, msg|
16
- %div{:id => "flash_#{name}", :class => "flash closable"}
17
- =h msg
18
- = content_tag :span, "[close]", :title => "close", :class => "closelink"
19
-
20
- #loginbox
21
- - if user_signed_in?
22
- Signed in as
23
- = current_user.email
24
- Not You?
25
- = link_to "Sign out", destroy_user_session_path
26
- - else
27
- = link_to "Sign up", new_user_registration_path
28
- or
29
- = link_to "sign in", new_user_session_path
30
-
31
- - if show_title?
32
- %h1= yield(:title)
33
-
34
- = yield
@@ -1,23 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
5
- <%%= stylesheet_link_tag "<%= file_name %>" %>
6
- <%%= javascript_include_tag :defaults %>
7
- <%%= csrf_meta_tag %>
8
- <%%= yield(:head) %>
9
- </head>
10
- <body>
11
- <div id="container">
12
- <%% flash.each do |name, msg| %>
13
- <%%= content_tag(:div, :id => "flash_#{name}", :class => "flash closable") do %>
14
- <%%=h msg %>
15
- <%%= content_tag(:span, "[close]", :title => "close", :class => "closelink") %>
16
- <%% end %>
17
- <%% end %>
18
-
19
- <%%= content_tag :h1, yield(:title) if show_title? %>
20
- <%%= yield %>
21
- </div>
22
- </body>
23
- </html>
@@ -1,23 +0,0 @@
1
- !!!
2
- %html
3
-
4
- %head
5
- %title
6
- = yield(:title) || "Untitled"
7
- %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
8
- = stylesheet_link_tag "application"
9
- = javascript_include_tag :defaults
10
- = csrf_meta_tag
11
- = yield(:head)
12
-
13
- %body
14
- #container
15
- - flash.each do |name, msg|
16
- %div{:id => "flash_#{name}", :class => "flash closable"}
17
- =h msg
18
- = content_tag :span, "[close]", :title => "close", :class => "closelink"
19
-
20
- - if show_title?
21
- %h1= yield(:title)
22
-
23
- = yield
@@ -1,163 +0,0 @@
1
- $primary_color: #D0D0D0
2
-
3
- body
4
- background-color: $primary_color
5
- font:
6
- family: Verdana, Helvetica, Arial
7
- size: 14px
8
-
9
- a
10
- color: blue
11
- img
12
- border: none
13
-
14
- .clear
15
- clear: both
16
- height: 0
17
- overflow: hidden
18
-
19
- #container
20
- width: 75%
21
- margin: 0 auto
22
- background: white
23
- padding: 20px 40px
24
- border: solid 1px black
25
- margin-top: 20px
26
-
27
- #flash_notice
28
- background-color: #CCEECC
29
- color: #006600
30
- text-shadow: 1px 1px 1px #FFFFFF
31
-
32
- #flash_error
33
- background-color: #FFFFD7
34
- color: #555555
35
- text-shadow: 1px 1px 1px #FFFFFF
36
-
37
- #flash_alert
38
- background-color: #F7E1DF
39
- color: #B81010
40
- text-shadow: 1px 1px 1px #FCF4F3
41
-
42
- .flash
43
- border: 1px solid #D5D5D5
44
- color: #555555
45
- margin: 10px 0
46
- padding: 10px
47
- font
48
- size: 13px
49
- weight: bold
50
-
51
- .closable
52
- height: 16px
53
- margin-top: -4px
54
- opacity: 0.8
55
- right: 8px
56
- top: 15px
57
-
58
- .closelink
59
- cursor: pointer
60
- float: right
61
- height: 16px
62
- margin-top: -4px
63
- opacity: 0.8
64
- right: 8px
65
- top: 15px
66
-
67
- .closelink:hover
68
- opacity: 1
69
-
70
- .fieldWithErrors
71
- display: inline
72
-
73
- .error_messages
74
- width: 400px
75
- border: 2px solid #cf0000
76
- padding: 0
77
- padding-bottom: 12px
78
- margin-bottom: 20px
79
- background-color: #f0f0f0
80
- font:
81
- size: 12px
82
- h2
83
- text-align: left
84
- padding: 5px 5px 5px 15px
85
- margin: 0
86
- font:
87
- weight: bold
88
- size: 12px
89
- background-color: #cc0000
90
- color: white
91
- p
92
- margin: 8px 10px
93
- ul
94
- margin: 0
95
-
96
- input.hint
97
- color: #999
98
- font
99
- style :italic
100
-
101
- #loginbox
102
- float: right
103
-
104
- table.pretty
105
- border-collapse: collapse
106
-
107
- .pretty td,
108
- .pretty th
109
- padding: 4px 10px
110
- border: solid 1px #AAA
111
-
112
- .simple_form
113
- label
114
- float: left
115
- width: 100px
116
- text-align: right
117
- margin: 2px 10px
118
-
119
- .simple_form
120
- div.input
121
- margin-bottom: 10px
122
-
123
- .simple_form
124
- div.boolean
125
- margin-left: 120px
126
-
127
- .simple_form
128
- input[type='submit']
129
- margin-left: 120px
130
-
131
- .simple_form
132
- div.boolean label
133
- float: none
134
- margin: 0
135
-
136
- .simple_form
137
- label.collection_radio
138
- float: none
139
- margin: 0
140
-
141
- .simple_form
142
- label.collection_radio
143
- margin-right: 10px
144
- margin-left: 2px
145
-
146
- .simple_form
147
- .error
148
- clear: left
149
- margin-left: 120px
150
- font
151
- size: 12px
152
- color: #D00
153
- display: block
154
-
155
- .simple_form
156
- .hint
157
- clear: left
158
- margin-left: 120px
159
- font
160
- size: 12px
161
- style: italic
162
- color: #555
163
- display: block
@@ -1,8 +0,0 @@
1
- def create
2
- @<%= instance_name %> = <%= class_name %>.new(params[:<%= instance_name %>])
3
- if @<%= instance_name %>.save
4
- redirect_to <%= items_url %>, :notice => "Successfully created <%= class_name.underscore.humanize.downcase %>."
5
- else
6
- render :action => 'new'
7
- end
8
- end
@@ -1,5 +0,0 @@
1
- def destroy
2
- @<%= instance_name %> = <%= class_name %>.find(params[:id])
3
- @<%= instance_name %>.destroy
4
- redirect_to <%= items_url %>, :notice => "Successfully destroyed <%= class_name.underscore.humanize.downcase %>."
5
- end
@@ -1,3 +0,0 @@
1
- def edit
2
- @<%= instance_name %> = <%= class_name %>.find(params[:id])
3
- end
@@ -1,10 +0,0 @@
1
- def index
2
- @search = <%= class_name %>.search(params[:search])
3
- @<%= instances_name %> = @search.paginate(:page => params[:page], :per_page => 10)
4
-
5
- respond_to do |format|
6
- format.html # index.html.erb
7
- format.xml { render :xml => @<%= instances_name %> }
8
- format.js
9
- end
10
- end
@@ -1,3 +0,0 @@
1
- def new
2
- @<%= instance_name %> = <%= class_name %>.new
3
- end
@@ -1,3 +0,0 @@
1
- def show
2
- @<%= instance_name %> = <%= class_name %>.find(params[:id])
3
- end
@@ -1,8 +0,0 @@
1
- def update
2
- @<%= instance_name %> = <%= class_name %>.find(params[:id])
3
- if @<%= instance_name %>.update_attributes(params[:<%= instance_name %>])
4
- redirect_to <%= items_url %>, :notice => "Successfully updated <%= class_name.underscore.humanize.downcase %>."
5
- else
6
- render :action => 'edit'
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- class <%= plural_class_name %>Controller < ApplicationController
2
- <%- unless @tinymce_name.empty? -%>
3
- uses_tiny_mce(:options => { :theme => 'advanced', :theme_advanced_resizing => true, :theme_advanced_resize_horizontal => false, :plugins => %w{ table fullscreen }}, :only => [:new, :edit])
4
- <%- end -%>
5
-
6
- <%= controller_methods :actions %>
7
- end
@@ -1,2 +0,0 @@
1
- module <%= plural_class_name %>Helper
2
- end