diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/website_sale/static/src/xml | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/website_sale/static/src/xml')
4 files changed, 271 insertions, 0 deletions
diff --git a/addons/website_sale/static/src/xml/website_sale.xml b/addons/website_sale/static/src/xml/website_sale.xml new file mode 100644 index 00000000..2b9e9e9a --- /dev/null +++ b/addons/website_sale/static/src/xml/website_sale.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<templates xml:space="preserve"> + + <t t-name="productVideo"> + <div class="embed-responsive embed-responsive-16by9 mt-2" t-if="embedCode"> + <t t-raw="embedCode"/> + </div> + </t> + +</templates> diff --git a/addons/website_sale/static/src/xml/website_sale_dashboard.xml b/addons/website_sale/static/src/xml/website_sale_dashboard.xml new file mode 100644 index 00000000..61b2ad79 --- /dev/null +++ b/addons/website_sale/static/src/xml/website_sale_dashboard.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates> + <t t-extend="website.dashboard_header"> + <t t-jquery="div.o_dashboard_common" t-operation="append"> + <div class="col-12 o_box" t-if="widget.dashboards_data.sales.summary.order_unpaid_count || widget.dashboards_data.sales.summary.order_to_invoice_count || widget.dashboards_data.sales.summary.payment_to_capture_count || widget.dashboards_data.sales.summary.order_carts_abandoned_count"> + <div t-if="widget.dashboards_data.sales.summary.order_unpaid_count" class="o_inner_box o_dashboard_action" title="Confirm orders when you get paid." name="website_sale.action_unpaid_orders_ecommerce"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.order_unpaid_count"/></div> + Unpaid Orders + </div> + <div t-if="widget.dashboards_data.sales.summary.order_to_invoice_count" class="o_inner_box o_dashboard_action" title="Generate an invoice from orders ready for invoicing." name="website_sale.sale_order_action_to_invoice"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.order_to_invoice_count"/></div> + Orders to Invoice + </div> + <div t-if="widget.dashboards_data.sales.summary.payment_to_capture_count" class="o_inner_box o_dashboard_action" title="Capture order payments when the delivery is completed." name="website_sale.payment_transaction_action_payments_to_capture"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.payment_to_capture_count"/></div> + Payments to Capture + </div> + <div t-if="widget.dashboards_data.sales.summary.order_carts_abandoned_count" class="o_inner_box o_dashboard_action" title="Send a recovery email to visitors who haven't completed their order." name="website_sale.action_view_abandoned_tree"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.order_carts_abandoned_count"/></div> + Abandoned Carts + </div> + </div> + </t> + </t> + + <t t-extend="website.dashboard_content"> + <t t-jquery="div.o_website_dashboard_content" t-operation="prepend"> + <div t-if="widget.groups.sale_salesman" class="row o_dashboard_sales"> + <div class="col-12 row o_box"> + <t t-if="widget.dashboards_data.sales.summary.order_count"> + <h2 class="col-lg-7 col-12"> + <t t-if="widget.date_range=='week'"> + Sales Since Last Week + </t> + <t t-elif="widget.date_range=='month'"> + Sales Since Last Month + </t> + <t t-elif="widget.date_range=='year'"> + Sales Since Last Year + </t> + <t t-else="">Sales</t> + </h2> + <h4 class='col-lg-5 col-12'>AT A GLANCE</h4> + <div class="col-lg-7 col-12"> + <div class="o_graph_sales" data-type="sales"/> + </div> + <div class="col-lg-5 col-12"> + <t t-call="website_sale.products_table"/> + </div> + </t> + <t t-if="! widget.dashboards_data.sales.summary.order_count"> + <t t-if="widget.date_range=='week'"> + <h2>Sales Since Last Week</h2> + </t> + <t t-elif="widget.date_range=='month'"> + <h2>Sales Since Last Month</h2> + </t> + <t t-elif="widget.date_range=='year'"> + <h2>Sales Since Last Year</h2> + </t> + <t t-else=""><h2>Sales</h2></t> + <div class="col-lg-12 col-12"> + <div class="o_demo_background"> + </div> + <div class="o_demo_message"> + <h3>There is no recent confirmed order.</h3> + </div> + </div> + </t> + </div> + </div> + </t> + </t> + + <t t-name="website_sale.products_table"> + <div class="row"> + <a href="#" class="col-md-4 o_dashboard_action" name="website_sale.sale_report_action_dashboard"> + <div class="o_link_enable" title="Orders"> + <div class="o_highlight"> + <t t-esc="widget.dashboards_data.sales.summary.order_count"/> + </div> + Orders + </div> + </a> + <a href="#" class="col-md-4 o_dashboard_action" name="website_sale.sale_report_action_dashboard"> + <div class="o_link_enable" title="Untaxed Total Sold"> + <div class="o_highlight"> + <t t-esc="widget.render_monetary_field(widget.dashboards_data.sales.summary.total_sold, widget.data.currency)"/> + </div> + Sold + </div> + </a> + <a href="#" class="col-md-4 o_dashboard_action" name="website_sale.sale_report_action_carts"> + <div class="o_link_enable o_invisible_border" title="Carts"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.order_carts_count"/></div> + Carts + </div> + </a> + <div class="col-md-4 o_link_disable" title="Orders/Day"> + <div class="o_highlight"><t t-esc="widget.dashboards_data.sales.summary.order_per_day_ratio"/></div> + Orders/Day + </div> + <div class="col-md-4 o_link_disable" title="Average Order"> + <div class="o_highlight"><t t-esc="widget.render_monetary_field(widget.dashboards_data.sales.summary.order_sold_ratio, widget.data.currency)"/></div> + Average Order + </div> + <div class="col-md-4 o_link_disable o_invisible_border" title="Conversion"> + <div class="o_highlight"><t t-esc="widget.format_number(widget.dashboards_data.sales.summary.order_convertion_pctg, 'float', [3, 2], '%')"/></div> + Conversion + </div> + </div> + <div class="col-lg-12 col-12 o_top_margin"> + <div class="row"> + <div class="col-lg-12 col-12"> + <h4>Best Sellers</h4> + <table class="table table-responsive table-hover"> + <tr> + <th>Product</th> + <th>Quantity</th> + <th>Sold</th> + </tr> + <tr class="o_product_template" t-foreach="widget.dashboards_data.sales.best_sellers" t-as="product" t-att-data-product-id="product.id"> + <td><t t-esc="product.name"/></td> + <td><t t-esc="product.qty"/></td> + <td><t t-esc="widget.render_monetary_field(product.sales, widget.data.currency)"/></td> + </tr> + </table> + </div> + </div> + </div> + </t> + + <t t-extend="website_sale.products_table"> + <t t-jquery=".o_top_margin .row .col-12" t-operation="attributes"> + <attribute name="class" value="col-lg-6 col-12" /> + </t> + <t t-jquery=".o_top_margin .row" t-operation="append"> + <div class="col-lg-6 col-12 o_dashboard_utms"> + <div> + <h4 class="float-left">REVENUE BY</h4> + <t t-call="website_sale.LinkTrackersDropDown"/> + </div> + <div class="o_utm_no_data_img"> + <img src="website_sale/static/src/img/website_sale_chart_demo.png" alt="There isn't any UTM tag detected in orders" class="utm_chart_image image-responsive mt8"/> + </div> + <div class="o_utm_data_graph"/> + </div> + </t> + </t> + + <t t-name="website_sale.LinkTrackersDropDown"> + <div class="dropdown"> + <button class="btn btn-secondary dropdown-toggle utm_dropdown ml4" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><span class="utm_button_name">Campaigns</span> + </button> + <div class="dropdown-menu" role="menu" aria-labelledby="utm_dropdown"> + <a name="campaign_id" class="dropdown-item js_utm_selector" role="menuitem">Campaigns</a> + <a name="medium_id" class="dropdown-item js_utm_selector" role="menuitem">Medium</a> + <a name="source_id" class="dropdown-item js_utm_selector" role="menuitem">Sources</a> + </div> + </div> + </t> +</templates> diff --git a/addons/website_sale/static/src/xml/website_sale_recently_viewed.xml b/addons/website_sale/static/src/xml/website_sale_recently_viewed.xml new file mode 100644 index 00000000..34b9ec0e --- /dev/null +++ b/addons/website_sale/static/src/xml/website_sale_recently_viewed.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates xml:space="preserve"> + <!-- Recently Viewed Products Carousel --> + <t t-name="website_sale.productsRecentlyViewed"> + <div t-att-id="uniqueId" class="carousel slide o_not_editable" data-interval="false"> + <div class="carousel-inner"> + <t t-foreach="productsGroups" t-as="products"> + <div t-attf-class="carousel-item #{!products_index and 'active' or ''}"> + <div class="row"> + <t t-foreach="products" t-as="product"> + <div t-attf-class="o_carousel_product_card_wrap col-md-#{12 / productFrame}"> + <div class="o_carousel_product_card card h-100"> + <input type="hidden" name="product-id" t-att-data-product-id="product.id"/> + <a class="o_carousel_product_img_link" t-att-href="product.website_url"> + <img class="o_carousel_product_card_img_top card-img-top" t-attf-src="/web/image/product.product/#{product.id}#{productFrame == 1 ? '/image_256' : '/image_512'}" t-att-alt="product.display_name"/> + </a> + <i class="fa fa-trash o_carousel_product_remove js_remove"></i> + <div class="o_carousel_product_card_body card-body border-top"> + <a t-att-href="product.website_url" class="text-decoration-none"> + <h6 class="card-title mb-0 text-truncate" t-raw="product.display_name"/> + </a> + <t t-if="product.rating" t-raw="product.rating"/> + </div> + <div class="o_carousel_product_card_footer card-footer d-flex align-items-center"> + <div class="d-block font-weight-bold" t-raw="product.price"/> + <button type="button" role="button" class="btn btn-primary js_add_cart ml-auto" title="Add to Cart"> + <i class="fa fa-fw fa-shopping-cart"/> + </button> + </div> + </div> + </div> + </t> + </div> + </div> + </t> + </div> + <t t-if='productsGroups.length > 1'> + <a class="o_carousel_product_control carousel-control-prev" t-att-href="'#' + uniqueId" role="button" data-slide="prev"> + <span class="carousel-control-prev-icon"></span> + <span class="sr-only">Previous</span> + </a> + <a class="o_carousel_product_control carousel-control-next" t-att-href="'#' + uniqueId" role="button" data-slide="next"> + <span class="carousel-control-next-icon"></span> + <span class="sr-only">Next</span> + </a> + </t> + </div> + </t> +</templates> diff --git a/addons/website_sale/static/src/xml/website_sale_utils.xml b/addons/website_sale/static/src/xml/website_sale_utils.xml new file mode 100644 index 00000000..8a470613 --- /dev/null +++ b/addons/website_sale/static/src/xml/website_sale_utils.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates id="template" xml:space="preserve"> + +<!-- Products Search Bar autocomplete item --> +<div t-name="website_sale.productsSearchBar.autocomplete" + class="dropdown-menu show w-100"> + <t t-if="!products.length"> + <span class="dropdown-item-text text-muted">No results found. Please try another search.</span> + </t> + <a t-foreach="products" t-as="product" + t-att-href="product['website_url']" class="dropdown-item p-2 text-wrap"> + <div class="media align-items-center o_search_product_item"> + <t t-if="widget.displayImage"> + <img t-attf-src="/web/image/product.template/#{product['id']}/image_128" + class="flex-shrink-0 o_image_64_contain"/> + </t> + <div class="media-body px-3"> + <t t-set="description" t-value="widget.displayDescription and product['description_sale']"/> + <h6 t-attf-class="font-weight-bold #{description ? '' : 'mb-0'}" t-esc="product['name']"/> + <p t-if="description" class="mb-0" t-esc="description"/> + </div> + <div t-if="widget.displayPrice" class="flex-shrink-0"> + <t t-if="product['has_discounted_price']"> + <span class="text-danger text-nowrap" style="text-decoration: line-through;"> + <t t-raw="product['list_price']"/> + </span> + <br/> + </t> + <b class="text-nowrap"> + <t t-raw="product['price']"/> + </b> + </div> + </div> + </a> + <t t-if="hasMoreProducts"> + <button type="submit" class="dropdown-item text-center text-primary">All results</button> + </t> +</div> + +<!-- Products Search Bar autocomplete item --> +<we-button t-name="website_sale.ribbonSelectItem" t-att-data-set-ribbon="ribbon.id"> + <t t-raw="ribbon.html"/> + <span t-attf-class="fa fa-#{isTag ? 'tag' : 'bookmark'} ml-auto"></span> + <span t-attf-class="fa fa-arrow-#{isLeft ? 'left' : 'right'} ml-1"></span> + <span t-attf-class="o_wsale_color_preview #{colorClasses} ml-1" t-attf-style="background-color: #{ribbon.bg_color}"></span> + <span t-attf-class="o_wsale_color_preview #{colorClasses} ml-1" t-attf-style="background-color: #{textColor} !important;"></span> +</we-button> + +</templates> |
