Commit Graph
139 Commits
Author SHA1 Message Date
Foram Shah 052dcd3ee8 [IMP] web: 'Not Archived' becomes 'Active', 'Not published' becomes 'Unpublished'
Another reason why it’s better to change ‘not archived’ into ‘active’ is
because ‘active’ is the functional name of this field in the filter list in list view.

For the rest, it’s just a better en_US way of saying it.
2016-06-14 16:23:50 +02:00
Jigar Patel 7853d0da26 [IMP] website_blog: Add published date, sort posts on this date + frontent filters
=======
Purpose
=======

For now all the views of blog posts sort them based on creation date. This creation date cannot be
changed (even with server actions). This leads to issues in several cases:

- import of old blog posts from a former system -> all the blog posts have the same date, on the website as well
- website visitors see when the blog post has been created, not published...

=============
Functional Spec
=============

Display blog post sorted by publish date in descending order. If the post has not been published yet,
the published date = creation date. When a post is unpublished and then published again, the publish
date should be updated to the last time it is published.

Add a status filter for published/not published blog posts, by default both are active (only visible
for website admin)
2016-06-06 12:56:56 +02:00
Xavier Morel bc4d10f48d [IMP] groupby domains & unformated dates
* ensure groupby domains are normalised, that's significantly more
  convenient for subsequent manipulations and combinations (e.g. OR-ing
  domains of multiple groups)
* split off "raw" groupby which provides ISO-8601 date and datetime
  ranges[0] (half-open) as values for grouped date/datetime fields

  for instance when grouping weekwise on a date field, the group
  including May 11th, 1930 would have the following value for
  the (grouped) date field: `("1930-05-05/1930-05-12", "W19 1930")`[1]

  this means callers can access the programmatic date range value
* fix website_mail_channel and website_blog to *not* go and randomly dig
  into the domains assuming a bunch of unspecified stuff about its
  formatting (such as it not being normalized)

[0] https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
[1] actual week number turns out to be locale-dependent...
2016-03-29 10:34:25 +02:00
Denis Ledoux f9efc14440 [MERGE] forward port of branch saas-6 up to cea0a80252 2015-11-02 17:24:30 +01:00
Denis Ledoux cea0a80252 [MERGE] forward port of branch 8.0 up to 90f4749 2015-10-26 15:51:51 +01:00
Nicolas Martinelli b40cb12626 [FIX] website_blog: return correct main_object
If the main object is not set, the default object used is 'ir.ui.view'.
One of the consequence is that website SEO metadata will be stored on
'ir.ui.view' instead of the correct model, in this case 'blog.blog'.
This will cause the SEO metadata to be the same for all the blogs.

opw-651898
2015-10-26 08:38:19 +01:00
Christophe Simonis 7636b510a2 [ADD] *: CSRF protection in forms and routes
* make CSRF protection the default on all non-SAFE methods
  note: there currently is no way to call a CSRF-protected endpoint
  without a form-encoded entity-body as that's the only place we get the
  CSRF token from.
* simple CSRF token generation: just use the HMAC'd session id, no
  generating a new random token per session then HMAC it
* use constant-time equal function to avoid timing attacks
* assert that a database secret is configured before hashing/validating
  the CSRF token
* opt-out database manager from CSRF: The super-admin password serves
  the purpose of a CSRF token in the database manager screens.
  There is no request database to obtain the
  secret and generate a CSRF token.
2015-10-01 01:36:50 +02:00
Jérome Maes 3c97dbf1e1 [FIX] website_blog : use website_mail mechanism to post message
Using website_mail mecanism will prevent to transform POST params into GET params when redirecting. This will reasure xmo ;)
2015-09-25 16:04:27 +02:00
Christophe Simonis 498147fbbf [FIX] point_of_sale,web,website_{blog,forum,sale}: remove useless method login_redirect() 2015-08-05 12:01:12 +02:00
Antony Lesuisse bf579ae460 [IMP] website_blog: add atom feeds 2015-08-02 00:45:02 +02:00
Christophe Matthieu 9665882fba [IMP] web_editor: adapt css, js and xml to use web_editor 2015-07-10 17:00:12 +02:00
Christophe Simonis fe92deaa1d [MERGE] forward port of branch 8.0 up to 2de301d 2015-07-07 18:13:57 +02:00
Goffin Simon 998ea74c64 [FIX] website_blog: public user comments
When the public user comments the website, he will be redirected
to the login page and his comment will be posted with his logged
user name.

