aslon_scaffold 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +20 -0
- data/README +26 -0
- data/Rakefile +2 -0
- data/aslon_scaffold.gemspec +33 -0
- data/config/locales/aslon_scaffold.fr.yml +14 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/app/controllers/articles_controller.rb +7 -0
- data/lib/app/helpers/application_helper.rb +410 -0
- data/lib/app/views/aslon_scaffolds/_search.haml +1 -0
- data/lib/app/views/aslon_scaffolds/index.haml +4 -0
- data/lib/app/views/aslon_scaffolds/new_edit.haml +8 -0
- data/lib/app/views/aslon_scaffolds/show.haml +9 -0
- data/lib/aslon_scaffold.rb +34 -0
- data/lib/aslon_scaffold/aslon_scaffold.rb +237 -0
- data/lib/aslon_scaffold/version.rb +4 -0
- data/lib/generators/haml.rb +11 -0
- data/lib/generators/haml/scaffold/scaffold_generator.rb +25 -0
- data/lib/generators/haml/scaffold/templates/_new_edit.haml.erb +6 -0
- data/lib/generators/haml/scaffold/templates/_search.haml.erb +6 -0
- data/lib/generators/haml/scaffold/templates/edit.haml.erb +5 -0
- data/lib/generators/haml/scaffold/templates/index.haml.erb +10 -0
- data/lib/generators/haml/scaffold/templates/layout.haml.erb +17 -0
- data/lib/generators/haml/scaffold/templates/new.haml.erb +6 -0
- data/lib/generators/haml/scaffold/templates/new_edit.haml.erb +13 -0
- data/lib/generators/haml/scaffold/templates/show.haml.erb +14 -0
- data/lib/generators/nifty.rb +28 -0
- data/lib/generators/nifty/aslon/USAGE +51 -0
- data/lib/generators/nifty/aslon/aslon_generator.rb +320 -0
- data/lib/generators/nifty/aslon/templates/actions/create.rb +8 -0
- data/lib/generators/nifty/aslon/templates/actions/destroy.rb +5 -0
- data/lib/generators/nifty/aslon/templates/actions/edit.rb +3 -0
- data/lib/generators/nifty/aslon/templates/actions/index.rb +3 -0
- data/lib/generators/nifty/aslon/templates/actions/new.rb +3 -0
- data/lib/generators/nifty/aslon/templates/actions/show.rb +3 -0
- data/lib/generators/nifty/aslon/templates/actions/update.rb +8 -0
- data/lib/generators/nifty/aslon/templates/controller.rb +10 -0
- data/lib/generators/nifty/aslon/templates/fixtures.yml +9 -0
- data/lib/generators/nifty/aslon/templates/helper.rb +2 -0
- data/lib/generators/nifty/aslon/templates/migration.rb +16 -0
- data/lib/generators/nifty/aslon/templates/model.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/create.rb +11 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/destroy.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/edit.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/index.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/new.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/show.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/actions/update.rb +11 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/controller.rb +8 -0
- data/lib/generators/nifty/aslon/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/create.rb +13 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/destroy.rb +8 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/edit.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/index.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/new.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/show.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/actions/update.rb +13 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/controller.rb +5 -0
- data/lib/generators/nifty/aslon/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/create.rb +11 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/destroy.rb +6 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/edit.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/index.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/new.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/show.rb +4 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/actions/update.rb +11 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/controller.rb +5 -0
- data/lib/generators/nifty/aslon/templates/tests/testunit/model.rb +7 -0
- data/lib/generators/nifty/aslon/templates/views/haml/_new_edit.html.haml +6 -0
- data/lib/generators/nifty/aslon/templates/views/haml/_search.html.haml +6 -0
- data/lib/generators/nifty/aslon/templates/views/haml/index.html.haml +10 -0
- data/lib/generators/nifty/aslon/templates/views/haml/layout.haml.erb +17 -0
- data/lib/generators/nifty/aslon/templates/views/haml/new_edit.html.haml +13 -0
- data/lib/generators/nifty/aslon/templates/views/haml/show.html.haml +14 -0
- data/lib/generators/nifty/layout/USAGE +25 -0
- data/lib/generators/nifty/layout/layout_generator.rb +42 -0
- data/lib/generators/nifty/layout/templates/_default.html.haml +9 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/add.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/delete.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/edit.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/folder.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/grid-blue-hd.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/grid-split.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/grid3-hrow.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/indicator.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/magnifier.png +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/sort_asc.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/images/aslon_scaffold/sort_desc.gif +0 -0
- data/lib/generators/nifty/layout/templates/assets/stylesheets/aslon_scaffold/base.css.sass +263 -0
- data/lib/generators/nifty/layout/templates/assets/stylesheets/aslon_scaffold/formtastic.css.sass +176 -0
- data/lib/generators/nifty/layout/templates/assets/stylesheets/aslon_scaffold/formtastic_changes.css.sass +31 -0
- data/lib/generators/nifty/layout/templates/assets/stylesheets/aslon_scaffold/table_coffee_with_milk.css.sass +94 -0
- data/lib/generators/nifty/layout/templates/error_messages_helper.rb +23 -0
- data/lib/generators/nifty/layout/templates/layout.html.haml +13 -0
- data/lib/generators/nifty/layout/templates/layout_helper.rb +22 -0
- data/lib/generators/nifty/layout/templates/locales/aslon_scaffold.fr.yml +14 -0
- data/lib/generators/nifty/scaffold/USAGE +51 -0
- data/lib/generators/nifty/scaffold/scaffold_generator.rb +319 -0
- data/lib/generators/nifty/scaffold/templates/actions/create.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/actions/destroy.rb +5 -0
- data/lib/generators/nifty/scaffold/templates/actions/edit.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/index.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/new.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/show.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/update.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/controller.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/fixtures.yml +9 -0
- data/lib/generators/nifty/scaffold/templates/helper.rb +2 -0
- data/lib/generators/nifty/scaffold/templates/migration.rb +16 -0
- data/lib/generators/nifty/scaffold/templates/model.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/create.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/edit.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/index.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/new.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/show.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/update.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/controller.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/create.rb +13 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/index.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/new.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/show.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/update.rb +13 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/controller.rb +5 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/create.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/edit.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/index.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/new.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/show.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/update.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/controller.rb +5 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/_form.html.erb +10 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/edit.html.erb +14 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/index.html.erb +29 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/new.html.erb +7 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/show.html.erb +20 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/_new_edit.html.haml +6 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/_search.html.haml +6 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/index.html.haml +10 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/layout.haml.erb +17 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/new_edit.haml.erb +13 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/show.haml.erb +14 -0
- data/lib/generators/templates/rails/scaffold_controller/controller.rb +11 -0
- data/lib/tasks/aslon_scaffold_tasks.rake +91 -0
- data/lib/tasks/task.rake +113 -0
- data/test/articles_controller_test.rb +24 -0
- data/test/database.yml +8 -0
- data/test/schema.rb +6 -0
- data/test/test_helper.rb +39 -0
- data/test/undeletable_plugin.sqlite.db +0 -0
- data/test/undeletable_plugin2.sqlite3.db +0 -0
- data/uninstall.rb +1 -0
- data/vendor/assets/images/aslon_scaffold/add.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/delete.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/edit.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/folder.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/grid-blue-hd.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/grid-split.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/grid3-hrow.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/indicator.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/magnifier.png +0 -0
- data/vendor/assets/images/aslon_scaffold/sort_asc.gif +0 -0
- data/vendor/assets/images/aslon_scaffold/sort_desc.gif +0 -0
- data/vendor/assets/stylesheets/aslon_scaffold_base.css.sass +116 -0
- data/vendor/assets/stylesheets/aslon_scaffold_base.css.sass.old +263 -0
- data/vendor/assets/stylesheets/aslon_scaffold_table.css.sass +94 -0
- data/vendor/assets/stylesheets/formtastic_changes.css.sass +31 -0
- metadata +185 -4
@@ -0,0 +1,11 @@
|
|
1
|
+
it "create action should render new template when model is invalid" do
|
2
|
+
<%= class_name %>.any_instance.stubs(:valid?).returns(false)
|
3
|
+
post :create
|
4
|
+
response.should render_template(:new)
|
5
|
+
end
|
6
|
+
|
7
|
+
it "create action should redirect when model is valid" do
|
8
|
+
<%= class_name %>.any_instance.stubs(:valid?).returns(true)
|
9
|
+
post :create
|
10
|
+
response.should redirect_to(<%= item_path_for_spec('url') %>)
|
11
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
it "destroy action should destroy model and redirect to index action" do
|
2
|
+
<%= instance_name %> = <%= class_name %>.first
|
3
|
+
delete :destroy, :id => <%= instance_name %>
|
4
|
+
response.should redirect_to(<%= items_url %>)
|
5
|
+
<%= class_name %>.exists?(<%= instance_name %>.id).should be_false
|
6
|
+
end
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,8 @@
|
|
1
|
+
context "destroy action" do
|
2
|
+
should "destroy model and redirect to index action" do
|
3
|
+
<%= instance_name %> = <%= class_name %>.first
|
4
|
+
delete :destroy, :id => <%= instance_name %>
|
5
|
+
assert_redirected_to <%= items_url %>
|
6
|
+
assert !<%= class_name %>.exists?(<%= instance_name %>.id)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
7
|
+
<title><%= controller_class_name %>: <%%= aslon_controller.action_name %></title>
|
8
|
+
<%%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
-# encoding UTF-8
|
2
|
+
-# autogenerated_by_scaffold
|
3
|
+
|
4
|
+
= titre_action(controller.action_name,"<%= singular_name %>")
|
5
|
+
= error_messages_for :<%= singular_name %>
|
6
|
+
|
7
|
+
- semantic_form_for @<%= singular_name %> do |f|
|
8
|
+
|
9
|
+
- f.inputs :name => "Basic", :id => "basic" do
|
10
|
+
<% for attribute in attributes -%>
|
11
|
+
= f.input :<%= attribute.name%>
|
12
|
+
<% end -%>
|
13
|
+
= f.buttons
|
@@ -0,0 +1,14 @@
|
|
1
|
+
-# encoding UTF-8
|
2
|
+
-# autogenerated_by_scaffold
|
3
|
+
|
4
|
+
=titre_show(@<%= singular_name %>,@<%= singular_name %>.lib)
|
5
|
+
%form.formtastic
|
6
|
+
%fieldset.inputs
|
7
|
+
%legend
|
8
|
+
%span=@as_options[:legend]
|
9
|
+
|
10
|
+
<% for attribute in attributes -%>
|
11
|
+
= show @<%= singular_name %>,:<%= attribute.name %>
|
12
|
+
<%end%>
|
13
|
+
= link_to 'Back', <%= plural_name %>_path
|
14
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Description:
|
2
|
+
The nifty_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 and javascript/stylesheet includes.
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
rails generate nifty:layout
|
15
|
+
|
16
|
+
Layout: app/views/layouts/application.html.erb
|
17
|
+
Stylesheet: public/stylesheets/application.css
|
18
|
+
Helper: app/helpers/layout_helper.rb
|
19
|
+
|
20
|
+
|
21
|
+
rails generate nifty:layout admin
|
22
|
+
|
23
|
+
Layout: app/views/layouts/admin.html.erb
|
24
|
+
Stylesheet: public/stylesheets/admin.css
|
25
|
+
Helper: app/helpers/layout_helper.rb
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'generators/nifty'
|
2
|
+
|
3
|
+
module Nifty
|
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
|
+
|
10
|
+
def create_layout
|
11
|
+
template '_default.html.haml', "app/views/layouts/_default.html.haml"
|
12
|
+
template 'layout.html.haml', "app/views/layouts/#{file_name}.html.haml"
|
13
|
+
|
14
|
+
copy_file 'layout_helper.rb', 'app/helpers/layout_helper.rb'
|
15
|
+
copy_file 'error_messages_helper.rb', 'app/helpers/error_messages_helper.rb'
|
16
|
+
end
|
17
|
+
def copy_stylesheet
|
18
|
+
%w( base formtastic formtastic_changes table_coffee_with_milk ).each do |filename|
|
19
|
+
copy_file "assets/stylesheets/aslon_scaffold/#{filename}.css.sass", "assets/stylesheets/aslon_scaffold/#{filename}.css.sass"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
def copy_locales
|
23
|
+
%w(aslon_scaffold.fr.yml).each do |filename|
|
24
|
+
copy_file "locales/#{filename}", "app/config/locales/#{filename}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
def copy_image
|
28
|
+
puts File.dirname(__FILE__)
|
29
|
+
Dir.foreach(File.join(File.dirname(__FILE__),"templates","assets",'images','aslon_scaffold')) do |filename|
|
30
|
+
if File.file?(File.join(File.dirname(__FILE__),"templates","assets",'images','aslon_scaffold',filename))
|
31
|
+
copy_file "assets/images/aslon_scaffold/#{filename}", "app/assets/images/aslon_scaffold/#{filename}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
private
|
36
|
+
|
37
|
+
def file_name
|
38
|
+
layout_name.underscore
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%html{ "xml:lang" => "en", :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
|
2
|
+
%head
|
3
|
+
%title
|
4
|
+
= yield(:title) || "Untitled"
|
5
|
+
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
6
|
+
= stylesheet_link_tag 'aslon_scaffold/base', :media=>"all"
|
7
|
+
= stylesheet_link_tag 'aslon_scaffold/application', :media=>"all"
|
8
|
+
= javascript_include_tag :defaults
|
9
|
+
= csrf_meta_tag
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,263 @@
|
|
1
|
+
body
|
2
|
+
margin: 0px
|
3
|
+
padding: 0px
|
4
|
+
font:
|
5
|
+
family: verdana, arial, helvetica, sans-serif
|
6
|
+
size: 80%
|
7
|
+
color: #333
|
8
|
+
background-color: white
|
9
|
+
|
10
|
+
h1
|
11
|
+
margin: 0px 0px 1px 0px
|
12
|
+
padding: 0px
|
13
|
+
line-height: 28px
|
14
|
+
font:
|
15
|
+
weight: 900
|
16
|
+
size: 14px
|
17
|
+
color: red
|
18
|
+
border-bottom: solid 1px #C5DBF7
|
19
|
+
h2
|
20
|
+
margin: 0px 0px 1px 0px
|
21
|
+
padding: 0px
|
22
|
+
font:
|
23
|
+
weight: 900
|
24
|
+
size: 14px
|
25
|
+
line-height: 28px
|
26
|
+
color: black
|
27
|
+
border-bottom: solid 1px #C5DBF7
|
28
|
+
|
29
|
+
#menu
|
30
|
+
float: left
|
31
|
+
margin: 2px
|
32
|
+
width: 150px
|
33
|
+
height: 400px
|
34
|
+
|
35
|
+
|
36
|
+
#titre1
|
37
|
+
margin: 0px 0px 10px 0px
|
38
|
+
padding: 0px
|
39
|
+
font-size: 14px
|
40
|
+
line-height: 28px
|
41
|
+
font-weight: 900
|
42
|
+
color: black
|
43
|
+
border-bottom: solid 1px #C5DBF7
|
44
|
+
background-color: #eee
|
45
|
+
text-indent: 30px
|
46
|
+
|
47
|
+
|
48
|
+
#titre2
|
49
|
+
margin: 0px 0px 10px 0px
|
50
|
+
padding: 0px
|
51
|
+
font-size: 14px
|
52
|
+
line-height: 28px
|
53
|
+
font-weight: 900
|
54
|
+
color: black
|
55
|
+
border-bottom: solid 1px #C5DBF7
|
56
|
+
background-color: #eee
|
57
|
+
text-indent: 30px
|
58
|
+
margin: 10px 0px 10px 0px
|
59
|
+
|
60
|
+
|
61
|
+
p
|
62
|
+
font: 11px/20px verdana, arial, helvetica, sans-serif
|
63
|
+
margin: 0px 0px 16px 0px
|
64
|
+
padding: 0px
|
65
|
+
|
66
|
+
|
67
|
+
a
|
68
|
+
color: #09c
|
69
|
+
font-size: 11px
|
70
|
+
text-decoration: none
|
71
|
+
font-weight: 600
|
72
|
+
font-family: verdana, arial, helvetica, sans-serif
|
73
|
+
|
74
|
+
&:link
|
75
|
+
color: #09c
|
76
|
+
|
77
|
+
&:visited
|
78
|
+
color: #07a
|
79
|
+
|
80
|
+
&:hover
|
81
|
+
background-color: #eee
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
.flash
|
86
|
+
ul
|
87
|
+
padding-left: 0pt
|
88
|
+
margin-bottom: 0pt
|
89
|
+
margin-top: 0pt
|
90
|
+
list-style-type: none
|
91
|
+
margin-left: 0pt
|
92
|
+
|
93
|
+
li
|
94
|
+
margin-bottom: 0em
|
95
|
+
padding-left: 1em
|
96
|
+
vertical-align: top
|
97
|
+
text-align: center
|
98
|
+
font-size: 1em
|
99
|
+
|
100
|
+
.container
|
101
|
+
padding-top: 0em
|
102
|
+
padding-left: 2em
|
103
|
+
position: absolute
|
104
|
+
top: 1px
|
105
|
+
left: 200px
|
106
|
+
width: 500px
|
107
|
+
height: 25px
|
108
|
+
|
109
|
+
.containerild
|
110
|
+
padding: 1em
|
111
|
+
padding-left: 5em
|
112
|
+
margin-bottom: 1.5em
|
113
|
+
|
114
|
+
.error
|
115
|
+
color: red
|
116
|
+
|
117
|
+
.errorold
|
118
|
+
background: #fcf6d0 url(../images/icons/flashes/error.gif) 1.5em 1.5em no-repeat
|
119
|
+
border-top: 1px solid #ecd757
|
120
|
+
border-bottom: 1px solid #ecd757
|
121
|
+
border-left: 1px solid #ecd757
|
122
|
+
border-right: 1px solid #ecd757
|
123
|
+
|
124
|
+
.back
|
125
|
+
background: #e9f3dc url(../images/icons/flashes/back.gif) 1.5em 1em no-repeat
|
126
|
+
border-top: 1px solid #bfcbb0
|
127
|
+
border-bottom: 1px solid #bfcbb0
|
128
|
+
|
129
|
+
.confirm
|
130
|
+
background: #e9f3dc url(../images/icons/flashes/confirm.gif) 1.5em 1em no-repeat
|
131
|
+
border-top: 1px solid #bfcbb0
|
132
|
+
border-bottom: 1px solid #bfcbb0
|
133
|
+
|
134
|
+
.info, .notice
|
135
|
+
color: green
|
136
|
+
|
137
|
+
.warn
|
138
|
+
color: orange
|
139
|
+
|
140
|
+
|
141
|
+
.fieldWithErrors
|
142
|
+
padding: 3px
|
143
|
+
background-color: red
|
144
|
+
display: table
|
145
|
+
|
146
|
+
|
147
|
+
#errorExplanation
|
148
|
+
width: 500px
|
149
|
+
border: 1px solid red
|
150
|
+
padding: 7px
|
151
|
+
padding-bottom: 12px
|
152
|
+
margin-bottom: 20px
|
153
|
+
background-color: #f0f0f0
|
154
|
+
|
155
|
+
h2
|
156
|
+
text-align: left
|
157
|
+
font-weight: bold
|
158
|
+
padding: 5px 5px 5px 60px
|
159
|
+
font-size: 12px
|
160
|
+
margin: -7px
|
161
|
+
background: url(../images/icons/flashes/error.gif) 1.5em 0.2em no-repeat
|
162
|
+
color: red
|
163
|
+
|
164
|
+
p
|
165
|
+
color: #333
|
166
|
+
margin-bottom: 0
|
167
|
+
padding: 5px
|
168
|
+
|
169
|
+
ul li
|
170
|
+
font-size: 12px
|
171
|
+
list-style: square
|
172
|
+
|
173
|
+
|
174
|
+
.pagination
|
175
|
+
font-size: 10px
|
176
|
+
padding: 3px
|
177
|
+
margin: 3px
|
178
|
+
|
179
|
+
a
|
180
|
+
padding: 2px 5px 2px 5px
|
181
|
+
margin: 2px
|
182
|
+
border: 1px solid #aaaadd
|
183
|
+
text-decoration: none
|
184
|
+
color: gray
|
185
|
+
|
186
|
+
&:hover, &:active
|
187
|
+
border: 1px solid gray
|
188
|
+
color: #000
|
189
|
+
|
190
|
+
span
|
191
|
+
&.current
|
192
|
+
padding: 2px 5px 2px 5px
|
193
|
+
margin: 2px
|
194
|
+
border: 1px solid lightgray
|
195
|
+
font-weight: bold
|
196
|
+
background-color: gray
|
197
|
+
color: white
|
198
|
+
|
199
|
+
&.disabled
|
200
|
+
padding: 2px 5px 2px 5px
|
201
|
+
margin: 2px
|
202
|
+
border: 1px solid #eee
|
203
|
+
color: #ddd
|
204
|
+
|
205
|
+
|
206
|
+
form#demoForm
|
207
|
+
width: 40ex
|
208
|
+
padding: 1em
|
209
|
+
margin: 0em auto
|
210
|
+
border: 1ex solid silver
|
211
|
+
background: #eee
|
212
|
+
font-family: sans-serif
|
213
|
+
|
214
|
+
p
|
215
|
+
position: relative
|
216
|
+
margin: 0 0 0.5em
|
217
|
+
|
218
|
+
&.submit
|
219
|
+
margin: 0.5em
|
220
|
+
text-align: center
|
221
|
+
color: red
|
222
|
+
|
223
|
+
label
|
224
|
+
font-weight: bold
|
225
|
+
display: block
|
226
|
+
width: 100px
|
227
|
+
float: left
|
228
|
+
color: red
|
229
|
+
font-size: 12pt
|
230
|
+
vertical-align: text-bottom
|
231
|
+
|
232
|
+
|
233
|
+
input
|
234
|
+
&#login, &#password
|
235
|
+
|
236
|
+
label
|
237
|
+
font-weight: bold
|
238
|
+
|
239
|
+
|
240
|
+
input
|
241
|
+
&:focus
|
242
|
+
border: 1px solid gray
|
243
|
+
background: #ffd
|
244
|
+
|
245
|
+
&.to_dest
|
246
|
+
position: absolute
|
247
|
+
left: 10ex
|
248
|
+
right: 5ex
|
249
|
+
|
250
|
+
|
251
|
+
label.required
|
252
|
+
font-weight: bold
|
253
|
+
|
254
|
+
&:after
|
255
|
+
content: '*'
|
256
|
+
|
257
|
+
|
258
|
+
span.accessKey
|
259
|
+
text-decoration: underline
|
260
|
+
|
261
|
+
@import aslon_scaffold/formtastic
|
262
|
+
@import aslon_scaffold/formtastic_changes
|
263
|
+
@import aslon_scaffold/table_coffee_with_milk
|