From dde96b674093af70700235aa075f995a822340e1 Mon Sep 17 00:00:00 2001 From: "Luis J. Romero" Date: Tue, 13 Dec 2022 12:39:23 +0100 Subject: [PATCH] Adding meta robots input texts for pages and content entries --- app/api/locomotive/api/entities/content_entry_entity.rb | 2 +- app/api/locomotive/api/entities/page_entity.rb | 2 +- app/api/locomotive/api/forms/content_entry_form.rb | 2 +- app/api/locomotive/api/forms/page_form.rb | 2 +- app/api/locomotive/api/resources/page_resource.rb | 2 ++ app/assets/javascripts/locomotive/editor.js | 4 ++-- app/controllers/locomotive/page_content_controller.rb | 2 +- app/javascript/src/locomotive/editor/services/api.js | 1 + app/javascript/src/locomotive/editor/views/seo/index.js | 6 ++++++ app/models/locomotive/concerns/shared/seo.rb | 1 + app/policies/locomotive/page_policy.rb | 3 ++- app/services/locomotive/content_entry_service.rb | 2 +- app/views/locomotive/content_entries/form/_seo.html.slim | 1 + app/views/locomotive/page_content/edit.json.jbuilder | 2 +- app/views/locomotive/pages/form/_seo.html.slim | 1 + config/locales/editor.en.yml | 1 + config/locales/editor.fr.yml | 1 + config/locales/simple_form.ca.yml | 2 ++ config/locales/simple_form.cs.yml | 2 ++ config/locales/simple_form.de.yml | 2 ++ config/locales/simple_form.el.yml | 2 ++ config/locales/simple_form.en.yml | 2 ++ config/locales/simple_form.es.yml | 2 ++ config/locales/simple_form.fi-FI.yml | 2 ++ config/locales/simple_form.fr.yml | 2 ++ config/locales/simple_form.ja-JP.yml | 2 ++ config/locales/simple_form.lt.yml | 2 ++ config/locales/simple_form.nl.yml | 2 ++ config/locales/simple_form.pl-PL.yml | 2 ++ config/locales/simple_form.pt-BR.yml | 2 ++ config/locales/simple_form.ru.yml | 2 ++ config/locales/simple_form.sl.yml | 2 ++ config/locales/simple_form.sv-FI.yml | 2 ++ config/locales/simple_form.sv.yml | 2 ++ config/locales/simple_form.uk.yml | 2 ++ config/locales/simple_form.zh-CN.yml | 2 ++ .../locomotive/api/entities/content_entry_entity_spec.rb | 1 + spec/api/locomotive/api/entities/page_entity_spec.rb | 1 + spec/policies/locomotive/page_policy_spec.rb | 4 ++-- spec/services/locomotive/content_entry_service_spec.rb | 2 +- 40 files changed, 68 insertions(+), 13 deletions(-) diff --git a/app/api/locomotive/api/entities/content_entry_entity.rb b/app/api/locomotive/api/entities/content_entry_entity.rb index db3ee456a0..0afab26f3a 100644 --- a/app/api/locomotive/api/entities/content_entry_entity.rb +++ b/app/api/locomotive/api/entities/content_entry_entity.rb @@ -12,7 +12,7 @@ class ContentEntryEntity < BaseEntity expose :_label, :_position, :_visible - expose :seo_title, :meta_keywords, :meta_description + expose :seo_title, :meta_keywords, :meta_description, :meta_robots expose :dynamic_fields diff --git a/app/api/locomotive/api/entities/page_entity.rb b/app/api/locomotive/api/entities/page_entity.rb index 717dceffc6..d85e50ca4b 100644 --- a/app/api/locomotive/api/entities/page_entity.rb +++ b/app/api/locomotive/api/entities/page_entity.rb @@ -50,7 +50,7 @@ class PageEntity < BaseEntity end # SEO - expose :seo_title, :meta_keywords, :meta_description + expose :seo_title, :meta_keywords, :meta_description, :meta_robots end diff --git a/app/api/locomotive/api/forms/content_entry_form.rb b/app/api/locomotive/api/forms/content_entry_form.rb index 2eb6607d92..279da23666 100644 --- a/app/api/locomotive/api/forms/content_entry_form.rb +++ b/app/api/locomotive/api/forms/content_entry_form.rb @@ -8,7 +8,7 @@ class ContentEntryForm < BaseForm attr_accessor :content_type, :dynamic_attributes - attrs :_slug, :_position, :_visible, :seo_title, :meta_keywords, :meta_description + attrs :_slug, :_position, :_visible, :seo_title, :meta_keywords, :meta_description, :meta_robots def initialize(content_type, attributes) self.content_type = content_type diff --git a/app/api/locomotive/api/forms/page_form.rb b/app/api/locomotive/api/forms/page_form.rb index c45832a2a1..ab5a20cbd5 100644 --- a/app/api/locomotive/api/forms/page_form.rb +++ b/app/api/locomotive/api/forms/page_form.rb @@ -20,7 +20,7 @@ class PageForm < BaseForm attrs :templatized, :target_klass_slug # SEO - attrs :seo_title, :meta_keywords, :meta_description + attrs :seo_title, :meta_keywords, :meta_description, :meta_robots # Editable elements attrs :editable_elements_attributes diff --git a/app/api/locomotive/api/resources/page_resource.rb b/app/api/locomotive/api/resources/page_resource.rb index 79ec5fd27e..13cc06d42f 100644 --- a/app/api/locomotive/api/resources/page_resource.rb +++ b/app/api/locomotive/api/resources/page_resource.rb @@ -71,6 +71,7 @@ def url_builder optional :seo_title optional :meta_keywords optional :meta_description + optional :meta_robots optional :display_settings end end @@ -111,6 +112,7 @@ def url_builder optional :seo_title optional :meta_keywords optional :meta_description + optional :meta_robots optional :display_settings end end diff --git a/app/assets/javascripts/locomotive/editor.js b/app/assets/javascripts/locomotive/editor.js index caa51e01e9..756d862627 100644 --- a/app/assets/javascripts/locomotive/editor.js +++ b/app/assets/javascripts/locomotive/editor.js @@ -813,7 +813,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"saveContent\", function() { return _saveContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadContent\", function() { return _loadContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadSectionHTML\", function() { return _loadSectionHTML; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uploadAssets\", function() { return _uploadAssets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAssets\", function() { return _loadAssets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getThumbnail\", function() { return _getThumbnail; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"searchForResources\", function() { return _searchForResources; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ApiFactory; });\n/* harmony import */ var _utils_misc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/misc */ \"./app/javascript/src/locomotive/editor/utils/misc.js\");\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\n\n\nvar requestOptions = function requestOptions(verb, data, headers) {\n var _headers = Object.assign({\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }, headers);\n\n if (_headers['Content-Type'] === null) delete _headers['Content-Type'];\n var options = {\n method: verb,\n credentials: 'same-origin',\n headers: _headers\n };\n if (verb !== 'GET') options.body = data;\n return options;\n};\n\nvar post = function post(url, data, headers) {\n return fetch(url, requestOptions('POST', data, headers));\n};\n\nvar put = function put(url, data, headers) {\n return fetch(url, requestOptions('PUT', data, headers));\n};\n\nvar jsonPut = function jsonPut(url, data, headers) {\n return put(url, JSON.stringify(data), headers).then(function (response) {\n return response.json();\n }).then(function (data) {\n if (data.errors) throw data.errors;\n return data;\n });\n};\n\nvar get = function get(url, query, headers) {\n var url = new URL(url, window.location.origin);\n Object.keys(query || {}).forEach(function (key) {\n return url.searchParams.append(key, query[key]);\n });\n return fetch(url.href, requestOptions('GET', null, headers));\n};\n\nvar jsonGet = function jsonGet(url, query, headers) {\n return get(url, query, headers).then(function (response) {\n var headers = response.headers;\n return response.json().then(function (json) {\n return {\n headers: headers,\n json: json\n };\n });\n });\n}; // CONTENT\n\n\nfunction _saveContent(url, site, page, locale) {\n return jsonPut(url, {\n content_locale: locale,\n site: {\n sections_content: JSON.stringify(site.sectionsContent)\n },\n page: {\n title: page.title,\n slug: page.slug,\n listed: page.listed,\n published: page.published,\n seo_title: page.seo_title,\n meta_keywords: page.meta_keywords,\n meta_description: page.meta_description,\n sections_content: JSON.stringify(page.sectionsContent),\n sections_dropzone_content: JSON.stringify(page.sectionsDropzoneContent)\n }\n });\n}\n\n\n\nfunction _loadContent(url, pageId, contentEntryId, locale) {\n var _url = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"replace\"])(url, /\\/pages\\/[0-9a-z]+\\//, \"/pages/\".concat(pageId, \"/\")) + '.json';\n\n return jsonGet(_url, {\n content_locale: locale,\n content_entry_id: contentEntryId\n }).then(function (response) {\n return {\n data: response.json.data,\n urls: response.json.urls\n };\n });\n} // SECTION\n\n\n\n\nfunction _loadSectionHTML(url, section, content) {\n return put(url, JSON.stringify({\n section_content: content\n }), {\n 'Locomotive-Section-Type': section.type\n }).then(function (response) {\n return response.text();\n });\n} // CONTENT ASSETS\n\n\n\n\nfunction _uploadAssets(url, assets) {\n var form = new FormData();\n Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(assets, function (asset) {\n if (typeof asset.name == 'string') form.append('content_assets[][source]', asset);else form.append('content_assets[][source]', asset.blob, asset.filename);\n });\n return post(url, form, {\n 'Content-Type': null\n }).then(function (response) {\n return response.json();\n });\n}\n\n\n\nfunction _loadAssets(url, options) {\n return jsonGet(url, {\n query: options.query || '',\n page: options.pagination.page || 1,\n per_page: options.pagination.perPage || 10\n }).then(function (response) {\n return {\n list: response.json,\n pagination: {\n page: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-current-page')),\n perPage: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-per-page')),\n totalPages: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-total-pages')),\n totalEntries: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-total-entries'))\n }\n };\n });\n}\n\n\n\nfunction _getThumbnail(url, imageUrl, format) {\n var _imageUrl = new URL(imageUrl, window.location.origin);\n\n return get(url, {\n image: _imageUrl,\n format: format\n }).then(function (response) {\n return response.text();\n });\n} // RESOURCES\n\n\n\n\nfunction _searchForResources(url, locale, type, q, scope) {\n return jsonGet(url, {\n content_locale: locale,\n q: q,\n type: type,\n scope: scope\n }).then(function (response) {\n return {\n list: response.json\n };\n });\n}\n\n\nfunction ApiFactory(urls, locale) {\n return {\n loadContent: function loadContent(pageId, contentEntryId, locale) {\n return _loadContent(urls.load, pageId, contentEntryId, locale);\n },\n saveContent: function saveContent(site, page, locale) {\n return _saveContent(urls.save, site, page, locale);\n },\n loadAssets: function loadAssets(options) {\n return _loadAssets(urls.assets, options);\n },\n uploadAssets: function uploadAssets(assets) {\n return _uploadAssets(urls.bulkAssetUpload, assets);\n },\n getThumbnail: function getThumbnail(imageUrl, format) {\n return _getThumbnail(urls.thumbnail, imageUrl, format);\n },\n searchForResources: function searchForResources(type, query, scope) {\n return _searchForResources(urls.resources, locale, type, query, scope);\n },\n loadSectionHTML: function loadSectionHTML(sectionType, content) {\n return _loadSectionHTML(urls.preview, sectionType, content);\n }\n };\n}\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/services/api.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"saveContent\", function() { return _saveContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadContent\", function() { return _loadContent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadSectionHTML\", function() { return _loadSectionHTML; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uploadAssets\", function() { return _uploadAssets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAssets\", function() { return _loadAssets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getThumbnail\", function() { return _getThumbnail; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"searchForResources\", function() { return _searchForResources; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ApiFactory; });\n/* harmony import */ var _utils_misc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/misc */ \"./app/javascript/src/locomotive/editor/utils/misc.js\");\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\n\n\nvar requestOptions = function requestOptions(verb, data, headers) {\n var _headers = Object.assign({\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': document.querySelector('meta[name=\"csrf-token\"]').content\n }, headers);\n\n if (_headers['Content-Type'] === null) delete _headers['Content-Type'];\n var options = {\n method: verb,\n credentials: 'same-origin',\n headers: _headers\n };\n if (verb !== 'GET') options.body = data;\n return options;\n};\n\nvar post = function post(url, data, headers) {\n return fetch(url, requestOptions('POST', data, headers));\n};\n\nvar put = function put(url, data, headers) {\n return fetch(url, requestOptions('PUT', data, headers));\n};\n\nvar jsonPut = function jsonPut(url, data, headers) {\n return put(url, JSON.stringify(data), headers).then(function (response) {\n return response.json();\n }).then(function (data) {\n if (data.errors) throw data.errors;\n return data;\n });\n};\n\nvar get = function get(url, query, headers) {\n var url = new URL(url, window.location.origin);\n Object.keys(query || {}).forEach(function (key) {\n return url.searchParams.append(key, query[key]);\n });\n return fetch(url.href, requestOptions('GET', null, headers));\n};\n\nvar jsonGet = function jsonGet(url, query, headers) {\n return get(url, query, headers).then(function (response) {\n var headers = response.headers;\n return response.json().then(function (json) {\n return {\n headers: headers,\n json: json\n };\n });\n });\n}; // CONTENT\n\n\nfunction _saveContent(url, site, page, locale) {\n return jsonPut(url, {\n content_locale: locale,\n site: {\n sections_content: JSON.stringify(site.sectionsContent)\n },\n page: {\n title: page.title,\n slug: page.slug,\n listed: page.listed,\n published: page.published,\n seo_title: page.seo_title,\n meta_keywords: page.meta_keywords,\n meta_description: page.meta_description,\n meta_robots: page.meta_robots,\n sections_content: JSON.stringify(page.sectionsContent),\n sections_dropzone_content: JSON.stringify(page.sectionsDropzoneContent)\n }\n });\n}\n\n\n\nfunction _loadContent(url, pageId, contentEntryId, locale) {\n var _url = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"replace\"])(url, /\\/pages\\/[0-9a-z]+\\//, \"/pages/\".concat(pageId, \"/\")) + '.json';\n\n return jsonGet(_url, {\n content_locale: locale,\n content_entry_id: contentEntryId\n }).then(function (response) {\n return {\n data: response.json.data,\n urls: response.json.urls\n };\n });\n} // SECTION\n\n\n\n\nfunction _loadSectionHTML(url, section, content) {\n return put(url, JSON.stringify({\n section_content: content\n }), {\n 'Locomotive-Section-Type': section.type\n }).then(function (response) {\n return response.text();\n });\n} // CONTENT ASSETS\n\n\n\n\nfunction _uploadAssets(url, assets) {\n var form = new FormData();\n Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(assets, function (asset) {\n if (typeof asset.name == 'string') form.append('content_assets[][source]', asset);else form.append('content_assets[][source]', asset.blob, asset.filename);\n });\n return post(url, form, {\n 'Content-Type': null\n }).then(function (response) {\n return response.json();\n });\n}\n\n\n\nfunction _loadAssets(url, options) {\n return jsonGet(url, {\n query: options.query || '',\n page: options.pagination.page || 1,\n per_page: options.pagination.perPage || 10\n }).then(function (response) {\n return {\n list: response.json,\n pagination: {\n page: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-current-page')),\n perPage: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-per-page')),\n totalPages: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-total-pages')),\n totalEntries: Object(_utils_misc__WEBPACK_IMPORTED_MODULE_0__[\"toInt\"])(response.headers.get('x-total-entries'))\n }\n };\n });\n}\n\n\n\nfunction _getThumbnail(url, imageUrl, format) {\n var _imageUrl = new URL(imageUrl, window.location.origin);\n\n return get(url, {\n image: _imageUrl,\n format: format\n }).then(function (response) {\n return response.text();\n });\n} // RESOURCES\n\n\n\n\nfunction _searchForResources(url, locale, type, q, scope) {\n return jsonGet(url, {\n content_locale: locale,\n q: q,\n type: type,\n scope: scope\n }).then(function (response) {\n return {\n list: response.json\n };\n });\n}\n\n\nfunction ApiFactory(urls, locale) {\n return {\n loadContent: function loadContent(pageId, contentEntryId, locale) {\n return _loadContent(urls.load, pageId, contentEntryId, locale);\n },\n saveContent: function saveContent(site, page, locale) {\n return _saveContent(urls.save, site, page, locale);\n },\n loadAssets: function loadAssets(options) {\n return _loadAssets(urls.assets, options);\n },\n uploadAssets: function uploadAssets(assets) {\n return _uploadAssets(urls.bulkAssetUpload, assets);\n },\n getThumbnail: function getThumbnail(imageUrl, format) {\n return _getThumbnail(urls.thumbnail, imageUrl, format);\n },\n searchForResources: function searchForResources(type, query, scope) {\n return _searchForResources(urls.resources, locale, type, query, scope);\n },\n loadSectionHTML: function loadSectionHTML(sectionType, content) {\n return _loadSectionHTML(urls.preview, sectionType, content);\n }\n };\n}\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/services/api.js?"); /***/ }), @@ -1401,7 +1401,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -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 _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../i18n */ \"./app/javascript/src/locomotive/editor/i18n.js\");\n/* harmony import */ var _hoc_with_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hoc/with_redux */ \"./app/javascript/src/locomotive/editor/hoc/with_redux.js\");\n/* harmony import */ var _components_default_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/default_view */ \"./app/javascript/src/locomotive/editor/components/default_view/index.js\");\n/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../inputs */ \"./app/javascript/src/locomotive/editor/inputs/index.js\");\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n\n // HOC\n\n // Components\n\n\n\n\nvar SeoForm = function SeoForm(_ref) {\n var page = _ref.page,\n errors = _ref.errors,\n updatePageSetting = _ref.updatePageSetting,\n moreSettingPath = _ref.moreSettingPath,\n props = _objectWithoutProperties(_ref, [\"page\", \"errors\", \"updatePageSetting\", \"moreSettingPath\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_default_view__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-page-settings\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.title_label'),\n getValue: function getValue() {\n return page.seo_title || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('seo_title', value);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.meta_keywords_label'),\n getValue: function getValue() {\n return page.meta_keywords || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('meta_keywords', value);\n },\n error: errors.slug\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.meta_description_label'),\n getValue: function getValue() {\n return page.meta_description || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('meta_description', value);\n }\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_hoc_with_redux__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (state) {\n return {\n page: state.content.page,\n errors: state.editor.formErrors.page || {},\n moreSettingPath: state.editor.urls.settings\n };\n})(SeoForm));\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/views/seo/index.js?"); +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 _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../i18n */ \"./app/javascript/src/locomotive/editor/i18n.js\");\n/* harmony import */ var _hoc_with_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../hoc/with_redux */ \"./app/javascript/src/locomotive/editor/hoc/with_redux.js\");\n/* harmony import */ var _components_default_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/default_view */ \"./app/javascript/src/locomotive/editor/components/default_view/index.js\");\n/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../inputs */ \"./app/javascript/src/locomotive/editor/inputs/index.js\");\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n\n // HOC\n\n // Components\n\n\n\n\nvar SeoForm = function SeoForm(_ref) {\n var page = _ref.page,\n errors = _ref.errors,\n updatePageSetting = _ref.updatePageSetting,\n moreSettingPath = _ref.moreSettingPath,\n props = _objectWithoutProperties(_ref, [\"page\", \"errors\", \"updatePageSetting\", \"moreSettingPath\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_default_view__WEBPACK_IMPORTED_MODULE_3__[\"default\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"editor-page-settings\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.title_label'),\n getValue: function getValue() {\n return page.seo_title || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('seo_title', value);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.meta_keywords_label'),\n getValue: function getValue() {\n return page.meta_keywords || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('meta_keywords', value);\n },\n error: errors.slug\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.meta_description_label'),\n getValue: function getValue() {\n return page.meta_description || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('meta_description', value);\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_inputs__WEBPACK_IMPORTED_MODULE_4__[\"TextInput\"], {\n label: _i18n__WEBPACK_IMPORTED_MODULE_1__[\"default\"].t('views.seo.meta_robots_label'),\n getValue: function getValue() {\n return page.meta_robots || '';\n },\n handleChange: function handleChange(value) {\n return updatePageSetting('meta_robots', value);\n }\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_hoc_with_redux__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (state) {\n return {\n page: state.content.page,\n errors: state.editor.formErrors.page || {},\n moreSettingPath: state.editor.urls.settings\n };\n})(SeoForm));\n\n//# sourceURL=webpack:///./app/javascript/src/locomotive/editor/views/seo/index.js?"); /***/ }), diff --git a/app/controllers/locomotive/page_content_controller.rb b/app/controllers/locomotive/page_content_controller.rb index a5abe010ca..9a1e9f9abf 100644 --- a/app/controllers/locomotive/page_content_controller.rb +++ b/app/controllers/locomotive/page_content_controller.rb @@ -69,7 +69,7 @@ def site_params def page_params params.require(:page).permit(:title, :slug, :published, :listed, - :seo_title, :meta_keywords, :meta_description, + :seo_title, :meta_keywords, :meta_description, :meta_robots, :sections_content, :sections_dropzone_content) end diff --git a/app/javascript/src/locomotive/editor/services/api.js b/app/javascript/src/locomotive/editor/services/api.js index 934fadc6a6..c1d1fcbbe9 100644 --- a/app/javascript/src/locomotive/editor/services/api.js +++ b/app/javascript/src/locomotive/editor/services/api.js @@ -67,6 +67,7 @@ export function saveContent(url, site, page, locale) { seo_title: page.seo_title, meta_keywords: page.meta_keywords, meta_description: page.meta_description, + meta_robots: page.meta_robots, sections_content: JSON.stringify(page.sectionsContent), sections_dropzone_content: JSON.stringify(page.sectionsDropzoneContent) } diff --git a/app/javascript/src/locomotive/editor/views/seo/index.js b/app/javascript/src/locomotive/editor/views/seo/index.js index 271e0592ba..e1c81ef228 100644 --- a/app/javascript/src/locomotive/editor/views/seo/index.js +++ b/app/javascript/src/locomotive/editor/views/seo/index.js @@ -30,6 +30,12 @@ const SeoForm = ({ page, errors, updatePageSetting, moreSettingPath, ...props }) getValue={() => page.meta_description || ''} handleChange={value => updatePageSetting('meta_description', value)} /> + + page.meta_robots || ''} + handleChange={value => updatePageSetting('meta_robots', value)} + /> ) diff --git a/app/models/locomotive/concerns/shared/seo.rb b/app/models/locomotive/concerns/shared/seo.rb index 7453fb8dbf..67d3882b77 100644 --- a/app/models/locomotive/concerns/shared/seo.rb +++ b/app/models/locomotive/concerns/shared/seo.rb @@ -8,6 +8,7 @@ module Seo field :seo_title, type: String, localize: true field :meta_keywords, type: String, localize: true field :meta_description, type: String, localize: true + field :meta_robots, type: String, localize: true end end # Seo diff --git a/app/policies/locomotive/page_policy.rb b/app/policies/locomotive/page_policy.rb index 9bb537ad0d..0cc569d3dc 100644 --- a/app/policies/locomotive/page_policy.rb +++ b/app/policies/locomotive/page_policy.rb @@ -30,7 +30,8 @@ def show? end def permitted_attributes - attributes = [:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords] + attributes = [:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, + :redirect_type, :seo_title, :meta_description, :meta_keywords, :meta_robots] if site_admin_or_designer? attributes += [:cache_enabled, :cache_control, :cache_vary] attributes += [:handle] diff --git a/app/services/locomotive/content_entry_service.rb b/app/services/locomotive/content_entry_service.rb index 698c9a96a4..610a7917ca 100644 --- a/app/services/locomotive/content_entry_service.rb +++ b/app/services/locomotive/content_entry_service.rb @@ -189,7 +189,7 @@ def permitted_attributes # needed to get the custom fields _entry = content_type.entries.build - default = %w(_slug _position _visible seo_title meta_keywords meta_description) + default = %w(_slug _position _visible seo_title meta_keywords meta_description meta_robots) dynamic = _entry.custom_fields_safe_setters referenced = {} diff --git a/app/views/locomotive/content_entries/form/_seo.html.slim b/app/views/locomotive/content_entries/form/_seo.html.slim index a2b0d46d4a..2367d7e638 100644 --- a/app/views/locomotive/content_entries/form/_seo.html.slim +++ b/app/views/locomotive/content_entries/form/_seo.html.slim @@ -2,5 +2,6 @@ = f.input :seo_title = f.input :meta_keywords = f.input :meta_description + = f.input :meta_robots = render 'locomotive/content_entries/form/actions', f: f diff --git a/app/views/locomotive/page_content/edit.json.jbuilder b/app/views/locomotive/page_content/edit.json.jbuilder index c0a7032320..29981a5926 100644 --- a/app/views/locomotive/page_content/edit.json.jbuilder +++ b/app/views/locomotive/page_content/edit.json.jbuilder @@ -4,7 +4,7 @@ json.data do end json.page do - json.(@page, :id, :title, :seo_title, :meta_description, :meta_keywords, :listed, :published) + json.(@page, :id, :title, :seo_title, :meta_description, :meta_keywords, :meta_robots, :listed, :published) json.slug @page.slug if display_slug?(@page) diff --git a/app/views/locomotive/pages/form/_seo.html.slim b/app/views/locomotive/pages/form/_seo.html.slim index f806c3e6e7..cc3182171c 100644 --- a/app/views/locomotive/pages/form/_seo.html.slim +++ b/app/views/locomotive/pages/form/_seo.html.slim @@ -2,5 +2,6 @@ = f.input :seo_title = f.input :meta_keywords = f.input :meta_description + = f.input :meta_robots = render 'locomotive/pages/form/actions', f: f diff --git a/config/locales/editor.en.yml b/config/locales/editor.en.yml index 01e460d63d..18b195dce5 100644 --- a/config/locales/editor.en.yml +++ b/config/locales/editor.en.yml @@ -124,6 +124,7 @@ en: title_label: "SEO title" meta_keywords_label: "META keywords" meta_description_label: "META description" + meta_robots_label: "META robots" settings: title_label: "Title" diff --git a/config/locales/editor.fr.yml b/config/locales/editor.fr.yml index 0819b9085b..9cb0947866 100644 --- a/config/locales/editor.fr.yml +++ b/config/locales/editor.fr.yml @@ -124,6 +124,7 @@ fr: title_label: "Titre SEO" meta_keywords_label: "Mots-clés META" meta_description_label: "Description META" + meta_robots_label: "Robots META" settings: title_label: "Titre" diff --git a/config/locales/simple_form.ca.yml b/config/locales/simple_form.ca.yml index 2d5c2d56eb..388a25d8e0 100644 --- a/config/locales/simple_form.ca.yml +++ b/config/locales/simple_form.ca.yml @@ -81,6 +81,7 @@ ca: seo_title: "Definir un títol de la pàgina que ha de ser utilitzat com el valor de l'etiqueta del títol a la secció de capçalera. Deixiu-ho buit si vol utilitzar el valor per defecte de la configuració del lloc." meta_keywords: "Anul·la les paraules clau del lloc usades dins de l'etiqueta de capçalera de la pàgina. Estan separades per una coma." meta_description: "Anul·la la descripció de la web feta servir a l'etiqueta de capçalera." + meta_robots: "Afegeix les etiquetes per modificar el posicionament SEO de la pàgina. Estan separades per una coma. Ex: 'noindex,nofollow'." is_layout: "Si és veritat, aquesta pàgina es pot utilitzar com un disseny per a altres pàgines." allow_layout: "Permetre als autors canviar o no el disseny de la pàgina." site: @@ -105,6 +106,7 @@ ca: _visible: "Per defecte, la entrada serà mostrada en el lloc web. Per tant es pot fer servir com un atribut publicat." seo_title: "El valor que entris reemplaçarà el títol SEO de la pàgina plantilla relativa al teu model." meta_keywords: "Anul•la les paraules clau del lloc web fetes servir dintre d'una etiqueta head de la pàgina. Són separades per comes." + meta_robots: "Afegeix les etiquetes per modificar el posicionament SEO de la pàgina. Estan separades per una coma. Ex: 'noindex,nofollow'." meta_description: "Anul•la la meta descripció feta servir dins l'etiqueta head de la pàgina." content_type: public_submission_accounts: "Quan es crea una entrada, envia un correu de notificació a la llista dels comptes d'acontinuació." diff --git a/config/locales/simple_form.cs.yml b/config/locales/simple_form.cs.yml index f5d9b17bee..4d220eace2 100644 --- a/config/locales/simple_form.cs.yml +++ b/config/locales/simple_form.cs.yml @@ -81,6 +81,7 @@ cs: seo_title: "Definujte název stránky, který můžete použít jako titulek. Nechte prázdné, pokud chcete použít výchozí hodnotu v nastavení webové stránky." meta_keywords: "Přepíše meta klíčová slova používaná v rámci webových stránek. Jsou oddělena čárkou." meta_description: "Přepíše meta popis používaný v rámci webových stránek." + meta_robots: "Přidáním značek upravíte umístění SEO stránky. Jsou odděleny čárkou. Příklad: 'noindex,nofollow'." is_layout: "Pokud je to pravda, můžete použít rozvržení této stránky, pro jiné stránky." allow_layout: "Autoři, pojďme změnit, nebo nechme původní rozložení této stránky." site: @@ -106,6 +107,7 @@ cs: seo_title: "Hodnota, kterou zadáte nahradí název SEO titulek stránky šablony, vztahující se k modelu." meta_keywords: "Přepíše meta klíčová slova používaná v rámci webových stránek. Jsou oddělena čárkou." meta_description: "Přepíše meta tag popis používaný v rámci webových stránek." + meta_robots: "Přidáním značek upravíte umístění SEO stránky. Jsou odděleny čárkou. Příklad: 'noindex,nofollow'." content_type: public_submission_accounts: "Když je vytvořen záznam, poslat oznámení e-mailem na účty, které jsou uvedeny níže." image_resize_form: diff --git a/config/locales/simple_form.de.yml b/config/locales/simple_form.de.yml index 7984dd8f82..dd622b787a 100644 --- a/config/locales/simple_form.de.yml +++ b/config/locales/simple_form.de.yml @@ -81,6 +81,7 @@ de: seo_title: "Einen Seitentitel festlegen der als Wert für den Title-Tag im Head-Bereich dient. Leer lassen um den Standardwert aus den Einstellungen zu verwenden." meta_keywords: "Überschreibt die Standard Meta-Schlüsselwörter im Head-Tag der Seite. Durch Kommas getrennt." meta_description: "Überschreibt die Standard Meta-Beschreibung im Head-Tag der Seite." + meta_robots: "Fügen Sie die Tags hinzu, um die SEO-Positionierung der Seite zu ändern. Sie werden durch ein Komma getrennt. Beispiel: „noindex, nofollow“." is_layout: "Wenn eingeschaltet, kann diese Seite als Layout für andere Seiten dienen." allow_layout: "Autoren erlauben das Layout der Seite zu verändern." site: @@ -106,6 +107,7 @@ de: seo_title: "Dieser Wert ersetzt den SEO-Titel der Vorlagenseite, die diesem Modell zugewiesen ist." meta_keywords: "Überschreibt die Standard Meta-Schlüsselwörter die im Head-Bereich der Seite genutzt werden. Durch Kommas getrennt." meta_description: "Überschreibt die Standard Meta-Beschreibung die im Head-Bereich der Seite genutzt wird." + meta_robots: "Fügen Sie die Tags hinzu, um die SEO-Positionierung der Seite zu ändern. Sie werden durch ein Komma getrennt. Beispiel: „noindex, nofollow“." content_type: public_submission_accounts: "Sende eine Benachrichtigung an unten angeführte Konten, wenn ein Eintrag erstellt wird." image_resize_form: diff --git a/config/locales/simple_form.el.yml b/config/locales/simple_form.el.yml index 4172b7730e..5877606a07 100644 --- a/config/locales/simple_form.el.yml +++ b/config/locales/simple_form.el.yml @@ -81,6 +81,7 @@ el: seo_title: "Ορίστε έναν τίτλο σελίδας που θα πρέπει να χρησιμοποιείται ως τιμή για την ετικέτα title του head. Αφήστε το κενό αν θέλετε να χρησιμοποιηθεί η προεπιλογή από τις ρυθμίσεις της τοποθεσίας." meta_keywords: "Υπερβαίνει τα meta keywords της τοποθεσίας που χρισιμοποιεούνται στην ετικέτα head της σελίδας. Διαχωρίζονται με κώμα." meta_description: "Υπερβαίνει το meta description της τοποθεσίας που χρησιμοποιείται στην ετικέτα head της σελίδας." + meta_robots: "Προσθέστε τις ετικέτες για να τροποποιήσετε τη θέση SEO της σελίδας. Χωρίζονται με κόμμα. Π.χ.: 'noindex,nofollow'." is_layout: "Αν είναι true, αυτη η σελίδα μπορεί να χρησιμοποιειθεί ως πρότυπο για άλλες σελίδες." allow_layout: "Επιτρέψτε τους authors να αλλάξουν ή όχι την διάταξη αυτής της σελίδας." site: @@ -106,6 +107,7 @@ el: seo_title: "Η τιμή που θα εισάγετε θα αντικαταστήσει τον τίτλο του SEO της templatized σελίδας σχετικής με το μοντέλο σας." meta_keywords: "Υπερβαίνει τα meta keywords της τοποθεσίας που χρισιμοποιεούνται στην ετικέτα head της σελίδας. Διαχωρίζονται με κώμα." meta_description: "Υπερβαίνει το meta description της τοποθεσίας που χρησιμοποιείται στην ετικέτα head της σελίδας." + meta_robots: "Προσθέστε τις ετικέτες για να τροποποιήσετε τη θέση SEO της σελίδας. Χωρίζονται με κόμμα. Π.χ.: 'noindex,nofollow'." content_type: public_submission_accounts: "Όταν δημιουργηθεί ένα στοιχείο, να σταλεί ειδοποίηση στα email των λογαριασμών που εμφανίζονται παρακάτω." image_resize_form: diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index a9a6314460..1c7fb83f42 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -95,6 +95,7 @@ en: seo_title: "Define a page title which should be used as the value for the title tag in the head section. Leave it empty if you want to use the default value from the site settings." meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma." meta_description: "Overrides the site's meta description used within the head tag of the page." + meta_robots: "Add the tags to modify the SEO ranking of the page. They are separated by a comma. Ex: 'noindex,nofollow'." is_layout: "If true, this page can used as a layout for other pages." allow_layout: "Let authors change or not the layout of that page." site: @@ -126,6 +127,7 @@ en: seo_title: "The value you fill in will replace the SEO title of the templatized page related to your model." meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma." meta_description: "Overrides the site's meta description used within the head tag of the page." + meta_robots: "Add the tags to modify the SEO ranking of the page. They are separated by a comma. Ex: 'noindex,nofollow'." content_entry_import: col_sep: "The String placed between each field. ',' by default." quote_char: "The character used to quote fields. '\"' by default." diff --git a/config/locales/simple_form.es.yml b/config/locales/simple_form.es.yml index bf3c3b5163..65a4540f1d 100644 --- a/config/locales/simple_form.es.yml +++ b/config/locales/simple_form.es.yml @@ -82,6 +82,7 @@ es: seo_title: "Define un titulo de pagina que debe ser usado como valor para una etiqueta de titulo en la seccion principal. Dejalo vacio si quieres usar el valor predetermiado de la configuracion del sitio." meta_keywords: "Sobreescribe las meta keywords del sitio usadas como la etiqueta principal de la pagina. Estan separadas por una coma." meta_description: "Sobreescribe la descripcion meta del sitio usada dentro de la etiqueta principal de la pagina." + meta_robots: "Añade las etiquetas para modificar el posicionamiento SEO de la pagina. Estan separadas por una coma. Ej: 'noindex,nofollow'" is_layout: "Si es true, esta pagina puede ser usada como layout para otras paginas." allow_layout: "Permitir a los autores cambiar o no la plantilla de la pagina." site: @@ -108,6 +109,7 @@ es: seo_title: "El valor que escribas reemplazara el titulo SEO de la pagina con plantilla relacionada con tu modelo." meta_keywords: "Sobreescribe las meta keywords del sitio usadas como la etiqueta principal de la pagina. Estan separadas por una coma." meta_description: "Sobreescribe la descripcion meta del sitio usada dentro de la etiqueta principal de la pagina." + meta_robots: "Añade las etiquetas para modificar el posicionamiento SEO de la pagina. Estan separadas por una coma. Ej: 'noindex,nofollow'" content_type: public_submission_accounts: "Cuando una entrada sea creada, enviar una notificacion por email a las cuentas listadas debajo." image_resize_form: diff --git a/config/locales/simple_form.fi-FI.yml b/config/locales/simple_form.fi-FI.yml index 782c33428f..9fdc36cfdc 100644 --- a/config/locales/simple_form.fi-FI.yml +++ b/config/locales/simple_form.fi-FI.yml @@ -81,6 +81,7 @@ fi-FI: seo_title: "Define a page title which should be used as the value for the title tag in the head section. Leave it empty if you want to use the default value from the site settings." meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma." meta_description: "Overrides the site's meta description used within the head tag of the page." + meta_robots: "Lisää tageja muokataksesi sivun SEO-sijaintia. Ne erotetaan pilkulla. Esim: 'noindex,nofollow'." is_layout: "If true, this page can used as a layout for other pages." allow_layout: "Let authors change or not the layout of that page." site: @@ -106,6 +107,7 @@ fi-FI: seo_title: "The value you fill in will replace the SEO title of the templatized page related to your model." meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma." meta_description: "Overrides the site's meta description used within the head tag of the page." + meta_robots: "Lisää tageja muokataksesi sivun SEO-sijaintia. Ne erotetaan pilkulla. Esim: 'noindex,nofollow'." content_type: public_submission_accounts: "When an entry is created, send a notification email to the accounts listed below." image_resize_form: diff --git a/config/locales/simple_form.fr.yml b/config/locales/simple_form.fr.yml index 50ac0e9b60..c2b839a23c 100644 --- a/config/locales/simple_form.fr.yml +++ b/config/locales/simple_form.fr.yml @@ -84,6 +84,7 @@ fr: seo_title: "Ce titre sera utilisé par le tag HTML TITLE de votre page. Laissez le vide si voulez utiliser le titre défini dans les paramètres du site." meta_keywords: "Surcharge les META KEYWORDS définis dans les paramètres du site. Ils sont séparés par des virgules." meta_description: "Surcharge la META DESCRIPTION définie dans les paramètres du site. " + meta_robots: "Ajoutez les balises pour modifier le positionnement SEO de la page. Ils sont séparés par une virgule. Ex : 'noindex,nofollow'." is_layout: "Si cette option est activée, la page pourra être utilisée comme gabarit pour d'autres pages." allow_layout: "Laisse les auteurs la possibilité d'utiliser un autre gabarit pour cette page." site: @@ -113,6 +114,7 @@ fr: seo_title: "Cette valeur sera utilisée dans le tag HTML TITLE de la page gabarit associé à ce modèle." meta_keywords: "Surcharge les META KEYWORDS définis dans les paramètres du site. Ils sont séparés par des virgules." meta_description: "Surcharge la META DESCRIPTION définie dans les paramètres du site. " + meta_robots: "Ajoutez les balises pour modifier le positionnement SEO de la page. Ils sont séparés par une virgule. Ex : 'noindex,nofollow'." content_type: public_submission_accounts: "Quand un élément est crée, un email de notification est envoyé à tous les comptes listés ci-dessous." image_resize_form: diff --git a/config/locales/simple_form.ja-JP.yml b/config/locales/simple_form.ja-JP.yml index 1187f5227a..d411517fdc 100644 --- a/config/locales/simple_form.ja-JP.yml +++ b/config/locales/simple_form.ja-JP.yml @@ -81,6 +81,7 @@ ja-JP: seo_title: "ヘッダセクションのタイトルタグを入力してください。サイト設定のデフォルト値を使用する場合は、空欄のままでかまいません。" meta_keywords: "ページヘッダで使用するサイトのメタキーワードを入力してください。コンマで区切ります。" meta_description: "ページヘッダで使用するサイトのメタ記述を入力してください。" + meta_robots: "タグを追加して、ページの SEO ポジショニングを変更します。それらはカンマで区切られています。例: 'noindex,nofollow'。" is_layout: "true なら、このページは他のページのレイアウトとして使用することができます " allow_layout: "作成者はページのレイアウトを自由に変更することができます。" site: @@ -106,6 +107,7 @@ ja-JP: seo_title: "モデルに関連づけされた、テンプレート化されたページのSEOタイトルに置き換わる値です。" meta_keywords: "ページヘッダで使用するサイトのメタキーワードを上書きしてください。コンマで区切ります。" meta_description: "ページヘッダで使用するサイトのメタ記述を上書きしてください。" + meta_robots: "タグを追加して、ページの SEO ポジショニングを変更します。それらはカンマで区切られています。例: 'noindex,nofollow'。" content_type: public_submission_accounts: "エントリが作成されると、以下のアカウントに通知メールが送信されます。" image_resize_form: diff --git a/config/locales/simple_form.lt.yml b/config/locales/simple_form.lt.yml index a89ffbdbe4..f00946e397 100644 --- a/config/locales/simple_form.lt.yml +++ b/config/locales/simple_form.lt.yml @@ -81,6 +81,7 @@ lt: seo_title: "Apibrėžkite puslapio pavadinimą, kurio reikšmė bus naudojama title tag puslapio head skiltyje. Nepildykite, jeigu norite, kad būtų naudojama reikšmė apibrėžta tinklalapio nustatymuose." meta_keywords: "Perrašo tinklalapio meta raktažodžius naudojamus head tag paslapyje. Jie turi būti atskirti kableliu." meta_description: "Perrašo tinklalapio meta aprašą naudojamą head tag paslapyje." + meta_robots: "Pridėkite žymas, kad pakeistumėte puslapio SEO padėtį. Jie atskiriami kableliu. Pvz.: „noindex,nofollow“." is_layout: "Jei tiesa, šis puslapis gali būti naudojamas kaip maketas kitiems puslapiams." allow_layout: "Leisti autoriams keisti to puslapio maketą." site: @@ -106,6 +107,7 @@ lt: seo_title: "Reikšmė pakeis siejamo su modeliu šablono puslapio SEO pavadinimą." meta_keywords: "Perrašo tinklalapio meta raktažodžius naudojamus head tag puslapyje. Jie turi būti atskirti kableliu." meta_description: "Perrašo tinklalapio meta aprašą naudojamą head tag puslapyje." + meta_robots: "Pridėkite žymas, kad pakeistumėte puslapio SEO padėtį. Jie atskiriami kableliu. Pvz.: „noindex,nofollow“." content_type: public_submission_accounts: "Kada įrašas yra sukuriamas, išsiunčiamas pranešimas el. paštu vartotojams, išvardintiems žemiau." image_resize_form: diff --git a/config/locales/simple_form.nl.yml b/config/locales/simple_form.nl.yml index 04b847ae25..4f32b6e824 100644 --- a/config/locales/simple_form.nl.yml +++ b/config/locales/simple_form.nl.yml @@ -81,6 +81,7 @@ nl: seo_title: "Definieer een pagina titel die zal gebruikt worden als de waarde voor de SEO titel tag. Laat het leeg als u de standaard waarde van de site instellingen wilt gebruiken." meta_keywords: "Overschrijf de site zijn keywords die gebruikt worden voor SEO doeleinden. Ze zijn gescheiden door een komma." meta_description: "Overschrijf de site meta omschrijving die gebruikt wordt voor SEO doeleinden." + meta_robots: "Voeg de tags toe om de SEO-positionering van de pagina te wijzigen. Ze worden gescheiden door een komma. Bijv.: 'noindex,nofollow'." is_layout: "Indien waar, dan kan deze pagina gebruikt worden als layout voor andere pagina's." allow_layout: "Laat auteurs de layout van een pagina wijzigen of niet." site: @@ -105,6 +106,7 @@ nl: _visible: "Standaard zal het item tonen in de site. Dus het kan gebruikt worden als een gepubliceerde eigenschap." seo_title: "De waarde die u hier invult zal de SEO titel vervangen van de templatized pagina gerelateerd aan uw model." meta_keywords: "Overschrijft de site zijn keywords die gebruikt worden voor SEO doeleinden. Ze zijn gescheiden door een komma." + meta_robots: "Voeg de tags toe om de SEO-positionering van de pagina te wijzigen. Ze worden gescheiden door een komma. Bijv.: 'noindex,nofollow'." meta_description: "Overschrijf de site meta omschrijving die gebruikt wordt voor SEO doeleinden." content_type: public_submission_accounts: "Wanneer een item gecreëerd is, stuur dan een notificatie email naar de accounts hieronder." diff --git a/config/locales/simple_form.pl-PL.yml b/config/locales/simple_form.pl-PL.yml index 5bf8cfb63f..b6c5a30210 100644 --- a/config/locales/simple_form.pl-PL.yml +++ b/config/locales/simple_form.pl-PL.yml @@ -81,6 +81,7 @@ pl-PL: seo_title: "Określ tytuł strony, który będzie użyty jako wartość dla znacznika title umieszczanego w sekcji head kodu HTML. Pozostaw to pole puste, jeśli chcesz, aby wykorzystana została domyślna wartość określona ustawieniami witryny." meta_keywords: "Nadpisz słowa kluczowe (meta keywords) umieszczane w sekcji head kodu HTML. Słowa powinny być oddzielone przecinkami." meta_description: "Nadpisz znacznik opisu (meta description) umieszczanego w sekcji head kodu HTML." + meta_robots: "Dodaj tagi, aby zmodyfikować pozycjonowanie strony pod kątem SEO. Są one oddzielone przecinkiem. Np.: „noindex, nofollow”." is_layout: "Jeśli włączone, ta strona będzie mogła zostać użyta jako layout innych stron." allow_layout: "Zezwól autorom na zmianę layoutu tej strony." site: @@ -106,6 +107,7 @@ pl-PL: seo_title: "Wartość, którą tu podasz, zastąpi tytuł SEO strony szablonowej odnoszącej się do stworzonego modelu." meta_keywords: "Nadpisz słowa kluczowe (meta keywords) witryny, umieszczane w sekcji head kodu HTML strony. Powinny być oddzielone przecinkami." meta_description: "Nadpisz opis (meta description) witryny, umieszczany w sekcji head kodu HTML strony." + meta_robots: "Dodaj tagi, aby zmodyfikować pozycjonowanie strony pod kątem SEO. Są one oddzielone przecinkiem. Np.: „noindex, nofollow”." content_type: public_submission_accounts: "Kiedy pozycja jest tworzona wyślij e-mail z powiadomieniem do użytkowników podanych poniżej." image_resize_form: diff --git a/config/locales/simple_form.pt-BR.yml b/config/locales/simple_form.pt-BR.yml index ae4337266c..0ee1ec0f9f 100644 --- a/config/locales/simple_form.pt-BR.yml +++ b/config/locales/simple_form.pt-BR.yml @@ -81,6 +81,7 @@ pt-BR: seo_title: "Defina um título para a página que deve ser utilizado como valor para a tag de título dentro seção de cabeçalho. Deixe em branco caso você queira usar o valor padrão das configurações do site." meta_keywords: "Sobrescreve as palavras-chave do site utilizadas dentro da tag de cabeçalho da página. Estes são separados por uma vírgula." meta_description: "Sobrescreve as palavras-chave do site utilizadas dentro da tag de cabeçalho da página." + meta_robots: "Adicione as tags para modificar o posicionamento SEO da página. Eles são separados por uma vírgula. Ex: 'noindex,nofollow'." is_layout: "Se verdadeiro, essa página pode ser utilizado como um layout para outras páginas." allow_layout: "Deixe os autores alterarem ou não o layout dessa página." site: @@ -106,6 +107,7 @@ pt-BR: seo_title: "O valor que você preencher irá substituir o título de SEO da página de template relacionada com o seu modelo." meta_keywords: "Sobrescreve as palavras-chave utilizadas dentro da tag de cabeçalho da página. Estes são separados por uma vírgula." meta_description: "Sobrescreve as palavras-chave do site utilizadas dentro da tag de cabeçalho da página." + meta_robots: "Adicione as tags para modificar o posicionamento SEO da página. Eles são separados por uma vírgula. Ex: 'noindex,nofollow'." content_type: public_submission_accounts: "Quando uma entrada é criada, envie um e-mail de notificação para as contas listadas abaixo." image_resize_form: diff --git a/config/locales/simple_form.ru.yml b/config/locales/simple_form.ru.yml index f1d5a49d49..32c75041fd 100644 --- a/config/locales/simple_form.ru.yml +++ b/config/locales/simple_form.ru.yml @@ -81,6 +81,7 @@ ru: seo_title: "Определите название страницы, которое будет использоваться как значение для тега названия в разделе заголовка. Оставьте пустым если Вы хотите использовать значение по-умолчанию из настроек сайта." meta_keywords: "Заместить мета ключевые слова сайта, используемые внутри тега заголовка страницы. Если их несколько, перечислять через запятую." meta_description: "Заместить мета описание сайта, используемое внутри тега заголовка страницы." + meta_robots: "Добавьте теги, чтобы изменить SEO-позиционирование страницы. Они разделены запятой. Пример: «без индекса, без подписки»." is_layout: "Если истинно, эта страница может быть использована в качестве размещения для других страниц." allow_layout: "Разрешить или нет авторам менять размещение этой страницы." site: @@ -106,6 +107,7 @@ ru: seo_title: "Заполненное значение заменит SEO название шаблонизированной страницы относящейся к Вашей модели." meta_keywords: "Заместить мета ключевые слова сайта, используемые внутри тега заголовка страницы. Разделение запятой." meta_description: "Заместить мета описание сайта, используемое внутри тега заголовка страницы." + meta_robots: "Добавьте теги, чтобы изменить SEO-позиционирование страницы. Они разделены запятой. Пример: «без индекса, без подписки»." content_type: public_submission_accounts: "При создании записи, отправить уведомление по электронной почте перечисленных ниже учётных записей." image_resize_form: diff --git a/config/locales/simple_form.sl.yml b/config/locales/simple_form.sl.yml index bbb275dbb2..eaa55f96ca 100644 --- a/config/locales/simple_form.sl.yml +++ b/config/locales/simple_form.sl.yml @@ -81,6 +81,7 @@ sl: seo_title: "Določite naslov strani, ki bo uporabljen kot vrednost naslova v glavi strani. Pustite prazno, če želite uporabiti privzeto vrednost iz nastavitev spletnega mesta." meta_keywords: "Prepiše meta ključne besede v glavi strani. Ključne besede ločite z vejico." meta_description: "Prepiše meta opis v glavi strani." + meta_robots: "Dodajte oznake, da spremenite SEO položaj strani. Ločeni so z vejico. Primer: 'noindex,nofollow'." is_layout: "Če DA, bo stran na voljo kot predloga za druge strani." allow_layout: "Omogoči urejanje postavitve na strani." site: @@ -106,6 +107,7 @@ sl: seo_title: "Vrednost bo nadomestila SEO naslov strani iz predloge, ki je vezana na model." meta_keywords: "Prepiše meta ključne besede v glavi strani. Ključne besede ločite z vejico." meta_description: "Prepiše meta opis v glavi strani. " + meta_robots: "Dodajte oznake, da spremenite SEO položaj strani. Ločeni so z vejico. Primer: 'noindex,nofollow'." content_type: public_submission_accounts: "Ko je dodan nov zapis, pošji obvestilo na spodnje račune." image_resize_form: diff --git a/config/locales/simple_form.sv-FI.yml b/config/locales/simple_form.sv-FI.yml index 86bb92decb..b7e0d7efa4 100644 --- a/config/locales/simple_form.sv-FI.yml +++ b/config/locales/simple_form.sv-FI.yml @@ -81,6 +81,7 @@ sv-FI: seo_title: "Definiera en sidtitel som kan användas som värde för titel-tag i sidans -sektion. Lämna tom om du vill använda standardvärden för din webbplats." meta_keywords: "Skriver över din webbplats metanyckelord i sidans -sektion. Separera med kommatecken." meta_description: "Skriver över din webbplats metabeskrivning i sidans -sektion." + meta_robots: "Lägg till taggarna för att ändra SEO-positioneringen för sidan. De är åtskilda av ett kommatecken. Ex: 'noindex,nofollow'." is_layout: "Om sant så kan denna sida användas som mall för andra sidor." allow_layout: "Låt författare ändra mall för sida." site: @@ -106,6 +107,7 @@ sv-FI: seo_title: "Värdet du fyller i kommer att ersätta SEO-titel i mallen relaterad till din innehållstyp." meta_keywords: "Skriver över webbplatsen metabeskrivning som används i sidans -sektion. Separera med kommatecken." meta_description: "Skriver över webbplatsens metabeskrivning som används i sidans -sektion." + meta_robots: "Lägg till taggarna för att ändra SEO-positioneringen för sidan. De är åtskilda av ett kommatecken. Ex: 'noindex,nofollow'." content_type: public_submission_accounts: "När ett inlägg skapas, skicka en avisering över e-post till konton listade nedan." image_resize_form: diff --git a/config/locales/simple_form.sv.yml b/config/locales/simple_form.sv.yml index fac8b97d5d..62c050a942 100644 --- a/config/locales/simple_form.sv.yml +++ b/config/locales/simple_form.sv.yml @@ -81,6 +81,7 @@ sv: seo_title: "Definiera en sidtitel som kan användas som värde för titel-tag i sidans -sektion. Lämna tom om du vill använda standardvärden för din webbplats." meta_keywords: "Skriver över din webbplats metanyckelord i sidans -sektion. Separera med kommatecken." meta_description: "Skriver över din webbplats metabeskrivning i sidans -sektion." + meta_robots: "Lägg till taggarna för att ändra SEO-positioneringen för sidan. De är åtskilda av ett kommatecken. Ex: 'noindex,nofollow'." is_layout: "Om sant så kan denna sida användas som mall för andra sidor." allow_layout: "Låt författare ändra mall för sida." site: @@ -106,6 +107,7 @@ sv: seo_title: "Värdet du fyller i kommer att ersätta SEO-titel i mallen relaterad till din innehållstyp." meta_keywords: "Skriver över webbplatsen metabeskrivning som används i sidans -sektion. Separera med kommatecken." meta_description: "Skriver över webbplatsens metabeskrivning som används i sidans -sektion." + meta_robots: "Lägg till taggarna för att ändra SEO-positioneringen för sidan. De är åtskilda av ett kommatecken. Ex: 'noindex,nofollow'." content_type: public_submission_accounts: "När ett inlägg skapas, skicka en avisering över e-post till konton listade nedan." image_resize_form: diff --git a/config/locales/simple_form.uk.yml b/config/locales/simple_form.uk.yml index 4d53849942..45c06364c1 100644 --- a/config/locales/simple_form.uk.yml +++ b/config/locales/simple_form.uk.yml @@ -81,6 +81,7 @@ uk: seo_title: "Визначте заголовок сторінки, що буде використовуватися як значення тега title в секції head. Залиште пустимо, якщо ви хочете використовувати значення за замовчуванням з налаштувань сайту." meta_keywords: "Перевизначає meta keywords сайту, які використовуються всередині тега head сторінки. Вони розділені комами." meta_description: "Перевизначає meta keywords сайту, які використовуються всередині тега head сторінки. Вони розділені комами." + meta_robots: "Додайте теги, щоб змінити SEO-позиціонування сторінки. Вони розділяються комою. Наприклад: 'noindex, nofollow'." is_layout: "Якщо 'Так', тоді ця сторінка можу слугувати шаблоном для інших сторінок." allow_layout: "Дозволити автору чи ні зміну шаблону сторінки." site: @@ -106,6 +107,7 @@ uk: seo_title: "Значення, що вводиться вами, буде замінювати SEO заголовок шаблонізованої сторінки, пов'язаної з вашою моделлю." meta_keywords: "Перевизначає meta keywords сайту, використовувані усередині тега head сторінки. Розділяються комою." meta_description: "Перевизначає meta description сайту, використовувані усередині тега head сторінки." + meta_robots: "Додайте теги, щоб змінити SEO-позиціонування сторінки. Вони розділяються комою. Наприклад: 'noindex, nofollow'." content_type: public_submission_accounts: "При створенні, надіслати сповіження на адреси наведенні нижче." image_resize_form: diff --git a/config/locales/simple_form.zh-CN.yml b/config/locales/simple_form.zh-CN.yml index 998f69cd7e..2e70dcd882 100644 --- a/config/locales/simple_form.zh-CN.yml +++ b/config/locales/simple_form.zh-CN.yml @@ -81,6 +81,7 @@ zh-CN: seo_title: "定义页面标题,该标题讲座在head section中的title tag的值。如果想使用默认值则留空。" meta_keywords: "复写站点页面中head tag的meta keywords,使用分号来区隔。" meta_description: "复写站点中页面head tag中的meta描述。" + meta_robots: "添加标签修改页面的SEO定位。它们以逗号分隔。例如:'noindex,nofollow'。" is_layout: "选中则该页面将会作为其他页面的layout。" allow_layout: "请让作者修改,或者并非该页面的layout。" site: @@ -105,6 +106,7 @@ zh-CN: _visible: "默认情况下,该记录将显示在站点中。所以能够被用作发布属性。" seo_title: "你填入的值将会替换与你的模型相关的模板化页面的SEO标题。" meta_keywords: "复写站点页面中head tag的meta keywords,使用分号来区隔。" + meta_robots: "添加标签修改页面的SEO定位。它们以逗号分隔。例如:'noindex,nofollow'。" meta_description: "复写站点中页面head tag中的meta描述。" content_type: public_submission_accounts: "当每条记录创建时,发送一封通知邮件到下列账号。" diff --git a/spec/api/locomotive/api/entities/content_entry_entity_spec.rb b/spec/api/locomotive/api/entities/content_entry_entity_spec.rb index 0f707ac731..d61d037c10 100644 --- a/spec/api/locomotive/api/entities/content_entry_entity_spec.rb +++ b/spec/api/locomotive/api/entities/content_entry_entity_spec.rb @@ -13,6 +13,7 @@ seo_title meta_keywords meta_description + meta_robots ) attributes.each do |exposure| diff --git a/spec/api/locomotive/api/entities/page_entity_spec.rb b/spec/api/locomotive/api/entities/page_entity_spec.rb index 9afdeb45ec..b72fac5b6e 100644 --- a/spec/api/locomotive/api/entities/page_entity_spec.rb +++ b/spec/api/locomotive/api/entities/page_entity_spec.rb @@ -28,6 +28,7 @@ seo_title meta_keywords meta_description + meta_robots ) attributes.each do |exposure| diff --git a/spec/policies/locomotive/page_policy_spec.rb b/spec/policies/locomotive/page_policy_spec.rb index e4974d51b2..06e9a3d434 100644 --- a/spec/policies/locomotive/page_policy_spec.rb +++ b/spec/policies/locomotive/page_policy_spec.rb @@ -13,14 +13,14 @@ context 'admin' do let(:membership) { build(:admin) } - it { is_expected.to eq([:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords, :cache_enabled, :cache_control, :cache_vary, :handle]) } + it { is_expected.to eq([:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords, :meta_robots, :cache_enabled, :cache_control, :cache_vary, :handle]) } end context 'author' do let(:membership) { build(:author) } - it { is_expected.to eq([:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords]) } + it { is_expected.to eq([:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords, :meta_robots]) } end diff --git a/spec/services/locomotive/content_entry_service_spec.rb b/spec/services/locomotive/content_entry_service_spec.rb index b2b3e83c4e..51e4ce1846 100644 --- a/spec/services/locomotive/content_entry_service_spec.rb +++ b/spec/services/locomotive/content_entry_service_spec.rb @@ -186,7 +186,7 @@ subject { service.permitted_attributes } - it { is_expected.to eq %w(_slug _position _visible seo_title meta_keywords meta_description title body published) } + it { is_expected.to eq %w(_slug _position _visible seo_title meta_keywords meta_description meta_robots title body published) } end