locomotivecms 4.1.0.rc1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ac2bdf950937bd4a07418b142bb21eea251c24db4b5682b8412a9c718374343
4
- data.tar.gz: 1546625baf49879c2c70209e5f3df46f0290b689f28c141135e8d52019c3b065
3
+ metadata.gz: f262308ca535c2fab8094e923bcfa830cccd8d47412c017354d3d41698545af0
4
+ data.tar.gz: 2dfc9cee2bb9d8543abb64ad496a5659baa8cbe7d47f22f7b74dabb7a0e79cdc
5
5
  SHA512:
6
- metadata.gz: d2e672fcec21c3eecba19c80fc7d1bc35f56488d57bc59f43cd2cde49946e71f900b826bef17c5255037b598f1ce4bdc912623d9b09fc477c95112e1d8ac2380
7
- data.tar.gz: 9226f4e89892f1e2d66b6f6b74d71981462f53e4969de3a5b09042316e2de20ac578dc9286165055b87066978b37b6a1883bb6da62f5de26173e603d6f3ba3b6
6
+ metadata.gz: 42b05ebe723bd5b2e84ab6a8b405677e7dec0e17f33702eafae56d4882dc9ad7691be902a17d273193e8199cf8311579f178c5a8791e0fcf2bb5fd95e2f0f068
7
+ data.tar.gz: 9aea9657f2b6a396e6fc749273c223b480d775add9827ff418760cbcebb037af3adfa7bdc117dca1d9eca78c6252216acde6da435c1e2d9f4982ae18a649666a
@@ -7,7 +7,8 @@ module Locomotive
7
7
  expose :name, :handle, :seo_title, :meta_keywords, :meta_description,
8
8
  :robots_txt, :cache_enabled, :private_access
9
9
 
10
- expose :locales, :prefix_default_locale, :bypass_browser_locale, :domains, :asset_host, :url_redirections, :overwrite_same_content_assets
10
+ expose :locales, :prefix_default_locale, :bypass_browser_locale, :domains, :asset_host, :url_redirections
11
+ expose :overwrite_same_content_assets, :allow_dots_in_slugs
11
12
 
12
13
  expose :memberships, using: MembershipEntity
13
14
 
@@ -11,6 +11,7 @@ module Locomotive
11
11
  attrs :cache_enabled, :cache_control, :cache_vary
12
12
  attrs :sections_content
13
13
  attrs :overwrite_same_content_assets
14
+ attrs :allow_dots_in_slugs
14
15
 
15
16
  # Make sure locales and domains are in arrays.
16
17
  def locales
@@ -48,6 +48,7 @@ module Locomotive
48
48
  optional :sections_content
49
49
  optional :routes
50
50
  optional :overwrite_same_content_assets
51
+ optional :allow_dots_in_slugs
51
52
  end
52
53
  end
53
54
  put do
@@ -77,6 +77,7 @@ module Locomotive
77
77
  optional :sections_content
78
78
  optional :routes
79
79
  optional :overwrite_same_content_assets
80
+ optional :allow_dots_in_slugs
80
81
  end
81
82
  end
82
83
  post do
@@ -115,6 +116,7 @@ module Locomotive
115
116
  optional :sections_content
116
117
  optional :routes
117
118
  optional :overwrite_same_content_assets
119
+ optional :allow_dots_in_slugs
118
120
  end
119
121
  end
120
122
  put ':id' do
@@ -1077,7 +1077,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
1077
1077
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1078
1078
 
1079
1079
  "use strict";
