[IMP] website: improving rename dialog
This commit is contained in:
committed by
qsm-odoo
parent
821d2edf04
commit
3ff7f12bb7
@@ -301,12 +301,12 @@ class website(osv.osv):
|
||||
for page in View.browse(cr, uid, pages, context=context):
|
||||
if page.page:
|
||||
dep[page_key].append({
|
||||
'text': _('Page <b>%s</b> seems to have a link to this page !') % page.key,
|
||||
'text': _('Page <b>%s</b> contains a link to this page') % page.key,
|
||||
'link': '/page/%s' % page.key
|
||||
})
|
||||
else:
|
||||
dep[page_key].append({
|
||||
'text': _('Template <b>%s (id:%s)</b> seems to have a link to this page !') % (page.key, page.id),
|
||||
'text': _('Template <b>%s (id:%s)</b> contains a link to this page') % (page.key, page.id),
|
||||
'link': '#'
|
||||
})
|
||||
|
||||
@@ -322,7 +322,7 @@ class website(osv.osv):
|
||||
dep[menu_key] = []
|
||||
for menu in Menu.browse(cr, uid, menus, context=context):
|
||||
dep[menu_key].append({
|
||||
'text': _('Menu <b>%s</b> seems to have a link to this page !') % menu.name,
|
||||
'text': _('This page is in the menu <b>%s</b>') % menu.name,
|
||||
'link': False
|
||||
})
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ var TopBarContent = Widget.extend({
|
||||
}).then(function (deps) {
|
||||
website.prompt({
|
||||
id: "editor_rename_page",
|
||||
window_title: _t("Rename Page"),
|
||||
window_title: _t("Rename This Page"),
|
||||
dependencies: deps,
|
||||
}, 'website.rename_page').then(function (val, field, $dialog) {
|
||||
ajax.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
|
||||
@@ -59,40 +59,28 @@
|
||||
</t>
|
||||
|
||||
<t t-name="website.dependencies">
|
||||
<div class="alert alert-warning alert-dismissible fade in mt16" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<strong>Be careful !</strong> Some dependencies can exist ...
|
||||
</div>
|
||||
<t t-if="dependencies">
|
||||
<p class="text-warning">
|
||||
<strong>Warning!</strong> Don't forget to update all links referring to this page:
|
||||
</p>
|
||||
<t t-set='tid' t-value='0'/>
|
||||
<t t-foreach="_.keys(dependencies)" t-as="type">
|
||||
<div class="panel-group" role="tablist">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" role="tab" >
|
||||
<h4 class="panel-title">
|
||||
<a class="collapsed" data-toggle="collapse" t-att-href="'#collapseDependencies'+tid" aria-expanded="false" t-att-aria-controls="'collapseDependencies'+tid">
|
||||
<t t-esc="type"/>
|
||||
<div t-foreach="_.keys(dependencies)" t-as="type" class="mb16">
|
||||
<a class="collapsed fa fa-caret-right" data-toggle="collapse" t-att-href="'#collapseDependencies'+tid" aria-expanded="false" t-att-aria-controls="'collapseDependencies'+tid">
|
||||
<t t-esc="type"/>:&nbsp;
|
||||
<span class="text-muted"><t t-esc="dependencies[type].length"/> found(s)</span>
|
||||
</a>
|
||||
<div t-att-id="'collapseDependencies'+tid" class="collapse" aria-expanded="false" >
|
||||
<ul>
|
||||
<li t-foreach="dependencies[type]" t-as="error">
|
||||
<a t-if="!_.contains(['', '#', false,], error.link)" t-att-href="error.link">
|
||||
<t t-raw="error.text"/>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div t-att-id="'collapseDependencies'+tid" class="panel-collapse collapse in" role="tabpanel" aria-expanded="false" >
|
||||
<ul class="list-group">
|
||||
<t t-foreach="dependencies[type]" t-as="error">
|
||||
<li class="list-group-item">
|
||||
<i class='fa fa-share fa-flip-vertical'/>
|
||||
<a t-if="!_.contains(['', '#', false,], error.link)" t-att-href="error.link">
|
||||
<t t-raw="error.text"/>
|
||||
</a>
|
||||
<t t-if="_.contains(['', '#', false,], error.link)" t-raw="error.text"/>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
<div class="panel-footer">Reference(s) found: <t t-esc="dependencies[type].length"/></div>
|
||||
</div>
|
||||
</div>
|
||||
<t t-if="_.contains(['', '#', false,], error.link)" t-raw="error.text"/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<t t-set='tid' t-value='tid+1'/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="website.delete_page">
|
||||
@@ -112,11 +100,11 @@
|
||||
<t t-call="website.modal_base">
|
||||
<t t-call="website.dependencies" />
|
||||
<div class="row">
|
||||
<form class="form-horizontal col-sm-offset-2 col-sm-8 alert alert-info" role="form" t-att-id="id">
|
||||
<div class="form-group" >
|
||||
<label for="new_name" class="control-label col-sm-4">New name</label>
|
||||
<form class="form-horizontal alert alert-info" role="form" t-att-id="id">
|
||||
<div class="form-group mb0" >
|
||||
<label for="new_name" class="control-label col-sm-4">Rename Page To:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" id="new_name" placeholder="New Name" />
|
||||
<input type="text" class="form-control" id="new_name" placeholder="e.g. About Us" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user