Commit Graph

66 Commits

Author SHA1 Message Date
Fabien Pinckaers ed7623fc45 [IMP] Performance improvement: improved cache with context, better get_object
bzr revid: fp@tinyerp.com-20131130154659-uqis34x2cemmocly
2013-11-30 16:46:59 +01:00
Fabien Meghazi 07eaace3ee [ADD] custom website ir.http#dispatch and rerouting
bzr revid: fme@openerp.com-20131127170432-z7d1w4ck03d7wwia
2013-11-27 18:04:32 +01:00
Xavier Morel 44af6d1e09 [IMP] significantly improve handling of trying to create a new page which already exists
# Through the menu

Rather than output a generic error (500 due to an IntegrityError),
return a templated 409 letting the user either visit the
page-which-already-exists-with-the-name-he'd-picked or open the page
creation dialog again for a second round.

An alternative would be to promote the website.prompt use to
full-blown dialog as a result of selecting "New Page" and handle the
"page already exists" case without even closing the dialog.

# Through the link dialog

Added an RPC call to check if a page already exists (essentially a
cheaper version of opening /page/whatever and checking whether it's a
200 over JSON-RPC), if the page matching the completion term already
exists, do *not* add the choice of creating the page, only provide
completions from existing pages.

bzr revid: xmo@openerp.com-20131126160148-wrk4zvz9istscwa0
2013-11-26 17:01:48 +01:00
Xavier Morel 6fc69e33d4 [FIX] correctly rollback savepoint in new_page
bzr revid: xmo@openerp.com-20131126102321-35wmxcncl3pp4mhw
2013-11-26 11:23:21 +01:00
Fabien Meghazi cc424c1a55 [IMP] http errors refactoring
bzr revid: fme@openerp.com-20131125165958-0k84rp9rbsxvav77
2013-11-25 17:59:58 +01:00
Xavier Morel 3542a27f9c [FIX] force url enumeration/generation to be performed as 'public' user
bzr revid: xmo@openerp.com-20131125100813-fln1j714m2h85h09
2013-11-25 11:08:13 +01:00
Fabien Pinckaers d19b85f873 [IMP] new featuers for complex events
bzr revid: fp@tinyerp.com-20131124223802-20rpekho195fu2l5
2013-11-24 23:38:02 +01:00
Fabien Pinckaers 5ee03592cf [FIX] misc fixes in new event devs
bzr revid: fp@tinyerp.com-20131124214257-pg9bsbzzydoz6z1a
2013-11-24 22:42:57 +01:00
Fabien Pinckaers 105fc16c11 [IMP] events improvements
bzr revid: fp@tinyerp.com-20131124210221-hwalp7983olmrhew
2013-11-24 22:02:21 +01:00
Fabien Meghazi a337d0dc2c [FIX] kanban broken by lazyrenderer
bzr revid: fme@openerp.com-20131121154213-71hb70c9326gtafb
2013-11-21 16:42:13 +01:00
Fabien Meghazi 7d43b226ab [IMP] Use LazyResponse for website.render()
bzr revid: fme@openerp.com-20131120202842-zethge8jykzlzjjy
2013-11-20 21:28:42 +01:00
Xavier Morel a1463c60b3 [CHG] **kw don't prevent url searching/listing anymore
After discussion and addition of support for the methods parameter (on
@route), it's been determined that:

* POST endpoint must set up method correctly

* **kw on GET endpoints must be completely optional, mandatory query
    arguments should be added as formal parameters without a default
    values

* URLs can thus be generated for methods with **kw, simply by ignoring
  it entirely

bzr revid: xmo@openerp.com-20131119154254-vp0zfnzjvi451vv0
2013-11-19 16:42:54 +01:00
Fabien Meghazi 8e68c33a4b [MOV] Moved methods filtering support from @website.route to @http.route
bzr revid: fme@openerp.com-20131119135428-fm3bfbp83anoxgo6
2013-11-19 14:54:28 +01:00
Xavier Morel 86a0f67a69 [ADD] note about leftover task
bzr revid: xmo@openerp.com-20131119122906-9meh7ubye952o67j
2013-11-19 13:29:06 +01:00
Christophe Matthieu 910c2657a9 [IMP] website: add a group_website_publisher to Display Editor Bar on Website and other editable option
bzr revid: chm@openerp.com-20131119103042-stdyd6r00e1zgli5
2013-11-19 11:30:42 +01:00
Xavier Morel 5723b1588e [MERGE] from trunk
bzr revid: xmo@openerp.com-20131119102552-f8d03meddylwseyr
2013-11-19 11:25:52 +01:00
Xavier Morel 986b4c49d1 [IMP] url generation & filtering
* add filtering in enumerate_pages directly
* make ModelConverter use name_search for generation

