From d32ece09dba0c083c2ea8b92c2728c290dffb241 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 29 Nov 2013 17:14:34 +0100 Subject: [PATCH] [IMP] website_blog: change url paths bzr revid: chm@openerp.com-20131129161434-rsnklmcz1g9b1cc0 --- addons/website_blog/controllers/main.py | 28 +++++++-------- .../website_blog/data/website_blog_data.xml | 4 +-- .../static/src/js/website.tour.blog.js | 2 +- .../static/src/js/website_blog.editor.js | 2 +- .../views/website_blog_templates.xml | 34 +++++++++---------- addons/website_event_track/models/event.py | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 652073c6b5e..401fd3ce4b2 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -67,14 +67,14 @@ class WebsiteBlog(http.Controller): }) @website.route([ - '/blog/cat//', - '/blog/cat//page//', - '/blog/cat//tag//', - '/blog/cat//tag//page//', - '/blog/cat//date//', - '/blog/cat//date//page//', - '/blog/cat//tag//date//', - '/blog/cat//tag//date//page//', + '/blog//', + '/blog//page//', + '/blog//tag//', + '/blog//tag//page//', + '/blog//date//', + '/blog//date//page//', + '/blog//tag//date//', + '/blog//tag//date//page//', ], type='http', auth="public", multilang=True) def blog(self, category=None, tag=None, date=None, page=1, **opt): """ Prepare all values to display the blog. @@ -151,7 +151,7 @@ class WebsiteBlog(http.Controller): return request.website.render("website_blog.blog_post_short", values) @website.route([ - '/blog//', + '/blogpost//', ], type='http', auth="public", multilang=True) def blog_post(self, blog_post=None, tag=None, date=None, page=1, enable_editor=None): """ Prepare all values to display the blog. @@ -214,7 +214,7 @@ class WebsiteBlog(http.Controller): } return request.website.render("website_blog.blog_post_complete", values) - @website.route(['/blog//comment'], type='http', auth="public") + @website.route(['/blogpost//comment'], type='http', auth="public") def blog_post_comment(self, blog_post_id, **post): cr, uid, context = request.cr, request.uid, request.context if post.get('comment'): @@ -226,7 +226,7 @@ class WebsiteBlog(http.Controller): context=dict(context, mail_create_nosubcribe=True)) return werkzeug.utils.redirect(request.httprequest.referrer + "#comments") - @website.route('/blog/new', type='http', auth="public", multilang=True) + @website.route('/blogpost/new', type='http', auth="public", multilang=True) def blog_post_create(self, category_id, **post): cr, uid, context = request.cr, request.uid, request.context create_context = dict(context, mail_create_nosubscribe=True) @@ -237,9 +237,9 @@ class WebsiteBlog(http.Controller): 'content': '', 'website_published': False, }, context=create_context) - return werkzeug.utils.redirect("/blog/%s/?enable_editor=1" % new_blog_post_id) + return werkzeug.utils.redirect("/blogpost/%s/?enable_editor=1" % new_blog_post_id) - @website.route('/blog/duplicate', type='http', auth="public") + @website.route('/blogpost/duplicate', type='http', auth="public") def blog_post_copy(self, blog_post_id, **post): """ Duplicate a blog. @@ -250,4 +250,4 @@ class WebsiteBlog(http.Controller): cr, uid, context = request.cr, request.uid, request.context create_context = dict(context, mail_create_nosubscribe=True) new_blog_post_id = request.registry['blog.post'].copy(cr, uid, blog_post_id, {}, context=create_context) - return werkzeug.utils.redirect("/blog/%s/?enable_editor=1" % new_blog_post_id) + return werkzeug.utils.redirect("/blogpost/%s/?enable_editor=1" % new_blog_post_id) diff --git a/addons/website_blog/data/website_blog_data.xml b/addons/website_blog/data/website_blog_data.xml index e16128f0697..e6fe75350d3 100644 --- a/addons/website_blog/data/website_blog_data.xml +++ b/addons/website_blog/data/website_blog_data.xml @@ -9,7 +9,7 @@ News - + 50 @@ -21,7 +21,7 @@ Website Blogs self - + diff --git a/addons/website_blog/static/src/js/website.tour.blog.js b/addons/website_blog/static/src/js/website.tour.blog.js index dd0f2b1f583..59bb70a1872 100644 --- a/addons/website_blog/static/src/js/website.tour.blog.js +++ b/addons/website_blog/static/src/js/website.tour.blog.js @@ -182,7 +182,7 @@ return (this.isCurrentStep('post-page') || this.isCurrentStep('save-changes')) && this._super(); }, trigger: function () { - return (this.resume() && this.testUrl(/^\/blog\/[0-9]+\//)) || this._super(); + return (this.resume() && this.testUrl(/^\/blogpost\/[0-9]+\//)) || this._super(); }, }); diff --git a/addons/website_blog/static/src/js/website_blog.editor.js b/addons/website_blog/static/src/js/website_blog.editor.js index 6e9a5e0682b..d63d4cf5f96 100644 --- a/addons/website_blog/static/src/js/website_blog.editor.js +++ b/addons/website_blog/static/src/js/website_blog.editor.js @@ -16,7 +16,7 @@ .call('name_search', [], { context: website.get_context() }); }, }).then(function (cat_id) { - document.location = '/blog/new?category_id=' + cat_id; + document.location = '/blogpost/new?category_id=' + cat_id; }); } }), diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index 2078c2ca663..dbfd17daf6e 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -11,7 +11,7 @@ @@ -52,7 +52,7 @@

- +   @@ -61,7 +61,7 @@
  In - +   @@ -74,7 +74,7 @@
- + comment comments @@ -109,12 +109,12 @@

- +

@@ -157,10 +157,10 @@
@@ -168,7 +168,7 @@
  • - Duplicate @@ -219,7 +219,7 @@
    -
    @@ -256,7 +256,7 @@ @@ -292,7 +292,7 @@ @@ -312,7 +312,7 @@ @@ -382,7 +382,7 @@