web-app-theme 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -3
- data/Rakefile +8 -8
- data/VERSION +1 -1
- data/index.html +4 -6
- data/lib/generators/web_app_theme/themed/templates/view_form.html.erb +3 -2
- data/lib/generators/web_app_theme/themed/themed_generator.rb +21 -10
- data/stylesheets/base.css +13 -0
- data/web-app-theme.gemspec +62 -64
- metadata +5 -9
- data/.gitignore +0 -3
data/README.md
CHANGED
@@ -8,11 +8,11 @@ it wants to be an idea to start developing a complete web application layout.
|
|
8
8
|
Installation
|
9
9
|
------------
|
10
10
|
|
11
|
-
You can use web-app-theme >= 0.6.
|
11
|
+
You can use web-app-theme >= 0.6.2 with Rails 3. If you want to use it with rails 2, use web-app-theme 0.5.3
|
12
12
|
Specify the web-app-theme gem in your Gemfile, only for :development and :test
|
13
13
|
|
14
14
|
group :development, :test do
|
15
|
-
gem 'web-app-theme', '>= 0.6.
|
15
|
+
gem 'web-app-theme', '>= 0.6.2'
|
16
16
|
end
|
17
17
|
|
18
18
|
Usage
|
@@ -69,7 +69,7 @@ If the controller has a name different to the model used, specify the controller
|
|
69
69
|
|
70
70
|
rails g web_app_theme:themed admin/items post
|
71
71
|
|
72
|
-
If you use `will_paginate` for pagination use the `--
|
72
|
+
If you use `will_paginate` for pagination use the `--will-paginate`:
|
73
73
|
|
74
74
|
rails g web_app_theme:themed items post --will-paginate
|
75
75
|
|
data/Rakefile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require "rubygems"
|
2
|
-
require "cucumber/rake/task"
|
3
|
-
require "spec/rake/spectask"
|
2
|
+
# require "cucumber/rake/task"
|
3
|
+
# require "spec/rake/spectask"
|
4
|
+
#
|
5
|
+
# Cucumber::Rake::Task.new
|
4
6
|
|
5
|
-
|
7
|
+
# Spec::Rake::SpecTask.new do |t|
|
8
|
+
# t.spec_files = FileList['test/**/*_spec.rb']
|
9
|
+
# end
|
6
10
|
|
7
|
-
|
8
|
-
t.spec_files = FileList['test/**/*_spec.rb']
|
9
|
-
end
|
10
|
-
|
11
|
-
task :default => [:spec, :cucumber]
|
11
|
+
# task :default => [:spec, :cucumber]
|
12
12
|
|
13
13
|
begin
|
14
14
|
require 'jeweler'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
data/index.html
CHANGED
@@ -182,9 +182,8 @@
|
|
182
182
|
<button class="button" type="submit">
|
183
183
|
<img src="images/icons/tick.png" alt="Save" /> Save
|
184
184
|
</button>
|
185
|
-
<
|
186
|
-
|
187
|
-
</a>
|
185
|
+
<span class="text_button_padding">or</span>
|
186
|
+
<a class="text_button_padding link_button" href="#header">Cancel</a>
|
188
187
|
</div>
|
189
188
|
</form>
|
190
189
|
</div>
|
@@ -275,9 +274,8 @@
|
|
275
274
|
<button class="button" type="submit">
|
276
275
|
<img src="images/icons/tick.png" alt="Save" /> Save
|
277
276
|
</button>
|
278
|
-
<
|
279
|
-
|
280
|
-
</a>
|
277
|
+
<span class="text_button_padding">or</span>
|
278
|
+
<a class="text_button_padding link_button" href="#header">Cancel</a>
|
281
279
|
</div>
|
282
280
|
</form>
|
283
281
|
</div>
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<div class="group navform wat-cf">
|
9
9
|
<button class="button" type="submit">
|
10
10
|
<%%= image_tag("web-app-theme/icons/tick.png", :alt => "#{t("web-app-theme.save", :default => "Save")}") %> <%%= t("web-app-theme.save", :default => "Save") %>
|
11
|
-
</button>
|
12
|
-
|
11
|
+
</button>
|
12
|
+
<span class="text_button_padding"><%%= t("web-app-theme.or", :default => "or") %></span>
|
13
|
+
<%%= link_to t("web-app-theme.cancel", :default => "Cancel"), <%= controller_routing_path %>_path, :class => "text_button_padding link_button" %>
|
13
14
|
</div>
|
@@ -20,16 +20,19 @@ module WebAppTheme
|
|
20
20
|
def copy_views
|
21
21
|
generate_views
|
22
22
|
unless options.layout.blank?
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
%|#{match}
|
27
|
-
%li{:class => controller.controller_path == '#{@controller_file_path}' ? 'active' : '' }
|
28
|
-
%a{:href => #{controller_routing_path}_path} #{plural_model_name}
|
29
|
-
</ul>|
|
30
|
-
else
|
23
|
+
if options.engine =~ /erb/
|
24
|
+
gsub_file(File.join('app/views/layouts', "#{options[:layout]}.html.#{options.engine}"), /\<div\s+id=\"main-navigation\">.*\<\/ul\>/mi) do |match|
|
25
|
+
match.gsub!(/\<\/ul\>/, "")
|
31
26
|
%|#{match} <li class="<%= controller.controller_path == '#{@controller_file_path}' ? 'active' : '' %>"><a href="<%= #{controller_routing_path}_path %>">#{plural_model_name}</a></li></ul>|
|
32
27
|
end
|
28
|
+
elsif options.engine =~ /haml/
|
29
|
+
gsub_file(File.join('app/views/layouts', "#{options[:layout]}.html.#{options.engine}"), /#main-navigation.*#wrapper.wat-cf/mi) do |match|
|
30
|
+
match.gsub!(/ #wrapper.wat-cf/, "")
|
31
|
+
%|#{match}| +
|
32
|
+
" "*6 + %|%li{:class => controller.controller_path == '#{@controller_file_path}' ? 'active' : '' }\n| +
|
33
|
+
" "*7 + %|%a{:href => #{controller_routing_path}_path} #{plural_model_name}\n| +
|
34
|
+
" "*3 + %|#wrapper.wat-cf|
|
35
|
+
end
|
33
36
|
end
|
34
37
|
end
|
35
38
|
end
|
@@ -67,9 +70,17 @@ module WebAppTheme
|
|
67
70
|
resource_name.pluralize
|
68
71
|
end
|
69
72
|
|
73
|
+
##
|
74
|
+
# Attempts to call #columns on the model's class
|
75
|
+
# If the (Active Record) #columns method does not exist, it attempts to
|
76
|
+
# perform the (Mongoid) #fields method instead
|
70
77
|
def columns
|
71
|
-
|
72
|
-
|
78
|
+
begin
|
79
|
+
excluded_column_names = %w[id created_at updated_at]
|
80
|
+
Kernel.const_get(@model_name).columns.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type)}
|
81
|
+
rescue NoMethodError
|
82
|
+
Kernel.const_get(@model_name).fields.collect{|c| c[1]}.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type.to_s)}
|
83
|
+
end
|
73
84
|
end
|
74
85
|
|
75
86
|
def extract_modules(name)
|
data/stylesheets/base.css
CHANGED
@@ -394,4 +394,17 @@ button.button:hover, a.button:hover {
|
|
394
394
|
|
395
395
|
button.button:active, a.button:active {
|
396
396
|
background-color:#e5e5e5;
|
397
|
+
}
|
398
|
+
.text_button_padding{
|
399
|
+
color: #222222;
|
400
|
+
display: block;
|
401
|
+
float: left;
|
402
|
+
font-size: 1em;
|
403
|
+
line-height: 2em;
|
404
|
+
margin: 0 7px 0 0;
|
405
|
+
padding: 5px 0 6px 7px;
|
406
|
+
text-decoration: none;
|
407
|
+
}
|
408
|
+
.link_button{
|
409
|
+
cursor: pointer;
|
397
410
|
}
|
data/web-app-theme.gemspec
CHANGED
@@ -1,89 +1,87 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{web-app-theme}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrea Franz"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-28}
|
13
13
|
s.description = %q{Web app theme generator for rails projects}
|
14
14
|
s.email = %q{andrea@gravityblast.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
"web-app-theme.gemspec"
|
20
|
+
"LICENSE",
|
21
|
+
"README.md",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"config/locales/de_de.yml",
|
25
|
+
"config/locales/pt_br.yml",
|
26
|
+
"features/step_definitions/layout_steps.rb",
|
27
|
+
"features/step_definitions/themed_steps.rb",
|
28
|
+
"features/support/env.rb",
|
29
|
+
"features/theme_generator.feature",
|
30
|
+
"features/themed_generator.feature",
|
31
|
+
"images/avatar.png",
|
32
|
+
"images/icons/application_edit.png",
|
33
|
+
"images/icons/cross.png",
|
34
|
+
"images/icons/key.png",
|
35
|
+
"images/icons/tick.png",
|
36
|
+
"index.html",
|
37
|
+
"javascripts/jquery-1.3.min.js",
|
38
|
+
"javascripts/jquery.localscroll.js",
|
39
|
+
"javascripts/jquery.scrollTo.js",
|
40
|
+
"lib/generators/web_app_theme/theme/templates/layout_admin.html.erb",
|
41
|
+
"lib/generators/web_app_theme/theme/templates/layout_sign.html.erb",
|
42
|
+
"lib/generators/web_app_theme/theme/theme_generator.rb",
|
43
|
+
"lib/generators/web_app_theme/themed/templates/view_edit.html.erb",
|
44
|
+
"lib/generators/web_app_theme/themed/templates/view_form.html.erb",
|
45
|
+
"lib/generators/web_app_theme/themed/templates/view_new.html.erb",
|
46
|
+
"lib/generators/web_app_theme/themed/templates/view_show.html.erb",
|
47
|
+
"lib/generators/web_app_theme/themed/templates/view_sidebar.html.erb",
|
48
|
+
"lib/generators/web_app_theme/themed/templates/view_signin.html.erb",
|
49
|
+
"lib/generators/web_app_theme/themed/templates/view_signup.html.erb",
|
50
|
+
"lib/generators/web_app_theme/themed/templates/view_tables.html.erb",
|
51
|
+
"lib/generators/web_app_theme/themed/templates/view_text.html.erb",
|
52
|
+
"lib/generators/web_app_theme/themed/themed_generator.rb",
|
53
|
+
"lib/web_app_theme.rb",
|
54
|
+
"stylesheets/base.css",
|
55
|
+
"stylesheets/override.css",
|
56
|
+
"stylesheets/themes/amro/style.css",
|
57
|
+
"stylesheets/themes/bec-green/style.css",
|
58
|
+
"stylesheets/themes/bec/style.css",
|
59
|
+
"stylesheets/themes/blue/style.css",
|
60
|
+
"stylesheets/themes/default/images/arrow.png",
|
61
|
+
"stylesheets/themes/default/images/boxbar-background.png",
|
62
|
+
"stylesheets/themes/default/images/button-background-active.png",
|
63
|
+
"stylesheets/themes/default/images/button-background.png",
|
64
|
+
"stylesheets/themes/default/images/menubar-background.png",
|
65
|
+
"stylesheets/themes/default/style.css",
|
66
|
+
"stylesheets/themes/djime-cerulean/style.css",
|
67
|
+
"stylesheets/themes/drastic-dark/style.css",
|
68
|
+
"stylesheets/themes/kathleene/style.css",
|
69
|
+
"stylesheets/themes/olive/style.css",
|
70
|
+
"stylesheets/themes/orange/style.css",
|
71
|
+
"stylesheets/themes/red/style.css",
|
72
|
+
"stylesheets/themes/reidb-greenish/style.css",
|
73
|
+
"stylesheets/themes/warehouse/style.css",
|
74
|
+
"test/spec_helper.rb",
|
75
|
+
"test/themed_generator_spec.rb",
|
76
|
+
"web-app-theme.gemspec"
|
78
77
|
]
|
79
78
|
s.homepage = %q{http://github.com/pilu/web-app-theme}
|
80
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
81
79
|
s.require_paths = ["lib"]
|
82
80
|
s.rubygems_version = %q{1.3.7}
|
83
81
|
s.summary = %q{Web app theme generator}
|
84
82
|
s.test_files = [
|
85
83
|
"test/spec_helper.rb",
|
86
|
-
|
84
|
+
"test/themed_generator_spec.rb"
|
87
85
|
]
|
88
86
|
|
89
87
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web-app-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 3
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
8
|
+
- 3
|
9
|
+
version: 0.6.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Andrea Franz
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-12-28 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies: []
|
21
20
|
|
@@ -29,7 +28,6 @@ extra_rdoc_files:
|
|
29
28
|
- LICENSE
|
30
29
|
- README.md
|
31
30
|
files:
|
32
|
-
- .gitignore
|
33
31
|
- LICENSE
|
34
32
|
- README.md
|
35
33
|
- Rakefile
|
@@ -92,8 +90,8 @@ homepage: http://github.com/pilu/web-app-theme
|
|
92
90
|
licenses: []
|
93
91
|
|
94
92
|
post_install_message:
|
95
|
-
rdoc_options:
|
96
|
-
|
93
|
+
rdoc_options: []
|
94
|
+
|
97
95
|
require_paths:
|
98
96
|
- lib
|
99
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -101,7 +99,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
99
|
requirements:
|
102
100
|
- - ">="
|
103
101
|
- !ruby/object:Gem::Version
|
104
|
-
hash: 3
|
105
102
|
segments:
|
106
103
|
- 0
|
107
104
|
version: "0"
|
@@ -110,7 +107,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
107
|
requirements:
|
111
108
|
- - ">="
|
112
109
|
- !ruby/object:Gem::Version
|
113
|
-
hash: 3
|
114
110
|
segments:
|
115
111
|
- 0
|
116
112
|
version: "0"
|
data/.gitignore
DELETED