comparison libervia/pages/lists/edit/page_meta.py @ 1469:b46fec21ceb9

pages (lists/edit): redirect to item instead of list and don't show confirm message
author Goffi <goffi@goffi.org>
date Fri, 01 Oct 2021 12:13:07 +0200
parents a84383c659b4
children 5cc6734093a6
comparison
equal deleted inserted replaced
1468:e85ef5f3515e 1469:b46fec21ceb9
76 False, profile) 76 False, profile)
77 77
78 template_data["new_list_item_xmlui"] = list_item 78 template_data["new_list_item_xmlui"] = list_item
79 79
80 80
81 @defer.inlineCallbacks 81 async def on_data_post(self, request):
82 def on_data_post(self, request):
83 data = self.getRData(request) 82 data = self.getRData(request)
84 service = data["service"] 83 service = data["service"]
85 node = data["node"] 84 node = data["node"]
86 item_id = data["item_id"] 85 item_id = data["item_id"]
87 posted_data = self.getAllPostedData(request) 86 posted_data = self.getAllPostedData(request)
92 except (KeyError, IndexError): 91 except (KeyError, IndexError):
93 pass 92 pass
94 profile = self.getProfile(request) 93 profile = self.getProfile(request)
95 94
96 # we convert back body to XHTML 95 # we convert back body to XHTML
97 body = yield self.host.bridgeCall( 96 body = await self.host.bridgeCall(
98 "syntaxConvert", posted_data['body'][0], "markdown", C.SYNTAX_XHTML, 97 "syntaxConvert", posted_data['body'][0], "markdown", C.SYNTAX_XHTML,
99 False, profile) 98 False, profile)
100 posted_data['body'] = ['<div xmlns="{ns}">{body}</div>'.format(ns=C.NS_XHTML, 99 posted_data['body'] = ['<div xmlns="{ns}">{body}</div>'.format(ns=C.NS_XHTML,
101 body=body)] 100 body=body)]
102 101
103 extra = {'update': True} 102 extra = {'update': True}
104 yield self.host.bridgeCall( 103 await self.host.bridgeCall(
105 "listSet", service.full(), node, posted_data, "", item_id, 104 "listSet", service.full(), node, posted_data, "", item_id,
106 data_format.serialise(extra), profile 105 data_format.serialise(extra), profile
107 ) 106 )
108 # we don't want to redirect to edit page on success, but to list overview
109 data["post_redirect_page"] = ( 107 data["post_redirect_page"] = (
110 self.getPageByName("lists"), 108 self.getPageByName("list_view"),
111 service.full(), 109 service.full(),
112 node or "@", 110 node or "@",
111 item_id
113 ) 112 )
113 return C.POST_NO_CONFIRM