summaryrefslogtreecommitdiff
path: root/addons/website_slides/static/src/xml
diff options
context:
space:
mode:
authorAurélien Warnon <awa@odoo.com>2019-02-20 14:07:11 +0000
committerThibault Delavallée <tde@odoo.com>2019-02-26 16:07:33 +0000
commit0e73de5dea5ae09705255747eaf203de6cd3bed3 (patch)
treeeb68496ad15354cf69ba62bb36f9ffc719d7cf7a /addons/website_slides/static/src/xml
parent5db9ed0391febb7cabfcd7fadb1971abd2fa0bc4 (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')
-rw-r--r--addons/website_slides/static/src/xml/slide_management.xml16
-rw-r--r--addons/website_slides/static/src/xml/website_slides_upload.xml29
2 files changed, 16 insertions, 29 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>
diff --git a/addons/website_slides/static/src/xml/website_slides_upload.xml b/addons/website_slides/static/src/xml/website_slides_upload.xml
index 7980d77880e..bc42bb8557c 100644
--- a/addons/website_slides/static/src/xml/website_slides_upload.xml
+++ b/addons/website_slides/static/src/xml/website_slides_upload.xml
@@ -207,33 +207,4 @@
</div>
</div>
</t>
-
- <t t-name="website.slide.add.section">
- <div role="dialog" class="modal" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <header class="modal-header">
- <h3 class="modal-title">Add a section</h3>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
- </header>
- <main class="modal-body modal-content">
- <form class="clearfix">
- <div class="form-group row">
- <label for="section_name" class="col-form-label col-md-3">Section name</label>
- <div class="col-md-9">
- <input type="text" class="form-control" id="section_name"/>
- </div>
- </div>
- <canvas id="data_canvas" style="display: none;"></canvas>
- </form>
- </main>
- <footer class="modal-footer">
- <button type="button" data-loading-text="Loading..." data-published="true" class="btn btn-primary save">Add</button>
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Discard</button>
- </footer>
- </div>
- </div>
- </div>
- </t>
-
</templates>