diff options
| author | rde <rde@odoo.com> | 2017-09-15 12:36:59 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2017-09-15 15:29:37 +0200 |
| commit | 4ecbacaf59576a22ff45615a5aa5c67244e4fb93 (patch) | |
| tree | b1d38321d2838579ccb8adc2f3fcdd0765351fcc /addons/website/static/src | |
| parent | 13a44d33bda1d7ff21e3de5de8b3c84f6a482a0d (diff) | |
[ADD] website: add new page management
website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.
From now, we don't have a specific /page controller to serve 'page'.
We use a new model website.page which is rendered if none route matches the url
and that the field 'url' on website.page matches the request.httprequest.path.
The order to serve a path is:
- Routes defines in controllers (/shop, /blog, ...)
- ir.attachment with name matching the path
- website.page with url matching the path
- website.redirect with url_from matching the path
- 404
To improve:
- allow regexp in website.redirect model
- allow to edit the view_arch from the page.management via redirect backend
(needed when traceback in the page, or when modifying a js/css/less/...)
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/js/content/website_root.js | 1 | ||||
| -rw-r--r-- | addons/website/static/src/js/menu/content.js | 403 | ||||
| -rw-r--r-- | addons/website/static/src/js/menu/seo.js | 32 | ||||
| -rw-r--r-- | addons/website/static/src/js/tours/rte.js | 4 | ||||
| -rw-r--r-- | addons/website/static/src/js/utils.js | 9 | ||||
| -rw-r--r-- | addons/website/static/src/less/website.ui.components.less | 28 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.contentMenu.xml | 10 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.pageProperties.xml | 112 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.seo.xml | 2 |
9 files changed, 493 insertions, 108 deletions
diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index 490151d38eb..74ab190f36d 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -195,6 +195,7 @@ var WebsiteRoot = BodyManager.extend({ }) .done(function (result) { $data.toggleClass("css_unpublished css_published"); + $data.find('input').prop("checked", result); $data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off'); }) .fail(function (err, data) { diff --git a/addons/website/static/src/js/menu/content.js b/addons/website/static/src/js/menu/content.js index 1ed6e2305e0..9a7e38244cf 100644 --- a/addons/website/static/src/js/menu/content.js +++ b/addons/website/static/src/js/menu/content.js @@ -3,13 +3,241 @@ odoo.define('website.contentMenu', function (require) { var core = require('web.core'); var Dialog = require('web.Dialog'); +var time = require('web.time'); var weContext = require('web_editor.context'); var widget = require('web_editor.widget'); var websiteNavbarData = require('website.navbar'); +var websiteRootData = require('website.WebsiteRoot'); +var Widget = require('web.Widget'); var _t = core._t; var qweb = core.qweb; +var PagePropertiesDialog = widget.Dialog.extend({ + template: 'website.pagesMenu.page_info', + xmlDependencies: widget.Dialog.prototype.xmlDependencies.concat( + ['/website/static/src/xml/website.pageProperties.xml'] + ), + events: _.extend({}, widget.Dialog.prototype.events, { + 'keyup input#page_url': '_onUrlChanged', + 'change input#create_redirect': '_onCreateRedirectChanged', + }), + + /** + * @constructor + * @override + */ + init: function (parent, page_id, options) { + var self = this; + var serverUrl = window.location.origin + "/"; + var length_url = serverUrl.length; + var serverUrlTrunc = serverUrl; + if(length_url > 30) + serverUrlTrunc = serverUrl.slice(0,14) + '..' + serverUrl.slice(-14); + this.serverUrl = serverUrl; + this.serverUrlTrunc = serverUrlTrunc; + this.current_page_url = window.location.pathname; + this.page_id = page_id; + + var buttons = [ + {text: _t("Save"), classes: "btn-primary o_save_button", click: self.save}, + {text: _t("Discard"), close: true}, + ]; + if (options.fromPageManagement) { + buttons.push({text: _t("Go To Page"), icon: "fa-globe", classes: "btn-link pull-right", click: function(e){window.location.href = self.page.url;}}); + } + this._super(parent, _.extend({}, { + title: _t("Page Properties"), + size: 'medium', + buttons: buttons, + }, options || {})); + }, + /** + * @override + */ + willStart: function () { + var defs = [this._super.apply(this, arguments)]; + var self = this; + var context = weContext.get(); + + defs.push(this._rpc({ + model: 'website.page', + method: 'get_page_info', + args: [self.page_id,context.website_id], + kwargs: { + context: context + }, + }).then(function (page) { + page[0].url = page[0].url.startsWith('/') ? page[0].url.substring(1) : page[0].url; + self.page = page[0]; + })); + + defs.push(this._rpc({ + model: 'website.redirect', + method: 'fields_get', + }).then(function (fields) { + self.fields = fields; + })); + + return $.when.apply($, defs); + }, + /** + * @override + */ + start: function() { + var self = this; + var context = weContext.get(); + + this.$(".ask_for_redirect").hide(); + this.$(".redirect_type").hide(); + + //TODO: remove.html() & set self.var & display in view instead of controller (here) + this._getPageDependencies(self.page_id, context) + .then(function (dependencies) { + var dep = []; + _.each(dependencies, function( value, index ) { + if (dependencies[index].length > 0) { + dep.push(dependencies[index].length + ' ' + index.toLowerCase() + (dependencies[index].length > 1 ? 's': '')); + } + }); + if (dep.length > 0) { + $("#dependencies_redirect").html("(" + _("used in") + " " + dep.join(", ") + ")"); + } + }); + + var l10n = _t.database.parameters; + var datepickersOptions = { + minDate: moment({ y: 1900 }), + maxDate: moment().add(200, "y"), + calendarWeeks: true, + icons : { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + next: 'fa fa-chevron-right', + previous: 'fa fa-chevron-left', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + }, + locale : moment.locale(), + format : time.strftime_to_moment_format(l10n.date_format +' '+ l10n.time_format), + widgetPositioning : { + horizontal: 'auto', + vertical: 'top', + }, + }; + if (self.page.date_publish) { + datepickersOptions.defaultDate = self.page.date_publish; + } + + this.$("#date_publish_container").datetimepicker(datepickersOptions); + + return this._super.apply(this, arguments); + }, + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * @override + */ + save: function(data){ + var self = this; + var context = weContext.get(); + var url = $(".o_page_management_info #page_url").val(); + + var date_publish = $(".o_page_management_info #date_publish").val(); + if (date_publish != "") { + date_publish = time.datetime_to_str(new Date(date_publish)); + } + var params = { + id: self.page.id, + name: $(".o_page_management_info #page_name").val(), + //replace duplicate following "/" by only one "/" + url: url.replace(/\/{2,}/g,"/"), + is_menu: $(".o_page_management_info #is_menu").prop('checked'), + is_homepage: $(".o_page_management_info #is_homepage").prop('checked'), + website_published: $(".o_page_management_info #is_published").prop('checked'), + create_redirect: $(".o_page_management_info #create_redirect").prop('checked'), + redirect_type: $(".o_page_management_info #redirect_type").val(), + website_indexed: $(".o_page_management_info #is_indexed").prop('checked'), + date_publish: date_publish, + }; + self._rpc({ + model: 'website.page', + method: 'save_page_info', + args: [[context.website_id], params], + kwargs: { + context: context + }, + }).then(function () { + // If from page manager: reload url, if from page itself: go to (possibly) new url + if (self._getMainObject().model == 'website.page') + window.location.href = url.toLowerCase(); + else + window.location.reload(true); + }); + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * Retrieves the page dependencies for the given object id. + * + * @private + * @param {integer} moID + * @param {Object} context + * @returns {Deferred<Array>} + */ + _getPageDependencies: function (moID, context) { + return this._rpc({ + model: 'website', + method: 'page_search_dependencies', + args: [moID], + context: context, + }); + }, + /** + * Returns information about the page main object. + * + * @private + * @returns {Object} model and id + */ + _getMainObject: function () { + var repr = $('html').data('main-object'); + var m = repr.match(/(.+)\((\d+),(.*)\)/); + return { + model: m[1], + id: m[2] | 0, + }; + }, + + //-------------------------------------------------------------------------- + // Handlers + //-------------------------------------------------------------------------- + + _onUrlChanged: function () { + var url = this.$('input#page_url').val(); + if (url != this.page.url) { + this.$(".ask_for_redirect").show(); + } + else { + this.$(".ask_for_redirect").hide(); + } + }, + _onCreateRedirectChanged: function () { + var createRedirect = this.$('input#create_redirect').prop('checked'); + if (createRedirect) { + this.$(".redirect_type").show(); + } + else { + this.$(".redirect_type").hide(); + } + }, +}); + var MenuEntryDialog = widget.LinkDialog.extend({ xmlDependencies: widget.LinkDialog.prototype.xmlDependencies.concat( ['/website/static/src/xml/website.contentMenu.xml'] @@ -24,13 +252,16 @@ var MenuEntryDialog = widget.LinkDialog.extend({ data.isNewWindow = data.new_window; this.data = data; this.menu_link_options = options.menu_link_options; - return this._super.apply(this, arguments); + this._super(parent, _.extend({}, { + title: _t("Create Menu"), + }, options || {}), editor, data); }, /** * @override */ start: function () { var self = this; + self.$('#o_link_dialog_url_input').closest('.form-group').hide(); this.$('.o_link_dialog_preview').remove(); this.$('.window-new, .link-style').closest('.form-group').remove(); this.$('label[for="o_link_dialog_label_input"]').text(_t("Menu Label")); @@ -288,9 +519,8 @@ var EditMenuDialog = widget.Dialog.extend({ var ContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ xmlDependencies: ['/website/static/src/xml/website.xml'], actions: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.prototype.actions || {}, { - delete_page: '_deletePage', edit_menu: '_editMenu', - rename_page: '_renamePage', + page_properties: '_pageProperties', }), //-------------------------------------------------------------------------- @@ -311,69 +541,12 @@ var ContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ id: m[2] | 0, }; }, - /** - * Retrieves the page dependencies for the given object id. - * - * @private - * @param {integer} moID - * @param {Object} context - * @returns {Deferred<Array>} - */ - _getPageDependencies: function (moID, context) { - return this._rpc({ - model: 'website', - method: 'page_search_dependencies', - args: [moID], - context: context, - }); - }, //-------------------------------------------------------------------------- // Actions //-------------------------------------------------------------------------- /** - * Searches for the page dependencies, inform the user about them then - * delete the page if the user agrees. - * - * @private - * @returns {Deferred} - */ - _deletePage: function () { - var self = this; - var moID = self._getMainObject().id; - var context = weContext.get(); - - var def = $.Deferred(); - - // Search the page dependencies - this._getPageDependencies(moID, context) - .then(function (dependencies) { - // Inform the user about those dependencies and ask him confirmation - var confirmDef = $.Deferred(); - Dialog.safeConfirm(self, "", { - title: _t("Delete Page"), - $content: $(qweb.render('website.delete_page', {dependencies: dependencies})), - confirm_callback: confirmDef.resolve.bind(confirmDef), - cancel_callback: def.resolve.bind(self), - }); - return confirmDef; - }).then(function () { - // Delete the page if the user confirmed - return self._rpc({ - model: 'website', - method: 'delete_page', - args: [moID], - context: context, - }); - }).then(function () { - // Redirect to homepage as the page is now deleted - window.location.href = '/'; - }, def.reject.bind(def)); - - return def; - }, - /** * Asks the user which menu to edit if multiple menus exist on the page. * Then opens the menu edition dialog. * Then executes the given callback once the edition is saved, to finally @@ -419,58 +592,104 @@ var ContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ return def; }, + _pageProperties: function () { + var self = this; + var moID = self._getMainObject().id; + var dialog = new PagePropertiesDialog(self,moID,{}).open(); + return dialog; + }, +}); + + +var PageManagement = Widget.extend({ + events: { + 'click a.js_page_properties': '_onPagePropertiesButtonClick', + 'click a.js_clone_page': '_onClonePageButtonClick', + 'click a.js_delete_page': '_onDeletePageButtonClick', + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + /** - * Asks the user for the new name of the page, then reloads to the new page - * with the correct name if saved. + * Retrieves the page dependencies for the given object id. * * @private - * @returns {Deferred} - * Unresolved if the page's name is changed and saved as the page - * will be reloaded. - * Resolved otherwise. + * @param {integer} moID + * @param {Object} context + * @returns {Deferred<Array>} */ - _renamePage: function () { - var def = $.Deferred(); + _getPageDependencies: function (moID, context) { + return this._rpc({ + model: 'website', + method: 'page_search_dependencies', + args: [moID], + context: context, + }); + }, + + //-------------------------------------------------------------------------- + // Handlers + //-------------------------------------------------------------------------- + _onPagePropertiesButtonClick: function (ev) { + var moID = $(ev.currentTarget).data('id'); + var dialog = new PagePropertiesDialog(this,moID, {'fromPageManagement': true}).open(); + return dialog; + }, + _onClonePageButtonClick: function (ev) { + var pageId = $(ev.currentTarget).data('id'); + var context = weContext.get(); + this._rpc({ + model: 'website.page', + method: 'clone_page', + args: [pageId], + kwargs: { + context: context, + }, + }).then(function (path) { + window.location.href = path; + }); + }, + _onDeletePageButtonClick: function (ev) { + var pageId = $(ev.currentTarget).data('id'); var self = this; - var moID = self._getMainObject().id; var context = weContext.get(); + var def = $.Deferred(); // Search the page dependencies - this._getPageDependencies(moID, context).then(function (dependencies) { - // Ask the user for the new page name and inform him about the dependencies - var renameDef = $.Deferred(); - var $content = $(qweb.render('website.rename_page', {dependencies: dependencies})); - Dialog.confirm(self, "", { - title: _t("Rename This Page"), - $content: $content, - confirm_callback: function () { - var $newNameInput = $content.find('input#new_name'); - renameDef.resolve($newNameInput.val()); - }, - cancel_callback: def.resolve.bind(def), + this._getPageDependencies(pageId, context) + .then(function (dependencies) { + // Inform the user about those dependencies and ask him confirmation + var confirmDef = $.Deferred(); + Dialog.safeConfirm(self, "", { + title: _t("Delete Page"), + $content: $(qweb.render('website.delete_page', {dependencies: dependencies})), + confirm_callback: confirmDef.resolve.bind(confirmDef), + cancel_callback: def.resolve.bind(self), }); - return renameDef; - }).then(function (newName) { - // Rename the page with the user's choice + return confirmDef; + }).then(function () { + // Delete the page if the user confirmed return self._rpc({ - model: 'website', - method: 'rename_page', - args: [moID, newName], + model: 'website.page', + method: 'delete_page', + args: [pageId], context: context, }); - }).then(function (newTechnicalName) { - // Redirects to the new renamed page - window.location.href = ('/page/' + encodeURIComponent(newTechnicalName)); + }).then(function () { + window.location.reload(true); }, def.reject.bind(def)); - - return def; }, }); + websiteNavbarData.websiteNavbarRegistry.add(ContentMenu, '#content-menu'); +websiteRootData.websiteRootRegistry.add(PageManagement, '#edit_website_pages'); return { + PagePropertiesDialog: PagePropertiesDialog, ContentMenu: ContentMenu, EditMenuDialog: EditMenuDialog, MenuEntryDialog: MenuEntryDialog, diff --git a/addons/website/static/src/js/menu/seo.js b/addons/website/static/src/js/menu/seo.js index 77b4d0a76e1..2a85b49bd59 100644 --- a/addons/website/static/src/js/menu/seo.js +++ b/addons/website/static/src/js/menu/seo.js @@ -375,8 +375,10 @@ var SeoConfigurator = Dialog.extend({ self.updateTable(removed); }); this.keywordList.insertAfter(this.$('.table thead')); - this.disableUnsavableFields(); - this.renderPreview(); + this.disableUnsavableFields().then(function(){ + self.renderPreview(); + }); + this.getLanguages(); this.updateTable(); }, @@ -396,7 +398,9 @@ var SeoConfigurator = Dialog.extend({ }, disableUnsavableFields: function () { var self = this; - this.loadMetaData().then(function (data) { + return this.loadMetaData().then(function (data) { + //If website.page, hide the google preview & tell user his page is currently unindexed + self.isIndexed = (data && ('website_indexed' in data)) ? data.website_indexed : true; self.canEditTitle = data && ('website_meta_title' in data); self.canEditDescription = data && ('website_meta_description' in data); self.canEditKeywords = data && ('website_meta_keywords' in data); @@ -474,6 +478,9 @@ var SeoConfigurator = Dialog.extend({ def.resolve(null); } else { var fields = ['website_meta_title', 'website_meta_description', 'website_meta_keywords']; + if (obj.model == 'website.page'){ + fields.push('website_indexed'); + } rpc.query({ model: obj.model, method: 'read', @@ -521,11 +528,20 @@ var SeoConfigurator = Dialog.extend({ }); }, renderPreview: function () { - var preview = new Preview(this, { - title: this.htmlPage.title(), - description: this.htmlPage.description(), - url: this.htmlPage.url(), - }); + var indexed = this.isIndexed; + var preview = ""; + if(indexed){ + preview = new Preview(this, { + title: this.htmlPage.title(), + description: this.htmlPage.description(), + url: this.htmlPage.url(), + }); + } + else{ + preview = new Preview(this, { + description: _("You have hidden this page from search results. It won't be indexed by search engine"), + }); + } var $preview = this.$('.js_seo_preview'); $preview.empty(); preview.appendTo($preview); diff --git a/addons/website/static/src/js/tours/rte.js b/addons/website/static/src/js/tours/rte.js index 35e7ad55bc4..c0119aec2a4 100644 --- a/addons/website/static/src/js/tours/rte.js +++ b/addons/website/static/src/js/tours/rte.js @@ -65,7 +65,7 @@ tour.register('rte_translator', { trigger: 'html:not(:has(#wrap p span)) .o_menu_systray a[data-action="translate"]', }, { content: "close modal", - trigger: '.modal-footer .btn-primary', + trigger: '.modal-footer .btn-default', }, { content: "check if translation is activate", trigger: '[data-oe-translation-id]', @@ -85,7 +85,7 @@ tour.register('rte_translator', { }, }, { content: "click on input", - trigger: 'input:first', + trigger: '#wrap input:first', extra_trigger: '#wrap .o_dirty font:first:contains(translated french text)', run: 'click', }, { diff --git a/addons/website/static/src/js/utils.js b/addons/website/static/src/js/utils.js index 40a4033540d..e7f76376480 100644 --- a/addons/website/static/src/js/utils.js +++ b/addons/website/static/src/js/utils.js @@ -7,7 +7,7 @@ var weContext = require('web_editor.context'); var qweb = core.qweb; /** - * Allows the given input to propose existing website pages. + * Allows the given input to propose existing website URLs. * * @param {ServicesMixin|Widget} self - an element capable to trigger an RPC * @param {jQuery} $input @@ -25,7 +25,12 @@ function autocompleteWithPages(self, $input) { }, }).then(function (exists) { var rs = _.map(exists, function (r) { - return r.loc; + if (show_only_website_page_model) { + return r.loc + ' (' + r.name + ')'; + } + else { + return r.loc; + } }); response(rs); }); diff --git a/addons/website/static/src/less/website.ui.components.less b/addons/website/static/src/less/website.ui.components.less index 409d72ba366..c1381f09e99 100644 --- a/addons/website/static/src/less/website.ui.components.less +++ b/addons/website/static/src/less/website.ui.components.less @@ -451,3 +451,31 @@ body .modal { content: initial; } } + +// Pages Management +.o_page_management_info .o_switch{ + padding-top:7px; +} +#edit_website_pages{ + .fa-check{ + color: #00a09d; + } + .fa-eye-slash{ + color: #00a09d; + } + th{ + background-color: #875A7B; + color: white; + opacity:0.8; + } + td{ + a.fa{ + color:#875A7B; + opacity:0.8; + margin-left:5px; + } + .text-muted{ + opacity:0.5; + } + } +}
\ No newline at end of file diff --git a/addons/website/static/src/xml/website.contentMenu.xml b/addons/website/static/src/xml/website.contentMenu.xml index 4d3ba998ef0..a5b7590ba53 100644 --- a/addons/website/static/src/xml/website.contentMenu.xml +++ b/addons/website/static/src/xml/website.contentMenu.xml @@ -8,7 +8,7 @@ <span class="js_menu_label"> <t t-esc="submenu.name"/> </span> - <i class="pull-right fa fa-home" style="margin-top: 3px"/> + <i t-if="submenu.is_homepage" class="pull-right fa fa-home" style="margin-top: 3px"/> </span> <span class="input-group-btn"> <button type="button" class="btn btn-primary js_edit_menu fa fa-pencil-square-o"/> @@ -54,8 +54,12 @@ <div class="form-group"> <label class="control-label col-sm-3">Link</label> <div class="col-sm-9"> - <input type="radio" name="link_menu_options" id="url" value="url" checked="checked"/> <label class="control-label mr16" for="url" >URL or Email</label> - <input type="radio" name="link_menu_options" id="new_page" value="new_page"/> <label class="control-label" for="new_page">New Page</label> + <div class="radio"> + <label class="checkbox-inline" for="new_page"><input type="radio" name="link_menu_options" id="new_page" value="new_page" checked="checked"/>New Page</label> + </div> + <div class="radio"> + <label class="checkbox-inline" for="url"><input type="radio" name="link_menu_options" id="url" value="url" />URL or Email</label> + </div> </div> </div> </t> diff --git a/addons/website/static/src/xml/website.pageProperties.xml b/addons/website/static/src/xml/website.pageProperties.xml new file mode 100644 index 00000000000..f21b0213f4e --- /dev/null +++ b/addons/website/static/src/xml/website.pageProperties.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates id="template" xml:space="preserve"> +<div t-name="website.pagesMenu.page_info" class="o_page_management_info"> + <form class="form-horizontal"> + <ul class="nav nav-tabs"> + <li class="active"><a data-toggle="tab" href="#basic_page_info">Name</a></li> + <li><a data-toggle="tab" href="#advances_page_info">Publish</a></li> + </ul> + <div class="tab-content mt16"> + <div id="basic_page_info" class="tab-pane fade in active"> + <div class="form-group"> + <label class="control-label col-sm-3" for="page_name">Page Name</label> + <div class="col-sm-9"> + <input type="text" class="form-control input-sm" id="page_name" t-att-value="widget.page.name" /> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" for="page_url">Page Url</label> + <div class="col-sm-9"> + <div class="input-group"> + <span class="input-group-addon" t-att-title="widget.serverUrl"><small><t t-esc="widget.serverUrlTrunc" /></small></span> + <input type="text" class="form-control input-sm" id="page_url" t-att-value="widget.page.url" /> + </div> + </div> + </div> + <div class="form-group ask_for_redirect"> + <label class="control-label col-sm-3" for="is_homepage">Redirect old url</label> + <div class="col-sm-2"> + <a> + <label class="o_switch" for="create_redirect" > + <input type="checkbox" id="create_redirect"/> + <span/> + </label> + </a> + </div> + <div class="col-sm-7 mt4"> + <span class="text-muted" id="dependencies_redirect"></span> + </div> + </div> + <div class="form-group ask_for_redirect"> + <label class="control-label col-sm-3 redirect_type" for="redirect_type">Type</label> + <div class="col-sm-6 redirect_type"> + <select class="form-control" id="redirect_type"> + <option t-foreach="widget.fields.type.selection" t-as="field" t-att-value="field[0]"><t t-esc="field[0] + ': ' + field[1]" /></option> + </select> + </div> + </div> + </div> + <div id="advances_page_info" class="tab-pane fade"> + <div class="form-group"> + <label class="control-label col-sm-3" for="is_menu">Show in top menu</label> + <div class="col-sm-2"> + <a> + <label class="o_switch" for="is_menu" > + <input type="checkbox" t-att-checked="widget.page.menu_ids.length > 0 ? true : undefined" id="is_menu"/> + <span/> + </label> + </a> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" for="is_homepage">Use as homepage</label> + <div class="col-sm-2"> + <a> + <label class="o_switch" for="is_homepage" > + <input type="checkbox" t-att-checked="widget.page.is_homepage ? true : undefined" id="is_homepage"/> + <span/> + </label> + </a> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" for="is_indexed"> + Indexed + <i class="fa fa-question-circle-o" title="Hide this page from search results" aria-hidden="true"></i> + </label> + <div class="col-sm-2"> + <a> + <label class="o_switch" for="is_indexed" > + <input type="checkbox" t-att-checked="widget.page.website_indexed ? true : undefined" id="is_indexed"/> + <span/> + </label> + </a> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" for="is_published">Publish</label> + <div class="col-sm-2"> + <a> + <label class="o_switch js_publish_btn" for="is_published" > + <input type="checkbox" t-att-checked="widget.page.website_published ? true : undefined" id="is_published"/> + <span/> + </label> + </a> + </div> + </div> + <div class="form-group"> + <label class="control-label col-sm-3" for="date_publish">Publishing Date</label> + <div class="col-sm-9"> + <div class='input-group date' id='date_publish_container'> + <input type='text' class="form-control" name="date_publish" id="date_publish" /> + <span class="input-group-addon"> + <span class="fa fa-calendar"></span> + </span> + </div> + </div> + </div> + </div> + </div> + </form> +</div> +</templates> diff --git a/addons/website/static/src/xml/website.seo.xml b/addons/website/static/src/xml/website.seo.xml index a3018720515..7afd4ad32e9 100644 --- a/addons/website/static/src/xml/website.seo.xml +++ b/addons/website/static/src/xml/website.seo.xml @@ -11,7 +11,7 @@ <div class="col-md-6"> <div class="form-horizontal mt16" role="form"> <div class="form-group"> - <label for="seo_page_title" class="col-xs-3 control-label">Page title</label> + <label for="seo_page_title" class="col-xs-3 control-label">Page Title</label> <div class="col-xs-9"> <input type="text" name="seo_page_title" class="form-control" maxlength="70" size="70"/> </div> |
