enjoy_cms 0.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +5 -0
  7. data/Gemfile.lock +249 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +137 -0
  10. data/Rakefile +1 -0
  11. data/app/assets/javascripts/enjoy_cms.coffee +6 -0
  12. data/app/assets/javascripts/enjoy_cms/flash.js.coffee +3 -0
  13. data/app/assets/javascripts/enjoy_cms/map.js.coffee +22 -0
  14. data/app/assets/javascripts/head.load.js +707 -0
  15. data/app/assets/javascripts/jquery.placeholder.js +157 -0
  16. data/app/assets/stylesheets/enjoy_cms.sass +5 -0
  17. data/app/assets/stylesheets/enjoy_cms/flash.sass +63 -0
  18. data/app/assets/stylesheets/enjoy_cms/normalize.scss +406 -0
  19. data/app/assets/stylesheets/enjoy_cms/powered.sass +18 -0
  20. data/app/controllers/concerns/enjoy/errors.rb +93 -0
  21. data/app/controllers/concerns/enjoy/fancybox.rb +14 -0
  22. data/app/controllers/concerns/enjoy/localizeable.rb +33 -0
  23. data/app/controllers/concerns/enjoy/nav_menu.rb +64 -0
  24. data/app/controllers/concerns/enjoy/no_cache.rb +12 -0
  25. data/app/controllers/concerns/enjoy/seo_pages.rb +83 -0
  26. data/app/controllers/enjoy/contacts_controller.rb +5 -0
  27. data/app/controllers/enjoy/home_controller.rb +6 -0
  28. data/app/controllers/enjoy/news_controller.rb +5 -0
  29. data/app/controllers/enjoy/pages_controller.rb +5 -0
  30. data/app/controllers/enjoy/search_controller.rb +6 -0
  31. data/app/helpers/enjoy/gzip_helper.rb +27 -0
  32. data/app/helpers/enjoy/powered_helper.rb +12 -0
  33. data/app/mailers/enjoy/contact_mailer.rb +17 -0
  34. data/app/models/concerns/enjoy/boolean_field.rb +17 -0
  35. data/app/models/concerns/enjoy/enableable.rb +8 -0
  36. data/app/models/concerns/enjoy/geocodeable.rb +4 -0
  37. data/app/models/concerns/enjoy/mappable.rb +95 -0
  38. data/app/models/concerns/enjoy/mongoid_paperclip.rb +37 -0
  39. data/app/models/concerns/enjoy/seoable.rb +36 -0
  40. data/app/models/concerns/enjoy/sitemap_data.rb +23 -0
  41. data/app/models/concerns/enjoy/sort_field.rb +20 -0
  42. data/app/models/concerns/enjoy/sortable.rb +8 -0
  43. data/app/models/enjoy/contact_message.rb +12 -0
  44. data/app/models/enjoy/embedded_element.rb +15 -0
  45. data/app/models/enjoy/embedded_gallery_image.rb +15 -0
  46. data/app/models/enjoy/gallery.rb +10 -0
  47. data/app/models/enjoy/gallery_image.rb +10 -0
  48. data/app/models/enjoy/menu.rb +12 -0
  49. data/app/models/enjoy/news.rb +12 -0
  50. data/app/models/enjoy/page.rb +12 -0
  51. data/app/models/enjoy/seo.rb +13 -0
  52. data/app/views/blocks/_favicon.html.slim +21 -0
  53. data/app/views/blocks/_footer.html.slim +1 -0
  54. data/app/views/blocks/_seo_block.html.slim +18 -0
  55. data/app/views/blocks/_seo_block_with_obj.html.slim +27 -0
  56. data/app/views/devise/registrations/edit.html.slim +21 -0
  57. data/app/views/devise/registrations/new.html.slim +21 -0
  58. data/app/views/devise/sessions/new.html.slim +22 -0
  59. data/app/views/devise/shared/_links.html.slim +11 -0
  60. data/app/views/enjoy/contact_mailer/new_message_email.html.slim +15 -0
  61. data/app/views/enjoy/contacts/index.html.slim +10 -0
  62. data/app/views/enjoy/contacts/new.html.slim +10 -0
  63. data/app/views/enjoy/contacts/sent.html.slim +4 -0
  64. data/app/views/enjoy/home/index.html.slim +1 -0
  65. data/app/views/enjoy/news/index.html.slim +9 -0
  66. data/app/views/enjoy/news/show.html.slim +8 -0
  67. data/app/views/enjoy/pages/show.html.slim +1 -0
  68. data/app/views/enjoy/search/index.html.slim +19 -0
  69. data/app/views/errors/_base.html.slim +3 -0
  70. data/app/views/errors/error_403.html.slim +1 -0
  71. data/app/views/errors/error_404.html.slim +1 -0
  72. data/app/views/errors/error_500.html.slim +1 -0
  73. data/app/views/layouts/application.html.slim +25 -0
  74. data/app/views/rails_admin/main/_check_boxes.html.slim +27 -0
  75. data/app/views/rails_admin/main/_enum_check_boxes.html.slim +5 -0
  76. data/app/views/rails_admin/main/_enum_radio_buttons.html.slim +5 -0
  77. data/app/views/rails_admin/main/_form_raw.html.slim +1 -0
  78. data/app/views/shared/_admin_link.html.slim +3 -0
  79. data/app/views/shared/_messages.html.slim +7 -0
  80. data/app/views/shared/_meta.html.slim +19 -0
  81. data/app/views/shared/_obj.html.slim +21 -0
  82. data/app/views/shared/_og.html.slim +4 -0
  83. data/app/views/simple_captcha/_simple_captcha.html.slim +12 -0
  84. data/config/initializers/simple_captcha.rb +29 -0
  85. data/config/locales/en.enjoy.yml +29 -0
  86. data/config/locales/en.enjoy_admin.yml +6 -0
  87. data/config/locales/ru.cancan.yml +4 -0
  88. data/config/locales/ru.devise.yml +65 -0
  89. data/config/locales/ru.enjoy.yml +39 -0
  90. data/config/locales/ru.enjoy_admin.yml +6 -0
  91. data/config/locales/ru.kaminari.yml +17 -0
  92. data/config/locales/ru.models.yml +103 -0
  93. data/config/locales/ru.mongoid.yml +450 -0
  94. data/config/locales/ru.rails_admin.yml +148 -0
  95. data/config/locales/ru.simple_captcha.yml +3 -0
  96. data/config/locales/ru.simple_form.yml +9 -0
  97. data/config/routes.rb +14 -0
  98. data/enjoy_cms.gemspec +53 -0
  99. data/lib/enjoy/admin.rb +350 -0
  100. data/lib/enjoy/admin/contact_message.rb +36 -0
  101. data/lib/enjoy/admin/embedded_element.rb +11 -0
  102. data/lib/enjoy/admin/embedded_gallery_image.rb +15 -0
  103. data/lib/enjoy/admin/gallery.rb +20 -0
  104. data/lib/enjoy/admin/gallery_image.rb +18 -0
  105. data/lib/enjoy/admin/menu.rb +27 -0
  106. data/lib/enjoy/admin/news.rb +57 -0
  107. data/lib/enjoy/admin/page.rb +81 -0
  108. data/lib/enjoy/admin/seo.rb +17 -0
  109. data/lib/enjoy/configuration.rb +73 -0
  110. data/lib/enjoy/controller.rb +31 -0
  111. data/lib/enjoy/controllers/contacts.rb +70 -0
  112. data/lib/enjoy/controllers/news.rb +36 -0
  113. data/lib/enjoy/controllers/pages.rb +22 -0
  114. data/lib/enjoy/controllers/search.rb +62 -0
  115. data/lib/enjoy/elastic_search.rb +31 -0
  116. data/lib/enjoy/engine.rb +46 -0
  117. data/lib/enjoy/migration.rb +34 -0
  118. data/lib/enjoy/model.rb +22 -0
  119. data/lib/enjoy/models/active_record/contact_message.rb +14 -0
  120. data/lib/enjoy/models/active_record/menu.rb +17 -0
  121. data/lib/enjoy/models/active_record/news.rb +26 -0
  122. data/lib/enjoy/models/active_record/page.rb +20 -0
  123. data/lib/enjoy/models/active_record/seo.rb +17 -0
  124. data/lib/enjoy/models/contact_message.rb +37 -0
  125. data/lib/enjoy/models/embedded_element.rb +12 -0
  126. data/lib/enjoy/models/embedded_gallery_image.rb +16 -0
  127. data/lib/enjoy/models/gallery.rb +29 -0
  128. data/lib/enjoy/models/gallery_image.rb +23 -0
  129. data/lib/enjoy/models/menu.rb +28 -0
  130. data/lib/enjoy/models/mongoid/contact_message.rb +20 -0
  131. data/lib/enjoy/models/mongoid/embedded_element.rb +13 -0
  132. data/lib/enjoy/models/mongoid/embedded_gallery_image.rb +19 -0
  133. data/lib/enjoy/models/mongoid/gallery.rb +23 -0
  134. data/lib/enjoy/models/mongoid/gallery_image.rb +21 -0
  135. data/lib/enjoy/models/mongoid/menu.rb +15 -0
  136. data/lib/enjoy/models/mongoid/news.rb +29 -0
  137. data/lib/enjoy/models/mongoid/page.rb +25 -0
  138. data/lib/enjoy/models/mongoid/seo.rb +28 -0
  139. data/lib/enjoy/models/news.rb +58 -0
  140. data/lib/enjoy/models/page.rb +90 -0
  141. data/lib/enjoy/models/seo.rb +22 -0
  142. data/lib/enjoy/patch.rb +58 -0
  143. data/lib/enjoy/rails_admin_menu.rb +145 -0
  144. data/lib/enjoy/simple_form_patch.rb +12 -0
  145. data/lib/enjoy/tasks.rb +13 -0
  146. data/lib/enjoy/version.rb +3 -0
  147. data/lib/enjoy_cms.rb +109 -0
  148. data/lib/filename_to_slug.rb +34 -0
  149. data/lib/generators/enjoy/ability_generator.rb +14 -0
  150. data/lib/generators/enjoy/admin_generator.rb +21 -0
  151. data/lib/generators/enjoy/capify_generator.rb +39 -0
  152. data/lib/generators/enjoy/layout_generator.rb +14 -0
  153. data/lib/generators/enjoy/migration_generator.rb +18 -0
  154. data/lib/generators/enjoy/templates/Capfile +17 -0
  155. data/lib/generators/enjoy/templates/ability.erb +26 -0
  156. data/lib/generators/enjoy/templates/admin.erb +89 -0
  157. data/lib/generators/enjoy/templates/deploy.erb +47 -0
  158. data/lib/generators/enjoy/templates/dl.erb +30 -0
  159. data/lib/generators/enjoy/templates/migration_contact_messages.rb +15 -0
  160. data/lib/generators/enjoy/templates/migration_news.rb +26 -0
  161. data/lib/generators/enjoy/templates/migration_pages.rb +45 -0
  162. data/lib/generators/enjoy/templates/migration_seos.rb +14 -0
  163. data/lib/generators/enjoy/templates/production.erb +8 -0
  164. data/lib/generators/enjoy/templates/unicorn.erb +66 -0
  165. data/lib/generators/enjoy/utils.rb +21 -0
  166. data/lib/manual_slug.rb +10 -0
  167. data/lib/manual_slug/active_record.rb +32 -0
  168. data/lib/manual_slug/mongoid.rb +36 -0
  169. data/lib/rails_admin/custom_show_in_app.rb +43 -0
  170. data/release.sh +13 -0
  171. data/template.rb +824 -0
  172. metadata +579 -0
