diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-09-26 19:37:29 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-09-26 19:37:29 +0200 |
| commit | 5f08d82bcd7fa0eaed7c0b0f35c7221c5e0b657a (patch) | |
| tree | 1d1be253f568f18ffd0f7b2bd67577b77afaa3bd /addons/website | |
| parent | 7b13888c8e258a05a8044b7566b949071a911eab (diff) | |
| parent | fd122aec52166a2d19fe80579dbf9c98c6ab41fa (diff) | |
[MERGE] forward port branch 11.0 up to fd122aec521
Diffstat (limited to 'addons/website')
| -rw-r--r-- | addons/website/data/website_demo.xml | 288 | ||||
| -rw-r--r-- | addons/website/static/src/js/content/snippets.animation.js | 8 | ||||
| -rw-r--r-- | addons/website/static/src/less/website.less | 21 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.gallery.xml | 6 |
4 files changed, 310 insertions, 13 deletions
diff --git a/addons/website/data/website_demo.xml b/addons/website/data/website_demo.xml index cf4f9453755..e1e67a2cbc6 100644 --- a/addons/website/data/website_demo.xml +++ b/addons/website/data/website_demo.xml @@ -243,5 +243,293 @@ response = request.render("website.template_partner_comment", { <field name="website_id" ref="website2"/> <field name="page_id" ref="website2_contactus_page" /> </record> + + <!-- BS Debug Page --> + <!-- Showcase all (most?) BS components and utilities --> + <record id="bs_debug_page" model="website.page"> + <field name="name">BS Debug</field> + <field name="url">/website/demo/bootstrap</field> + <field name="website_published">False</field> + <field name="type">qweb</field> + <field name="key">website.bs_debug_page_view</field> + <field name="arch" type="xml"> + <t name="Debug" t-name="website.bs_debug_page_view"> + <t t-call="website.layout"> + <t t-set="odoo_theme_colors" t-value="[['alpha', 'Alpha'], ['beta', 'Beta'], ['gamma', 'Gamma'], ['delta', 'Delta'], ['epsilon', 'Epsilon']]"/> + <t t-set="bs_basic_colors" t-value="[['primary', 'Primary'], ['default', 'Default']]"/> + <t t-set="bs_state_colors" t-value="[['success', 'Success'], ['info', 'Info'], ['warning', 'Warning'], ['danger', 'Danger']]"/> + <t t-set="bs_theme_colors" t-value="bs_basic_colors + bs_state_colors"/> + <t t-set="bs_gray_colors" t-value="[['white', 'White'], ['gray-lighter', 'Gray Lighter'], ['gray-light', 'Gray Light'], ['gray', 'Gray'], ['gray-dark', 'Gray Dark'], ['gray-darker', 'Gray Darker'], ['black', 'Black']]"/> + <div id="wrap oe_structure"> + <section class="py-2"> + <div class="container"> + <h1>Components</h1> + <div class="row"> + <div class="col-md-9"> + <h2>Badge</h2> + <span class="badge mb4">This is a badge</span> + + <h2 class="mt8">Label</h2> + <t t-foreach="bs_theme_colors" t-as="color"> + <span t-attf-class="label mb4 label-#{color[0]}"><t t-esc="color[1]"/></span> + </t> + <h3 class="mt8 h5">Link</h3> + <t t-foreach="bs_theme_colors" t-as="color"> + <a href="#" t-attf-class="label mb4 label-#{color[0]}"><t t-esc="color[1]"/></a> + </t> + <h3 class="mt8 h5">Autosizing</h3> + <div class="mt0 h3"> + <t t-foreach="bs_theme_colors" t-as="color"> + <span t-attf-class="label mb4 label-#{color[0]}"><t t-esc="color[1]"/></span> + </t> + </div> + + <h2 class="mt16">Button</h2> + <t t-foreach="odoo_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <br/> + <t t-foreach="bs_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <h3 class="mt8 h6">Extra Small</h3> + <t t-foreach="odoo_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-xs btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <br/> + <t t-foreach="bs_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-xs btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <h3 class="mt8 h5">Small</h3> + <t t-foreach="odoo_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-sm btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <br/> + <t t-foreach="bs_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-sm btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <h3 class="mt8 h5">Large</h3> + <t t-foreach="odoo_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-lg btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + <br/> + <t t-foreach="bs_theme_colors" t-as="color"> + <button type="button" t-attf-class="btn mb4 btn-lg btn-#{color[0]}"><t t-esc="color[1]"/></button> + </t> + + <h2 class="mt16">Dropdown</h2> + <div class="dropdown"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Toggle <span class="caret"/></button> + <ul class="dropdown-menu"> + <li class="dropdown-header">Header</li> + <li><a href="#">Action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"/> + <li><a href="#">Separated link</a></li> + </ul> + </div> + + <h2 class="mt16">Navbar</h2> + <nav class="navbar navbar-default"> + <div class="navbar-header"> + <a class="navbar-brand" href="#">Navbar</a> + <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + + <div class="collapse navbar-collapse" id="navbarSupportedContent"> + <ul class="nav navbar-nav"> + <li class="active"> + <a href="#">Home <span class="sr-only">(current)</span></a> + </li> + <li> + <a href="#">Link</a> + </li> + <li> + <a class="disabled" href="#">Disabled</a> + </li> + </ul> + <form class="navbar-form navbar-right"> + <input class="form-control" type="search" placeholder="Search" aria-label="Search"/> + <button class="btn btn-success" type="submit">Search</button> + </form> + </div> + </nav> + + <h2 class="mt16">Form</h2> + <form> + <div class="form-group"> + <label for="exampleInputEmail1">Email address</label> + <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email"/> + <small id="emailHelp" class="help-block text-muted">We'll never share your email with anyone else.</small> + </div> + </form> + + <h2 class="mt16">Pagination</h2> + <nav> + <ul class="pagination"> + <li class="disabled"> + <a href="#" tabindex="-1">Previous</a> + </li> + <li> + <a href="#">1</a> + </li> + <li class="active"> + <a href="#">2 <span class="sr-only">(current)</span></a> + </li> + <li> + <a href="#">3</a> + </li> + <li> + <a href="#">Next</a> + </li> + </ul> + </nav> + </div> + <div class="col-md-3"> + <h2>Alert</h2> + <t t-foreach="bs_state_colors" t-as="color"> + <div t-attf-class="alert alert-#{color[0]}"> + This is a "<t t-esc="color[1]"/>" alert with a <a href="#" class="alert-link">link</a>. + </div> + </t> + + <h2 class="mt16">Breadcrumb</h2> + <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + <li><a href="#">Home</a></li> + <li><a href="#">Library</a></li> + <li class="active" aria-current="page">Data</li> + </ol> + </nav> + + <h2 class="mt16">Card</h2> + <div class="panel panel-default"> + <div class="panel-heading"> + Card Header + </div> + <div class="panel-body"> + Card Body + </div> + <ul class="list-group"> + <li class="list-group-item">Item 1</li> + <li class="list-group-item">Item 2</li> + </ul> + <div class="panel-footer"> + Card Footer + </div> + </div> + </div> + </div> + </div> + </section> + <section class="py-2"> + <div class="container"> + <h1>Utilities & Typography</h1> + <div class="row"> + <div class="col-md-9"> + <div> + <t t-foreach="odoo_theme_colors" t-as="color"> + <div t-attf-class="bg-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + <div class="mt8"> + <t t-foreach="bs_theme_colors" t-as="color"> + <div t-attf-class="bg-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + <div class="mt8"> + <t t-foreach="bs_gray_colors" t-as="color"> + <div t-attf-class="bg-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + <div class="mt16"> + <t t-foreach="odoo_theme_colors" t-as="color"> + <div t-attf-class="text-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + <div class="mt8"> + <t t-foreach="bs_theme_colors" t-as="color"> + <div t-attf-class="text-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + <div class="mt8"> + <t t-foreach="bs_gray_colors" t-as="color"> + <div t-attf-class="text-#{color[0]}" style="display: inline-block; padding: 4px 12px;"> + <t t-esc="color[1]"/> + </div> + </t> + </div> + </div> + <div class="col-md-3"> + <h1>Headings 1</h1> + <h2>Headings 2</h2> + <h3>Headings 3</h3> + <h4>Headings 4</h4> + <h5>Headings 5</h5> + <h6>Headings 6</h6> + <p>Paragraph with <strong>bold</strong>, <span class="text-muted">muted</span> and <em>italic</em> texts</p> + <p><a href="#">Link</a></p> + <p><button type="button" class="btn btn-link">Link button</button></p> + </div> + </div> + </div> + </section> + </div> + </t> + </t> + </field> + </record> + + <!-- Snippet Debug Page --> + <!-- Showcase all snippets --> + <record id="snippets_debug_page" model="website.page"> + <field name="name">Snippet Debug</field> + <field name="url">/website/demo/snippets</field> + <field name="website_published">False</field> + <field name="type">qweb</field> + <field name="key">website.snippets_debug_page_view</field> + <field name="arch" type="xml"> + <t name="Debug" t-name="website.snippets_debug_page_view"> + <t t-call="website.layout"> + <style> + #snippets_menu, #o_scroll > .o_panel > .o_panel_header { + display: none !important; + } + [data-oe-type="snippet"]:not([data-module-id])::before { + content: attr(name); + display: block; + padding: 16px; + background-color: lightgray; + color: black; + font-size: 24px; + } + [data-oe-type="snippet"]:not([data-module-id])::after { + content: ""; + display: table; + clear: both; + } + </style> + <div id="wrap oe_structure"> + <t t-call="website.snippets"/> + </div> + </t> + </t> + </field> + </record> </data> </odoo> diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 602556c03cc..e28e1e0d14f 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -699,6 +699,7 @@ registry.gallery = Animation.extend({ * @param {Event} ev */ _onClickImg: function (ev) { + var self = this; var $cur = $(ev.currentTarget); var urls = []; @@ -743,7 +744,12 @@ registry.gallery = Animation.extend({ $modal.find('.modal-content, .modal-body.o_slideshow').css('height', '100%'); $modal.appendTo(document.body); - this.carousel = new registry.gallery_slider($modal.find('.carousel').carousel()); + $modal.one('shown.bs.modal', function () { + self.trigger_up('animation_start_demand', { + editableMode: false, + $target: $modal.find('.modal-body.o_slideshow'), + }); + }); }, }); diff --git a/addons/website/static/src/less/website.less b/addons/website/static/src/less/website.less index 4fdbb8db726..a8918608751 100644 --- a/addons/website/static/src/less/website.less +++ b/addons/website/static/src/less/website.less @@ -411,30 +411,27 @@ div.carousel .container { border-width: 0; position: absolute; bottom: 0; + width: 100%; + margin-left: 0; + left: 0%; > * { list-style-image: none; display: inline-block; width: 40px; height: 40px; - margin: 0 0px 5px 5px; + margin: 2.5px 2.5px 2.5px 2.5px; padding: 0; border: 1px solid #aaa; text-indent: initial; background-size: cover; background-color: #fff; border-radius: 0; + vertical-align: bottom; &:not(.active) { opacity: 0.8; - -webkit-filter: grayscale(100%); - filter: grayscale(100%); - filter: gray; - filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale"); - } - - &:first-child { - margin-left: 0; + filter: grayscale(1); } } } @@ -444,6 +441,12 @@ div.carousel .container { background-image: none; background-color: transparent; } + &.left * { + right: 0%; + } + &.right * { + left: 0%; + } } } } diff --git a/addons/website/static/src/xml/website.gallery.xml b/addons/website/static/src/xml/website.gallery.xml index 76bf650e76d..919da3c53d4 100644 --- a/addons/website/static/src/xml/website.gallery.xml +++ b/addons/website/static/src/xml/website.gallery.xml @@ -20,11 +20,11 @@ </div> <ul class="carousel-indicators"> - <li class="fa fa-chevron-left o_indicators_left" style="overflow: hidden; padding: 12px; border: 0;"></li> + <li class="fa fa-chevron-left o_indicators_left" style="overflow: hidden; padding: 12px; border: 0; visibility: hidden;"></li> <t t-foreach="srcs" t-as="src"> - <li t-attf-data-target="##{id}" t-att-data-slide-to="src_index" t-att-class="src_index == index and 'active'" t-attf-style="background-image: url(#{src})"></li> + <li t-attf-data-target="##{id}" t-att-data-slide-to="src_index" t-att-class="'hidden ' + (src_index == index and 'active')" t-attf-style="background-image: url(#{src})"></li> </t> - <li class="fa fa-chevron-right o_indicators_right" style="overflow: hidden; padding: 12px; border: 0;"></li> + <li class="fa fa-chevron-right o_indicators_right" style="overflow: hidden; padding: 12px; border: 0; visibility: hidden;"></li> </ul> <a class="carousel-control left" t-attf-href="##{id}" data-slide="prev"><span class="fa fa-chevron-left" /></a> |
