website_builder_engine 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG.textile +7 -0
  3. data/Gemfile.lock +1 -1
  4. data/app/assets/stylesheets/website_builder_engine/welcome.css.scss +87 -0
  5. data/app/controllers/website_builder_engine/articles_controller.rb +1 -0
  6. data/app/models/article.rb +1 -0
  7. data/app/models/offerpage.rb +1 -0
  8. data/app/models/setting.rb +5 -1
  9. data/app/views/shared/_google_analytics.html.haml +11 -0
  10. data/app/views/website_builder_engine/articles/_form.html.haml +3 -0
  11. data/app/views/website_builder_engine/articles/template.html.haml +11 -4
  12. data/app/views/website_builder_engine/offerpages/_form.html.haml +3 -0
  13. data/app/views/website_builder_engine/offerpages/template.html.haml +11 -4
  14. data/app/views/website_builder_engine/settings/_form.html.haml +14 -2
  15. data/app/views/website_builder_engine/welcome/template.html.haml +21 -16
  16. data/spec/dummy/app/assets/stylesheets/application.css +28 -2
  17. data/spec/dummy/app/assets/stylesheets/articles.css.scss +87 -0
  18. data/spec/dummy/app/assets/stylesheets/base.css.scss +336 -0
  19. data/spec/dummy/app/assets/stylesheets/home.css.scss +7 -0
  20. data/spec/dummy/app/assets/stylesheets/layout.css.scss +64 -0
  21. data/spec/dummy/app/assets/stylesheets/normalize.css.scss +413 -0
  22. data/spec/dummy/app/assets/stylesheets/offerpages.css.scss +232 -0
  23. data/spec/dummy/app/assets/stylesheets/scaffolds.css.scss +56 -0
  24. data/spec/dummy/app/assets/stylesheets/settings.css.scss +7 -0
  25. data/spec/dummy/app/assets/stylesheets/skeleton.css.scss +237 -0
  26. data/spec/dummy/app/assets/stylesheets/welcome.css.scss +88 -0
  27. data/spec/dummy/log/development.log +752 -0
  28. data/spec/dummy/public/howto/using-rails-3-1.html +105 -0
  29. data/spec/dummy/public/index.html +94 -0
  30. data/spec/dummy/tmp/cache/assets/C62/1D0/sprockets%2F1638f87db345b13872695759502b54fe +0 -0
  31. data/spec/dummy/tmp/cache/assets/C73/800/sprockets%2Fe26c7a52215e3d8315b952630b7d6230 +0 -0
  32. data/spec/dummy/tmp/cache/assets/CD7/6F0/sprockets%2Fbd3936370d0f952ada5774e2230046ed +0 -0
  33. data/spec/dummy/tmp/cache/assets/CFA/F70/sprockets%2F3d96de8209591d59d678790b059ed4cb +0 -0
  34. data/spec/dummy/tmp/cache/assets/D17/4C0/sprockets%2Fb8f748b53e6b83e646f2114a34ca8a86 +0 -0
  35. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  36. data/spec/dummy/tmp/cache/assets/D3E/660/sprockets%2Ff27703f6505840cfcd80bce4f380c7a5 +0 -0
  37. data/spec/dummy/tmp/cache/assets/D44/5E0/sprockets%2F9e993bc311cd8ad60bc66560b6629bd6 +0 -0
  38. data/spec/dummy/tmp/cache/assets/D46/0F0/sprockets%2Fa788672c315b82d19c5db34f9bcf3a19 +0 -0
  39. data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  40. data/spec/dummy/tmp/cache/assets/D5E/170/sprockets%2F2f2229c70dcf195564d4d0fd6a12ac1a +0 -0
  41. data/spec/dummy/tmp/cache/assets/D79/9D0/sprockets%2F6ea17d7230964f04e6dd9cc9a724bf7d +0 -0
  42. data/spec/dummy/tmp/cache/assets/D9B/890/sprockets%2F350c8c72b1dbd7a84f85424b5cd4def1 +0 -0
  43. data/spec/dummy/tmp/cache/assets/DA7/4C0/sprockets%2F834c8b5df453ca373b66bca70d74fe8f +0 -0
  44. data/spec/dummy/tmp/cache/assets/DC8/280/sprockets%2Fa32ab71649e3db15eca95bcc3a7588da +0 -0
  45. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  46. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/articles.css.scssc +0 -0
  47. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/base.css.scssc +0 -0
  48. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/home.css.scssc +0 -0
  49. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/layout.css.scssc +0 -0
  50. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/normalize.css.scssc +0 -0
  51. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/offerpages.css.scssc +0 -0
  52. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/scaffolds.css.scssc +0 -0
  53. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/settings.css.scssc +0 -0
  54. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/skeleton.css.scssc +0 -0
  55. data/spec/dummy/tmp/cache/sass/0ab7c234fc1a58954e94a39dac695c435cc5d635/welcome.css.scssc +0 -0
  56. data/spec/dummy/tmp/cache/sass/a4c85d529bdb9cb90c9baac1d898e753aa526545/welcome.css.scssc +0 -0
  57. data/version.rb +1 -1
  58. metadata +96 -20
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ pkg/
4
4
  spec/dummy/db/*.sqlite3
5
5
  spec/dummy/log/*.log
6
6
  spec/dummy/tmp/
7
+ spec/dummy/public/*
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,12 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h2. 0.0.3 September 25, 2011
4
+
5
+ * improve Facebook OpenGraph metadata for templates
6
+ * add Google Analytics script to all templates
7
+ * rework home page template
8
+ * add missing stylesheet for home page
9
+
3
10
  h2. 0.0.2 September 24, 2011
4
11
 
5
12
  * fix indentation of 'body' tag in layouts and templates
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- website_builder_engine (0.0.2)
10
+ website_builder_engine (0.0.3)
11
11
  RedCloth
12
12
  bourbon
13
13
  bson_ext
@@ -0,0 +1,87 @@
1
+ // Place all the styles related to the Articles controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
4
+ body.welcome {
5
+ .container {
6
+ background: #fff;
7
+ font: 14px/21px Georgia, Times, serif;
8
+ color: #555;
9
+
10
+ .logo {
11
+ margin-top:30px;
12
+ margin-bottom:0px;
13
+ .sitename{float:left;text-transform: lowercase;}
14
+ .sitename a{color:#cc0000; text-decoration:none;}
15
+ .sitename a:hover{color:#cc0000;}
16
+ .tagline{text-transform: lowercase;}
17
+ .tagline:before{content:" :";}
18
+ }
19
+
20
+ article {
21
+ h1, h2, h3, h4, h5, h6, p {
22
+ font-family: inherit;
23
+ color: inherit;
24
+ }
25
+ h1 {
26
+ font-size: 28px;
27
+ padding-bottom: 5px;
28
+ line-height: 1em;
29
+ }
30
+ h2 {
31
+ font-size: 20px;
32
+ line-height: 30px;
33
+ }
34
+ h3 {
35
+ font-size: 16px;
36
+ line-height: 30px;
37
+ }
38
+ blockquote {
39
+ font-size: inherit;
40
+ line-height: inherit;
41
+ margin: 1.5em;
42
+ padding: 0;
43
+ border-left: none;
44
+ p {
45
+ font-size: inherit;
46
+ line-height: inherit;
47
+ color: #666;
48
+ font-style: italic;
49
+ }
50
+ }
51
+ }
52
+
53
+ aside {
54
+ section {
55
+ h1, h2, h3, h4, h5, h6, p {
56
+ font-family: inherit;
57
+ color: inherit;
58
+ }
59
+ h1 {
60
+ color: #444;
61
+ border-bottom: 1px solid #ccc;
62
+ font-size: 14px;
63
+ padding-bottom: 5px;
64
+ line-height: 30px;
65
+ }
66
+ ul {
67
+ font-family: inherit;
68
+ color: inherit;
69
+ font-size: inherit;
70
+ line-height: inherit;
71
+ margin: 0;
72
+ padding: 15px;
73
+ li {
74
+ a {
75
+ text-decoration: none;
76
+ color: #cc0000;
77
+ }
78
+ a:hover {
79
+ background-color: #000;
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ }
87
+ }
@@ -23,6 +23,7 @@ module WebsiteBuilderEngine
23
23
  # create (or recreate) the welcome page
24
24
  @articles = Article.where(published: true)
25
25
  @welcome_sidebar = RedCloth.new(@settings.sidebar).to_html.html_safe if @settings.sidebar
26
+ @welcome_intro = RedCloth.new(@settings.introduction).to_html.html_safe if @settings.introduction
26
27
  welcome_page = render_to_string(:template => "website_builder_engine/welcome/template.html.haml", :layout => false )
27
28
  File.open("#{@docroot_path}index.html", 'w') {|f| f.write(welcome_page) }
28
29
  respond_to do |format|
@@ -4,6 +4,7 @@ class Article
4
4
  field :filename, :type => String
5
5
  field :description, :type => String
6
6
  field :keywords, :type => String
7
+ field :image_url, :type => String
7
8
  field :headline, :type => String
8
9
  field :subhead, :type => String
9
10
  field :content, :type => String
@@ -4,6 +4,7 @@ class Offerpage
4
4
  field :filename, :type => String
5
5
  field :description, :type => String
6
6
  field :keywords, :type => String
7
+ field :image_url, :type => String
7
8
  field :headline, :type => String
8
9
  field :subhead, :type => String
9
10
  field :content_block1, :type => String
@@ -5,9 +5,13 @@ class Setting
5
5
  field :site_tagline, :type => String
6
6
  field :site_description, :type => String
7
7
  field :site_keywords, :type => String
8
- field :twitter_account, :type => String
8
+ field :site_image_url, :type => String
9
9
  field :domain, :type => String
10
10
  field :articles_directory, :type => String
11
11
  field :offerpages_directory, :type => String
12
12
  field :sidebar, :type => String
13
+ field :introduction, :type => String
14
+ field :google_analytics_id, :type => String
15
+ field :twitter_account, :type => String
16
+ field :facebook_admin_id, :type => String
13
17
  end
@@ -0,0 +1,11 @@
1
+ - unless @settings.google_analytics_id.blank?
2
+ :javascript
3
+ // Google Analytics Tracking Code
4
+ var _gaq = _gaq || [];
5
+ _gaq.push(['_setAccount', '#{@settings.google_analytics_id}']);
6
+ _gaq.push(['_trackPageview']);
7
+ (function() {
8
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
9
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
10
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
11
+ })();
@@ -18,6 +18,9 @@
18
18
  .field
19
19
  = f.label :keywords
20
20
  = f.text_field :keywords
21
+ .field
22
+ = f.label :image_url
23
+ = f.text_field :image_url
21
24
  .field
22
25
  = f.label :headline
23
26
  = f.text_field :headline
@@ -6,17 +6,24 @@
6
6
  %meta{:name=>'description', :content=>"#{@article.description}"}
7
7
  %meta{:name=>'keywords', :content=>"#{@article.keywords}"}
8
8
  -# meta tags for the Open Graph protocol for Facebook
9
- %meta{:property => "og:title", :content => "#{@article.title}"}
10
9
  %meta{:property => "og:type", :content => "article"}
11
10
  %meta{:property => "og:url", :content => "#{@permalink}"}
12
- %meta{:property => "og:image", :content => ""}
13
- %meta{:property => "og:description", :content => "#{@article.description}"}
14
- %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
11
+ - unless @article.title.blank?
12
+ %meta{:property => "og:title", :content => "#{@article.title}"}
13
+ - unless @article.image_url.blank?
14
+ %meta{:property => "og:image", :content => "#{@article.image_url}"}
15
+ - unless @article.description.blank?
16
+ %meta{:property => "og:description", :content => "#{@article.description}"}
17
+ - unless @settings.site_name.blank?
18
+ %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
19
+ - unless @settings.facebook_admin_id.blank?
20
+ %meta{:property => "fb:admins", :content => "#{@settings.facebook_admin_id}"}
15
21
  = stylesheet_link_tag :application
16
22
  = javascript_include_tag :application
17
23
  = csrf_meta_tags
18
24
  %title
19
25
  = @article.title
26
+ = render 'shared/google_analytics'
20
27
  %body.articles
21
28
  .container
22
29
  .logo.sixteen.columns
@@ -18,6 +18,9 @@
18
18
  .field
19
19
  = f.label :keywords
20
20
  = f.text_area :keywords
21
+ .field
22
+ = f.label :image_url
23
+ = f.text_field :image_url
21
24
  .field
22
25
  = f.label :headline
23
26
  = f.text_area :headline
@@ -6,17 +6,24 @@
6
6
  %meta{:name=>'description', :content=>"#{@offerpage.description}"}
7
7
  %meta{:name=>'keywords', :content=>"#{@offerpage.keywords}"}
8
8
  -# meta tags for the Open Graph protocol for Facebook
9
- %meta{:property => "og:title", :content => "#{@offerpage.title}"}
10
9
  %meta{:property => "og:type", :content => "product"}
11
10
  %meta{:property => "og:url", :content => "#{@permalink}"}
12
- %meta{:property => "og:image", :content => ""}
13
- %meta{:property => "og:description", :content => "#{@offerpage.description}"}
14
- %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
11
+ - unless @offerpage.title.blank?
12
+ %meta{:property => "og:title", :content => "#{@offerpage.title}"}
13
+ - unless @offerpage.image_url.blank?
14
+ %meta{:property => "og:image", :content => "#{@offerpage.image_url}"}
15
+ - unless @offerpage.description.blank?
16
+ %meta{:property => "og:description", :content => "#{@offerpage.description}"}
17
+ - unless @settings.site_name.blank?
18
+ %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
19
+ - unless @settings.facebook_admin_id.blank?
20
+ %meta{:property => "fb:admins", :content => "#{@settings.facebook_admin_id}"}
15
21
  = stylesheet_link_tag :application
16
22
  = javascript_include_tag :application
17
23
  = csrf_meta_tags
18
24
  %title
19
25
  = @offerpage.title
26
+ = render 'shared/google_analytics'
20
27
  %body.offerpages
21
28
  .container
22
29
  .logo.sixteen.columns
@@ -22,8 +22,8 @@
22
22
  = f.label :site_keywords
23
23
  = f.text_field :site_keywords
24
24
  .field
25
- = f.label :twitter_account
26
- = f.text_field :twitter_account
25
+ = f.label :site_image_url
26
+ = f.text_field :site_image_url
27
27
  .field
28
28
  = f.label :domain
29
29
  = f.text_field :domain
@@ -36,5 +36,17 @@
36
36
  .field
37
37
  = f.label :sidebar
38
38
  = f.text_area :sidebar
39
+ .field
40
+ = f.label :introduction
41
+ = f.text_area :introduction
42
+ .field
43
+ = f.label :google_analytics_id
44
+ = f.text_field :google_analytics_id
45
+ .field
46
+ = f.label :twitter_account
47
+ = f.text_field :twitter_account
48
+ .field
49
+ = f.label :facebook_admin_id
50
+ = f.text_field :facebook_admin_id
39
51
  .actions
40
52
  = f.submit 'Save'
@@ -6,40 +6,45 @@
6
6
  %meta{:name=>'description', :content=>"#{@settings.site_description}"}
7
7
  %meta{:name=>'keywords', :content=>"#{@settings.site_keywords}"}
8
8
  -# meta tags for the Open Graph protocol for Facebook
9
- %meta{:property => "og:title", :content => "#{@settings.site_title}"}
10
- %meta{:property => "og:type", :content => "article"}
9
+ %meta{:property => "og:type", :content => "website"}
11
10
  %meta{:property => "og:url", :content => "#{@permalink}"}
12
- %meta{:property => "og:image", :content => ""}
13
- %meta{:property => "og:description", :content => "#{@settings.site_description}"}
14
- %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
11
+ - unless @settings.site_title.blank?
12
+ %meta{:property => "og:title", :content => "#{@settings.site_title}"}
13
+ - unless @settings.site_image_url.blank?
14
+ %meta{:property => "og:image", :content => "#{@settings.site_image_url}"}
15
+ - unless @settings.site_description.blank?
16
+ %meta{:property => "og:description", :content => "#{@settings.site_description}"}
17
+ - unless @settings.site_name.blank?
18
+ %meta{:property => "og:site_name", :content => "#{@settings.site_name}"}
19
+ - unless @settings.facebook_admin_id.blank?
20
+ %meta{:property => "fb:admins", :content => "#{@settings.facebook_admin_id}"}
15
21
  = stylesheet_link_tag :application
16
22
  = javascript_include_tag :application
17
23
  = csrf_meta_tags
18
24
  %title
19
25
  = @settings.site_title
26
+ = render 'shared/google_analytics'
20
27
  %body.welcome
21
28
  .container
22
29
  .logo.sixteen.columns
23
- .sitename
30
+ %h1.sitename
24
31
  = link_to @settings.site_name, '/index.html'
25
32
  .tagline
26
33
  = @settings.site_tagline
27
34
  %hr/
28
35
  %article.twelve.columns
29
- %header
30
- %h1
31
- = @settings.site_title
32
36
  #main{:role => "main"}
33
- %ul
34
- - if @articles.empty?
35
- %li
36
- none
37
- - else
37
+ #fb-root
38
+ %fb:like{:action => "recommend", :send => "true", :show_faces => "false", :width => "450"}
39
+ - unless @welcome_intro.blank?
40
+ %h2 Introduction
41
+ = @welcome_intro
42
+ - unless @articles.empty?
43
+ %h2 Articles
44
+ %ul
38
45
  - @articles.each do |article|
39
46
  %li
40
47
  = link_to article.title, "#{@url_path + article.filename}.html"
41
- #fb-root
42
- %fb:like{:action => "recommend", :send => "true", :show_faces => "false", :width => "450"}
43
48
  %aside.four.columns
44
49
  %section
45
50
  %h1
@@ -2,6 +2,32 @@
2
2
  * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
3
  * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
4
  * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require website_builder_engine/base
6
+ *= require website_builder_engine/layout
7
+ *= require website_builder_engine/normalize
8
+ *= require website_builder_engine/scaffolds
9
+ *= require website_builder_engine/skeleton
10
+ *= require_tree .
5
11
  *= require_self
6
- *= require_tree .
7
- */
12
+ */
13
+ header nav ul {
14
+ list-style: none;
15
+ margin: 0 0 2em;
16
+ padding: 0;
17
+ }
18
+ header nav ul li {
19
+ display: inline;
20
+ }
21
+ #flash_notice, #flash_alert {
22
+ padding: 5px 8px;
23
+ margin: 10px 0;
24
+ }
25
+ #flash_notice {
26
+ background-color: #CFC;
27
+ border: solid 1px #6C6;
28
+ }
29
+ #flash_alert {
30
+ background-color: #FCC;
31
+ border: solid 1px #C66;
32
+ }
33
+
@@ -0,0 +1,87 @@
1
+ // Place all the styles related to the Articles controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
4
+ body.articles {
5
+ .container {
6
+ background: #fff;
7
+ font: 14px/21px Georgia, Times, serif;
8
+ color: #555;
9
+
10
+ .logo {
11
+ margin-top:30px;
12
+ margin-bottom:0px;
13
+ .sitename{float:left;text-transform: lowercase;}
14
+ .sitename a{color:#cc0000; text-decoration:none;}
15
+ .sitename a:hover{color:#cc0000;}
16
+ .tagline{text-transform: lowercase;}
17
+ .tagline:before{content:" :";}
18
+ }
19
+
20
+ article {
21
+ h1, h2, h3, h4, h5, h6, p {
22
+ font-family: inherit;
23
+ color: inherit;
24
+ }
25
+ h1 {
26
+ font-size: 28px;
27
+ padding-bottom: 5px;
28
+ line-height: 1em;
29
+ }
30
+ h2 {
31
+ font-size: 20px;
32
+ line-height: 30px;
33
+ }
34
+ h3 {
35
+ font-size: 16px;
36
+ line-height: 30px;
37
+ }
38
+ blockquote {
39
+ font-size: inherit;
40
+ line-height: inherit;
41
+ margin: 1.5em;
42
+ padding: 0;
43
+ border-left: none;
44
+ p {
45
+ font-size: inherit;
46
+ line-height: inherit;
47
+ color: #666;
48
+ font-style: italic;
49
+ }
50
+ }
51
+ }
52
+
53
+ aside {
54
+ section {
55
+ h1, h2, h3, h4, h5, h6, p {
56
+ font-family: inherit;
57
+ color: inherit;
58
+ }
59
+ h1 {
60
+ color: #444;
61
+ border-bottom: 1px solid #ccc;
62
+ font-size: 14px;
63
+ padding-bottom: 5px;
64
+ line-height: 30px;
65
+ }
66
+ ul {
67
+ font-family: inherit;
68
+ color: inherit;
69
+ font-size: inherit;
70
+ line-height: inherit;
71
+ margin: 0;
72
+ padding: 15px;
73
+ li {
74
+ a {
75
+ text-decoration: none;
76
+ color: #cc0000;
77
+ }
78
+ a:hover {
79
+ background-color: #000;
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ }
87
+ }