opw:643412
2015-07-02 10:44:50 +02:00
Jérome Maes ea022f0d4a [FIX] website_blog, website_sale, website_quote, website_slide : fix adding comment after mail migration
The commit 4b122ad41d rename the 'type' field of mail.message into 'message_type'. The change was not applied to the adding comment feature of website module. The comments were posted but not displayed.
2015-05-04 17:17:31 +02:00
Jérome Maes 093e39bd17 [IMP] web, website_blog, website_forum, website_sale : uniformize the way to add comment by redirecting to login form (if not logged) and keep the parameters (i.e. the comment) when redirecting to the comment route. The comment route must now be GET and POST. 2015-04-03 13:29:58 +02:00
Christophe Simonis 5aba579e74 [MERGE] forward port of branch saas-6 up to 42db2db 2015-03-21 15:54:05 +01:00
Hitesh Trivedi f2987ea412 [IMP] website_blog : onboarding. The cover image of a blog post is editable (opacity, color, size, ...). Add a new tour, views improvements and new default images 2015-03-17 09:09:27 +01:00
Jeremy Kersten dd26aac66f [FIX] website_blog: check that tag exists before to slug it
Link with deleted tag will return an browseNull which don't
support slug function.
2015-03-16 23:29:52 +01:00
Jeremy Kersten bcc36c3241 [FIX] website_blog: use slug and unslug for multi-tag
It's better for SEO to have tags slugged in url
tag=1,2 => tag=website-1,functionnal-2

It allow to keep the retro-compatibility with v8 and google links.
2015-03-16 21:50:28 +01:00
Jeremy Kersten b2aa9c8429 [FIX] website_blog: duplicate blog via front end.
Traceback because id was not casted: AccessError: ('AccessError', u"Database fetch misses ids (u'1') and has extra ids (1), may be caused by a type incoherence in a previous request")
2015-02-20 16:19:34 +01:00
Christophe Simonis fa75094e6f [MERGE] forward port of branch 8.0 up to 4af53de
ignore .po and .pot changes
2015-02-03 18:47:42 +01:00
Ravi Gohil 6451a553c0 [FIX] website_blog: next post looping when last post
The next post button at the bottom of an article was stuck when getting to
the last page. A cookie storing the *all* the visited posts was used
to determine the next one according to a non-stored (so not working) and
unexpected criteria 'ranking'. Also could get articles from other blog.

Instead of this whole broken logic, simple loop through articles by classic
order and go back to first one when at the end.
Better looping algorithm can be used in master where ranking is stored.
Fixes #3097, opw 614559
2015-01-30 17:05:22 +01:00
Goffin Simon 0fd773a486 [IMP] Cleanup and refactoring of exception handling
Unify and refactor exception handling in framework and addons.