todo: per-request name_get caching/coalescing?

bzr revid: xmo@openerp.com-20131119102117-p7de3t93qex1n28q
2013-11-19 11:21:17 +01:00
Xavier Morel 5bab419967 [IMP] add page converter to get pages listing out of enumeration/search itself, restrict to single converter
bzr revid: xmo@openerp.com-20131115154840-psfns4datw5l1lr4
2013-11-15 16:48:40 +01:00
Christophe Matthieu b958ece1df [IMP] website_sale: access rights
bzr revid: chm@openerp.com-20131115152716-86wb7yxq2s4hr633
2013-11-15 16:27:16 +01:00
Xavier Morel 780c35598d [MERGE] from trunk
bzr revid: xmo@openerp.com-20131115132903-epi3321e4uxjqtn2
2013-11-15 14:29:03 +01:00
Christophe Matthieu cc574fa2c4 [IMP] website: catch exception of controller error to return a 401 or 500 error page (and log this exception).
bzr revid: chm@openerp.com-20131114144652-7ta05hrssx22cuiv
2013-11-14 15:46:52 +01:00
Christophe Matthieu 8ae07d4cba [FIX] website: helper google_map for res.company
bzr revid: chm@openerp.com-20131114090223-2gl6y7shh6f7fplm
2013-11-14 10:02:23 +01:00
Xavier Morel d15a6f426d [IMP] replace selection list of existing CMS pages by FAYT via select2
bzr revid: xmo@openerp.com-20131113143934-je7dusgzj15f7li0
2013-11-13 15:39:34 +01:00
Xavier Morel 122ddb8e31 [IMP] rename list_pages to enumerate_pages, add a search method and a basic non-contiguous substring match
bzr revid: xmo@openerp.com-20131113101824-uqatvqokkzhvi0ei
2013-11-13 11:18:24 +01:00
Fabien Meghazi 9ca2b8e8e0 [ADD] methods arg to @website.route() until the feature hit the server
bzr revid: fme@openerp.com-20131113101319-tvamyl0ikqmsqh18
2013-11-13 11:13:19 +01:00
Xavier Morel b1b29acd4b [ADD] pages to pages listing
I don't see a good way to reverse `/page/<path:path>` for Website.page
during pages listing, so reintoduce explicit handling of that crap.

Ideally it would be possible to plug in new converters per db and
create some sort of PageConverte, *or* add a reverse operation to
controllers on top of converters (-> controller-specific url
generation even with un-generable converters).

bzr revid: xmo@openerp.com-20131112120814-ekt1rzlzj06pzypw
2013-11-12 13:08:14 +01:00
Fabien Meghazi 91ac20c28c [FIX] Remove lang_code from kwargs
bzr revid: fme@openerp.com-20131112112150-ka9ner1bkqx6ioeg
2013-11-12 12:21:50 +01:00
Xavier Morel 5b0e0a343b [IMP] use pair unpacking rather than indexing + comment
bzr revid: xmo@openerp.com-20131112101559-s280ffmmc06vq23a
2013-11-12 11:15:59 +01:00
Xavier Morel 92b0539d1d [IMP] remove unused local variable in list_pages
bzr revid: xmo@openerp.com-20131112100411-r4va4xpcovnawuzr
2013-11-12 11:04:11 +01:00
Xavier Morel 8c786b7aab [IMP] move slugify to server, use slugified url as page name
bzr revid: xmo@openerp.com-20131108154842-ts1nnd40jusa92h6
2013-11-08 16:48:42 +01:00
Xavier Morel 01a414fb7c [ADD] initial route introspection + fix pair of routes/controllers
* most controllers turn out to be complete cork and thus can't be
  reversed

* fixup a pair of simple controllers

TODO:
* fixup more controllers
* how can labels/page names be produced?
* grouping/categories of links?

At a high level, workings are pretty simple:
* iterate on all rules (every url pattern produces a werkzeug rule)
* check if the url can make sense as a link: GET, http, no auth or
  public auth, coming from the CMS (no web client links) and all
  converters can generate values for themselves (e.g. a url with an
  `int` converter can't be generated as there is no finite set of
  integers, let alone one small enough to make sense to show to users)
* check if the controller function bound to the URL can use the URLs
  we can generate (no **kwargs as that means arbitrary get|post
  parameter, no query param without a default value (a query param is
  a parameter which does not come from a URL/rule converter))
* use rule converter(s) to generate a matrix of values, and build urls
  from these

