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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7396a7e0de757550c9c23cd91c1a04cfa089a67b
4
- data.tar.gz: 35134eb111a84278479d77e1f4f1d85f56da950b
3
+ metadata.gz: 6b716ab79a5d4ea81e6b859c0c8456b683e62d48
4
+ data.tar.gz: 6b176e5cd1d3b85592e68d759d9b1f307805e300
5
5
  SHA512:
6
- metadata.gz: 71d0e398cf285ef3da4687a6ec70d09c9350611413a8d11af1f4eb4271b16e2309ddbe5fff4b733d5ba5a1a5827459c3bd5e75ecba6c2c3b8960043f8cf53b05
7
- data.tar.gz: c8f2350501b3add07a6b876a1295bb4b92dfc4dcd9c4b35004c24e26d4c30e90f59810663dd90c72b6dbdab7280821695bcd42c357606943758a214b5efac8c1
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.5)
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.0)
113
- rails-dom-testing (~> 1.0)
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 (10.5.0)
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)
@@ -4,3 +4,4 @@
4
4
  #= require head.load.js
5
5
  #= require enjoy_cms/map
6
6
  #= require enjoy_cms/flash
7
+ #= require enjoy_cms/contacts
@@ -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()
@@ -0,0 +1,7 @@
1
+ = simple_form_for @contact_message, url: enjoy_contacts_path do |f|
2
+ = f.input :name
3
+ = f.input :email
4
+ = f.input :phone
5
+ = f.input :content, as: :text
6
+ = f.input :captcha, as: :simple_captcha
7
+ = f.submit t('enjoy.send')
@@ -1,10 +1,4 @@
1
1
  = render 'shared/obj', obj: @seo_page
2
2
 
3
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')
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
- = 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')
4
+ = render partial: "enjoy/contacts/form"
@@ -1,17 +1,18 @@
1
1
  doctype html
2
2
  html lang="ru"
3
3
  head
4
- meta chaenjoyet="UTF-8"
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
- = stylesheet_link_tag "application", media: "all", async: Rails.env == "production"
12
- = javascript_include_tag "application", async: Rails.env == "production"
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: Rails.env == "production"
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
- = render 'shared/admin_link', obj: obj
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
- = render 'shared/admin_link', obj: @seo_page
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/embeddede_gallery_image:
92
+ enjoy/embeddeded_gallery_image:
93
+ enjoy/page_blockset:
94
+ blocks: Блоки
90
95
  errors:
91
96
  models:
92
97
  contact_message:
@@ -21,7 +21,6 @@ module Enjoy
21
21
  end
22
22
  end
23
23
 
24
-
25
24
  Enjoy::RailsAdminGroupPatch::enjoy_cms_group(self, fields)
26
25
 
27
26
  if block_given?
@@ -38,7 +38,8 @@ module Enjoy
38
38
  private
39
39
  def render_contacts_error
40
40
  if request.xhr? && process_ajax
41
- render json: {errors: @contact_message.errors}, status: 422
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
- # overrideable hook for updating message
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(:contact_message).permit(Enjoy.config.contacts_fields.keys + [:name, :email, :phone, :content, :captcha, :captcha_key])
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: :enjoy_create_contacts
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
@@ -1,3 +1,3 @@
1
1
  module Enjoy
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
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.5
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-07 00:00:00.000000000 Z
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/flash.js.coffee
409
- - app/assets/javascripts/enjoy_cms/map.js.coffee
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