diff options
| author | Aurélien Warnon <awa@odoo.com> | 2019-02-20 14:07:11 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-02-26 16:07:33 +0000 |
| commit | 0e73de5dea5ae09705255747eaf203de6cd3bed3 (patch) | |
| tree | eb68496ad15354cf69ba62bb36f9ffc719d7cf7a /addons/website_slides/static/src/xml/slide_management.xml | |
| parent | 5db9ed0391febb7cabfcd7fadb1971abd2fa0bc4 (diff) | |
[REF] website_slides: refactor the category add modal on frontend
Purpose
=======
This commits refactors the way slide.category are added on frontend:
* JS now extends a standard Dialog widget;
* added "required" name value on the form and handled validation;
* controller adds the category at the bottom of the list (sequence+1);
Commit linked to task ID 1942852 and PR #31394.
Diffstat (limited to 'addons/website_slides/static/src/xml/slide_management.xml')
| -rw-r--r-- | addons/website_slides/static/src/xml/slide_management.xml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/website_slides/static/src/xml/slide_management.xml b/addons/website_slides/static/src/xml/slide_management.xml index 118c45970fe..b402c1e3fd3 100644 --- a/addons/website_slides/static/src/xml/slide_management.xml +++ b/addons/website_slides/static/src/xml/slide_management.xml @@ -5,4 +5,20 @@ <p>Are you sure you want to archive this slide ?</p> </div> </t> + + <t t-name="slides.category.add"> + <div> + <form action="/slides/category/add" method="POST" id="slide_category_add_form"> + <input type="hidden" name="csrf_token" t-att-value="csrf_token"/> + <input type="hidden" name="channel_id" t-att-value="widget.channelId"/> + <div class="form-group row"> + <label for="section_name" class="col-sm-3 col-form-label">Section name</label> + <div class="col-sm-9"> + <input type="text" class="form-control" name="name" id="section_name" required="required"/> + </div> + </div> + </form> + </div> + </t> + </templates> |
