enjoy_cms_faq 0.3.2 → 0.3.5

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: f74523e085f8b1d0f5dc74c225e0c8551fef7549
4
- data.tar.gz: 7b0afe4a8218f10880c14a3b7a32a56ab9726042
3
+ metadata.gz: c5c4f104fce776355a25b9073e42aa96a4643d8d
4
+ data.tar.gz: 2e4422d8ec654c5b0c9e6f41dbc9b8b70db52b9d
5
5
  SHA512:
6
- metadata.gz: d4290543bccf56d27246cc51f0f77b5d5ff7acb5ef21bbe4a1147d14b72a001fb5ef15a994380739886168dbd9c38bbef0b6fc7a9b93d458cbe1cf145c517524
7
- data.tar.gz: 3b6f23463593ebf576887bd511d9501c2f98c479e65934e7c31c4b9450a6f050ae5dc8986f3ad2d09d6261370658de50f8a7759a07e72073410b6f97f80a33fc
6
+ metadata.gz: 3ee95207fb2d6a8f3b174214b4920976d0ae31df2034bfb123c302caa64f40e2cfccedd758a586cdbf68ed15f5ca0126badfad7001971be9433a78af1fe7abd7
7
+ data.tar.gz: 4c97c0f2c58c34e8fffc037809b476114478e51a696b70c3ac5fe5a87c1422e4db84c99a2a32f63bd92ebbf14c35f02fd54f11a10c1ebe484987bd81d080a9f2
@@ -1,6 +1,6 @@
1
1
  - @question ||= Enjoy::Faq::Question.new
2
2
  - if @question.new_record?
3
- = simple_form_for @question, url: enjoy_cms_faq.questions_path do |f|
3
+ = simple_form_for @question, url: enjoy_questions_path do |f|
4
4
  - unless @message.blank?
5
5
  h3= @message
6
6
  .inputtextblock_q
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler", "~> 1.10"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
 
33
- spec.add_dependency 'enjoy_cms', "~> 0.3.2"
33
+ spec.add_dependency 'enjoy_cms', "~> 0.3.5"
34
34
  end
@@ -19,8 +19,6 @@ module Enjoy
19
19
  attr_accessor :save_with_captcha
20
20
  attr_accessor :captcha_error_message
21
21
 
22
- attr_accessor :routes_config
23
-
24
22
  def initialize
25
23
  @author_name_required = true
26
24
 
@@ -28,12 +26,6 @@ module Enjoy
28
26
 
29
27
  @save_with_captcha = true
30
28
  @captcha_error_message = "Код с картинки введен неверно"
31
-
32
- @routes_config = {
33
- use_questions_path: true,
34
- use_question_categories_path: true,
35
- use_faq_path: true
36
- }
37
29
  end
38
30
  end
39
31
  end
@@ -1,7 +1,7 @@
1
1
  module Enjoy
2
2
  module Faq
3
3
  class Engine < ::Rails::Engine
4
- isolate_namespace Enjoy::Faq
4
+ # isolate_namespace Enjoy::Faq
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,34 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+
4
+ def enjoy_cms_faq_routes(config = {})
5
+ routes_config = {
6
+ use_questions_path: true,
7
+ use_question_categories_path: true,
8
+ use_faq_path: true
9
+ }
10
+ routes_config.merge!(config)
11
+
12
+ scope module: 'enjoy' do
13
+ scope module: 'faq' do
14
+ if routes_config[:use_questions_path]
15
+ resources :questions, only: [:show, :new, :create], as: :enjoy_faq_questions do
16
+ get '(/page/:page)', action: :index, on: :collection, as: ""
17
+ end
18
+ end
19
+
20
+ if routes_config[:use_question_categories_path]
21
+ resources :question_categories, only: [:index, :show], as: :enjoy_faq_question_categories do
22
+ get 'questions(/page/:page)', action: :questions, on: :member, as: :questions
23
+ end
24
+ end
25
+ if routes_config[:use_faq_path]
26
+ get 'faq' => 'question_categories#index', as: :enjoy_faq
27
+ end
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+ end
@@ -1,5 +1,5 @@
1
1
  module Enjoy
2
2
  module Faq
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
data/lib/enjoy_cms_faq.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require "enjoy/faq/version"
2
2
 
3
- require 'money-rails'
3
+ require 'enjoy/faq/routes'
4
+
5
+ require 'enjoy_cms'
4
6
 
5
- require 'enjoy_cms_mongoid'
6
7
  require 'rails_admin_sort_embedded'
7
8
  require 'rails_admin_jcrop'
8
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enjoy_cms_faq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.2
47
+ version: 0.3.5
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.2
54
+ version: 0.3.5
55
55
  description: FAQ system with EnjoyCMS support.
56
56
  email:
57
57
  - dev@enjoycreate.ru
@@ -86,7 +86,6 @@ files:
86
86
  - bin/console
87
87
  - bin/setup
88
88
  - config/initializers/rails_admin.rb
89
- - config/routes.rb
90
89
  - enjoy_cms_faq.gemspec
91
90
  - lib/enjoy/faq/admin.rb
92
91
  - lib/enjoy/faq/admin/question.rb
@@ -99,6 +98,7 @@ files:
99
98
  - lib/enjoy/faq/models/mongoid/question_category.rb
100
99
  - lib/enjoy/faq/models/question.rb
101
100
  - lib/enjoy/faq/models/question_category.rb
101
+ - lib/enjoy/faq/routes.rb
102
102
  - lib/enjoy/faq/version.rb
103
103
  - lib/enjoy_cms_faq.rb
104
104
  - release.sh
data/config/routes.rb DELETED
@@ -1,18 +0,0 @@
1
- Enjoy::Faq::Engine.routes.draw do
2
- routes_config = Enjoy::Faq.configuration.routes_config
3
-
4
- if !routes_config or routes_config[:use_questions_path]
5
- resources :questions, only: [:show, :new, :create] do
6
- get '(/page/:page)', action: :index, on: :collection, as: ""
7
- end
8
- end
9
-
10
- if !routes_config or routes_config[:use_question_categories_path]
11
- resources :question_categories, only: [:index, :show] do
12
- get 'items(/page/:page)', action: :questions, on: :member, as: :items
13
- end
14
- end
15
- if !routes_config or routes_config[:use_faq_path]
16
- get 'faq' => 'question_categories#index', as: :faq
17
- end
18
- end