1080
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../i18n */ \"./app/javascript/src/locomotive/editor/i18n.js\");\n/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! client-compress */ \"./node_modules/client-compress/dist/index.js\");\n/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(client_compress__WEBPACK_IMPORTED_MODULE_3__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\nvar Uploader = /*#__PURE__*/function (_Component) {\n _inherits(Uploader, _Component);\n\n var _super = _createSuper(Uploader);\n\n function Uploader(props) {\n var _this;\n\n _classCallCheck(this, Uploader);\n\n _this = _super.call(this, props);\n _this.state = {\n uploading: false\n };\n Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"bindAll\"])(_assertThisInitialized(_this), 'openDialog', 'handleUpload');\n return _this;\n }\n\n _createClass(Uploader, [{\n key: \"openDialog\",\n value: function openDialog() {\n this.input.click();\n }\n }, {\n key: \"_handleUpload\",\n value: function _handleUpload(files) {\n var _this2 = this;\n\n this.props.uploadAssets(files).then(function (assets) {\n _this2.setState({\n uploading: false\n }, function () {\n _this2.props.handleUpload(assets[0]);\n });\n })[\"catch\"](function (error) {\n alert('error!', error);\n });\n }\n }, {\n key: \"handleUpload\",\n value: function handleUpload(event) {\n var _this3 = this;\n\n var files = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"compact\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(event.target.files, function (file) {\n return file.size > window.Locomotive.maximum_uploaded_file_size ? null : file;\n }));\n if (files.length != event.target.files.length) alert(_i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.too_big'));\n if (files.length > 0) this.setState({\n uploading: true\n }, function () {\n // do we have to compress the images on the browser before sending them to server?\n // https://www.npmjs.com/package/client-compress\n if (_this3.props.compress !== undefined) {\n var compress = new client_compress__WEBPACK_IMPORTED_MODULE_3___default.a(_this3.props.compress);\n compress.compress(files).then(function (conversions) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(conversions, function (conversion) {\n return {\n blob: conversion.photo.data,\n filename: conversion.photo.name\n };\n });\n }).then(function (_files) {\n return _this3._handleUpload(_files);\n });\n } else _this3._handleUpload(files);\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-image-uploader\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"file\",\n ref: function ref(el) {\n return _this4.input = el;\n },\n onChange: this.handleUpload\n }), !this.state.uploading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n className: \"editor-image-uploader--button\",\n onClick: this.openDialog\n }, _i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.add')), this.state.uploading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-image-uploader--uploading\"\n }, _i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.upload_in_progress')));\n }\n }]);\n\n return Uploader;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Uploader);\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/views/pickers/images/uploader.js?");
1080
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../i18n */ \"./app/javascript/src/locomotive/editor/i18n.js\");\n/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! client-compress */ \"./node_modules/client-compress/dist/index.js\");\n/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(client_compress__WEBPACK_IMPORTED_MODULE_3__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\nvar Uploader = /*#__PURE__*/function (_Component) {\n _inherits(Uploader, _Component);\n\n var _super = _createSuper(Uploader);\n\n function Uploader(props) {\n var _this;\n\n _classCallCheck(this, Uploader);\n\n _this = _super.call(this, props);\n _this.state = {\n uploading: false\n };\n Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"bindAll\"])(_assertThisInitialized(_this), 'openDialog', 'handleUpload');\n return _this;\n }\n\n _createClass(Uploader, [{\n key: \"openDialog\",\n value: function openDialog() {\n this.input.click();\n }\n }, {\n key: \"_handleUpload\",\n value: function _handleUpload(files) {\n var _this2 = this;\n\n this.props.uploadAssets(files).then(function (assets) {\n _this2.setState({\n uploading: false\n }, function () {\n _this2.props.handleUpload(assets[0]);\n });\n })[\"catch\"](function (error) {\n alert('error!', error);\n });\n }\n }, {\n key: \"handleUpload\",\n value: function handleUpload(event) {\n var _this3 = this;\n\n var files = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"compact\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(event.target.files, function (file) {\n return file.size > window.Locomotive.maximum_uploaded_file_size ? null : file;\n }));\n if (files.length != event.target.files.length) alert(_i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.too_big'));\n if (files.length > 0) this.setState({\n uploading: true\n }, function () {\n // do we have to compress the images on the browser before sending them to server?\n // https://www.npmjs.com/package/client-compress \n if (_this3.props.compress !== undefined) {\n var options = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"mapKeys\"])(_this3.props.compress, function (_, k) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"camelCase\"])(k);\n });\n var compress = new client_compress__WEBPACK_IMPORTED_MODULE_3___default.a(options);\n compress.compress(files).then(function (conversions) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(conversions, function (conversion) {\n return {\n blob: conversion.photo.data,\n filename: conversion.photo.name\n };\n });\n }).then(function (_files) {\n return _this3._handleUpload(_files);\n });\n } else _this3._handleUpload(files);\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-image-uploader\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"file\",\n ref: function ref(el) {\n return _this4.input = el;\n },\n onChange: this.handleUpload\n }), !this.state.uploading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n className: \"editor-image-uploader--button\",\n onClick: this.openDialog\n }, _i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.add')), this.state.uploading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-image-uploader--uploading\"\n }, _i18n__WEBPACK_IMPORTED_MODULE_2__[\"default\"].t('views.pickers.images.upload_in_progress')));\n }\n }]);\n\n return Uploader;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Uploader);\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/views/pickers/images/uploader.js?");
1081
1081
 
1082
1082
  /***/ }),
1083
1083
 
@@ -21,7 +21,12 @@ module Locomotive
21
21
  self._slug = self._label.dup if self._slug.blank? && self._label.present?
