enjoy_cms 0.3.5 → 0.3.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/app/assets/javascripts/enjoy_cms.coffee +1 -0
- data/app/assets/javascripts/enjoy_cms/contacts.coffee +11 -0
- data/app/assets/javascripts/enjoy_cms/{flash.js.coffee → flash.coffee} +0 -0
- data/app/assets/javascripts/enjoy_cms/{map.js.coffee → map.coffee} +0 -0
- data/app/views/enjoy/contacts/_form.html.slim +7 -0
- data/app/views/enjoy/contacts/index.html.slim +1 -7
- data/app/views/enjoy/contacts/new.html.slim +1 -7
- data/app/views/layouts/application.html.slim +5 -4
- data/app/views/shared/_obj.html.slim +4 -3
- data/config/locales/ru.models.yml +6 -1
- data/lib/enjoy/admin/contact_message.rb +0 -1
- data/lib/enjoy/controllers/contacts.rb +11 -3
- data/lib/enjoy/routes.rb +1 -1
- data/lib/enjoy/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b716ab79a5d4ea81e6b859c0c8456b683e62d48
|
|
4
|
+
data.tar.gz: 6b176e5cd1d3b85592e68d759d9b1f307805e300
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30266bf6706c48215330362675aedcecef219b6fd64322c38b2ce7ff3942c3d7270582b7f465481f7ecc4f6ecce3b3dca16333cc2072933680f09b5667d8d2f9
|
|
7
|
+
data.tar.gz: 8e7699946577593cd4cd10d486ef578c30fdfbf655f98ea45c004d6eea503c4288e597394733b3cbf2104e04633682ea7707ab1574fbbe99c38cd58085269d02
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
enjoy_cms (0.3.
|
|
4
|
+
enjoy_cms (0.3.6)
|
|
5
5
|
ack_rails_admin_jcrop
|
|
6
6
|
addressable
|
|
7
7
|
ckeditor
|
|
@@ -109,8 +109,8 @@ GEM
|
|
|
109
109
|
tilt
|
|
110
110
|
htmlentities (4.3.4)
|
|
111
111
|
i18n (0.7.0)
|
|
112
|
-
jquery-rails (4.1.
|
|
113
|
-
rails-dom-testing (
|
|
112
|
+
jquery-rails (4.1.1)
|
|
113
|
+
rails-dom-testing (>= 1, < 3)
|
|
114
114
|
railties (>= 4.2.0)
|
|
115
115
|
thor (>= 0.14, < 2.0)
|
|
116
116
|
jquery-ui-rails (5.0.5)
|
|
@@ -195,7 +195,7 @@ GEM
|
|
|
195
195
|
activesupport (= 4.2.4)
|
|
196
196
|
rake (>= 0.8.7)
|
|
197
197
|
thor (>= 0.18.1, < 2.0)
|
|
198
|
-
rake (
|
|
198
|
+
rake (11.0.1)
|
|
199
199
|
remotipart (1.2.1)
|
|
200
200
|
responders (2.1.1)
|
|
201
201
|
railties (>= 4.2.0, < 5.1)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
window.create_enjoy_cms_feedback_ajax_form = (form_selector = "#new_contact_message", wrapper_selector = "#enjoy_cms_contact_form" )->
|
|
2
|
+
|
|
3
|
+
$(document).delegate form_id, "ajax:complete", (event, xhr, status)->
|
|
4
|
+
$(event.currentTarget).closest().html(xhr.responseText)
|
|
5
|
+
|
|
6
|
+
$(document).delegate form_selector + " .input", 'click', (e) ->
|
|
7
|
+
e.preventDefault()
|
|
8
|
+
$(e.currentTarget).removeClass("field_with_errors").find('span.error').hide()
|
|
9
|
+
return false
|
|
10
|
+
|
|
11
|
+
create_enjoy_cms_feedback_ajax_form()
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
= render 'shared/obj', obj: @seo_page
|
|
2
2
|
|
|
3
3
|
#enjoy_cms_contact_form
|
|
4
|
-
=
|
|
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')
|
|
4
|
+
= render partial: "enjoy/contacts/form"
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
= render 'shared/obj', obj: @seo_page
|
|
2
2
|
|
|
3
3
|
#enjoy_cms_contact_form
|
|
4
|
-
=
|
|
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')
|
|
4
|
+
= render partial: "enjoy/contacts/form"
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
doctype html
|
|
2
2
|
html lang="ru"
|
|
3
3
|
head
|
|
4
|
-
meta
|
|
4
|
+
meta charset="UTF-8"
|
|
5
5
|
meta name="viewport" content="width=device-width, maximum-scale=1"
|
|
6
6
|
title= page_title
|
|
7
7
|
= yield :meta
|
|
8
8
|
= csrf_meta_tags
|
|
9
9
|
= render partial: "blocks/favicon"
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
=
|
|
11
|
+
- async = Rails.env == "production"
|
|
12
|
+
= stylesheet_link_tag "application", media: "all", async: async
|
|
13
|
+
= javascript_include_tag "application", async: async
|
|
13
14
|
/[if lt IE 9]
|
|
14
|
-
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js", async:
|
|
15
|
+
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js", async: async
|
|
15
16
|
|
|
16
17
|
body
|
|
17
18
|
#root
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
= raw @seo_page.page_content
|
|
9
9
|
- else
|
|
10
10
|
= raw obj.content
|
|
11
|
-
.admin_button
|
|
12
11
|
- if !obj.nil?
|
|
13
|
-
|
|
12
|
+
.admin_button
|
|
13
|
+
= render 'shared/admin_link', obj: obj
|
|
14
14
|
- if !@seo_page.nil? && (@seo_page.id != obj.id || @seo_page.class.name != obj.class.name)
|
|
15
|
-
|
|
15
|
+
.admin_button
|
|
16
|
+
= render 'shared/admin_link', obj: @seo_page
|
|
16
17
|
|
|
17
18
|
- content_for :meta do
|
|
18
19
|
= render 'shared/meta', obj: obj
|
|
@@ -55,6 +55,9 @@ ru:
|
|
|
55
55
|
enjoy/embeddede_gallery_image: Фото в фотогалерее
|
|
56
56
|
enjoy/seo: SEO
|
|
57
57
|
enjoy/sitemap_data: Карта сайта
|
|
58
|
+
|
|
59
|
+
enjoy/page_blockset: Блоки
|
|
60
|
+
enjoy/page_block: Блок
|
|
58
61
|
attributes:
|
|
59
62
|
user:
|
|
60
63
|
email: E-mail
|
|
@@ -86,7 +89,9 @@ ru:
|
|
|
86
89
|
enjoy/gallery:
|
|
87
90
|
enjoy/gallery_image:
|
|
88
91
|
gallery: Фотогалерея
|
|
89
|
-
enjoy/
|
|
92
|
+
enjoy/embeddeded_gallery_image:
|
|
93
|
+
enjoy/page_blockset:
|
|
94
|
+
blocks: Блоки
|
|
90
95
|
errors:
|
|
91
96
|
models:
|
|
92
97
|
contact_message:
|
|
@@ -38,7 +38,8 @@ module Enjoy
|
|
|
38
38
|
private
|
|
39
39
|
def render_contacts_error
|
|
40
40
|
if request.xhr? && process_ajax
|
|
41
|
-
render
|
|
41
|
+
render partial: form_partial
|
|
42
|
+
# render json: {errors: @contact_message.errors}, status: 422
|
|
42
43
|
else
|
|
43
44
|
flash.now[:alert] = @contact_message.errors.full_messages.join("\n")
|
|
44
45
|
render action: Enjoy.configuration.recreate_contact_message_action, status: 422
|
|
@@ -54,16 +55,23 @@ module Enjoy
|
|
|
54
55
|
redirect_to :contacts_sent
|
|
55
56
|
end
|
|
56
57
|
def after_initialize
|
|
57
|
-
|
|
58
|
+
if request.xhr?
|
|
59
|
+
render partial: form_partial
|
|
60
|
+
end
|
|
58
61
|
end
|
|
59
62
|
def after_create
|
|
60
63
|
# overrideable hook for updating message
|
|
61
64
|
end
|
|
65
|
+
def form_partial
|
|
66
|
+
"enjoy/contacts/form"
|
|
67
|
+
end
|
|
62
68
|
def model
|
|
63
69
|
Enjoy::ContactMessage
|
|
64
70
|
end
|
|
65
71
|
def message_params
|
|
66
|
-
params.require(
|
|
72
|
+
params.require(model.to_param.gsub("::", "").underscore).permit(
|
|
73
|
+
Enjoy.config.contacts_fields.keys + [:name, :email, :phone, :content, :captcha, :captcha_key]
|
|
74
|
+
)
|
|
67
75
|
end
|
|
68
76
|
end
|
|
69
77
|
end
|
data/lib/enjoy/routes.rb
CHANGED
|
@@ -15,7 +15,7 @@ module ActionDispatch::Routing
|
|
|
15
15
|
scope module: 'enjoy' do
|
|
16
16
|
if routes_config[:use_contacts_path]
|
|
17
17
|
get 'contacts' => 'contacts#new', as: :enjoy_contacts
|
|
18
|
-
post 'contacts' => 'contacts#create', as: :
|
|
18
|
+
post 'contacts' => 'contacts#create', as: :create_enjoy_contacts
|
|
19
19
|
get 'contacts/sent' => 'contacts#sent', as: :enjoy_contacts_sent
|
|
20
20
|
end
|
|
21
21
|
|
data/lib/enjoy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: enjoy_cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Kiseliev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -405,8 +405,9 @@ files:
|
|
|
405
405
|
- README.md
|
|
406
406
|
- Rakefile
|
|
407
407
|
- app/assets/javascripts/enjoy_cms.coffee
|
|
408
|
-
- app/assets/javascripts/enjoy_cms/
|
|
409
|
-
- app/assets/javascripts/enjoy_cms/
|
|
408
|
+
- app/assets/javascripts/enjoy_cms/contacts.coffee
|
|
409
|
+
- app/assets/javascripts/enjoy_cms/flash.coffee
|
|
410
|
+
- app/assets/javascripts/enjoy_cms/map.coffee
|
|
410
411
|
- app/assets/javascripts/head.load.js
|
|
411
412
|
- app/assets/javascripts/jquery.placeholder.js
|
|
412
413
|
- app/assets/stylesheets/enjoy_cms.sass
|
|
@@ -480,6 +481,7 @@ files:
|
|
|
480
481
|
- app/views/devise/sessions/new.html.slim
|
|
481
482
|
- app/views/devise/shared/_links.html.slim
|
|
482
483
|
- app/views/enjoy/contact_mailer/new_message_email.html.slim
|
|
484
|
+
- app/views/enjoy/contacts/_form.html.slim
|
|
483
485
|
- app/views/enjoy/contacts/index.html.slim
|
|
484
486
|
- app/views/enjoy/contacts/new.html.slim
|
|
485
487
|
- app/views/enjoy/contacts/sent.html.slim
|