@@ -0,0 +1,8 @@
1
+ module Enjoy::Enableable
2
+ extend ActiveSupport::Concern
3
+ include Enjoy::BooleanField
4
+
5
+ included do
6
+ boolean_field(:enabled)
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Enjoy::Geocodeable
2
+ extend ActiveSupport::Concern
3
+ include Enjoy::Mappable
4
+ end
@@ -0,0 +1,95 @@
1
+ module Enjoy::Mappable
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+
6
+ if Enjoy.mongoid?
7
+ include Geocoder::Model::Mongoid
8
+ field :coordinates, type: Array
9
+ field :address, type: String
10
+
11
+ field :map_address, type: String
12
+ field :map_hint, type: String
13
+
14
+ field :lat, type: Float
15
+ field :lon, type: Float
16
+ end
17
+
18
+ geocoded_by :geo_address
19
+ after_validation :do_geocode
20
+ end
21
+
22
+ if Enjoy.active_record?
23
+ def coordinates
24
+ if latitude.nil? || longitude.nil?
25
+ nil
26
+ else
27
+ [longitude, latitude]
28
+ end
29
+ end
30
+ end
31
+
32
+ def do_geocode
33
+ if geo_address.blank?
34
+ if Enjoy.mongoid?
35
+ self.coordinates = nil
36
+ else
37
+ self.latitude = nil
38
+ self.longitude = nil
39
+ end
40
+ else
41
+ if (lat.nil? || lon.nil?) && (new_record? || address_changed? || coordinates.nil? || map_address_changed?)
42
+ geocode
43
+ end
44
+ end
45
+ end
46
+
47
+ def get_lat
48
+ if lat.blank?
49
+ if coordinates.nil?
50
+ nil
51
+ else
52
+ coordinates[1]
53
+ end
54
+ else
55
+ lat
56
+ end
57
+ end
58
+ def get_lon
59
+ if lon.blank?
60
+ if coordinates.nil?
61
+ nil
62
+ else
63
+ coordinates[0]
64
+ end
65
+ else
66
+ lon
67
+ end
68
+ end
69
+
70
+ def has_map?
71
+ (!lat.blank? && !lon.blank?) || !coordinates.nil?
72
+ end
73
+
74
+ def to_map
75
+ {
76
+ id: id.to_s,
77
+ hint: map_hint,
78
+ addr: address,
79
+ lat: get_lat,
80
+ lon: get_lon,
81
+ }
82
+ end
83
+
84
+ def geo_address
85
+ if map_address.blank?
86
+ address
87
+ else
88
+ map_address
89
+ end
90
+ end
91
+
92
+ def self.admin
93
+ Enjoy.map_config
94
+ end
95
+ end
@@ -0,0 +1,37 @@
1
+ if Enjoy.mongoid?
2
+ module Enjoy::MongoidPaperclip
3
+ extend ActiveSupport::Concern
4
+
5
+ include Mongoid::Paperclip
6
+
7
+ module ClassMethods
8
+ def enjoy_cms_mongoid_attached_file(name, opts = {})
9
+ name = name.to_sym
10
+ unless opts.blank?
11
+ content_type = opts.delete(:content_type)
12
+ jcrop_options = opts.delete(:jcrop_options)
13
+ end
14
+
15
+ has_mongoid_attached_file name, opts
16
+ validates_attachment name, content_type: content_type unless content_type.blank?
17
+ class_eval <<-EVAL
18
+ def #{name}_file_name=(val)
19
+ return self[:#{name}_file_name] = "" if val == ""
20
+ return self[:#{name}_file_name] = nil if val == nil
21
+ val = val.to_s
22
+ extension = File.extname(val)[1..-1]
23
+ file_name = val[0..val.size-extension.size-1]
24
+ self[:#{name}_file_name] = "\#{file_name.filename_to_slug}.\#{extension.filename_to_slug}"
25
+ end
26
+ EVAL
27
+ if jcrop_options
28
+ class_eval <<-EVAL
29
+ def #{name}_jcrop_options
30
+ #{jcrop_options}
31
+ end
32
+ EVAL
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,36 @@
1
+ module Enjoy::Seoable
2
+ extend ActiveSupport::Concern
3
+ LOCALIZED_FIELDS = [:h1, :title, :keywords, :description, :og_title]
4
+ FIELDS = LOCALIZED_FIELDS + [:og_image, :robots]
5
+
6
+ included do
7
+ has_one :seo, as: :seoable, autosave: true
8
+ accepts_nested_attributes_for :seo
9
+ delegate *FIELDS, to: :seo
10
+ delegate *(FIELDS.map {|f| "#{f}=".to_sym }), to: :seo
11
+ alias seo_without_build seo
12
+ def seo
13
+ seo_without_build || build_seo
14
+ end
15
+ if Enjoy.config.localize
16
+ delegate *(LOCALIZED_FIELDS.map {|f| "#{f}_translations".to_sym }), to: :seo
17
+ delegate *(LOCALIZED_FIELDS.map {|f| "#{f}_translations=".to_sym }), to: :seo
18
+ end
19
+ end
20
+
21
+ def page_title
22
+ title.blank? ? name : title
23
+ end
24
+
25
+ def get_og_title
26
+ og_title.blank? ? name : og_title
27
+ end
28
+
29
+ def self.admin
30
+ Enjoy.seo_config
31
+ end
32
+
33
+ def og_image_jcrop_options
34
+ {aspectRation: 800.0/600.0}
35
+ end
36
+ end
@@ -0,0 +1,23 @@
1
+ module Enjoy::SitemapData
2
+ extend ActiveSupport::Concern
3
+
4
+ SITEMAP_CHANGEFREQ_ARRAY = %w(always hourly daily weekly monthly yearly never)
5
+
6
+ included do
7
+ if Enjoy.mongoid?
8
+ field :sitemap_show, type: Boolean, default: true
9
+ field :sitemap_lastmod, type: DateTime
10
+ field :sitemap_changefreq, type: String, default: 'daily'
11
+ field :sitemap_priority, type: Float
12
+
13
+ scope :sitemap_show, -> { where(sitemap_show: true) }
14
+ scope :for_sitemap, -> { sitemap_show }
15
+ scope :show_in_sitemap, -> { sitemap_show }
16
+ elsif Enjoy.active_record?
17
+ end
18
+ end
19
+
20
+ def self.admin
21
+ Enjoy.sitemap_data_config
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ module Enjoy::SortField
2
+ extend ActiveSupport::Concern
3
+
4
+ module ClassMethods
5
+ def sort_field(prefix = '')
6
+ prefix = "#{prefix}_" unless prefix == ''
7
+
8
+ if Enjoy.mongoid?
9
+ field "#{prefix}order".to_sym, type: Integer
10
+ alias_method "#{prefix}sort", "#{prefix}order"
11
+ scope "#{prefix}ordered".to_sym, -> { asc("#{prefix}order".to_sym) }
12
+ scope "#{prefix}sorted".to_sym, -> { asc("#{prefix}order".to_sym) }
13
+ end
14
+ if Enjoy.active_record?
15
+ scope "#{prefix}ordered".to_sym, -> { order("#{prefix}order".to_sym => :asc) }
16
+ scope "#{prefix}sorted".to_sym, -> { order("#{prefix}order".to_sym => :asc) }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,8 @@
1
+ module Enjoy::Sortable
2
+ extend ActiveSupport::Concern
3
+ include Enjoy::SortField
4
+
5
+ included do
6
+ sort_field
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ module Enjoy
2
+ if Enjoy.active_record?
3
+ class ContactMessage < ActiveRecord::Base
4
+ end
5
+ end
6
+
7
+ class ContactMessage
8
+ include Enjoy::Models::ContactMessage
9
+ Enjoy.apply_patches self
10
+ rails_admin &Enjoy.contact_message_config
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class Enjoy
4
+ include Enjoy::Models::Enjoy
5
+ Enjoy.apply_patches self
6
+
7
+ # use it in inherited model
8
+ #rails_admin &Enjoy.embedded_image_config
9
+
10
+ # use it in rails_admin in parent model for sort
11
+ # sort_embedded({fields: [:embedded_field_1, :embedded_field_2...]})
12
+ # or u need to override rails_admin in inherited model to add sort field
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class EmbeddedGalleryImage < Enjoy
4
+ include Enjoy::Models::EmbeddedGalleryImage
5
+ Enjoy.apply_patches self
6
+
7
+ # use it in inherited model
8
+ #rails_admin &Enjoy.embedded_image_config
9
+
10
+ # use it in rails_admin in parent model for sort
11
+ # sort_embedded({fields: [:embedded_field_1, :embedded_field_2...]})
12
+ # or u need to override rails_admin in inherited model to add sort field
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class Gallery
4
+ include Enjoy::Models::Gallery
5
+ Enjoy.apply_patches self
6
+
7
+ rails_admin &Enjoy.gallery_config
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class GalleryImage
4
+ include Enjoy::Models::GalleryImage
5
+ Enjoy.apply_patches self
6
+
7
+ rails_admin &Enjoy.image_config
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module Enjoy
2
+ if Enjoy.active_record?
3
+ class Menu < ActiveRecord::Base
4
+ end
5
+ end
6
+
7
+ class Menu
8
+ include Enjoy::Models::Menu
9
+ Enjoy.apply_patches self
10
+ rails_admin &Enjoy.menu_config
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Enjoy
2
+ if Enjoy.active_record?
3
+ class News < ActiveRecord::Base
4
+ end
5
+ end
6
+
7
+ class News
8
+ include Enjoy::Models::News
9
+ Enjoy.apply_patches self
10
+ rails_admin &Enjoy.news_config
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Enjoy
2
+ if Enjoy.active_record?
3
+ class Page < ActiveRecord::Base
4
+ end
5
+ end
6
+
7
+ class Page
8
+ include Enjoy::Models::Page
9
+ Enjoy.apply_patches self
10
+ rails_admin &Enjoy.page_config
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ module Enjoy
2
+ if Enjoy.active_record?
3
+ class Seo < ActiveRecord::Base
4
+ end
5
+ end
6
+
7
+ class Seo
8
+ include Enjoy::Models::Seo
9
+ Enjoy.apply_patches self
10
+ rails_admin &Enjoy.seo_config
11
+ belongs_to :seoable, polymorphic: true
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ / For third-generation iPad with high-resolution Retina display:
2
+ / Size should be 228 x 228 pixels
3
+ = favicon_link_tag '/apple-touch-icon-228x228-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '228x228'
4
+ / For iPhone with high-resolution Retina display:
5
+ / Size should be 114 x 114 pixels
6
+ = favicon_link_tag '/apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
7
+ / For fienjoyt- and second-generation iPad:
8
+ / Size should be 72 x 72 pixels
9
+ = favicon_link_tag '/apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72'
10
+ / For non-Retina iPhone, iPod Touch, and Android 2.1+ devices:
11
+ / Size should be 57 x 57 pixels
12
+ = favicon_link_tag '/apple-touch-icon-57x57-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '57x57'
13
+ / For non-Retina iPhone, iPod Touch, and Android 2.1+ devices:
14
+ / Size should be 57 x 57 pixels
15
+ = favicon_link_tag '/apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png'
16
+ / For all other devices
17
+ / Size should be 32 x 32 pixels
18
+ = favicon_link_tag '/favicon.ico', :rel => 'shortcut icon', :type => 'image/vnd.microsoft.icon'
19
+ / For all other devices
20
+ / Size should be 32 x 32 pixels
21
+ = favicon_link_tag '/favicon.png', :rel => 'shortcut icon', :type => 'image/png'
@@ -0,0 +1 @@
1
+ '(c) 2016 etc
@@ -0,0 +1,18 @@
1
+ - if @seo_page
2
+ - content_for :meta do
3
+ = render 'shared/meta', obj: @seo_page, alt_obj: @seo_parent_page
4
+
5
+ - og_title = (@seo_page.get_og_title.blank? and @seo_parent_page ? @seo_parent_page.get_og_title : @seo_page.get_og_title)
6
+ - og_image = (@seo_page.og_image.blank? and @seo_parent_page ? @seo_parent_page.og_image : @seo_page.og_image)
7
+ = render 'shared/og', title: @seo_page.get_og_title, image: @seo_page.og_image
8
+ - elsif @seo_parent_page
9
+ - content_for :meta do
10
+ = render 'shared/meta', obj: @seo_parent_page
11
+ = render 'shared/og', title: @seo_parent_page.get_og_title, image: @seo_parent_page.og_image
12
+
13
+ - if @seo_page and @seo_page.title
14
+ - content_for :title do
15
+ title= @seo_page.title
16
+ - elsif @seo_parent_page and @seo_parent_page.title
17
+ - content_for :title do
18
+ title= @seo_parent_page.title
@@ -0,0 +1,27 @@
1
+ - obj ||= nil
2
+ - if obj
3
+ - content_for :meta do
4
+ - seo_page = @seo_page || @seo_parent_page
5
+ = render 'shared/meta', obj: obj
6
+
7
+ - og_title = (obj.get_og_title.blank? and seo_page ? seo_page.get_og_title : obj.get_og_title)
8
+ - og_image = (obj.og_image.blank? and seo_page ? seo_page.og_image : obj.og_image)
9
+ = render 'shared/og', title: obj.get_og_title, image: obj.og_image
10
+ - if obj.title
11
+ - content_for :title do
12
+ title= obj.title
13
+
14
+ - elsif @seo_page
15
+ - content_for :meta do
16
+ = render 'shared/meta', obj: @seo_page
17
+ = render 'shared/og', title: @seo_page.get_og_title, image: @seo_page.og_image
18
+
19
+ - if obj and obj.title
20
+ - content_for :title do
21
+ title= obj.title
22
+ - elsif @seo_page and @seo_page.title
23
+ - content_for :title do
24
+ title= @seo_page.title
25
+ - elsif @seo_parent_page and @seo_parent_page.title
26
+ - content_for :title do
27
+ title= @seo_parent_page.title