22
22
 
23
23
  if self._slug.present?
24
- self._slug.permalink!
24
+ # we can't rely on the self.site property yet (brand new entry for instance)
25
+ if self.content_type.site.allow_dots_in_slugs?
26
+ self._slug.pathify!
27
+ else
28
+ self._slug.permalink!
29
+ end
25
30
 
26
31
  self.find_next_unique_slug if self.slug_already_taken?
27
32
  end
@@ -29,7 +34,7 @@ module Locomotive
29
34
  # all the site locales share the same slug ONLY IF the entry is not localized.
30
35
  self.set_same_slug_for_all_site_locales if !self.localized?
31
36
  end
32
-
37
+
33
38
  # For each locale of the site, we set the slug
34
39
  # coming from the value for the default locale.
35
40
  def set_same_slug_for_all_site_locales
@@ -23,9 +23,9 @@ module Locomotive
23
23
  self.slug = value.clone
24
24
  end
25
25
 
26
- if self.slug.present?
27
- self.slug.permalink!
28
- end
26
+ return unless self.slug.present?
27
+
28
+ site&.allow_dots_in_slugs ? self.slug.pathify! : self.slug.permalink!
29
29
  end
30
30
 
31
31
  end
@@ -20,6 +20,7 @@ module Locomotive
20
20
  field :robots_txt
21
21
  field :maximum_uploaded_file_size, type: ::Integer, default: Locomotive.config.default_maximum_uploaded_file_size
22
22
  field :overwrite_same_content_assets, type: Boolean, default: false
23
+ field :allow_dots_in_slugs, type: Boolean, default: false
23
24
 
24
25
  mount_uploader :picture, PictureUploader, validate_integrity: true
25
26
 
@@ -60,7 +60,7 @@ module Locomotive
60
60
  :cache_enabled, :cache_control, :cache_vary,
61
61
  :asset_host, :redirect_to_first_domain, :redirect_to_https,
62
62
  :private_access, :password, :prefix_default_locale, :bypass_browser_locale,
63
- :overwrite_same_content_assets,
63
+ :overwrite_same_content_assets, :allow_dots_in_slugs,
64
64
  :permitted_params_from_policy
65
65
  ]
66
66
  hash = { domains: [], locales: [], url_redirections: [] }
@@ -58,7 +58,7 @@ module Locomotive
58
58
  end
59
59
 
60
60
  def attributes_from_row(row)
61
- attributes = {}
61
+ attributes = { _slug: row['_slug'] }
62
62
  content_type.entries_custom_fields.each do |field|
63
63
  next if row[field.name].blank?
64
64
  name, value = transform_attribute(field, row[field.name])
@@ -15,8 +15,8 @@
15
15
 
16
16
  .body
17
17
  .small-thumbnail
18
- - if asset_with_thumbnail?(asset)
19
- = image_tag asset.alternative_vignette_url
18
+ - if asset_with_thumbnail?(asset) && thumbnail_url = asset.alternative_vignette_url
19
+ = image_tag thumbnail_url
20
20
  - else
21
21
  div class="not-a-image #{asset.content_type}"
22
22
  span= asset_text(asset)
@@ -31,3 +31,5 @@ javascript:
31
31
  = csrf_meta_tag
32
32
 
33
33
  = yield :head
34
+
35
+ = render 'locomotive/shared/account/main_app_head'
@@ -0,0 +1 @@
1
+ - # this partial can be overridden in the main app in order to include extra css or js
@@ -27,6 +27,11 @@ CarrierWave.configure do |config|
27
27
  config.aws_credentials[:endpoint] = ENV['S3_ENDPOINT']
28
28
  end
29
29
 
30
+ # For some endpoint like minio you need to rewrite path
31
+ if ENV['S3_PATH_STYLE'].present?
32
+ config.aws_credentials[:force_path_style] = ENV['S3_PATH_STYLE']
33
+ end
34
+
30
35
  # Put your CDN host below instead
31
36
  if ENV['S3_ASSET_HOST_URL'].present?
32
37
  config.asset_host = ENV['S3_ASSET_HOST_URL']
@@ -23,9 +23,13 @@ Locomotive.configure do |config|
23
23
  # available locales suggested to "localize" a site. You will have to pick up at least one among that list.
24
24
  # config.site_locales = %w{en de fr pl pt pt-BR it nl nb es ru ja cs bg sk uk}
25
25
 
26
- # tell if logs are enabled. Useful for debug purpose.
26
+ # tell if logs (back-office) are enabled. Useful for debug purpose.
27
27
  config.enable_logs = true
28
28
 
