diff options
| author | Fabien Meghazi <fme@openerp.com> | 2013-12-02 13:57:23 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2013-12-02 13:57:23 +0100 |
| commit | d376bd55ca0badc53faec7a89d37b045c579b032 (patch) | |
| tree | b915c39c0654384f6890473fb323ff263aee3cf9 | |
| parent | a5ed3f8b423bb7b6505528f49d98e4a01478e8c1 (diff) | |
[IMP] url slug in templates
bzr revid: fme@openerp.com-20131202125723-aw66fidrinaolgyo
8 files changed, 34 insertions, 34 deletions
diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index 86f212f2310..958f29c770a 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -52,7 +52,7 @@ <t t-foreach="blogs" t-as="blog"> <div class="col-md-4"> <h4> - <a t-href="/blogpost/#{blog.id}?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a> + <a t-href="/blogpost/#{ slug(blog) }?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a> <span t-if="not blog.website_published" class="text-warning"> &nbsp; <span class="icon-warning-sign" title="Not published"/> @@ -61,7 +61,7 @@ <div class="text-muted"> <span class="icon-calendar"> <span t-field="blog.create_date"/> &nbsp;</span> <span class="icon-folder-open"> In - <a t-href="/blog//#{blog.category_id.id}"> + <a t-href="/blog/#{ slug(blog.category_id) }"> <span t-field="blog.category_id"/> </a> &nbsp; </span> @@ -74,7 +74,7 @@ </div> <div class="text-muted" t-if="len(blog.message_ids) > 0"> <span class="icon-comment"> - <a t-href="/blogpost/#{blog.id}/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}#comment"> + <a t-href="/blogpost/#{ slug(blog) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}#comment"> <t t-if="len(blog.message_ids) <= 1" ><t t-esc="len(blog.message_ids)"/> comment</t> <t t-if="len(blog.message_ids) > 1"><t t-esc="len(blog.message_ids)"/> comments</t> </a> @@ -109,12 +109,12 @@ <t t-foreach="blog_posts" t-as="blog_post"> <div t-att-data-publish="blog_post.website_published and 'on' or 'off'"> <h2 class="text-center"> - <a t-href="/blogpost/#{blog_post.id}/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a> + <a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a> </h2> <p class="post-meta text-muted text-center" name='blog_post_data'> <span class="icon-calendar"> <span t-field="blog_post.create_date"/> &nbsp;</span> <span t-if="len(blog_post.message_ids) > 0" class="icon-comment"> - <a t-href="/blogpost/#{blog_post.id}/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}#comment"> + <a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}#comment"> <t t-if="len(blog_post.message_ids) <= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t> <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t> </a> @@ -144,7 +144,7 @@ <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)"> <span class="icon-tags"/> <t t-foreach="blog_post.tag_ids" t-as="tag"> - <a t-href="/blog/#{ category.id }/tag/#{tag.id}" t-esc="tag.name"/> &nbsp; + <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &nbsp; </t> </p> </xpath> @@ -157,10 +157,10 @@ <div class="row"> <div class="col-sm-9"> <ol class="breadcrumb"> - <li><a t-href="/blog/#{category.id}"><span t-field="category.name"/></a></li> - <li t-if="tag"><a t-href="/blog/#{ category.id }/tag/#{tag.id}"><span t-field="tag.name"/></a></li> - <li t-if="tag and date"><a t-href="/blog/#{ category.id }/tag/#{tag.id}/date/#{ date }" t-esc="date_name"/></li> - <li t-if="not tag and date"><a t-href="/blog/#{ category.id }/date/#{ date }" t-esc="date_name"/></li> + <li><a t-href="/blog/#{ slug(category) }"><span t-field="category.name"/></a></li> + <li t-if="tag"><a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }"><span t-field="tag.name"/></a></li> + <li t-if="tag and date"><a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }/date/#{ date }" t-esc="date_name"/></li> + <li t-if="not tag and date"><a t-href="/blog/#{ slug(category) }/date/#{ date }" t-esc="date_name"/></li> <li class="active"><span t-field="blog_post.name"/></li> </ol> </div><div class="col-sm-3"> @@ -255,7 +255,7 @@ <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)"> <span class="icon-tags"/> <t t-foreach="blog_post.tag_ids" t-as="tag"> - <a t-href="/blog/#{ category.id }/tag/#{tag.id}" t-esc="tag.name"/> &nbsp; + <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &nbsp; </t> </p> </xpath> @@ -291,7 +291,7 @@ <ul class="nav nav-pills nav-stacked"> <t t-foreach="tags" t-as="tag_id"> <li t-att-class="tag and tag_id.id == tag.id and 'active' or None" style="display: inline-block;"> - <a t-href="/blog/#{ category.id }/tag/#{ tag_id.id }"><span t-field="tag_id.name"/></a> + <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag_id) }"><span t-field="tag_id.name"/></a> </li> </t> </ul> @@ -311,7 +311,7 @@ <ul class="nav nav-pills nav-stacked"> <t t-foreach="nav_list" t-as="months"> <li t-att-class="months['date'] == date and 'active' or None"> - <a t-ignore="True" t-href="/blog/#{ category.id }/#{ tag and 'tag/%s/' % tag.id or '' }date/#{ months['date'] }"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a> + <a t-ignore="True" t-href="/blog/#{ slug(category) }/#{ tag and 'tag/%s/' % slug(tag) or '' }date/#{ months['date'] }"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a> </li> </t> </ul> @@ -381,7 +381,7 @@ <ul class="nav nav-pills nav-stacked"> <t t-foreach="categories" t-as="nav_category"> <li t-att-class="nav_category.id == category.id and 'active' or ''"> - <a t-href="/blog/#{nav_category.id}"> + <a t-href="/blog/#{ slug(nav_category) }"> <span t-field="nav_category.name"/> </a> </li> diff --git a/addons/website_customer/views/website_customer.xml b/addons/website_customer/views/website_customer.xml index 1752a3b37ba..818d249196c 100644 --- a/addons/website_customer/views/website_customer.xml +++ b/addons/website_customer/views/website_customer.xml @@ -41,12 +41,12 @@ <div class="row"> <t t-foreach="partner_ids" t-as="partner" class="media"> <div class="col-md-2"> - <a t-href="/customers/#{ partner.id }/"> + <a t-href="/customers/#{ slug(partner) }/"> <img class="img img-thumbnail" t-att-src="partner.img('image_medium')"/> </a> </div><div class="col-md-10"> <h4> - <a t-href="/customers/#{ partner.id }/" t-field="partner.name"/> + <a t-href="/customers/#{ slug(partner) }/" t-field="partner.name"/> </h4> <div t-field="partner.website_short_description"/> </div> diff --git a/addons/website_customer_crm_partner_assign/views/website_customer.xml b/addons/website_customer_crm_partner_assign/views/website_customer.xml index 54c4632997d..95de94c1167 100644 --- a/addons/website_customer_crm_partner_assign/views/website_customer.xml +++ b/addons/website_customer_crm_partner_assign/views/website_customer.xml @@ -27,7 +27,7 @@ </div> </address> <div> - <a t-href="/customers/#{ partner.id }#references" t-if="partner.implemented_partner_ids"> + <a t-href="/customers/#{ slug(partner) }#references" t-if="partner.implemented_partner_ids"> <t t-esc="len(partner.implemented_partner_ids)"/> references </a> </div> @@ -43,11 +43,11 @@ <div> <div t-foreach="partner.implemented_partner_ids" t-as="partner" class="media thumbnail"> <t t-call="website.publish_management"><t t-set="object" t-value="partner"/></t> - <a class="pull-left" t-attf-href="/customers/#{ partner.id }/"> + <a class="pull-left" t-href="/customers/#{ slug(partner) }/"> <img class="media-object" t-att-src="partner.img('image_small')"/> </a> <div class="media-body" style="min-height: 64px;"> - <a class="media-heading" t-attf-href="/customers/#{ partner.id }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a> + <a class="media-heading" t-href="/customers/#{ slug(partner) }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a> <div t-field="partner.website_short_description"/> </div> </div> diff --git a/addons/website_event/views/website_event.xml b/addons/website_event/views/website_event.xml index ce27e7f528b..8b60165efaa 100644 --- a/addons/website_event/views/website_event.xml +++ b/addons/website_event/views/website_event.xml @@ -72,7 +72,7 @@ </span> </t> <h4 class="media-heading"> - <a t-href="/event/#{ event.id }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a> + <a t-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a> <small t-if="not event.website_published" class="label label-danger">not published</small> </h4> <div> diff --git a/addons/website_event_track/views/website_event.xml b/addons/website_event_track/views/website_event.xml index e1ad25a5a17..10ba00770a4 100644 --- a/addons/website_event_track/views/website_event.xml +++ b/addons/website_event_track/views/website_event.xml @@ -59,10 +59,10 @@ <div class="col-md-3 css_noprint"> <ul class="nav nav-pills nav-stacked"> - <li t-att-class="'' if searches.get('tag') else 'active'"><a t-href="/event/#{ event.id }/track/">All</a></li> + <li t-att-class="'' if searches.get('tag') else 'active'"><a t-href="/event/#{ slug(event) }/track/">All</a></li> <t t-foreach="tags" t-as="tag"> <li t-att-class="searches.get('tag') == tag.id and 'active' or ''"> - <a t-href="/event/#{ event.id }/track/tag/#{ tag.id }"> + <a t-href="/event/#{ slug(event) }/track/tag/#{ slug(tag) }"> <t t-esc="tag.name"/> </a> </li> @@ -75,7 +75,7 @@ <li t-foreach="tracks" t-as="track" class="media"> <div class="media-body"> <h4 class="media-heading"> - <a t-href="/event/#{ event.id }/track/#{track.id}"><span t-field="track.name"> </span></a> + <a t-href="/event/#{ slug(event) }/track/#{ slug(track) }"><span t-field="track.name"> </span></a> <span t-field="track.date"/> <!-- <small t-if="not track.website_published" class="label label-danger">not published</small> --> </h4> diff --git a/addons/website_hr_recruitment/views/website_hr_recruitment.xml b/addons/website_hr_recruitment/views/website_hr_recruitment.xml index 7b9754b28ad..40b40ce1795 100644 --- a/addons/website_hr_recruitment/views/website_hr_recruitment.xml +++ b/addons/website_hr_recruitment/views/website_hr_recruitment.xml @@ -59,7 +59,7 @@ <li t-foreach="jobs" t-as="job" class="media"> <div class="media-body" t-att-data-publish="job.website_published and 'on' or 'off'"> <h3 class="media-heading"> - <a t-href="/job/detail/#{ job.id }/"> + <a t-href="/job/detail/#{ slug(job) }/"> <span t-field="job.name"/> </a> <small t-if="job.no_of_recruitment > 1"> @@ -240,7 +240,7 @@ <li t-att-class=" '' if active else 'active' "><a href="/jobs">All Departments</a></li> <t t-foreach="departments" t-as="department"> <li t-att-class="department.id == active and 'active' or ''"> - <a t-href="/jobs/department/#{ department.id }/" ><span t-field="department.name"/></a> + <a t-href="/jobs/department/#{ slug(department) }/" ><span t-field="department.name"/></a> </li> </t> </ul> @@ -256,7 +256,7 @@ <li t-att-class=" '' if office else 'active' "><a href="/jobs">All Offices</a></li> <t t-foreach="offices" t-as="thisoffice"> <li t-att-class="thisoffice.id == office and 'active' or ''"> - <a t-href="/jobs/office/#{ thisoffice.id }/" > + <a t-href="/jobs/office/#{ slug(thisoffice) }/" > <span t-field="thisoffice.city"/><t t-if="thisoffice.country_id">, <span t-field="thisoffice.country_id.name"/> </t> diff --git a/addons/website_membership/views/website_membership.xml b/addons/website_membership/views/website_membership.xml index 6a0b03aacf5..c28498c7e55 100644 --- a/addons/website_membership/views/website_membership.xml +++ b/addons/website_membership/views/website_membership.xml @@ -64,11 +64,11 @@ <t t-call="website.publish_management"> <t t-set="object" t-value="partner"/> </t> - <a class="pull-left" t-href="/members/#{ partner.id }/"> + <a class="pull-left" t-href="/members/#{ slug(partner) }/"> <img class="media-object" t-att-src="partner.img('image_small')"/> </a> <div class="media-body" style="min-height: 64px;"> - <a class="media-heading" t-href="/members/#{ partner.id }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a> + <a class="media-heading" t-href="/members/#{ slug(partner) }/"><span t-field="partner.parent_id"/> <span t-field="partner.name"/></a> <div t-field="partner.website_short_description"/> </div> </div> diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index 1c2af44a9e9..13af89ea937 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -46,7 +46,7 @@ <div class="ribbon"><span contentEditable="true">Promo</span></div> </div> <div class="oe_product_description"> - <a t-href="/shop/product/#{ product.id }/" t-keep-query="category,search,filter_domain"> + <a t-href="/shop/product/#{ slug(product) }/" t-keep-query="category,search,filter_domain"> <b t-field="product.name"/> </a> </div> @@ -330,7 +330,7 @@ <div class='mt16 text-center'> <span t-field="product.image_small"/> <h5> - <a t-href="/shop/product/#{ product.id }/" + <a t-href="/shop/product/#{ slug(product) }/" style="display: block"> <span t-field='product.name' style="display: block"/> @@ -401,7 +401,7 @@ </td> <td t-if="line.product_id.product_tmpl_id"> <div> - <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"> + <a t-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }/"> <strong t-field="line.product_id.name"/> </a> </div> @@ -570,14 +570,14 @@ <tr t-foreach="suggested_products" t-as="product"> <td> - <a t-href="/shop/product/#{ product.product_tmpl_id.id }/"> + <a t-href="/shop/product/#{ slug(product.product_tmpl_id) }/"> <span t-field="product.image_small" t-field-options='{"widget": "image", "class": "img-rounded"}'/> </a> </td> <td> <div> - <a t-href="/shop/product/#{ product.product_tmpl_id.id }/"> + <a t-href="/shop/product/#{ slug(product.product_tmpl_id) }/"> <strong t-field="product.name"/> </a> </div> @@ -817,7 +817,7 @@ <tr t-foreach="website_sale_order.order_line" t-as="line"> <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td> <td t-if="line.product_id.product_tmpl_id"> - <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"> + <a t-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }/"> <span t-field="line.product_id.image_small" t-field-options='{"widget": "image", "class": "img-rounded"}'/> </a> |
