enjoy_cms 0.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +249 -0
- data/LICENSE.txt +22 -0
- data/README.md +137 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/enjoy_cms.coffee +6 -0
- data/app/assets/javascripts/enjoy_cms/flash.js.coffee +3 -0
- data/app/assets/javascripts/enjoy_cms/map.js.coffee +22 -0
- data/app/assets/javascripts/head.load.js +707 -0
- data/app/assets/javascripts/jquery.placeholder.js +157 -0
- data/app/assets/stylesheets/enjoy_cms.sass +5 -0
- data/app/assets/stylesheets/enjoy_cms/flash.sass +63 -0
- data/app/assets/stylesheets/enjoy_cms/normalize.scss +406 -0
- data/app/assets/stylesheets/enjoy_cms/powered.sass +18 -0
- data/app/controllers/concerns/enjoy/errors.rb +93 -0
- data/app/controllers/concerns/enjoy/fancybox.rb +14 -0
- data/app/controllers/concerns/enjoy/localizeable.rb +33 -0
- data/app/controllers/concerns/enjoy/nav_menu.rb +64 -0
- data/app/controllers/concerns/enjoy/no_cache.rb +12 -0
- data/app/controllers/concerns/enjoy/seo_pages.rb +83 -0
- data/app/controllers/enjoy/contacts_controller.rb +5 -0
- data/app/controllers/enjoy/home_controller.rb +6 -0
- data/app/controllers/enjoy/news_controller.rb +5 -0
- data/app/controllers/enjoy/pages_controller.rb +5 -0
- data/app/controllers/enjoy/search_controller.rb +6 -0
- data/app/helpers/enjoy/gzip_helper.rb +27 -0
- data/app/helpers/enjoy/powered_helper.rb +12 -0
- data/app/mailers/enjoy/contact_mailer.rb +17 -0
- data/app/models/concerns/enjoy/boolean_field.rb +17 -0
- data/app/models/concerns/enjoy/enableable.rb +8 -0
- data/app/models/concerns/enjoy/geocodeable.rb +4 -0
- data/app/models/concerns/enjoy/mappable.rb +95 -0
- data/app/models/concerns/enjoy/mongoid_paperclip.rb +37 -0
- data/app/models/concerns/enjoy/seoable.rb +36 -0
- data/app/models/concerns/enjoy/sitemap_data.rb +23 -0
- data/app/models/concerns/enjoy/sort_field.rb +20 -0
- data/app/models/concerns/enjoy/sortable.rb +8 -0
- data/app/models/enjoy/contact_message.rb +12 -0
- data/app/models/enjoy/embedded_element.rb +15 -0
- data/app/models/enjoy/embedded_gallery_image.rb +15 -0
- data/app/models/enjoy/gallery.rb +10 -0
- data/app/models/enjoy/gallery_image.rb +10 -0
- data/app/models/enjoy/menu.rb +12 -0
- data/app/models/enjoy/news.rb +12 -0
- data/app/models/enjoy/page.rb +12 -0
- data/app/models/enjoy/seo.rb +13 -0
- data/app/views/blocks/_favicon.html.slim +21 -0
- data/app/views/blocks/_footer.html.slim +1 -0
- data/app/views/blocks/_seo_block.html.slim +18 -0
- data/app/views/blocks/_seo_block_with_obj.html.slim +27 -0
- data/app/views/devise/registrations/edit.html.slim +21 -0
- data/app/views/devise/registrations/new.html.slim +21 -0
- data/app/views/devise/sessions/new.html.slim +22 -0
- data/app/views/devise/shared/_links.html.slim +11 -0
- data/app/views/enjoy/contact_mailer/new_message_email.html.slim +15 -0
- data/app/views/enjoy/contacts/index.html.slim +10 -0
- data/app/views/enjoy/contacts/new.html.slim +10 -0
- data/app/views/enjoy/contacts/sent.html.slim +4 -0
- data/app/views/enjoy/home/index.html.slim +1 -0
- data/app/views/enjoy/news/index.html.slim +9 -0
- data/app/views/enjoy/news/show.html.slim +8 -0
- data/app/views/enjoy/pages/show.html.slim +1 -0
- data/app/views/enjoy/search/index.html.slim +19 -0
- data/app/views/errors/_base.html.slim +3 -0
- data/app/views/errors/error_403.html.slim +1 -0
- data/app/views/errors/error_404.html.slim +1 -0
- data/app/views/errors/error_500.html.slim +1 -0
- data/app/views/layouts/application.html.slim +25 -0
- data/app/views/rails_admin/main/_check_boxes.html.slim +27 -0
- data/app/views/rails_admin/main/_enum_check_boxes.html.slim +5 -0
- data/app/views/rails_admin/main/_enum_radio_buttons.html.slim +5 -0
- data/app/views/rails_admin/main/_form_raw.html.slim +1 -0
- data/app/views/shared/_admin_link.html.slim +3 -0
- data/app/views/shared/_messages.html.slim +7 -0
- data/app/views/shared/_meta.html.slim +19 -0
- data/app/views/shared/_obj.html.slim +21 -0
- data/app/views/shared/_og.html.slim +4 -0
- data/app/views/simple_captcha/_simple_captcha.html.slim +12 -0
- data/config/initializers/simple_captcha.rb +29 -0
- data/config/locales/en.enjoy.yml +29 -0
- data/config/locales/en.enjoy_admin.yml +6 -0
- data/config/locales/ru.cancan.yml +4 -0
- data/config/locales/ru.devise.yml +65 -0
- data/config/locales/ru.enjoy.yml +39 -0
- data/config/locales/ru.enjoy_admin.yml +6 -0
- data/config/locales/ru.kaminari.yml +17 -0
- data/config/locales/ru.models.yml +103 -0
- data/config/locales/ru.mongoid.yml +450 -0
- data/config/locales/ru.rails_admin.yml +148 -0
- data/config/locales/ru.simple_captcha.yml +3 -0
- data/config/locales/ru.simple_form.yml +9 -0
- data/config/routes.rb +14 -0
- data/enjoy_cms.gemspec +53 -0
- data/lib/enjoy/admin.rb +350 -0
- data/lib/enjoy/admin/contact_message.rb +36 -0
- data/lib/enjoy/admin/embedded_element.rb +11 -0
- data/lib/enjoy/admin/embedded_gallery_image.rb +15 -0
- data/lib/enjoy/admin/gallery.rb +20 -0
- data/lib/enjoy/admin/gallery_image.rb +18 -0
- data/lib/enjoy/admin/menu.rb +27 -0
- data/lib/enjoy/admin/news.rb +57 -0
- data/lib/enjoy/admin/page.rb +81 -0
- data/lib/enjoy/admin/seo.rb +17 -0
- data/lib/enjoy/configuration.rb +73 -0
- data/lib/enjoy/controller.rb +31 -0
- data/lib/enjoy/controllers/contacts.rb +70 -0
- data/lib/enjoy/controllers/news.rb +36 -0
- data/lib/enjoy/controllers/pages.rb +22 -0
- data/lib/enjoy/controllers/search.rb +62 -0
- data/lib/enjoy/elastic_search.rb +31 -0
- data/lib/enjoy/engine.rb +46 -0
- data/lib/enjoy/migration.rb +34 -0
- data/lib/enjoy/model.rb +22 -0
- data/lib/enjoy/models/active_record/contact_message.rb +14 -0
- data/lib/enjoy/models/active_record/menu.rb +17 -0
- data/lib/enjoy/models/active_record/news.rb +26 -0
- data/lib/enjoy/models/active_record/page.rb +20 -0
- data/lib/enjoy/models/active_record/seo.rb +17 -0
- data/lib/enjoy/models/contact_message.rb +37 -0
- data/lib/enjoy/models/embedded_element.rb +12 -0
- data/lib/enjoy/models/embedded_gallery_image.rb +16 -0
- data/lib/enjoy/models/gallery.rb +29 -0
- data/lib/enjoy/models/gallery_image.rb +23 -0
- data/lib/enjoy/models/menu.rb +28 -0
- data/lib/enjoy/models/mongoid/contact_message.rb +20 -0
- data/lib/enjoy/models/mongoid/embedded_element.rb +13 -0
- data/lib/enjoy/models/mongoid/embedded_gallery_image.rb +19 -0
- data/lib/enjoy/models/mongoid/gallery.rb +23 -0
- data/lib/enjoy/models/mongoid/gallery_image.rb +21 -0
- data/lib/enjoy/models/mongoid/menu.rb +15 -0
- data/lib/enjoy/models/mongoid/news.rb +29 -0
- data/lib/enjoy/models/mongoid/page.rb +25 -0
- data/lib/enjoy/models/mongoid/seo.rb +28 -0
- data/lib/enjoy/models/news.rb +58 -0
- data/lib/enjoy/models/page.rb +90 -0
- data/lib/enjoy/models/seo.rb +22 -0
- data/lib/enjoy/patch.rb +58 -0
- data/lib/enjoy/rails_admin_menu.rb +145 -0
- data/lib/enjoy/simple_form_patch.rb +12 -0
- data/lib/enjoy/tasks.rb +13 -0
- data/lib/enjoy/version.rb +3 -0
- data/lib/enjoy_cms.rb +109 -0
- data/lib/filename_to_slug.rb +34 -0
- data/lib/generators/enjoy/ability_generator.rb +14 -0
- data/lib/generators/enjoy/admin_generator.rb +21 -0
- data/lib/generators/enjoy/capify_generator.rb +39 -0
- data/lib/generators/enjoy/layout_generator.rb +14 -0
- data/lib/generators/enjoy/migration_generator.rb +18 -0
- data/lib/generators/enjoy/templates/Capfile +17 -0
- data/lib/generators/enjoy/templates/ability.erb +26 -0
- data/lib/generators/enjoy/templates/admin.erb +89 -0
- data/lib/generators/enjoy/templates/deploy.erb +47 -0
- data/lib/generators/enjoy/templates/dl.erb +30 -0
- data/lib/generators/enjoy/templates/migration_contact_messages.rb +15 -0
- data/lib/generators/enjoy/templates/migration_news.rb +26 -0
- data/lib/generators/enjoy/templates/migration_pages.rb +45 -0
- data/lib/generators/enjoy/templates/migration_seos.rb +14 -0
- data/lib/generators/enjoy/templates/production.erb +8 -0
- data/lib/generators/enjoy/templates/unicorn.erb +66 -0
- data/lib/generators/enjoy/utils.rb +21 -0
- data/lib/manual_slug.rb +10 -0
- data/lib/manual_slug/active_record.rb +32 -0
- data/lib/manual_slug/mongoid.rb +36 -0
- data/lib/rails_admin/custom_show_in_app.rb +43 -0
- data/release.sh +13 -0
- data/template.rb +824 -0
- metadata +579 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
h2 Редактирование профиля
|
2
|
+
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
3
|
+
/= devise_error_messages!
|
4
|
+
.field
|
5
|
+
= f.label :email, I18n.t("shared.email")
|
6
|
+
br
|
7
|
+
= f.email_field :email, autofocus: true
|
8
|
+
.field
|
9
|
+
= f.label :password
|
10
|
+
- if @minimum_password_length
|
11
|
+
em
|
12
|
+
(Минимум символов: #{@minimum_password_length})
|
13
|
+
br
|
14
|
+
= f.password_field :password, I18n.t("shared.password"), autocomplete: "off"
|
15
|
+
.field
|
16
|
+
= f.label :password_confirmation
|
17
|
+
br
|
18
|
+
= f.password_field :password_confirmation, I18n.t("shared.password_confirmation"), autocomplete: "off"
|
19
|
+
.actions
|
20
|
+
= f.submit "Зарегистрироваться"
|
21
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
h2 Регистрация
|
2
|
+
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
3
|
+
= devise_error_messages!
|
4
|
+
.field
|
5
|
+
= f.label :email, label: I18n.t("shared.email")
|
6
|
+
br
|
7
|
+
= f.email_field :email, autofocus: true
|
8
|
+
.field
|
9
|
+
= f.label :password
|
10
|
+
- if @minimum_password_length
|
11
|
+
em= " (Минимум символов: #{@minimum_password_length})"
|
12
|
+
br
|
13
|
+
= f.password_field :password, label: I18n.t("shared.password"), autocomplete: "off"
|
14
|
+
.field
|
15
|
+
= f.label :password_confirmation
|
16
|
+
br
|
17
|
+
= f.password_field :password_confirmation, label: I18n.t("shared.password_confirmation"), autocomplete: "off"
|
18
|
+
.actions
|
19
|
+
= f.submit "Зарегистрироваться"
|
20
|
+
br
|
21
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
h2= I18n.t("shared.enter_site")
|
2
|
+
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
3
|
+
.field
|
4
|
+
= f.label :email, I18n.t("shared.email")
|
5
|
+
br
|
6
|
+
= f.email_field :email, autofocus: true, title: I18n.t("shared.email")
|
7
|
+
br
|
8
|
+
.field
|
9
|
+
= f.label :password, title: I18n.t("shared.password")
|
10
|
+
br
|
11
|
+
= f.password_field :password, autocomplete: "off", title: I18n.t("shared.password")
|
12
|
+
br
|
13
|
+
- if devise_mapping.rememberable?
|
14
|
+
.field
|
15
|
+
= f.check_box :remember_me, title: I18n.t("shared.remember_me")
|
16
|
+
= f.label :remember_me, I18n.t("shared.remember_me")
|
17
|
+
|
18
|
+
.actions
|
19
|
+
= f.submit I18n.t("shared.enter")
|
20
|
+
br
|
21
|
+
|
22
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- if controller_name != 'sessions'
|
2
|
+
= link_to I18n.t("shared.enter_site"), new_session_path(resource_name)
|
3
|
+
br
|
4
|
+
|
5
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
6
|
+
= link_to I18n.t("shared.registration"), new_registration_path(resource_name)
|
7
|
+
br
|
8
|
+
|
9
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
10
|
+
= link_to I18n.t("shared.forget_password"), new_password_path(resource_name)
|
11
|
+
br
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- excluded_column_names = %w[id c_at u_at created_at updated_at _id _type enabled attachment c_at u_at captcha captcha_key veenjoyion creator_id creator updater_id updater modifier modifier_id]
|
2
|
+
|
3
|
+
h3= "Сообщение из формы связи:"
|
4
|
+
|
5
|
+
table
|
6
|
+
tr
|
7
|
+
th(style='padding: 2px 3px') Поле
|
8
|
+
th(style='padding: 2px 3px') Значение
|
9
|
+
- fields = (Enjoy.mongoid? ? Enjoy::ContactMessage.fields.keys : Enjoy::ContactMessage.columns.map(&:name))
|
10
|
+
- fields.reject{|c| excluded_column_names.include?(c) }.each do |c|
|
11
|
+
tr
|
12
|
+
td(style='padding: 2px 3px')
|
13
|
+
= Enjoy::ContactMessage.human_attribute_name(c)
|
14
|
+
td(style='padding: 2px 3px')
|
15
|
+
= @message.send(c.to_sym)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render 'shared/obj', obj: @seo_page
|
2
|
+
|
3
|
+
#enjoy_cms_contact_form
|
4
|
+
= simple_form_for @contact_message, url: enjoy.contacts_path do |f|
|
5
|
+
= f.input :name
|
6
|
+
= f.input :email
|
7
|
+
= f.input :phone
|
8
|
+
= f.input :content
|
9
|
+
= f.input :captcha, as: :simple_captcha
|
10
|
+
= f.submit t('enjoy.send')
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render 'shared/obj', obj: @seo_page
|
2
|
+
|
3
|
+
#enjoy_cms_contact_form
|
4
|
+
= simple_form_for @contact_message, url: enjoy.contacts_path do |f|
|
5
|
+
= f.input :name
|
6
|
+
= f.input :email
|
7
|
+
= f.input :phone
|
8
|
+
= f.input :content
|
9
|
+
= f.input :captcha
|
10
|
+
= f.submit t('enjoy.send')
|
@@ -0,0 +1 @@
|
|
1
|
+
div enjoy_cms test app
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.enjoy-news-index
|
2
|
+
h1= t('enjoy.news')
|
3
|
+
- @news.each do |news|
|
4
|
+
.enjoy-news-date= l(news.time.to_date)
|
5
|
+
= link_to news.name, news, class: "enjoy-news-title", title: news.name
|
6
|
+
- if !Enjoy.configuration.news_image_styles.nil? && news.image?
|
7
|
+
.enjoy-news-image= image_tag news.image.url(:thumb)
|
8
|
+
.enjoy-news-excerpt== news.excerpt
|
9
|
+
= paginate @news
|
@@ -0,0 +1,8 @@
|
|
1
|
+
.enjoy-news-show
|
2
|
+
h1.enjoy-news-title= @news.name
|
3
|
+
.enjoy-news-date= l(@news.time.to_date)
|
4
|
+
.enjoy-news-text== @news.content
|
5
|
+
- if !Enjoy.config.news_image_styles.nil? && @news.image?
|
6
|
+
.enjoy-news-image= image_tag @news.image.url(:main)
|
7
|
+
.enjoy-news-content
|
8
|
+
= render 'shared/obj', obj: @news
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'shared/obj', obj: @seo_page
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.enjoy-search-results
|
2
|
+
h1 Результаты поиска
|
3
|
+
= form_tag enjoy.search_path, method: :get, class: 'nav_search' do
|
4
|
+
= text_field_tag 'query', params[:query], placeholder: "Поиск"
|
5
|
+
= submit_tag 'Найти'
|
6
|
+
ol
|
7
|
+
- any = false
|
8
|
+
- @results.each do |r|
|
9
|
+
- any = true
|
10
|
+
li
|
11
|
+
.title= link_to (r._highlight.nil? || r._highlight['name'].nil?) ? r.name : r._highlight['name'].join(' ... ').html_safe, url_for(r)
|
12
|
+
.text
|
13
|
+
= raw (r._highlight.nil? || r._highlight['content'].nil?) ? (r.content.blank? ? '' : SmartExcerpt.truncate(r.content)) : r._highlight['content'].join(' ... ')
|
14
|
+
span.more= link_to '', url_for(r)
|
15
|
+
|
16
|
+
- unless any
|
17
|
+
.enjoy-search-no-results К сожалению, ничего не найдено
|
18
|
+
|
19
|
+
= paginate @results if any
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'erroenjoy/base', code: 403, text: t('enjoy.erroenjoy.access_denied')
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'erroenjoy/base', code: 404, text: t('enjoy.erroenjoy.not_found')
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'erroenjoy/base', code: 500, text: t('enjoy.erroenjoy.internal_error')
|
@@ -0,0 +1,25 @@
|
|
1
|
+
doctype html
|
2
|
+
html lang="ru"
|
3
|
+
head
|
4
|
+
meta chaenjoyet="UTF-8"
|
5
|
+
meta name="viewport" content="width=device-width, maximum-scale=1"
|
6
|
+
title= page_title
|
7
|
+
= yield :meta
|
8
|
+
= csrf_meta_tags
|
9
|
+
= render partial: "blocks/favicon"
|
10
|
+
|
11
|
+
= stylesheet_link_tag "application", media: "all", async: true
|
12
|
+
= javascript_include_tag "application", async: true
|
13
|
+
/[if lt IE 9]
|
14
|
+
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js", async: true
|
15
|
+
|
16
|
+
body
|
17
|
+
#root
|
18
|
+
= render 'shared/messages'
|
19
|
+
#sidebar
|
20
|
+
= render_navigation &navigation(:main)
|
21
|
+
#content
|
22
|
+
= yield
|
23
|
+
#root_footer
|
24
|
+
#footer
|
25
|
+
= render 'blocks/footer'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
- if params[:associations].nil?
|
2
|
+
= render 'rails_admin/main/enum_check_boxes', field: field, form: form
|
3
|
+
- else
|
4
|
+
:ruby
|
5
|
+
related_id = params[:associations] && params[:associations][field.name.to_s]
|
6
|
+
config = field.associated_model_config
|
7
|
+
source_abstract_model = RailsAdmin.config(form.object.class).abstract_model
|
8
|
+
|
9
|
+
if form.object.new_record? && related_id.present? && related_id != 'new'
|
10
|
+
selected = [config.abstract_model.get(related_id)]
|
11
|
+
else
|
12
|
+
selected = form.object.send(field.name)
|
13
|
+
end
|
14
|
+
selected_ids = selected.map{|s| s.send(field.associated_primary_key)}
|
15
|
+
|
16
|
+
current_action = params[:action].in?(['create', 'new']) ? 'create' : 'update'
|
17
|
+
|
18
|
+
xhr = !field.associated_collection_cache_all
|
19
|
+
|
20
|
+
collection = if xhr
|
21
|
+
selected.map { |o| [o.send(field.associated_object_label_method), o.send(field.associated_primary_key)] }
|
22
|
+
else
|
23
|
+
i = 0
|
24
|
+
controller.list_entries(config, :index, field.associated_collection_scope, false).map { |o| [o.send(field.associated_object_label_method), o.send(field.associated_primary_key)] }.sort_by {|a| [selected_ids.index(a[1]) || selected_ids.size, i+=1] }
|
25
|
+
end
|
26
|
+
|
27
|
+
= form.collection_check_boxes field.method_name, collection, :last, :fienjoyt, {}, {} { |i| i.label( class: 'checkbox' ) { i.check_box + i.text } }
|
@@ -0,0 +1,5 @@
|
|
1
|
+
:ruby
|
2
|
+
values = form.object.class.send(field.method_name).values.map { |v|
|
3
|
+
[t("enumerize.#{form.object.class.name.downcase}.#{field.method_name}.#{v}", default: t("enumerize.defaults.#{field.method_name}.#{v}")), v]
|
4
|
+
}
|
5
|
+
= form.collection_check_boxes field.method_name, values, :last, :fienjoyt, {}, {} { |i| i.label( class: 'checkbox' ) { i.check_box + i.text } }
|
@@ -0,0 +1,5 @@
|
|
1
|
+
:ruby
|
2
|
+
values = form.object.class.send(field.method_name).values.map { |v|
|
3
|
+
[t("enumerize.#{form.object.class.name.downcase}.#{field.method_name}.#{v}", default: t("enumerize.defaults.#{field.method_name}.#{v}")), v]
|
4
|
+
}
|
5
|
+
= form.collection_radio_buttons field.method_name, values, :last, :fienjoyt, {}, {} { |i| i.label(class: 'radio') { i.radio_button + i.text } }
|
@@ -0,0 +1 @@
|
|
1
|
+
= field.pretty_value
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- alt_obj ||= nil
|
2
|
+
|
3
|
+
- if obj.respond_to?(:keywords) and !obj.keywords.blank?
|
4
|
+
meta{name="keywords" content="#{obj.keywords}"}/
|
5
|
+
- else
|
6
|
+
- if alt_obj and alt_obj.respond_to?(:keywords) and !alt_obj.keywords.blank?
|
7
|
+
meta{name="keywords" content="#{alt_obj.keywords}"}/
|
8
|
+
|
9
|
+
- if obj.respond_to?(:description) and !obj.description.blank?
|
10
|
+
meta{name="description" content="#{obj.description}"}/
|
11
|
+
- else
|
12
|
+
- if alt_obj and alt_obj.respond_to?(:description) and !alt_obj.description.blank?
|
13
|
+
meta{name="description" content="#{alt_obj.description}"}/
|
14
|
+
|
15
|
+
- if obj.respond_to?(:robots) and !obj.robots.blank?
|
16
|
+
meta{name="robots" content="#{obj.robots}"}/
|
17
|
+
- else
|
18
|
+
- if alt_obj and alt_obj.respond_to?(:robots) and !alt_obj.robots.blank?
|
19
|
+
meta{name="robots" content="#{alt_obj.robots}"}/
|
@@ -0,0 +1,21 @@
|
|
1
|
+
- unless obj.nil?
|
2
|
+
.text_content
|
3
|
+
- if (!defined?(h1) || h1) && !obj.h1.blank?
|
4
|
+
h1= obj.h1
|
5
|
+
- if obj.content.blank?
|
6
|
+
- unless @seo_page.nil?
|
7
|
+
= raw @seo_page.page_content
|
8
|
+
- else
|
9
|
+
= raw obj.content
|
10
|
+
- if !obj.nil?
|
11
|
+
= render 'shared/admin_link', obj: obj
|
12
|
+
- if !@seo_page.nil? && (@seo_page.id != obj.id || @seo_page.class.name != obj.class.name)
|
13
|
+
= render 'shared/admin_link', obj: @seo_page
|
14
|
+
|
15
|
+
- content_for :meta do
|
16
|
+
= render 'shared/meta', obj: obj
|
17
|
+
= render 'shared/og', title: obj.get_og_title, image: obj.og_image
|
18
|
+
|
19
|
+
- content_for :title do
|
20
|
+
- if obj.title
|
21
|
+
title= obj.title
|
@@ -0,0 +1,12 @@
|
|
1
|
+
label.form-label
|
2
|
+
= simple_captcha_options[:label]
|
3
|
+
.input_image_block
|
4
|
+
.image
|
5
|
+
= simple_captcha_options[:image]
|
6
|
+
.input
|
7
|
+
= simple_captcha_options[:field]
|
8
|
+
|
9
|
+
- unless simple_captcha_options[:error_messages].blank?
|
10
|
+
.errors_black
|
11
|
+
- simple_captcha_options[:error_messages].each do |m|
|
12
|
+
span.error= m
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SimpleCaptcha #:nodoc
|
2
|
+
module ViewHelper #:nodoc
|
3
|
+
def show_simple_captcha(options={})
|
4
|
+
key = simple_captcha_key(options[:object])
|
5
|
+
options[:field_value] = set_simple_captcha_data(key, options)
|
6
|
+
|
7
|
+
defaults = {
|
8
|
+
:image => simple_captcha_image(key, options),
|
9
|
+
:label => options[:label] || I18n.t('simple_captcha.label'),
|
10
|
+
:field => simple_captcha_field(options),
|
11
|
+
:error_messages => options[:error_messages]
|
12
|
+
}
|
13
|
+
|
14
|
+
render :partial => 'simple_captcha/simple_captcha', :locals => { :simple_captcha_options => defaults }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
SimpleCaptcha.setup do |sc|
|
20
|
+
sc.image_size = "200x50"
|
21
|
+
sc.length = 4
|
22
|
+
sc.charset = "1234567890"
|
23
|
+
|
24
|
+
sc.add_image_style("enjoy_cms_style", ["-alpha set", "-fill '#ffffff'", "-background 'transparent'", "-size 200x50", "xc:transparent"])
|
25
|
+
|
26
|
+
sc.image_style = 'enjoy_cms_style'
|
27
|
+
|
28
|
+
sc.tmp_path = "tmp/sc"
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
en:
|
2
|
+
enjoy:
|
3
|
+
gallery: "Gallery"
|
4
|
+
cms: "CMS"
|
5
|
+
menu: "Menu"
|
6
|
+
settings: 'Settings'
|
7
|
+
news: 'News'
|
8
|
+
with_final_slash: "should begin with a slash"
|
9
|
+
page_url_regex: "Regular expression to check if page is current"
|
10
|
+
final_in_menu: "This link is also displayed in menu"
|
11
|
+
no_contact_info: "^Please enter your phone or email so we could contact you."
|
12
|
+
map: 'Map'
|
13
|
+
sitemap: 'Sitemap'
|
14
|
+
sitemap_data: 'Sitemap data'
|
15
|
+
edit: Edit
|
16
|
+
send: Send
|
17
|
+
format_time: "%-m/%-d/%Y"
|
18
|
+
m:
|
19
|
+
enabled: 'added to menu "%{menu}"'
|
20
|
+
disabled: 'deleted from menu "%{menu}"'
|
21
|
+
error: "Error: %{err}"
|
22
|
+
no_id: "No ID"
|
23
|
+
errors:
|
24
|
+
title: "Error %{code}"
|
25
|
+
form_expired: "Token expired"
|
26
|
+
internal_error: "Internal error"
|
27
|
+
internal_error_full: "Internal error: %{klass} %{message}"
|
28
|
+
access_denied: "Access denied"
|
29
|
+
not_found: 'The requested page was not found on this server'
|
@@ -0,0 +1,65 @@
|
|
1
|
+
ru:
|
2
|
+
devise:
|
3
|
+
confirmations:
|
4
|
+
confirmed: Ваша учётная запись подтверждена. Теперь вы вошли в систему.
|
5
|
+
send_instructions: В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи.
|
6
|
+
send_paranoid_instructions: Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи.
|
7
|
+
failure:
|
8
|
+
already_authenticated: Вы уже вошли в систему.
|
9
|
+
inactive: Ваша учётная запись ещё не активирована.
|
10
|
+
invalid: Неверный адрес e-mail или пароль.
|
11
|
+
invalid_token: Неверный ключ аутентификации.
|
12
|
+
locked: Ваша учётная запись заблокирована.
|
13
|
+
not_found_in_database:
|
14
|
+
timeout: Ваш сеанс закончился. Пожалуйста, войдите в систему снова.
|
15
|
+
unauthenticated: Вам необходимо войти в систему или зарегистрироваться.
|
16
|
+
unconfirmed: Вы должны подтвердить вашу учётную запись.
|
17
|
+
mailer:
|
18
|
+
confirmation_instructions:
|
19
|
+
subject: Инструкции по подтверждению учётной записи
|
20
|
+
reset_password_instructions:
|
21
|
+
subject: Инструкции по восстановлению пароля
|
22
|
+
unlock_instructions:
|
23
|
+
subject: Инструкции по разблокировке учётной записи
|
24
|
+
omniauth_callbacks:
|
25
|
+
failure: Вы не можете войти в систему с учётной записью из %{kind}, т.к. "%{reason}".
|
26
|
+
success: Вход в систему выполнен с учётной записью из %{kind}.
|
27
|
+
passwords:
|
28
|
+
no_token: Доступ к этой странице возможен только по ссылке из письма о восстановлении пароля. Если Вы пришли по такой ссылке, пожалуйста убедитесь что Вы скопировали всю ссылку целиком.
|
29
|
+
send_instructions: В течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля.
|
30
|
+
send_paranoid_instructions: Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля.
|
31
|
+
updated: Ваш пароль изменён. Теперь вы вошли в систему.
|
32
|
+
updated_not_active: Ваш пароль изменен.
|
33
|
+
registrations:
|
34
|
+
destroyed: До свидания! Ваша учётная запись удалена. Надеемся снова увидеть вас.
|
35
|
+
signed_up: Добро пожаловать! Вы успешно зарегистрировались.
|
36
|
+
signed_up_but_inactive: Вы успешно зарегистрированы. Однако, вы не можете войти в систему, потому что ваша учетная запись не активирована.
|
37
|
+
signed_up_but_locked: Вы успешно зарегистрированы. Однако, вы не можете войти в систему, потому что ваша учетная запись заблокирована.
|
38
|
+
signed_up_but_unconfirmed: Письмо со ссылкой для подтверждения было отправлено на ваш e-mail. Пожалуйста, перейдите по ссылке, чтобы подтвердить вашу учетную запись.
|
39
|
+
update_needs_confirmation: Вы успешно обновили данные вашей учетной записи, но нам нужно проверить ваш новый адрес e-mail. Пожалуйста, проверьте ваш почтовый ящик и перейдите по ссылке, чтобы закончить процедуру проверки вашего нового адреса e-mail.
|
40
|
+
updated: Ваша учётная запись изменена.
|
41
|
+
sessions:
|
42
|
+
signed_in: Вход в систему выполнен.
|
43
|
+
signed_out: Выход из системы выполнен.
|
44
|
+
unlocks:
|
45
|
+
send_instructions: В течение нескольких минут вы получите письмо с инструкциями по разблокировке вашей учётной записи.
|
46
|
+
send_paranoid_instructions: Если ваша учётная запись существует, то в течение нескольких минут вы получите письмо с инструкциями по её разблокировке.
|
47
|
+
unlocked: Ваша учётная запись разблокирована. Теперь вы можете войти в систему.
|
48
|
+
failure:
|
49
|
+
user:
|
50
|
+
not_found_in_database: Пользователь не найден в базе
|
51
|
+
invalid: Неверный пароль
|
52
|
+
unauthenticated: Необходимо авторизоваться
|
53
|
+
unconfirmed: 'Необходимо подтвердить адрес электронной почты'
|
54
|
+
errors:
|
55
|
+
messages:
|
56
|
+
already_confirmed: уже подтверждена. Пожалуйста, попробуйте войти в систему
|
57
|
+
confirmation_period_expired:
|
58
|
+
expired: устарела. Пожалуйста, запросите новую
|
59
|
+
not_found: не найдена
|
60
|
+
not_locked: не заблокирована
|
61
|
+
not_saved:
|
62
|
+
few: ! '%{resource}: сохранение не удалось из-за %{count} ошибок'
|
63
|
+
many: ! '%{resource}: сохранение не удалось из-за %{count} ошибок'
|
64
|
+
one: ! '%{resource}: сохранение не удалось из-за %{count} ошибки'
|
65
|
+
other: ! '%{resource}: сохранение не удалось из-за %{count} ошибки'
|