base_rails_app 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -0
- data/README +1 -0
- data/lib/app/controllers/application_controller.rb +55 -0
- data/lib/app/controllers/password_resets_controller.rb +45 -0
- data/lib/app/controllers/user_sessions_controller.rb +25 -0
- data/lib/app/controllers/users_controller.rb +37 -0
- data/lib/app/helpers/application_helper.rb +4 -0
- data/lib/app/helpers/user_sessions_helper.rb +2 -0
- data/lib/app/helpers/users_helper.rb +2 -0
- data/lib/app/models/postman.rb +20 -0
- data/lib/app/models/user.rb +12 -0
- data/lib/app/models/user_session.rb +2 -0
- data/lib/app/views/application/404_not_found.html.erb +8 -0
- data/lib/app/views/layouts/application.html.erb +57 -0
- data/lib/app/views/password_resets/_sidebar.html.erb +0 -0
- data/lib/app/views/password_resets/edit.html.erb +33 -0
- data/lib/app/views/password_resets/new.html.erb +26 -0
- data/lib/app/views/postman/password_reset_instructions.html.erb +3 -0
- data/lib/app/views/postman/welcome_email.html.erb +3 -0
- data/lib/app/views/user_sessions/_form.html.erb +19 -0
- data/lib/app/views/user_sessions/_sidebar.html.erb +13 -0
- data/lib/app/views/user_sessions/new.html.erb +15 -0
- data/lib/app/views/users/_form.html.erb +28 -0
- data/lib/app/views/users/_sidebar.html.erb +6 -0
- data/lib/app/views/users/edit.html.erb +19 -0
- data/lib/app/views/users/new.html.erb +15 -0
- data/lib/app/views/users/show.html.erb +46 -0
- data/lib/base_rails_app.rb +5 -0
- data/lib/base_rails_app/boot.rb +2 -0
- data/lib/base_rails_app/tasks.rb +12 -0
- data/lib/config/configatron/cucumber.rb +0 -0
- data/lib/config/configatron/defaults.rb +4 -0
- data/lib/config/configatron/development.rb +1 -0
- data/lib/config/configatron/production.rb +0 -0
- data/lib/config/configatron/test.rb +0 -0
- data/lib/config/database.yml +25 -0
- data/lib/config/deploy.rb +15 -0
- data/lib/config/environments/cucumber.rb +22 -0
- data/lib/config/environments/development.rb +17 -0
- data/lib/config/environments/production.rb +28 -0
- data/lib/config/environments/test.rb +28 -0
- data/lib/config/gemtronics.rb +36 -0
- data/lib/config/initializers/backtrace_silencers.rb +7 -0
- data/lib/config/initializers/configatron.rb +1 -0
- data/lib/config/initializers/hoptoad.rb +3 -0
- data/lib/config/initializers/inflections.rb +10 -0
- data/lib/config/initializers/mailers.rb +1 -0
- data/lib/config/initializers/mime_types.rb +5 -0
- data/lib/config/initializers/new_rails_defaults.rb +21 -0
- data/lib/config/initializers/session_store.rb +17 -0
- data/lib/config/locales/en.yml +5 -0
- data/lib/config/routes.rb +51 -0
- data/lib/config/schedule.rb +20 -0
- data/lib/db/migrate/20090809175903_create_users.rb +30 -0
- data/lib/db/migrate/20090809204840_acts_as_taggable_on_migration.rb +29 -0
- data/lib/db/migrate/20090912171353_create_delayed_jobs.rb +20 -0
- data/lib/db/migrate/20090912171829_add_delayed_job_extras.rb +11 -0
- data/lib/db/migrate/20090929201455_add_more_time_columns_to_dj.rb +11 -0
- data/lib/db/schema.rb +72 -0
- data/lib/db/seeds.rb +7 -0
- data/lib/lib/tasks/cucumber.rake +36 -0
- data/lib/lib/tasks/rcov.rake +27 -0
- data/lib/lib/tasks/rspec.rake +183 -0
- data/lib/vendor/plugins/delayed_job/generators/delayed_job/delayed_job_generator.rb +22 -0
- data/lib/vendor/plugins/delayed_job/generators/delayed_job/templates/migration.rb +20 -0
- data/lib/vendor/plugins/delayed_job/init.rb +2 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/command.rb +65 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/job.rb +271 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/message_sending.rb +18 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/performable_method.rb +55 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/tasks.rb +15 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed/worker.rb +54 -0
- data/lib/vendor/plugins/delayed_job/lib/delayed_job.rb +13 -0
- data/lib/vendor/plugins/delayed_job/recipes/delayed_job.rb +26 -0
- data/lib/vendor/plugins/delayed_job/tasks/jobs.rake +1 -0
- data/lib/vendor/plugins/hoptoad_notifier/install.rb +1 -0
- data/lib/vendor/plugins/hoptoad_notifier/lib/hoptoad_notifier.rb +418 -0
- data/lib/vendor/plugins/hoptoad_notifier/lib/hoptoad_tasks.rb +26 -0
- data/lib/vendor/plugins/hoptoad_notifier/recipes/hoptoad.rb +22 -0
- data/lib/vendor/plugins/hoptoad_notifier/tasks/hoptoad_notifier_tasks.rake +66 -0
- data/lib/vendor/plugins/inherited_resources/README.rdoc +524 -0
- data/lib/vendor/plugins/inherited_resources/inherited_resources.gemspec +71 -0
- data/lib/vendor/plugins/inherited_resources/init.rb +1 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources.rb +23 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/actions.rb +79 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/base.rb +42 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/base_helpers.rb +363 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/belongs_to_helpers.rb +89 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/class_methods.rb +338 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/dsl.rb +26 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/dumb_responder.rb +20 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/has_scope_helpers.rb +83 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/legacy/respond_to.rb +156 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/legacy/responder.rb +200 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/polymorphic_helpers.rb +155 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/singleton_helpers.rb +95 -0
- data/lib/vendor/plugins/inherited_resources/lib/inherited_resources/url_helpers.rb +179 -0
- data/lib/vendor/plugins/inherited_resources/test/aliases_test.rb +139 -0
- data/lib/vendor/plugins/inherited_resources/test/association_chain_test.rb +125 -0
- data/lib/vendor/plugins/inherited_resources/test/base_test.rb +225 -0
- data/lib/vendor/plugins/inherited_resources/test/belongs_to_test.rb +87 -0
- data/lib/vendor/plugins/inherited_resources/test/class_methods_test.rb +138 -0
- data/lib/vendor/plugins/inherited_resources/test/customized_base_test.rb +162 -0
- data/lib/vendor/plugins/inherited_resources/test/customized_belongs_to_test.rb +76 -0
- data/lib/vendor/plugins/inherited_resources/test/defaults_test.rb +70 -0
- data/lib/vendor/plugins/inherited_resources/test/flash_test.rb +88 -0
- data/lib/vendor/plugins/inherited_resources/test/has_scope_test.rb +139 -0
- data/lib/vendor/plugins/inherited_resources/test/locales/en.yml +17 -0
- data/lib/vendor/plugins/inherited_resources/test/nested_belongs_to_test.rb +108 -0
- data/lib/vendor/plugins/inherited_resources/test/optional_belongs_to_test.rb +164 -0
- data/lib/vendor/plugins/inherited_resources/test/polymorphic_test.rb +186 -0
- data/lib/vendor/plugins/inherited_resources/test/redirect_to_test.rb +51 -0
- data/lib/vendor/plugins/inherited_resources/test/respond_to_test.rb +155 -0
- data/lib/vendor/plugins/inherited_resources/test/singleton_test.rb +83 -0
- data/lib/vendor/plugins/inherited_resources/test/test_helper.rb +38 -0
- data/lib/vendor/plugins/inherited_resources/test/url_helpers_test.rb +537 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cars/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cars/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cars/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cars/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cities/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cities/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cities/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/cities/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/comments/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/comments/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/comments/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/comments/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/employees/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/employees/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/employees/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/employees/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/managers/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/managers/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/managers/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/painters/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/painters/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/painters/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/painters/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/pets/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/pets/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/pets/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/pets/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/products/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/products/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/products/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/products/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/professors/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/professors/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/professors/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/professors/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/projects/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/projects/index.json.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/projects/respond_to_skip_default_template.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/projects/respond_with_resource.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/students/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/students/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/trees/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/trees/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/trees/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/trees/show.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/users/edit.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/users/index.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/users/new.html.erb +1 -0
- data/lib/vendor/plugins/inherited_resources/test/views/users/show.html.erb +1 -0
- data/lib/vendor/plugins/web-app-theme/README.md +22 -0
- data/lib/vendor/plugins/web-app-theme/images/avatar.png +0 -0
- data/lib/vendor/plugins/web-app-theme/index.html +473 -0
- data/lib/vendor/plugins/web-app-theme/javascripts/jquery-1.3.min.js +19 -0
- data/lib/vendor/plugins/web-app-theme/javascripts/jquery.localscroll.js +104 -0
- data/lib/vendor/plugins/web-app-theme/javascripts/jquery.scrollTo.js +150 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/theme/templates/view_layout_administration.html.erb +48 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/theme/templates/view_layout_sign.html.erb +15 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/theme/theme_generator.rb +38 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_edit.html.erb +20 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_form.html.erb +10 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_new.html.erb +19 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_show.html.erb +23 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_sidebar.html.erb +13 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_signin.html.erb +39 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_signup.html.erb +56 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/templates/view_tables.html.erb +50 -0
- data/lib/vendor/plugins/web-app-theme/rails_generators/themed/themed_generator.rb +89 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/base.css +336 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/bec-green/style.css +290 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/bec/style.css +301 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/blue/style.css +280 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/default/style.css +267 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/djime-cerulean/style.css +298 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/drastic-dark/style.css +373 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/kathleene/style.css +272 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/orange/style.css +263 -0
- data/lib/vendor/plugins/web-app-theme/stylesheets/themes/reidb-greenish/style.css +301 -0
- metadata +257 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<h3>Simple Block</h3>
|
3
|
+
<div class="content">
|
4
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<div class="block">
|
8
|
+
<h3>Links</h3>
|
9
|
+
<ul class="navigation">
|
10
|
+
<li><a href="#">Link 1</a></li>
|
11
|
+
<li><a href="#">Link 2</a></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<h1><%= options[:app_name] %></h1>
|
2
|
+
<div class="block" id="block-login">
|
3
|
+
<h2>Login Box</h2>
|
4
|
+
<div class="content login">
|
5
|
+
<div class="flash">
|
6
|
+
<%% flash.each do |type, message| -%>
|
7
|
+
<div class="message <%%= type %>">
|
8
|
+
<p><%%= message %></p>
|
9
|
+
</div>
|
10
|
+
<%% end -%>
|
11
|
+
</div>
|
12
|
+
<%% form_tag({:action => :create}, :class => 'form login') do -%>
|
13
|
+
<div class="group">
|
14
|
+
<div class="left">
|
15
|
+
<label class="label right">Login</label>
|
16
|
+
</div>
|
17
|
+
<div class="right">
|
18
|
+
<%%= text_field_tag :login, @login, :class => 'text_field' %>
|
19
|
+
</div>
|
20
|
+
<div class="clear"></div>
|
21
|
+
</div>
|
22
|
+
<div class="group">
|
23
|
+
<div class="left">
|
24
|
+
<label class="label right">Password</label>
|
25
|
+
</div>
|
26
|
+
<div class="right">
|
27
|
+
<%%= password_field_tag :password, nil, :class => 'text_field' %>
|
28
|
+
</div>
|
29
|
+
<div class="clear"></div>
|
30
|
+
</div>
|
31
|
+
<div class="group navform">
|
32
|
+
<div class="right">
|
33
|
+
<input type="submit" class="button" value="Sign in" />
|
34
|
+
</div>
|
35
|
+
<div class="clear"></div>
|
36
|
+
</div>
|
37
|
+
<%% end -%>
|
38
|
+
</div>
|
39
|
+
</div>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<h1><%= options[:app_name] %></h1>
|
2
|
+
<div class="block" id="block-signup">
|
3
|
+
<h2>Sign up</h2>
|
4
|
+
<div class="content">
|
5
|
+
<div class="flash">
|
6
|
+
<%% flash.each do |type, message| -%>
|
7
|
+
<div class="message <%%= type %>">
|
8
|
+
<p><%%= message %></p>
|
9
|
+
</div>
|
10
|
+
<%% end -%>
|
11
|
+
</div>
|
12
|
+
<%% form_for :<%= resource_name %>, :url => <%= controller_routing_path %>_path, :html => { :class => 'form' } do |f| -%>
|
13
|
+
<div class="group">
|
14
|
+
<div class="left">
|
15
|
+
<label class="label">Login</label>
|
16
|
+
</div>
|
17
|
+
<div class="right">
|
18
|
+
<%%= f.text_field :login, :class => 'text_field' %>
|
19
|
+
</div>
|
20
|
+
<div class="clear"></div>
|
21
|
+
</div>
|
22
|
+
<div class="group">
|
23
|
+
<div class="left">
|
24
|
+
<label class="label">Email</label>
|
25
|
+
</div>
|
26
|
+
<div class="right">
|
27
|
+
<%%= f.text_field :email, :class => 'text_field' %>
|
28
|
+
</div>
|
29
|
+
<div class="clear"></div>
|
30
|
+
</div>
|
31
|
+
<div class="group">
|
32
|
+
<div class="left">
|
33
|
+
<label class="label">Password</label>
|
34
|
+
</div>
|
35
|
+
<div class="right">
|
36
|
+
<%%= f.password_field :password, :class => 'text_field' %>
|
37
|
+
</div>
|
38
|
+
<div class="clear"></div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="group">
|
42
|
+
<div class="left">
|
43
|
+
<label class="label">Password</label>
|
44
|
+
</div>
|
45
|
+
<div class="right">
|
46
|
+
<%%= f.password_field :password_confirmation, :class => 'text_field' %>
|
47
|
+
</div>
|
48
|
+
<div class="clear"></div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div class="group navform">
|
52
|
+
<input type="submit" class="button" value="Sign up" />
|
53
|
+
</div>
|
54
|
+
<%% end -%>
|
55
|
+
</div>
|
56
|
+
</div>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<div class="secondary-navigation">
|
3
|
+
<ul>
|
4
|
+
<li class="first active"><%%= link_to 'List', <%= controller_routing_path %>_path %></li>
|
5
|
+
<li><%%= link_to 'New', new_<%= singular_controller_routing_path %>_path %></li>
|
6
|
+
</ul>
|
7
|
+
<div class="clear"></div>
|
8
|
+
</div>
|
9
|
+
<div class="content">
|
10
|
+
<h2 class="title">All <%= plural_model_name %></h2>
|
11
|
+
<div class="inner">
|
12
|
+
<table class="table">
|
13
|
+
<tr>
|
14
|
+
<th class="first">ID</th>
|
15
|
+
<th><%= columns.first.name.capitalize %></th>
|
16
|
+
<th>Created at</th>
|
17
|
+
<th class="last"> </th>
|
18
|
+
</tr>
|
19
|
+
<%% @<%= plural_resource_name %>.each do |<%= resource_name %>| -%>
|
20
|
+
<tr>
|
21
|
+
<td>
|
22
|
+
<%%= <%= resource_name %>.id %>
|
23
|
+
</td>
|
24
|
+
<td>
|
25
|
+
<%%= link_to <%= resource_name %>.<%= columns.first.name %>, <%= singular_controller_routing_path %>_path(<%= resource_name %>) %>
|
26
|
+
</td>
|
27
|
+
<td>
|
28
|
+
<%%= <%= resource_name %>.created_at %>
|
29
|
+
</td>
|
30
|
+
<td class="last">
|
31
|
+
<%%= link_to 'show', <%= singular_controller_routing_path %>_path(<%= resource_name %>) %> |
|
32
|
+
<%%= link_to 'edit', edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>) %> |
|
33
|
+
<%%= link_to 'destroy', <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => 'Are you sure?' %>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
<%% end -%>
|
37
|
+
</table>
|
38
|
+
<div class="actions-bar">
|
39
|
+
<div class="actions">
|
40
|
+
</div>
|
41
|
+
<% if options[:will_paginate] %>
|
42
|
+
<%%= will_paginate @<%= resource_name %> %>
|
43
|
+
<% end %>
|
44
|
+
<div class="clear"></div>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<%% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
class ThemedGenerator < Rails::Generator::NamedBase
|
2
|
+
|
3
|
+
default_options :app_name => 'Web App',
|
4
|
+
:themed_type => :crud,
|
5
|
+
:layout => false,
|
6
|
+
:will_paginate => false
|
7
|
+
|
8
|
+
attr_reader :controller_routing_path,
|
9
|
+
:singular_controller_routing_path,
|
10
|
+
:columns,
|
11
|
+
:model_name,
|
12
|
+
:plural_model_name,
|
13
|
+
:resource_name,
|
14
|
+
:plural_resource_name
|
15
|
+
|
16
|
+
def initialize(runtime_args, runtime_options = {})
|
17
|
+
super
|
18
|
+
@controller_path = runtime_args.shift
|
19
|
+
@model_name = runtime_args.shift
|
20
|
+
end
|
21
|
+
|
22
|
+
def manifest
|
23
|
+
@controller_routing_path = @table_name
|
24
|
+
@singular_controller_routing_path = @table_name.singularize
|
25
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_path)
|
26
|
+
@model_name = base_name.singularize unless @model_name
|
27
|
+
|
28
|
+
# Post
|
29
|
+
@model_name = @model_name.camelize
|
30
|
+
# Posts
|
31
|
+
@plural_model_name = @model_name.pluralize
|
32
|
+
# post
|
33
|
+
@resource_name = @model_name.downcase
|
34
|
+
# posts
|
35
|
+
@plural_resource_name = @resource_name.pluralize
|
36
|
+
|
37
|
+
manifest_method = "manifest_for_#{options[:themed_type]}"
|
38
|
+
record do |m|
|
39
|
+
send(manifest_method, m) if respond_to?(manifest_method)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
protected
|
44
|
+
|
45
|
+
def manifest_for_crud(m)
|
46
|
+
@columns = get_columns
|
47
|
+
m.directory(File.join('app/views', @controller_file_path))
|
48
|
+
m.template('view_tables.html.erb', File.join("app/views", @controller_file_path, "index.html.erb"))
|
49
|
+
m.template('view_new.html.erb', File.join("app/views", @controller_file_path, "new.html.erb"))
|
50
|
+
m.template('view_edit.html.erb', File.join("app/views", @controller_file_path, "edit.html.erb"))
|
51
|
+
m.template('view_form.html.erb', File.join("app/views", @controller_file_path, "_form.html.erb"))
|
52
|
+
m.template('view_show.html.erb', File.join("app/views", @controller_file_path, "show.html.erb"))
|
53
|
+
m.template('view_sidebar.html.erb', File.join("app/views", @controller_file_path, "_sidebar.html.erb"))
|
54
|
+
|
55
|
+
if options[:layout]
|
56
|
+
m.gsub_file(File.join("app/views/layouts", "#{options[:layout]}.html.erb"), /\<div\s+id=\"main-navigation\">.*\<\/ul\>/mi) do |match|
|
57
|
+
match.gsub!(/\<\/ul\>/, "")
|
58
|
+
%|#{match} <li class="<%= controller.controller_path == '#{@controller_file_path}' ? 'active' : '' %>"><a href="<%= #{controller_routing_path}_path %>">#{plural_model_name}</a></li></ul>|
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def manifest_for_restful_authentication(m)
|
64
|
+
signup_controller_path = @controller_file_path
|
65
|
+
signin_controller_path = @model_name.downcase # just here I use the second argument as a controller path
|
66
|
+
@resource_name = @controller_path.singularize
|
67
|
+
m.template('view_signup.html.erb', File.join("app/views", signup_controller_path, "new.html.erb"))
|
68
|
+
m.template('view_signin.html.erb', File.join("app/views", signin_controller_path, "new.html.erb"))
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_columns
|
72
|
+
excluded_column_names = %w[id created_at updated_at]
|
73
|
+
Kernel.const_get(@model_name).columns.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generator::GeneratedAttribute.new(c.name, c.type)}
|
74
|
+
end
|
75
|
+
|
76
|
+
def banner
|
77
|
+
"Usage: #{$0} themed ControllerPath [ModelName] [options]"
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_options!(opt)
|
81
|
+
opt.separator ''
|
82
|
+
opt.separator 'Options:'
|
83
|
+
opt.on("--app_name=app_name", String, "") { |v| options[:app_name] = v }
|
84
|
+
opt.on("--type=themed_type", String, "") { |v| options[:themed_type] = v }
|
85
|
+
opt.on("--layout=layout", String, "Add menu link") { |v| options[:layout] = v }
|
86
|
+
opt.on("--with_will_paginate", "Add pagination using will_paginate") { |v| options[:will_paginate] = true }
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
@@ -0,0 +1,336 @@
|
|
1
|
+
* {margin:0;padding:0}
|
2
|
+
.clear { clear: both; height: 0; }
|
3
|
+
|
4
|
+
h1 { margin: 15px 0; font-size: 22px; font-weight: normal; }
|
5
|
+
h2 { font-size: 22px; margin: 15px 0; font-weight: normal;}
|
6
|
+
h3 { font-size: 18px; margin: 10px 0; font-weight: normal;}
|
7
|
+
h4 { font-size: 16px; margin: 10px 0; font-weight: normal;}
|
8
|
+
hr {height: 1px; border: 0; }
|
9
|
+
p { margin: 15px 0;}
|
10
|
+
a img { border: none; }
|
11
|
+
|
12
|
+
body {
|
13
|
+
font-size: 12px;
|
14
|
+
font-family: sans-serif;
|
15
|
+
}
|
16
|
+
|
17
|
+
#container {
|
18
|
+
min-width: 960px;
|
19
|
+
}
|
20
|
+
|
21
|
+
#header, #wrapper {
|
22
|
+
padding: 0 20px;
|
23
|
+
}
|
24
|
+
|
25
|
+
#header {
|
26
|
+
position: relative;
|
27
|
+
padding-top: 1px;
|
28
|
+
}
|
29
|
+
|
30
|
+
#header h1 {
|
31
|
+
margin: 0;
|
32
|
+
padding: 10px 0;
|
33
|
+
font-size: 30px;
|
34
|
+
}
|
35
|
+
|
36
|
+
#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
|
37
|
+
text-decoration: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
#main {
|
41
|
+
width: 70%;
|
42
|
+
float: left;
|
43
|
+
}
|
44
|
+
|
45
|
+
.actions-bar {
|
46
|
+
padding: 10px 1px;
|
47
|
+
}
|
48
|
+
|
49
|
+
.actions-bar .actions {
|
50
|
+
float: left;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
.actions-bar .pagination {
|
55
|
+
float: right;
|
56
|
+
padding: 1px 0;
|
57
|
+
}
|
58
|
+
|
59
|
+
#sidebar {
|
60
|
+
width: 25%;
|
61
|
+
float: right;
|
62
|
+
}
|
63
|
+
|
64
|
+
#sidebar h3 {
|
65
|
+
padding: 10px 15px;
|
66
|
+
margin: 0;
|
67
|
+
font-size: 13px;
|
68
|
+
}
|
69
|
+
|
70
|
+
#sidebar .block {
|
71
|
+
margin-bottom: 20px;
|
72
|
+
padding-bottom: 10px;
|
73
|
+
}
|
74
|
+
|
75
|
+
#sidebar .block .content {
|
76
|
+
padding: 0 15px;
|
77
|
+
}
|
78
|
+
|
79
|
+
#sidebar ul.navigation li a:link, #sidebar ul.navigation li a:visited {
|
80
|
+
display: block;
|
81
|
+
padding: 10px 15px;
|
82
|
+
}
|
83
|
+
|
84
|
+
#sidebar .block .sidebar-block, #sidebar .notice {
|
85
|
+
padding:10px;
|
86
|
+
}
|
87
|
+
|
88
|
+
#wrapper {
|
89
|
+
padding-top: 20px;
|
90
|
+
}
|
91
|
+
|
92
|
+
#main .block {
|
93
|
+
margin-bottom: 20px;
|
94
|
+
padding-top: 1px;
|
95
|
+
}
|
96
|
+
|
97
|
+
#main .block .content .inner {
|
98
|
+
padding: 0 15px 15px;
|
99
|
+
}
|
100
|
+
|
101
|
+
#main .main p.first {
|
102
|
+
margin-top: 0;
|
103
|
+
}
|
104
|
+
|
105
|
+
#user-navigation {
|
106
|
+
position: absolute;
|
107
|
+
top: 0px;
|
108
|
+
right: 20px;
|
109
|
+
}
|
110
|
+
|
111
|
+
#main-navigation {
|
112
|
+
width: 100%;
|
113
|
+
}
|
114
|
+
|
115
|
+
#user-navigation ul, #main-navigation ul, .secondary-navigation ul, #sidebar ul.navigation {
|
116
|
+
margin: 0;
|
117
|
+
padding: 0;
|
118
|
+
list-style-type: none;
|
119
|
+
}
|
120
|
+
|
121
|
+
#user-navigation ul li, #main-navigation ul li, .secondary-navigation ul li {
|
122
|
+
float: left;
|
123
|
+
}
|
124
|
+
|
125
|
+
#main-navigation ul li {
|
126
|
+
margin-right: 5px;
|
127
|
+
}
|
128
|
+
|
129
|
+
#user-navigation ul li {
|
130
|
+
padding: 5px 10px;
|
131
|
+
}
|
132
|
+
|
133
|
+
#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
|
134
|
+
.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
|
135
|
+
#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
|
136
|
+
text-decoration: none;
|
137
|
+
}
|
138
|
+
|
139
|
+
#main-navigation ul li a {
|
140
|
+
font-size: 15px;
|
141
|
+
display: block;
|
142
|
+
padding: 8px 15px;
|
143
|
+
}
|
144
|
+
|
145
|
+
.secondary-navigation {
|
146
|
+
font-size: 13px;
|
147
|
+
border-bottom-width: 10px;
|
148
|
+
border-bottom-style: solid;
|
149
|
+
}
|
150
|
+
|
151
|
+
.secondary-navigation ul li a {
|
152
|
+
display: block;
|
153
|
+
padding: 10px 15px;
|
154
|
+
}
|
155
|
+
|
156
|
+
#footer {
|
157
|
+
padding-bottom: 20px;
|
158
|
+
}
|
159
|
+
|
160
|
+
/* pagination */
|
161
|
+
|
162
|
+
.pagination a, .pagination span {
|
163
|
+
padding: 2px 5px;
|
164
|
+
margin-right: 5px;
|
165
|
+
display: block;
|
166
|
+
float: left;
|
167
|
+
border-style: solid;
|
168
|
+
border-width: 1px;
|
169
|
+
}
|
170
|
+
|
171
|
+
.pagination span.current {
|
172
|
+
font-weight: bold;
|
173
|
+
}
|
174
|
+
|
175
|
+
.pagination a {
|
176
|
+
text-decoration: none;
|
177
|
+
}
|
178
|
+
|
179
|
+
/* tables */
|
180
|
+
.table {
|
181
|
+
width: 100%;
|
182
|
+
border-collapse: collapse;
|
183
|
+
margin-bottom: 15px;
|
184
|
+
}
|
185
|
+
|
186
|
+
.table th {
|
187
|
+
padding: 10px;
|
188
|
+
font-weight: bold;
|
189
|
+
text-align: left;
|
190
|
+
}
|
191
|
+
|
192
|
+
.table th.first {
|
193
|
+
width: 30px;
|
194
|
+
}
|
195
|
+
|
196
|
+
.table th.last {
|
197
|
+
width: 200px;
|
198
|
+
}
|
199
|
+
|
200
|
+
.table .checkbox {
|
201
|
+
margin-left: 10px;
|
202
|
+
}
|
203
|
+
|
204
|
+
.table td {
|
205
|
+
padding: 10px;
|
206
|
+
}
|
207
|
+
|
208
|
+
.table td.last {
|
209
|
+
text-align: right;
|
210
|
+
}
|
211
|
+
|
212
|
+
/* forms */
|
213
|
+
|
214
|
+
input.checkbox {
|
215
|
+
margin: 0;
|
216
|
+
padding: 0;
|
217
|
+
}
|
218
|
+
|
219
|
+
.form .group {
|
220
|
+
margin-bottom: 15px;
|
221
|
+
}
|
222
|
+
|
223
|
+
.form div.left {
|
224
|
+
width: 20%;
|
225
|
+
float: left;
|
226
|
+
}
|
227
|
+
|
228
|
+
.form div.right {
|
229
|
+
width: 75%;
|
230
|
+
float: right;
|
231
|
+
}
|
232
|
+
|
233
|
+
.form .columns .column {
|
234
|
+
width: 48%;
|
235
|
+
}
|
236
|
+
|
237
|
+
.form .columns .left {
|
238
|
+
float: left;
|
239
|
+
}
|
240
|
+
|
241
|
+
.form .columns .right {
|
242
|
+
float: right;
|
243
|
+
}
|
244
|
+
|
245
|
+
.form label.label, .form input.text_field, .form textarea.text_area {
|
246
|
+
font-size: 1.2em;
|
247
|
+
padding: 1px 0;
|
248
|
+
margin: 0;
|
249
|
+
}
|
250
|
+
|
251
|
+
.form label.right {
|
252
|
+
text-align: right;
|
253
|
+
}
|
254
|
+
|
255
|
+
.form input.checkbox, .form input.radio {
|
256
|
+
margin-right: 5px;
|
257
|
+
}
|
258
|
+
|
259
|
+
.form label.checkbox, .form label.radio {
|
260
|
+
line-height: 1.5em;
|
261
|
+
}
|
262
|
+
|
263
|
+
.form label.label {
|
264
|
+
display: block;
|
265
|
+
padding-bottom: 2px;
|
266
|
+
font-weight: bold;
|
267
|
+
}
|
268
|
+
|
269
|
+
.form div.fieldWithErrors label.label {
|
270
|
+
display: inline;
|
271
|
+
}
|
272
|
+
|
273
|
+
.form .fieldWithErrors .error {
|
274
|
+
color: red;
|
275
|
+
}
|
276
|
+
|
277
|
+
.form input.text_field, .form textarea.text_area {
|
278
|
+
width: 100%;
|
279
|
+
border-width: 1px;
|
280
|
+
border-style: solid;
|
281
|
+
}
|
282
|
+
|
283
|
+
/* lists */
|
284
|
+
|
285
|
+
ul.list {
|
286
|
+
margin: 0;
|
287
|
+
padding: 0;
|
288
|
+
list-style-type: none;
|
289
|
+
}
|
290
|
+
|
291
|
+
ul.list li {
|
292
|
+
clear: left;
|
293
|
+
padding-bottom: 5px;
|
294
|
+
}
|
295
|
+
|
296
|
+
ul.list li .left {
|
297
|
+
float: left;
|
298
|
+
}
|
299
|
+
|
300
|
+
ul.list li .left .avatar {
|
301
|
+
width: 50px;
|
302
|
+
height: 50px;
|
303
|
+
}
|
304
|
+
|
305
|
+
ul.list li .item {
|
306
|
+
margin-left: 80px;
|
307
|
+
}
|
308
|
+
|
309
|
+
ul.list li .item .avatar {
|
310
|
+
float: left;
|
311
|
+
margin: 0 5px 5px 0;
|
312
|
+
width: 30px;
|
313
|
+
height: 30px;
|
314
|
+
}
|
315
|
+
|
316
|
+
/* box */
|
317
|
+
|
318
|
+
#box {
|
319
|
+
width: 500px;
|
320
|
+
margin: 50px auto;
|
321
|
+
}
|
322
|
+
|
323
|
+
#box .block {
|
324
|
+
margin-bottom: 20px;
|
325
|
+
}
|
326
|
+
|
327
|
+
#box .block h2 {
|
328
|
+
padding: 10px 15px;
|
329
|
+
margin: 0;
|
330
|
+
}
|
331
|
+
|
332
|
+
#box .block .content {
|
333
|
+
padding: 10px 20px;
|
334
|
+
}
|
335
|
+
|
336
|
+
|