The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
 - `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
 - `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
 - `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
 - `MissingError`: raised when an operation is attempted on a record that does not exist.
 - `ValidationError`: raised when an operation violates a SQL or Python constraint.
 - All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.

All exceptions take a single message argument.

The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.

A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.

This commit introduces a more consistent policy for logging errors and warnings:
 - All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
 - All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
 - All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
2015-01-16 17:15:18 +01:00
Jérome Maes fec5306326 [FIX] website_blog : identation problem, and unused variable 2014-12-30 09:34:58 +01:00
Jérome Maes aaf37d8e87 [IMP] website_blog : allow multi tags and date filter, clean all the routes, remove group_comment from website_mail (only user and portal can post comment on blog.post, but the form is visible for all), modify the redirect controller to the login form when posting comment, and remove the description field of blog.blog 2014-12-26 16:04:29 +01:00
Fabien Pinckaers 5a14f885b2 [FIX] number of blogs by month according to blog/tags 2014-12-14 20:21:29 +01:00
Jeremy Kersten b21b32ed2e [FIX] website_blog: Show tag by blog. No interest to display all tag, anyway the search by tag is done for the current blog 2014-12-02 11:35:29 +01:00
Amit Vora 4bf9dc4078 [IMP] [FIX] website_blog: better follow mechanism. Now people following
a blog will receive notifications only for published posts. They
will not receive all comments of all posts anymore.
When commenting a post users will receive the answers.

Added tests to try to test this behavior.
2014-11-28 15:12:14 +01:00
Jeremy Kersten db20a45186 [IMP] website_blog: group the get_discussion in one request(get_discussionS), that will avoid to make one request by paragraph in blog. 2014-07-29 12:05:50 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Christophe Simonis a756b82372 [MERGE] forward port of branch saas-4 up to revid bb26dea 2014-05-20 20:19:55 +02:00
Christophe Simonis d93f628c72 [MERGE] merge bzr saas-4 addons branch 2014-05-20 17:12:01 +02:00
Thibault Delavallée 5a15b58a3b [FIX] website_blog: order archives by date desc 2014-05-19 11:14:30 +02:00
Richard Mathot (OpenERP) 8145c52dea [FIX] website_blog: display blog posts in anti-chronological order 2014-05-14 16:11:46 +02:00
Fabien Meghazi c3cfc4bc32 [MERGE] sitemap backport, merge trunk from 9438 til 9440
merge from 9438 revid:fp@tinyerp.com-20140511115231-g8ke14r9iepyypv4 til 9440 revid:fp@tinyerp.com-20140511143314-nzn1239l00arbxjq
2014-05-13 16:38:31 +02:00
Fabien Meghazi 8eed143112 [IMP] Invert multilang logic in route decorator. True by default, can be set to False explicitlty 2014-05-13 11:35:45 +02:00
Olivier Dony 4cecbd919f [FIX] mass_mailing,website*,survey: leftover calls to website.get_public_user()
This method was (partially) removed at rev.9421 
rev-id al@openerp.com-20140507153223-q73u5lhyrfw98o3a

bzr revid: odo@openerp.com-20140512103935-o0ue9wzenm5wjejq
2014-05-12 12:39:35 +02:00
Fabien Pinckaers 54d30d5194 [IMP] clean sitemap, enumerate pages + fixes
bzr revid: fp@tinyerp.com-20140511115231-g8ke14r9iepyypv4
2014-05-11 13:52:31 +02:00
Thibault Delavallée 6c6885d7fa [IMP] website_blog: always have a next_post, even a visited one, it you have at least
2 posts.

bzr revid: tde@openerp.com-20140408134728-fy4mbsuetwksa76v
2014-04-08 15:47:28 +02:00
Thibault Delavallée 5dac705c1a [IMP] website_blog: enable_editor + slugify URLs in order to be directly
in edit mode when creating a new blog.

bzr revid: tde@openerp.com-20140408134115-125vtpmtikdd2u26
2014-04-08 15:41:15 +02:00
Thibault Delavallée 8f105b6624 [IMP] website_blog: path computation (unique key) for paragraphs in medium-like blogs
is now done server-side and stored directly in the html content, as post processing.
The front-end attaches messages based on the attribute data-chatter-id, but do not
compute the attribute itself anymore.
Misc cleaning of code.

bzr revid: tde@openerp.com-20140403112656-ane3ovhh70qdc8b4
2014-04-03 13:26:56 +02:00
Thibault Delavallée 045157170a [IMP] website_blog: update templates to use the contact widget, allowing to
display partner-related stuff without having to tweak the access rights.
Misc update of templates due to some filed renaming.
Added author field on the blog, allowing to avoid having issues with
create_uid field.

bzr revid: tde@openerp.com-20140402140200-a3g0750akro2n12v
2014-04-02 16:02:00 +02:00
ajay javiya (OpenERP) 7126bc5b50 [MERGE] : with trunk and resolve conflicts
bzr revid: aja@tinyerp.com-20140401132534-owbxvwqo6qpodw7e
2014-04-01 18:55:34 +05:30
Thibault Delavallée 76141aaecf [FIX] website_blog: who wrote such stupid domains ?
bzr revid: tde@openerp.com-20140401095430-tn2i94o1bmdvevgd
2014-04-01 11:54:30 +02:00
Thibault Delavallée e29e6dfe26 [CLEAN] website_blog :code cleaning in added code
bzr revid: tde@openerp.com-20140401092826-gf9f365bn4wu8mk3
2014-04-01 11:28:26 +02:00
Thibault Delavallée 6a4e52f272 [IMP] website_blog: use 2 different URL schemes (post and blog), to ease url use in templates
bzr revid: tde@openerp.com-20140401092026-2patc88e0xu6ghyx
2014-04-01 11:20:26 +02:00
Thibault Delavallée e6bcc1111e [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140401084304-mnbcx1agdzdptyyf
2014-04-01 10:43:04 +02:00
ajay javiya (OpenERP) 844e010a3d [REM] : unused import
bzr revid: aja@tinyerp.com-20140401061146-gxavo2gi25oi82yk
2014-04-01 11:41:46 +05:30
ajay javiya (OpenERP) 138f5d7f32 [MERGE] : with trunk and resolve conflicts
bzr revid: aja@tinyerp.com-20140401052801-4483i0z0ivmrwsbn
2014-04-01 10:58:01 +05:30
Thibault Delavallée 2555249fbb [IMP] website_blog: url helper defintiion + use; still blog posts to fix.
bzr revid: tde@openerp.com-20140331152711-yg34m7klexuu6v8t
2014-03-31 17:27:11 +02:00