bzr revid: xmo@openerp.com-20131108132615-2n7t1vj8hz9v9eis
2013-11-08 14:26:15 +01:00
Fabien Meghazi 01a28b6e03 [FIX] Can't translate menus
context was not passed while setting request.website
forced to refactor a bit in order to make true model methods but stopped
because it will be duplicated work when migrating to the new api

bzr revid: fme@openerp.com-20131107151400-9dmtgz7xs34qmbmq
2013-11-07 16:14:00 +01:00
Fabien Meghazi 1aaf0eaa4c [FIX] Multiple fixes to url_for
url_for now accepts a path or an uri
correctly handling shemeless uri's
url params are shadowed by keep_query

bzr revid: fme@openerp.com-20131106151752-sdov6zynz2g80uro
2013-11-06 16:17:52 +01:00
Fabien Meghazi 6ba57343da [WIP] Trying to use t-fields for menus
Not working quite well
Working it out

bzr revid: fme@openerp.com-20131105151651-8jn1po2fhyojum2c
2013-11-05 16:16:51 +01:00
Christophe Matthieu 49384720c0 [FIX] website contact us: add google_map_img on res.company insead of use partner_id field
bzr revid: chm@openerp.com-20131104165954-o77oi2miksvvt81r
2013-11-04 17:59:54 +01:00
Fabien Meghazi 5f2dc489b2 [MERGE] upstream
bzr revid: fme@openerp.com-20131104114431-dhjp6iy1sfxq4cg1
2013-11-04 12:44:31 +01:00
Xavier Morel 49381094a8 [IMP] error handling in website.render
Return responses with the correct status code instead of always
returning 200 on rendering errors from website.

bzr revid: xmo@openerp.com-20131104111021-inrsbawnakhsva1q
2013-11-04 12:10:21 +01:00
Antony Lesuisse c0dc6c81dc [FIX] qweb exception hiding
bzr revid: al@openerp.com-20131102171656-j4lqrx1gfosi8ofd
2013-11-02 18:16:56 +01:00
Fabien Meghazi 90814d781a [MERGE] upstream
bzr revid: fme@openerp.com-20131030144813-xmjb6i9ayv23aqyi
2013-10-30 15:48:13 +01:00
Fabien Meghazi 2e429fff8b [FIX] Load translation wizard could not properly redirect when only one language is installed
bzr revid: fme@openerp.com-20131030142955-482vt76w67zerui2
2013-10-30 15:29:55 +01:00
Fabien Meghazi 418e10c382 [IMP] Misc menu improvements
bzr revid: fme@openerp.com-20131030140216-f2fz7p3waur3l8j7
2013-10-30 15:02:16 +01:00
Fabien Meghazi fcdef0faaf [ADD] delete menu
bzr revid: fme@openerp.com-20131030105803-yq7r5lt9vtnd21p0
2013-10-30 11:58:03 +01:00
Fabien Meghazi 07b9cf0f02 [IMP] Save menu is working
bzr revid: fme@openerp.com-20131029143346-nu9skoj5s06hwgw6
2013-10-29 15:33:46 +01:00
Fabien Meghazi af4b4b94be [ADD] new_window field in website.menu
bzr revid: fme@openerp.com-20131029112221-7h39wlmbxb8xwm94
2013-10-29 12:22:21 +01:00
Fabien Meghazi 26e62b0e0e [IMP] Menu tree from client side
bzr revid: fme@openerp.com-20131028112350-9or1z3e3ndgk4mfg
2013-10-28 12:23:50 +01:00
Fabien Meghazi eb7b1362cd [WIP] Menu working from database (not yet multi-website)
bzr revid: fme@openerp.com-20131025152446-si9gsjujzcn40hip
2013-10-25 17:24:46 +02:00
Fabien Meghazi a597cc59ef [WIP] menus
bzr revid: fme@openerp.com-20131024141840-ihp2i6huzdlamf94
2013-10-24 16:18:40 +02:00
Xavier Morel b702a9887c [IMP] remove /website/attachment, make attachments go through /website/image
bzr revid: xmo@openerp.com-20131024103401-yik03je9qm1ge0tp
2013-10-24 12:34:01 +02:00
ddm 62bdd7bd9c [FIX] Fixed eCommerce pager
bzr revid: ddm@openerp.com-20131023145152-smhlpc0eydvos7sx
2013-10-23 16:51:52 +02:00
Fabien Meghazi 120620eb27 [IMP] Check current website in Load a Translation wizard
bzr revid: fme@openerp.com-20131022121840-0q1n8ci1fpihi4yf
2013-10-22 14:18:40 +02:00