[IMP] website: pageManagement - improvements according to first feedbacks
- labelling and screen redesign (update labels, hide labels, hide fields, ...) - make UI more mobile friendly (icon biggest, color using less variables,...) - Page & Redirection menu are for visible only in debug mode - Add meta noindex for website.page not shown in sitemap - Add mechanism to be able to edit in backend a broken view (Needed for - Internal Error 500, css, js file, ...) - website pagemanager dedicated to website_publisher only
This commit is contained in:
@@ -247,7 +247,7 @@ Dialog.confirm = function (owner, message, options) {
|
||||
*/
|
||||
Dialog.safeConfirm = function (owner, message, options) {
|
||||
var $checkbox = dom.renderCheckbox({
|
||||
text: options && options.securityMessage || _t("I am sure about this"),
|
||||
text: options && options.securityMessage || _t("I am sure about this."),
|
||||
}).addClass('mb0');
|
||||
var $securityCheck = $('<div/>', {
|
||||
class: 'alert alert-' + (options && options.securityLevel || 'warning') + ' mt8 mb0',
|
||||
|
||||
@@ -207,6 +207,10 @@ class Website(Home):
|
||||
|
||||
@http.route(['/website/pages', '/website/pages/page/<int:page>'], type='http', auth="user", website=True)
|
||||
def pages_management(self, page=1, sortby='name', search='', **kw):
|
||||
# only website_designer should access the page Management
|
||||
if not request.env.user.has_group('website.group_website_designer'):
|
||||
raise werkzeug.exceptions.NotFound()
|
||||
|
||||
Page = request.env['website.page']
|
||||
searchbar_sortings = {
|
||||
'url': {'label': _('Sort by Url'), 'order': 'url'},
|
||||
|
||||
@@ -267,6 +267,8 @@ var MenuEntryDialog = widget.LinkDialog.extend({
|
||||
this.$('label[for="o_link_dialog_label_input"]').text(_t("Menu Label"));
|
||||
if (this.menu_link_options) { // add menu link option only when adding new menu
|
||||
this.$('#o_link_dialog_label_input').closest('.form-group').after(qweb.render('website.contentMenu.dialog.edit.link_menu_options'));
|
||||
// remove the label that is automatically added before
|
||||
this.$('#o_link_dialog_url_input').parent().siblings().html('');
|
||||
this.$('input[name=link_menu_options]').on('change', function () {
|
||||
self.$('#o_link_dialog_url_input').closest('.form-group').toggle();
|
||||
});
|
||||
|
||||
@@ -25,12 +25,7 @@ function autocompleteWithPages(self, $input) {
|
||||
},
|
||||
}).then(function (exists) {
|
||||
var rs = _.map(exists, function (r) {
|
||||
if (show_only_website_page_model) {
|
||||
return r.loc + ' (' + r.name + ')';
|
||||
}
|
||||
else {
|
||||
return r.loc;
|
||||
}
|
||||
return r.loc;
|
||||
});
|
||||
response(rs);
|
||||
});
|
||||
|
||||
@@ -454,7 +454,7 @@ body .modal {
|
||||
|
||||
// Pages Management
|
||||
.o_page_management_info .o_switch{
|
||||
padding-top:7px;
|
||||
padding-top: 7px;
|
||||
}
|
||||
#edit_website_pages{
|
||||
.fa-check{
|
||||
@@ -464,18 +464,16 @@ body .modal {
|
||||
color: #00a09d;
|
||||
}
|
||||
th{
|
||||
background-color: #875A7B;
|
||||
background-color: @odoo-brand-primary;
|
||||
color: white;
|
||||
opacity:0.8;
|
||||
}
|
||||
td{
|
||||
a.fa{
|
||||
color:#875A7B;
|
||||
opacity:0.8;
|
||||
margin-left:5px;
|
||||
color: @odoo-brand-primary;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.text-muted{
|
||||
opacity:0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@
|
||||
<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>
|
||||
<label class="checkbox-inline" for="url"><input type="radio" name="link_menu_options" id="url" value="url" />Existing Page, URL or Email</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3" for="page_url">Page Url</label>
|
||||
<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>
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group ask_for_redirect">
|
||||
<label class="control-label col-sm-3" for="is_homepage">Redirect old url</label>
|
||||
<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" >
|
||||
@@ -48,7 +48,7 @@
|
||||
</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>
|
||||
<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" >
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3" for="is_homepage">Use as homepage</label>
|
||||
<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" >
|
||||
|
||||
@@ -203,4 +203,18 @@
|
||||
parent="menu_website_global_configuration"
|
||||
groups="base.group_system"/>
|
||||
|
||||
<menuitem name="Pages"
|
||||
id="menu_website_pages_list"
|
||||
action="action_website_pages_list"
|
||||
parent="menu_website_global_configuration"
|
||||
sequence="20"
|
||||
groups="base.group_no_one"/>
|
||||
|
||||
<menuitem name="Redirects"
|
||||
id="menu_website_redirect_list"
|
||||
action="action_website_redirect_list"
|
||||
parent="menu_website_global_configuration"
|
||||
sequence="30"
|
||||
groups="base.group_no_one"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -116,6 +116,8 @@
|
||||
</xpath>
|
||||
<xpath expr="//t[@t-set='head_website']" position="replace">
|
||||
<t t-set="head_website">
|
||||
<meta t-if="main_object and 'website_indexed' in main_object
|
||||
and not main_object.website_indexed" name="robots" content="noindex"/>
|
||||
<meta name="description" t-att-content="main_object and 'website_meta_description' in main_object
|
||||
and main_object.website_meta_description or website_meta_description"/>
|
||||
<meta name="keywords" t-att-content="main_object and 'website_meta_keywords' in main_object
|
||||
@@ -859,7 +861,7 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h3 class="mt16">Pages Management</h3>
|
||||
<h3 class="mt16">Manage your custom pages</h3>
|
||||
<t t-if="not pages">
|
||||
<div t-if="search" class="alert alert-warning mt8" role="alert">
|
||||
Your search '<t t-esc="search" />' did not match any pages.
|
||||
@@ -877,21 +879,22 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
<th class="col-md-1 text-center"><i title="Is the page included in the main menu?" class="fa fa-thumb-tack" aria-hidden="true"></i></th>
|
||||
<th class="col-md-1 text-center"><i title="Is the page published?" class="fa fa-eye" aria-hidden="true"></i></th>
|
||||
<th class="col-md-1 text-center"><i title="Is the page indexed by search engines?" class="fa fa-globe" aria-hidden="true"></i></th>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-sm-3 col-md-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<t t-foreach="pages" t-as="page">
|
||||
<tr>
|
||||
<td><i t-if="page.is_homepage" class="fa fa-home"></i> <span style="word-break: break-all;" t-esc="page.name"/></td>
|
||||
<td><a style="word-break: break-all;" t-attf-href="{{page.url}}"><t t-esc="page.url"/></a></td>
|
||||
<td style="text-align:center"><i t-att-class="'fa fa-check' if page.menu_ids else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td class="text-center"><i t-att-class="'fa fa-check' if page.menu_ids else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<t t-set='date_formatted'><t t-options='{"widget": "date"}' t-esc="page.date_publish"/></t>
|
||||
<td style="text-align:center"><i t-att-title="not page.is_visible and page.website_published and 'This page will be visible on ' + date_formatted" t-att-class="'fa fa-check' if page.is_visible and page.website_published else 'fa fa-eye-slash' if not page.is_visible and page.website_published else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td style="text-align:center"><i t-att-class="'fa fa-check' if page.website_indexed else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td>
|
||||
<a class="fa fa-cog js_page_properties" t-att-data-id="page.id" href="#" title="Manage this page"></a>
|
||||
<a class="fa fa-clone js_clone_page" t-att-data-id="page.id" href="#" title="Clone this page"></a>
|
||||
<a class="fa fa-trash js_delete_page" t-att-data-id="page.id" href="#" title="Delete this page"></a>
|
||||
<td class="text-center"><i t-att-title="not page.is_visible and page.website_published and 'This page will be visible on ' + date_formatted" t-att-class="'fa fa-check' if page.is_visible and page.website_published else 'fa fa-eye-slash' if not page.is_visible and page.website_published else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td class="text-center"><i t-att-class="'fa fa-check' if page.website_indexed else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td class="text-right">
|
||||
<a class="mr4 fa fa-lg fa-cog js_page_properties" t-att-data-id="page.id" href="#" title="Manage this page"></a>
|
||||
<a class="mr4 fa fa-lg fa-pencil-square-o" t-attf-href="/web#id=#{page.ir_ui_view_id.id}&view_type=form&model=ir.ui.view" title="Edit page content in backend"></a>
|
||||
<a class="mr4 fa fa-lg fa-clone js_clone_page" t-att-data-id="page.id" href="#" title="Clone this page"></a>
|
||||
<a class="fa fa-lg fa-trash js_delete_page" t-att-data-id="page.id" href="#" title="Delete this page"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
@@ -109,12 +109,6 @@
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Redirects"
|
||||
id="menu_website_redirect_list"
|
||||
action="action_website_redirect_list"
|
||||
parent="website.menu_website_configuration"
|
||||
groups="base.group_system"/>
|
||||
|
||||
<!-- website.page views -->
|
||||
<record id="website_pages_form_view" model="ir.ui.view">
|
||||
<field name="name">website.page.form</field>
|
||||
@@ -134,7 +128,8 @@
|
||||
<field name="date_publish"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="website_ids"/>
|
||||
<field groups="base.group_no_one" name="website_ids"/>
|
||||
<label string="Related Menu Items"/>
|
||||
<field name="menu_ids"/>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -166,12 +161,6 @@
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Pages"
|
||||
id="menu_website_pages_list"
|
||||
action="action_website_pages_list"
|
||||
parent="website.menu_website_configuration"
|
||||
groups="base.group_system"/>
|
||||
|
||||
<!-- website.menu views -->
|
||||
<record id="action_website_menu" model="ir.actions.act_window">
|
||||
<field name="name">Website Menu</field>
|
||||
|
||||
@@ -58,7 +58,7 @@ odoo.define("website_sale.tour_shop", function (require) {
|
||||
trigger: ".js_publish_management .js_publish_btn .css_publish",
|
||||
extra_trigger: "body:not(.editor_enable)",
|
||||
content: _t("Click on this button so your customers can see it."),
|
||||
position: "top",
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: ".o_main_navbar .o_menu_toggle, #oe_applications .dropdown.full",
|
||||
content: _t("Let's now take a look at your administration dashboard to get your eCommerce website ready in no time."),
|
||||
|
||||
Reference in New Issue
Block a user