29
+ # setup the logger for Steam (rendering)
30
+ # config.steam_log_file = ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
31
+ # config.steam_log_level = ::Logger::DEBUG
32
+
29
33
  # the API authentication requires to developer to pass 2 params in the header
30
34
  # of the request: X-Locomotive-Account-Email and X-Locomotive-Token.
31
35
  # However, to keep backward compatability with v2.x versions, you can use
@@ -15,6 +15,8 @@ module Locomotive
15
15
  site_locales: @@site_locales,
16
16
  cookie_key: '_locomotive_session',
17
17
  enable_logs: false,
18
+ steam_log_file: nil,
19
+ steam_log_level: ::Logger::DEBUG,
18
20
  enable_admin_ssl: false,
19
21
  delayed_job: false,
20
22
  default_locale: :en,
@@ -30,6 +30,27 @@ class String #:nodoc
30
30
 
31
31
  alias :parameterize! :permalink!
32
32
 
33
+ # Very similar to the to_url from the Stringex gem
34
+ # except that we allow the dots.
35
+ def pathify
36
+ whitespace_replacement_token = self.index('_').nil? ? '-' : '_'
37
+ self
38
+ .convert_smart_punctuation
39
+ .convert_accented_html_entities
40
+ .convert_vulgar_fractions
41
+ .convert_unreadable_control_characters
42
+ .convert_miscellaneous_html_entities
43
+ .to_ascii
44
+ .collapse
45
+ .replace_whitespace(whitespace_replacement_token)
46
+ .collapse(whitespace_replacement_token)
47
+ .downcase
48
+ end
49
+
50
+ def pathify!
51
+ replace(self.pathify)
52
+ end
53
+
33
54
  end
34
55
 
35
56
  ## Hash
@@ -44,6 +44,10 @@ Locomotive::Steam.configure do |config|
44
44
  # let the Rails engine handle the "no site" error
45
45
  config.render_404_if_no_site = false
46
46
 
47
+ # setup the logger
48
+ config.log_file = Locomotive.config.steam_log_file || ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
49
+ config.log_level = Locomotive.config.steam_log_level
50
+
47
51
  config.services_hook = -> (services) {
48
52
  services.cache = Rails.cache
49
53
  repositories = services.repositories
@@ -57,8 +61,8 @@ Locomotive::Steam.configure do |config|
57
61
  }
58
62
  end
59
63
 
60
- Locomotive::Common.reset
61
- Locomotive::Common.configure do |config|
62
- config_file = ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
63
- config.notifier = Locomotive::Common::Logger.setup(config_file.to_s)
64
- end
64
+ # Locomotive::Common.reset
65
+ # Locomotive::Common.configure do |config|
66
+ # config_file = ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
67
+ # config.notifier = Locomotive::Common::Logger.setup(config_file.to_s, )
68
+ # end
@@ -1,3 +1,3 @@
1
1
  module Locomotive
2
- VERSION = '4.1.0.rc1'
2
+ VERSION = '4.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.rc1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -162,28 +162,28 @@ dependencies:
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: 2.12.0
165
+ version: 2.12.1
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 2.12.0
172
+ version: 2.12.1
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: locomotivecms_steam
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 1.6.0.rc1
179
+ version: 1.6.0
180
180
  type: :runtime
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 1.6.0.rc1
186
+ version: 1.6.0
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: slim
189
189
  requirement: !ruby/object:Gem::Requirement
@@ -1108,6 +1108,7 @@ files:
1108
1108
  - app/views/locomotive/shared/_navigation.html.slim
1109
1109
  - app/views/locomotive/shared/_sidebar.html.slim
1110
1110
  - app/views/locomotive/shared/account/_head.html.slim
1111
+ - app/views/locomotive/shared/account/_main_app_head.html.slim
1111
1112
  - app/views/locomotive/shared/account/_navigation.html.slim
1112
1113
  - app/views/locomotive/shared/rte/_image_popover.html.slim
1113
1114
  - app/views/locomotive/shared/rte/_link_popover.html.slim
@@ -1432,11 +1433,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
1432
1433
  version: '0'
1433
1434
  required_rubygems_version: !ruby/object:Gem::Requirement
1434
1435
  requirements:
1435
- - - ">"
1436
+ - - ">="
1436
1437
  - !ruby/object:Gem::Version
1437
- version: 1.3.1
1438
+ version: '0'
1438
1439
  requirements: []
1439
- rubygems_version: 3.1.4
1440
+ rubygems_version: 3.1.6
1440
1441
  signing_key:
1441
1442
  specification_version: 4
1442
1443
  summary: A platform to create, publish and edit sites