ecm_cms2 2.0.2 → 2.0.3
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/app/controllers/ecm/cms/page_controller.rb +1 -0
- data/app/helpers/ecm/cms_helper.rb +3 -0
- data/config/initializers/mime_types.rb +1 -0
- data/lib/ecm/cms/configuration.rb +2 -0
- data/lib/ecm/cms/version.rb +1 -1
- data/lib/generators/ecm/cms/install/install_generator.rb +1 -1
- data/lib/generators/ecm/cms/install/templates/{ecm_cms.rb → initializer.rb} +10 -0
- data/lib/tasks/ecm_cms_tasks.rake +6 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e6364fc3164fd1c55e586159b1a29398d37b2b0
|
4
|
+
data.tar.gz: 3ede2082907be277aa14133b0da47b90833f4555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce777ff95913a00b6f0f4df4b51f0659e21e61f994ce2ff636bff931729eb737cbfa8665fffb4c38b1d50e47b1450fc3cbd8e9d77ebcd0d4c4c7e09cf981606
|
7
|
+
data.tar.gz: b1193f91d736d099f532f5c17bde07242169a678053b9e8851568ae21bdc66a73138c6eae2b278f5c771d373e8fa22f080c6a4aa2c3e86bd562cb7ba912efa3c
|
@@ -20,6 +20,7 @@ class Ecm::Cms::PageController < Ecm::Cms::Configuration.base_controller.constan
|
|
20
20
|
def respond
|
21
21
|
respond_to do |format|
|
22
22
|
format.html { render template: params[:page] }
|
23
|
+
format.txt { render template: params[:page], layout: false, formats: [:text] }
|
23
24
|
format.pdf do
|
24
25
|
output = render_to_string template: params[:page], formats: [:html, :pdf], layout: false
|
25
26
|
self.response_body = WickedPdf.new.pdf_from_string(output)
|
@@ -10,6 +10,9 @@ module Ecm::CmsHelper
|
|
10
10
|
level_as_array = (level).is_a?(Range) ? level.to_a : [level]
|
11
11
|
|
12
12
|
navigation = Ecm::Cms::Navigation.where(name: name.to_s, locale: I18n.locale.to_s).first
|
13
|
+
if navigation.nil? && (locale = Ecm::Cms::Configuration.navigation_locale_fallback.call(name, I18n.locale))
|
14
|
+
navigation = Ecm::Cms::Navigation.where(name: name.to_s, locale: locale).first
|
15
|
+
end
|
13
16
|
unless navigation
|
14
17
|
return I18n.t('ecm.cms.navigation.messages.not_found', lang: I18n.locale.to_s, name: name.to_s)
|
15
18
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Mime::Type.register "text/plain", :txt
|
data/lib/ecm/cms/version.rb
CHANGED
@@ -34,4 +34,14 @@ Ecm::Cms.configure do |config|
|
|
34
34
|
# Default: config.navigation_item_properties = [:data_add_icon]
|
35
35
|
#
|
36
36
|
config.navigation_item_properties = [:data_add_icon]
|
37
|
+
|
38
|
+
# Fallback to the given locale, if no navigation is found for the actual locale.
|
39
|
+
# Set to false to disable fallback. Must be a proc. Two params are passend to the
|
40
|
+
# proc: The navigation name and the actual locale.
|
41
|
+
#
|
42
|
+
# Example: config.navigation_locale_fallback = ->(navigation_name, locale) { navigation_name, localeI18n.locale }
|
43
|
+
#
|
44
|
+
# Default: config.navigation_locale_fallback = ->(navigation_name, locale) { false }
|
45
|
+
#
|
46
|
+
config.navigation_locale_fallback = ->(navigation_name, locale) { I18n.default_locale }
|
37
47
|
end
|
@@ -5,5 +5,11 @@ namespace :ecm do
|
|
5
5
|
args.with_defaults(view_path: Rails.root.join(*%(app views)), force: false)
|
6
6
|
Ecm::Cms::ImportPartialsService.call(args)
|
7
7
|
end
|
8
|
+
|
9
|
+
desc 'Adds homepages for all (or given) locales'
|
10
|
+
task :add_homepages, [:locales] => [:environment] do |_t, args|
|
11
|
+
args.with_defaults(locales: I18n.available_locales)
|
12
|
+
Ecm::Cms::AddHomepagesService.call(args)
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_cms2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -434,6 +434,7 @@ files:
|
|
434
434
|
- app/services/ecm/cms/add_homepages_service.rb
|
435
435
|
- app/services/ecm/cms/import_partials_service.rb
|
436
436
|
- app/views/ecm/cms/_link_to_top.html.erb
|
437
|
+
- config/initializers/mime_types.rb
|
437
438
|
- config/locales/ecm.cms.content_box.de.yml
|
438
439
|
- config/locales/ecm.cms.content_box.en.yml
|
439
440
|
- config/locales/ecm.cms.de.yml
|
@@ -479,7 +480,7 @@ files:
|
|
479
480
|
- lib/ecm/cms/version.rb
|
480
481
|
- lib/ecm_cms2.rb
|
481
482
|
- lib/generators/ecm/cms/install/install_generator.rb
|
482
|
-
- lib/generators/ecm/cms/install/templates/
|
483
|
+
- lib/generators/ecm/cms/install/templates/initializer.rb
|
483
484
|
- lib/generators/ecm/cms/locales/locales_generator.rb
|
484
485
|
- lib/tasks/ecm_cms_tasks.rake
|
485
486
|
homepage: https://github.com/robotex82/ecm_cms2
|
@@ -506,3 +507,4 @@ signing_key:
|
|
506
507
|
specification_version: 4
|
507
508
|
summary: CMS base module for ruby on rails.
|
508
509
|
test_files: []
|
510
|
+
has_rdoc:
|