Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix webpack bundles, reorganize css and js files
weronka3cbeb10ddf57
diff --git a/saleor/static/js/cart.js b/saleor/static/js/cart.jsdeleted file mode 100644index 9d967c14fe..0000000000--- a/saleor/static/js/cart.js+++ /dev/null@@ -1,74 +0,0 @@-/* @flow */--import $ from 'jquery'-import React from 'react'-import { render } from 'react-dom'-import { Provider } from 'react-redux'--import { CartItemAmount, CartItemSubtotal, CartTotal } from './components/cart'-import store from './stores/cart-store'--import '../scss/cart.scss'--const options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]--$('.cart-item-amount').each(function(index) {- let $input = $(this).find('input')- let $button = $(this).find('button')- let value = $input.val()- let name = $input.attr('name')- let max = $input.attr('max')- let props = {- className: '',- index: index,- max: parseInt(max),- options: options.slice(0, max),- thresholdValue: options[options.length - 1],- url: $(this).find('form').attr('action'),- fieldName: name,- value: parseInt(value)- }- $(this).find('.cart-item-quantity').removeClass('js-hidden')- $button.addClass('invisible')- render(- <Provider store={store}>- <CartItemAmount {...props}/>- </Provider>,- this- )-})--let $cartTotal = $('.cart-total')-let cartTotalValue = $cartTotal.data('value')-let cartLocalTotalValue = $cartTotal.data('value-local')-if ($cartTotal.length) {- store.dispatch({- type: 'UPDATE_TOTAL',- total: cartTotalValue,- localTotal: cartLocalTotalValue- })- render(- <Provider store={store}>- <CartTotal />- </Provider>,- $cartTotal[0]- )-}--$('.cart-item-subtotal').each(function() {- let productId = $(this).data('product-id')- let props = {- productId,- subtotal: $(this).text()- }- store.dispatch({- type: 'UPDATE_SUBTOTAL',- ...props- })- render(- <Provider store={store}>- <CartItemSubtotal productId={productId} />- </Provider>,- this- )-})diff --git a/saleor/static/js/components/cart.js b/saleor/static/js/components/cart.jsdeleted file mode 100644index 8adc867991..0000000000--- a/saleor/static/js/components/cart.js+++ /dev/null@@ -1,257 +0,0 @@-/* @flow */--import React, { Component, findDOMNode, PropTypes } from 'react'-import { connect } from 'react-redux'-import $ from 'jquery'--export class CartItemAmountOption extends Component {- render(): React.Element {- const value = this.props.value- const label = this.props.label ? this.props.label : value- return <option value={value}>{label}</option>- }-}--class CartItemAmountSelect extends Component {- static propTypes = {- className: PropTypes.string,- fieldName: PropTypes.string.isRequired,- max: PropTypes.number,- min: PropTypes.number,- options: PropTypes.arrayOf(PropTypes.number).isRequired,- thresholdValue: PropTypes.number,- value: PropTypes.number.isRequired- };-- state: {- error: ?string;- lastSavedValue: number;- renderSelect: bool;- renderSubmit: bool;- result: ?string;- sending: bool;- value: number- } = {- error: null,- lastSavedValue: this.props.value,- renderSelect: false,- renderSubmit: false,- result: null,- sending: false,- value: this.props.value- };-- _change = (event) => {- let newValue = event.target.value- this.setState({ result: null })- if (newValue !== this.props.thresholdValue || !this.state.renderSelect) {- this.setState({ value: newValue })- }- if (newValue >= this.props.thresholdValue) {- this.setState({ renderSelect: false })- }- if (newValue < this.props.thresholdValue && this.state.renderSelect) {- this.sendQuantity(newValue)- }- if (!this.state.renderSelect && !this.state.sending) {- this.setState({ renderSubmit: true })- }- };-- _checkKey = (event) => {- if (event.key === 'Enter' && this.valueChanged()) {- this.sendQuantityWrapper()- }- };-- componentDidMount() {- if (this.state.value < this.props.thresholdValue) {- this.setState({ renderSelect: true })- }- }-- valueChanged() {- return this.state.lastSavedValue != this.state.value- }-- sendQuantityWrapper() {- this.sendQuantity(this.state.value)- }-- sendQuantity(quantity) {- this.setState({ renderSubmit: false })- this.setState({ sending: true })-- $.ajax({- url: this.props.url,- method: 'post',- data: { [this.props.fieldName]: quantity },- complete: () => {- this.setState({ sending: false })- if (quantity < this.props.thresholdValue) {- this.setState({ renderSelect: true })- }- },- success: (response) => {- if (!quantity) {- if (!response.total) {- location.reload()- }- $(findDOMNode(this)).parents('tr').fadeOut(function() {- $(this).remove()- })- }- if (response.hasOwnProperty('variantId')) {- const { variantId, subtotal, total, localTotal } = response- this.props.dispatch({- type: 'UPDATE_SUBTOTAL',- variantId,- subtotal- })- this.props.dispatch({- type: 'UPDATE_TOTAL',- total,- localTotal- })- }- this.setState({- result: 'success',- lastSavedValue: quantity- })- setTimeout(() => {- this.setState({ result: null })- }, 1000)- },- error: (response) => {- this.setState({- error: response.error.quantity,- result: 'error'- })- }- })- }-- removeFromCart() {- this.sendQuantity(0)- }-- render() {- let classNames = [this.props.className]- switch (this.state.result) {- case ('success'):- classNames.push('has-success')- break- case ('error'):- classNames.push('has-error')- break- }- let classNamesInput = ['input-group', 'cart-item-quantity']- if (- (!this.state.renderSubmit || !this.valueChanged())- && !(this.state.result === 'error')- ) {- classNamesInput.push('no-submit')- }-- const options = this.props.options.map((option) => (- <CartItemAmountOption- key={option}- label={option == this.props.thresholdValue ? `${option} +` : option}- value={option}- />- ))- const select = (- <select- className="form-control cart-item-quantity-select"- onChange={this._change}- value={this.state.value}- >- {options}- </select>- )- const input = (- <div className={classNamesInput.join(' ')}>- <input- className="form-control"- id="id_quantity"- max={this.props.max}- min={1}- name="quantity"- onChange={this._change}- onKeyUp={this._checkKey}- ref="inputQuantity"- type="number"- value={this.state.value}- />- <span className="input-group-btn">- <button- className="btn btn-info"- onClick={this.sendQuantityWrapper.bind(this)}- type="submit"- >- Update- </button>- </span>- </div>- )- return (- <div className={classNames.join(' ')}>- <div className="col-md-2 col-xs-4">- {this.state.renderSelect ? select : input}- {this.state.sending && this.state.result !== 'error' ? (- <i className="glyphicon glyphicon-time"></i>- ) : undefined}- {this.state.result === 'error' ? (- <span className="error text-danger">- {this.state.error}- </span>- ) : undefined}- </div>- <div className="col-md-2 col-xs-6 push-md-2 push-xs-6">- <button- className="btn btn-link btn-sm cart-item-remove"- onClick={this.removeFromCart.bind(this)}- type="submit"- >- <img src="/static/img/icon_delete.svg" />- </button>- </div>- </div>- )- }-}--const selectQuantities = (state) => ({}) // FIXME: move quantities to store--export const CartItemAmount = connect(selectQuantities)(CartItemAmountSelect);--const renderSubtotal = ({variantId, subtotals}) => {- let value;- if (subtotals.hasOwnProperty(variantId)) {- value = subtotals[variantId]- }- return (- <div className="col-md-2 col-xs-6 pull-md-2 pull-xs-6">- <span className="float-xs-left float-md-right">{value}</span>- </div>- )-}--const selectSubtotals = (state) => ({- subtotals: state.subtotals-})--export const CartItemSubtotal = connect(selectSubtotals)(renderSubtotal)--const renderTotal = ({total, localTotal}) => <span>- {total}- {localTotal ? <br/> : undefined}- {localTotal ? <small className="text-info">≈ {localTotal}</small> : undefined}-</span>--const selectTotal = (state) => ({- total: state.total,- localTotal: state.localTotal-})--export const CartTotal = connect(selectTotal)(renderTotal)diff --git a/saleor/static/js/dashboard.js b/saleor/static/js/dashboard.jsindex c314f322b3..8f23c6ca7d 100644--- a/saleor/static/js/dashboard.js+++ b/saleor/static/js/dashboard.js@@ -4,7 +4,7 @@ import 'materialize-css/dist/js/materialize'import 'select2'import Sortable from 'sortablejs'-import '../scss/dashboard.scss'+import '../scss/dashboard/dashboard.scss'function openModal() {$('.modal-trigger-custom').on('click', function (e) {diff --git a/saleor/static/js/demo/storefront.js b/saleor/static/js/demo/storefront.jsdeleted file mode 100644index dcf7240c9c..0000000000--- a/saleor/static/js/demo/storefront.js+++ /dev/null@@ -1,140 +0,0 @@-import '../../scss/demo/storefront.scss'-import 'jquery.cookie'-import React from 'react'-import ReactDOM from 'react-dom'--import VariantPicker from '../components/variantPicker/VariantPicker'--let csrftoken = $.cookie('csrftoken')--function csrfSafeMethod(method) {- return /^(GET|HEAD|OPTIONS|TRACE)$/.test(method)-}--$.ajaxSetup({- beforeSend: function(xhr, settings) {- if (!csrfSafeMethod(settings.type) && !this.crossDomain) {- xhr.setRequestHeader('X-CSRFToken', csrftoken)- }- }-})--// Mobile menu--$(document).ready((e) => {- var $toogleIcon = $('.navbar__brand__menu-toggle')- var $mobileNav = $('nav')- var windowWidth = $(window).width()-- if (windowWidth < 767) {- $mobileNav.append('<ul class="nav navbar-nav navbar__menu__login"></ul>')- $('.navbar__login a').appendTo('.navbar__menu__login')- .wrap( '<li class="nav-item login-item"></li>')- .addClass('nav-link')- }-- $toogleIcon.click((e) => {- $mobileNav.toggleClass('open')- event.stopPropagation()- })- $(document).click((e) => {- $mobileNav.removeClass('open')- })-})--// New address dropdown--var $addressShow = $('.address_show label')-var $addressHide = $('.address_hide label')-var $addressForm = $('.checkout__new-address')-var $initialValue = $('#address_new_address').prop('checked')-$addressShow.click((e) => {- $addressForm.slideDown('slow')-})-$addressHide.click((e) => {- $addressForm.slideUp('slow')-})-if ($initialValue) {- $addressForm.slideDown(0)-} else {- $addressForm.slideUp(0)-}--//Cart dropdown--var summaryLink = "/cart/summary"-var $cartDropdown = $(".cart-dropdown")-$.get(summaryLink, (data) => {- $cartDropdown.html(data)-})-$('.navbar__brand__cart').hover((e) => {- $cartDropdown.addClass("show")-}, (e) => {- $cartDropdown.removeClass("show")-})-$('.product-form button').click((e) => {- e.preventDefault()- var quantity = $('#id_quantity').val()- var variant = $('#id_variant').val()- $.ajax ({- url: $('.product-form').attr('action'),- type: 'POST',- data: {- variant: variant,- quantity: quantity- },- success: function() {- $.get(summaryLink, (data) => {- $cartDropdown.html(data)- var newQunatity = $('.cart-dropdown__total').data('quantity')- $('.badge').html(newQunatity).removeClass('hidden-xs-up')- $cartDropdown.addClass("show")- setTimeout((e) => {- $cartDropdown.removeClass('show')- }, 2500)- })- }- })-})--// Delivery information--var $deliveryForm = $('.deliveryform')-var crsfToken = $deliveryForm.data('crsf')-var $countrySelect = $('#id_country')-var $newMethod = $('.cart__delivery-info__method')-var $newPrice = $('.cart__delivery-info__price')-$countrySelect.on('change', (e) => {- var newCountry = $countrySelect.val()- $.ajax({- url: "/cart/shipingoptions/",- type: 'POST',- data: {- 'csrfmiddlewaretoken': crsfToken,- 'country': newCountry- },- success: (data) => {- $newMethod.empty()- $newPrice.empty()- $.each(data.options, (key, val) => {- $newMethod.append('<p>' + val.shipping_method__name + '</p>')- $newPrice.append('<p>$' + val.price[1] + '</p>')- })- }- })-})---const variantPicker = document.getElementById('variant-picker')-if (variantPicker) {- const variantPickerData = JSON.parse(variantPicker.dataset.variantPickerData)- ReactDOM.render(- <VariantPicker- attributes={variantPickerData.attributes}- url={variantPicker.dataset.action}- variants={variantPickerData.variants}- />,- variantPicker- )--}diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.jsindex a7169521f0..9bc083b8f4 100644--- a/saleor/static/js/storefront.js+++ b/saleor/static/js/storefront.js@@ -1,12 +1,8 @@-/* @flow */--import 'bootstrap-sass'-import $ from 'jquery'+import '../scss/storefront/storefront.scss'import 'jquery.cookie'import React from 'react'import ReactDOM from 'react-dom'-import '../scss/storefront.scss'import VariantPicker from './components/variantPicker/VariantPicker'let csrftoken = $.cookie('csrftoken')@@ -23,36 +19,108 @@ $.ajaxSetup({}})-$(function() {- const $carousel = $('.carousel')- const $items = $('.product-gallery-item')- const $modal = $('.modal')+// Mobile menu- $items.on('click', function(e) {- if ($carousel.is(':visible')) {- e.preventDefault()- }- const index = $(this).index()- $carousel.carousel(index)+$(document).ready((e) => {+ var $toogleIcon = $('.navbar__brand__menu-toggle')+ var $mobileNav = $('nav')+ var windowWidth = $(window).width()++ if (windowWidth < 767) {+ $mobileNav.append('<ul class="nav navbar-nav navbar__menu__login"></ul>')+ $('.navbar__login a').appendTo('.navbar__menu__login')+ .wrap( '<li class="nav-item login-item"></li>')+ .addClass('nav-link')+ }++ $toogleIcon.click((e) => {+ $mobileNav.toggleClass('open')+ event.stopPropagation()})+ $(document).click((e) => {+ $mobileNav.removeClass('open')+ })+})++// New address dropdown- $modal.on('show.bs.modal', function() {- const $img = $(this).find('.modal-body img')- const dataSrc = $img.attr('data-src')- $img.attr('src', dataSrc)+var $addressShow = $('.address_show label')+var $addressHide = $('.address_hide label')+var $addressForm = $('.checkout__new-address')+var $initialValue = $('#address_new_address').prop('checked')+$addressShow.click((e) => {+ $addressForm.slideDown('slow')+})+$addressHide.click((e) => {+ $addressForm.slideUp('slow')+})+if ($initialValue) {+ $addressForm.slideDown(0)+} else {+ $addressForm.slideUp(0)+}++//Cart dropdown++var summaryLink = "/cart/summary"+var $cartDropdown = $(".cart-dropdown")+$.get(summaryLink, (data) => {+ $cartDropdown.html(data)+})+$('.navbar__brand__cart').hover((e) => {+ $cartDropdown.addClass("show")+}, (e) => {+ $cartDropdown.removeClass("show")+})+$('.product-form button').click((e) => {+ e.preventDefault()+ var quantity = $('#id_quantity').val()+ var variant = $('#id_variant').val()+ $.ajax ({+ url: $('.product-form').attr('action'),+ type: 'POST',+ data: {+ variant: variant,+ quantity: quantity+ },+ success: function() {+ $.get(summaryLink, (data) => {+ $cartDropdown.html(data)+ var newQunatity = $('.cart-dropdown__total').data('quantity')+ $('.badge').html(newQunatity).removeClass('hidden-xs-up')+ $cartDropdown.addClass("show")+ setTimeout((e) => {+ $cartDropdown.removeClass('show')+ }, 2500)+ })+ }})})-$(function() {- const $i18nAddresses = $('.i18n-address')- $i18nAddresses.each(function () {- const $form = $(this).closest('form')- const $countryField = $form.find('select[name=country]')- const $previewField = $form.find('input.preview')- $countryField.on('change', () => {- $previewField.val('on')- $form.submit()- })+// Delivery information++var $deliveryForm = $('.deliveryform')+var crsfToken = $deliveryForm.data('crsf')+var $countrySelect = $('#id_country')+var $newMethod = $('.cart__delivery-info__method')+var $newPrice = $('.cart__delivery-info__price')+$countrySelect.on('change', (e) => {+ var newCountry = $countrySelect.val()+ $.ajax({+ url: "/cart/shipingoptions/",+ type: 'POST',+ data: {+ 'csrfmiddlewaretoken': crsfToken,+ 'country': newCountry+ },+ success: (data) => {+ $newMethod.empty()+ $newPrice.empty()+ $.each(data.options, (key, val) => {+ $newMethod.append('<p>' + val.shipping_method__name + '</p>')+ $newPrice.append('<p>$' + val.price[1] + '</p>')+ })+ }})})@@ -70,4 +138,3 @@ if (variantPicker) {)}-diff --git a/saleor/static/js/stores/cart-store.js b/saleor/static/js/stores/cart-store.jsdeleted file mode 100644index c52ba2451d..0000000000--- a/saleor/static/js/stores/cart-store.js+++ /dev/null@@ -1,50 +0,0 @@-/* @flow */--import { createStore } from 'redux';--type CartState = {- total: string;- subtotals: { [key: number]: string };-};--type CartUpdateTotal = {- type: 'UPDATE_TOTAL';- total: string,- localTotal: string-};--type CartUpdateSubtotal = {- type: 'UPDATE_SUBTOTAL';- variantId: number;- subtotal: string-};--type CartAction = CartUpdateTotal | CartUpdateSubtotal;--const defaultState: CartState = {- total: 'N/A',- localTotal: undefined,- subtotals: {}-}--const cart = (state: CartState = defaultState, action: CartAction) => {- switch(action.type) {- case ('UPDATE_TOTAL'):- return {- ...state,- total: action.total,- localTotal: action.localTotal- }- case ('UPDATE_SUBTOTAL'):- const { variantId, subtotal } = action;- const subtotals = { ...state.subtotals, [variantId]: subtotal }- return {- ...state,- subtotals- }- default:- return state- }-}--export default createStore(cart)diff --git a/saleor/static/scss/cart.scss b/saleor/static/scss/cart.scssdeleted file mode 100644index b4ec915f49..0000000000--- a/saleor/static/scss/cart.scss+++ /dev/null@@ -1,73 +0,0 @@-@import "~bootstrap-sass/assets/stylesheets/bootstrap/variables";--.cart {- > tbody {- > .cart-item {- > td {- vertical-align: text-bottom;- }- }- }-- &-item {- &-image {- display: inline-block;- max-width: 100%;- }-- &-quantity {- input {- border-bottom-right-radius: 0;- border-top-right-radius: 0;- }-- &-select {- display: inline-block;- width: calc(100% - 71px);-- option {- &:last-child {- color: lighten($text-color, 33%);- }- }- }-- &.has-error {- input {- border-color: $state-danger-text;- }- }- }-- &-amount {- .input-group {- &.no-submit {- display: inline-block;- width: calc(100% - 71px);-- input {- border-bottom-right-radius: $input-border-radius;- border-top-right-radius: $input-border-radius;- }-- .btn {- display: none;- }- }- }-- .fa {- margin-left: 6px;- padding-left: 1px;- }- }-- &-remove {- padding-left: 0;- }-- .error {- display: block;- }- }-}diff --git a/saleor/static/scss/dashboard.scss b/saleor/static/scss/dashboard/dashboard.scsssimilarity index 100%rename from saleor/static/scss/dashboard.scssrename to saleor/static/scss/dashboard/dashboard.scssdiff --git a/saleor/static/scss/vendor/_basic.scss b/saleor/static/scss/dashboard/vendor/_basic.scsssimilarity index 100%rename from saleor/static/scss/vendor/_basic.scssrename to saleor/static/scss/dashboard/vendor/_basic.scssdiff --git a/saleor/static/scss/vendor/_dropzone.scss b/saleor/static/scss/dashboard/vendor/_dropzone.scsssimilarity index 100%rename from saleor/static/scss/vendor/_dropzone.scssrename to saleor/static/scss/dashboard/vendor/_dropzone.scssdiff --git a/saleor/static/scss/widget/_breadcrumbs.scss b/saleor/static/scss/dashboard/widget/_breadcrumbs.scsssimilarity index 100%rename from saleor/static/scss/widget/_breadcrumbs.scssrename to saleor/static/scss/dashboard/widget/_breadcrumbs.scssdiff --git a/saleor/static/scss/widget/_card.scss b/saleor/static/scss/dashboard/widget/_card.scsssimilarity index 100%rename from saleor/static/scss/widget/_card.scssrename to saleor/static/scss/dashboard/widget/_card.scssdiff --git a/saleor/static/scss/widget/_data-table.scss b/saleor/static/scss/dashboard/widget/_data-table.scsssimilarity index 100%rename from saleor/static/scss/widget/_data-table.scssrename to saleor/static/scss/dashboard/widget/_data-table.scssdiff --git a/saleor/static/scss/widget/_dropzone.scss b/saleor/static/scss/dashboard/widget/_dropzone.scsssimilarity index 100%rename from saleor/static/scss/widget/_dropzone.scssrename to saleor/static/scss/dashboard/widget/_dropzone.scssdiff --git a/saleor/static/scss/widget/_form.scss b/saleor/static/scss/dashboard/widget/_form.scsssimilarity index 100%rename from saleor/static/scss/widget/_form.scssrename to saleor/static/scss/dashboard/widget/_form.scssdiff --git a/saleor/static/scss/widget/_list.scss b/saleor/static/scss/dashboard/widget/_list.scsssimilarity index 100%rename from saleor/static/scss/widget/_list.scssrename to saleor/static/scss/dashboard/widget/_list.scssdiff --git a/saleor/static/scss/widget/_ppoi.scss b/saleor/static/scss/dashboard/widget/_ppoi.scsssimilarity index 100%rename from saleor/static/scss/widget/_ppoi.scssrename to saleor/static/scss/dashboard/widget/_ppoi.scssdiff --git a/saleor/static/scss/widget/_product-gallery.scss b/saleor/static/scss/dashboard/widget/_product-gallery.scsssimilarity index 100%rename from saleor/static/scss/widget/_product-gallery.scssrename to saleor/static/scss/dashboard/widget/_product-gallery.scssdiff --git a/saleor/static/scss/widget/_select2.scss b/saleor/static/scss/dashboard/widget/_select2.scsssimilarity index 100%rename from saleor/static/scss/widget/_select2.scssrename to saleor/static/scss/dashboard/widget/_select2.scssdiff --git a/saleor/static/scss/widget/_tabs.scss b/saleor/static/scss/dashboard/widget/_tabs.scsssimilarity index 100%rename from saleor/static/scss/widget/_tabs.scssrename to saleor/static/scss/dashboard/widget/_tabs.scssdiff --git a/saleor/static/scss/widget/_toast.scss b/saleor/static/scss/dashboard/widget/_toast.scsssimilarity index 100%rename from saleor/static/scss/widget/_toast.scssrename to saleor/static/scss/dashboard/widget/_toast.scssdiff --git a/saleor/static/scss/storefront.scss b/saleor/static/scss/storefront.scssdeleted file mode 100644index e25ce1f112..0000000000--- a/saleor/static/scss/storefront.scss+++ /dev/null@@ -1,186 +0,0 @@-$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";-@import "~bootstrap-sass/assets/stylesheets/bootstrap";--.table > tbody > tr > td.noborder {- border-top: 1px solid transparent;-}--.navbar {- margin-bottom: $grid-gutter-width;-}--.price {- &.undiscounted {- position: relative;- &:before {- border-top: 1px solid;- border-color: inherit;- content: "";- left: 0;- position: absolute;- right: 0;- top: 50%;- transform: rotate(-5deg);- }- }-}--.address-details {- border-bottom: 1px dashed;- color: #3a87ad;- cursor: pointer;-}--.i18n-address {- .row {- @media (min-width: $screen-sm-min) {- display: flex;-- .col-sm-4 {- float: none;- flex: 1;- }- }- }-}--.popover {- min-width: 200px;-}--.product-list-item-name {- display: block;- margin-top: $grid-gutter-width/4;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;-}--.product-gallery {- margin-top: $grid-gutter-width;-}--.product-related {- .active {- border: 1px solid $btn-primary-border;- box-shadow: 0 0 5px $btn-primary-border;- }-}--.product-form {- .btn-group {- display: block;- overflow: hidden;- }-}--.breadcrumb {- > li+li {- &:before {- content: '/';- }- }-}--.nav {- > li {- > a {- @extend .text-info;- }-- &.active {- > a, a:hover {- background-color: $brand-info;- }- }- }-}--.page-header {- &--order {- margin-top: $grid-gutter-width/3;- }-}--.js {- .js-hidden {- display: none;- }-}--.nav-pills {- &.nav-wizard {- display: table;- a {- position: relative;- overflow: visible;- border-right: 15px solid $body-bg;- border-left: 15px solid $body-bg;- display: block;- width: 100%;- padding-top: 10px;- margin-top: 5px;- @media (min-width: $screen-xs-max) {- display: table-cell;- width: 25%;- padding-top: 0;- vertical-align: middle;- }- border-radius: 0;- background-color: $gray-lighter;- height: 40px;- text-align: center;-- &:first-of-type {- border-left: 0;- border-radius:5px 0 0 5px;- }-- &:last-of-type {- border-right: 0;- border-radius:0 5px 5px 0;- }-- &:hover {- text-decoration: none;- }- }-- .nav-arrow {- position: absolute;- top: 0px;- right: -20px;- width: 0px;- height: 0px;- border-style: solid;- border-width: 20px 0 20px 20px;- border-color: transparent transparent transparent $gray-lighter;- z-index: 150;- }-- .nav-wedge {- position: absolute;- top: 0px;- left: -20px;- width: 0px;- height: 0px;- border-style: solid;- border-width: 20px 0 20px 20px;- border-color: $gray-lighter $gray-lighter $gray-lighter transparent;- z-index: 150;- }-- .active {- .nav-arrow {- border-color: transparent transparent transparent $nav-pills-active-link-hover-bg;- }-- .nav-wedge {- border-color: $nav-pills-active-link-hover-bg $nav-pills-active-link-hover-bg $nav-pills-active-link-hover-bg transparent;- }-- background-color: $nav-pills-active-link-hover-bg;- color: $nav-pills-active-link-hover-color;- }- }-}diff --git a/saleor/static/scss/demo/components/_breadcrumbs.scss b/saleor/static/scss/storefront/components/_breadcrumbs.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_breadcrumbs.scssrename to saleor/static/scss/storefront/components/_breadcrumbs.scssdiff --git a/saleor/static/scss/demo/components/_buttons.scss b/saleor/static/scss/storefront/components/_buttons.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_buttons.scssrename to saleor/static/scss/storefront/components/_buttons.scssdiff --git a/saleor/static/scss/demo/components/_cart-dropdown.scss b/saleor/static/scss/storefront/components/_cart-dropdown.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_cart-dropdown.scssrename to saleor/static/scss/storefront/components/_cart-dropdown.scssdiff --git a/saleor/static/scss/demo/components/_cart.scss b/saleor/static/scss/storefront/components/_cart.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_cart.scssrename to saleor/static/scss/storefront/components/_cart.scssdiff --git a/saleor/static/scss/demo/components/_checkout.scss b/saleor/static/scss/storefront/components/_checkout.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_checkout.scssrename to saleor/static/scss/storefront/components/_checkout.scssdiff --git a/saleor/static/scss/demo/components/_fonts.scss b/saleor/static/scss/storefront/components/_fonts.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_fonts.scssrename to saleor/static/scss/storefront/components/_fonts.scssdiff --git a/saleor/static/scss/demo/components/_footer.scss b/saleor/static/scss/storefront/components/_footer.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_footer.scssrename to saleor/static/scss/storefront/components/_footer.scssdiff --git a/saleor/static/scss/demo/components/_forms.scss b/saleor/static/scss/storefront/components/_forms.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_forms.scssrename to saleor/static/scss/storefront/components/_forms.scssdiff --git a/saleor/static/scss/demo/components/_header.scss b/saleor/static/scss/storefront/components/_header.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_header.scssrename to saleor/static/scss/storefront/components/_header.scssdiff --git a/saleor/static/scss/demo/components/_home.scss b/saleor/static/scss/storefront/components/_home.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_home.scssrename to saleor/static/scss/storefront/components/_home.scssdiff --git a/saleor/static/scss/demo/components/_labels.scss b/saleor/static/scss/storefront/components/_labels.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_labels.scssrename to saleor/static/scss/storefront/components/_labels.scssdiff --git a/saleor/static/scss/demo/components/_login.scss b/saleor/static/scss/storefront/components/_login.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_login.scssrename to saleor/static/scss/storefront/components/_login.scssdiff --git a/saleor/static/scss/demo/components/_order-details.scss b/saleor/static/scss/storefront/components/_order-details.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_order-details.scssrename to saleor/static/scss/storefront/components/_order-details.scssdiff --git a/saleor/static/scss/demo/components/_pagination.scss b/saleor/static/scss/storefront/components/_pagination.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_pagination.scssrename to saleor/static/scss/storefront/components/_pagination.scssdiff --git a/saleor/static/scss/demo/components/_product-list.scss b/saleor/static/scss/storefront/components/_product-list.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_product-list.scssrename to saleor/static/scss/storefront/components/_product-list.scssdiff --git a/saleor/static/scss/demo/components/_product-page.scss b/saleor/static/scss/storefront/components/_product-page.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_product-page.scssrename to saleor/static/scss/storefront/components/_product-page.scssdiff --git a/saleor/static/scss/demo/components/_userprofile.scss b/saleor/static/scss/storefront/components/_userprofile.scsssimilarity index 100%rename from saleor/static/scss/demo/components/_userprofile.scssrename to saleor/static/scss/storefront/components/_userprofile.scssdiff --git a/saleor/static/scss/demo/storefront.scss b/saleor/static/scss/storefront/storefront.scsssimilarity index 100%rename from saleor/static/scss/demo/storefront.scssrename to saleor/static/scss/storefront/storefront.scssdiff --git a/saleor/static/scss/demo/variables.scss b/saleor/static/scss/storefront/variables.scsssimilarity index 100%rename from saleor/static/scss/demo/variables.scssrename to saleor/static/scss/storefront/variables.scssdiff --git a/templates/base.html b/templates/base.htmlindex 49fc13313e..71b3a7518e 100644--- a/templates/base.html+++ b/templates/base.html@@ -14,7 +14,7 @@{% endblock meta %}{% render_bundle 'vendor' 'css' %}- {% render_bundle 'demo' 'css' %}+ {% render_bundle 'storefront' 'css' %}{% block stylesheet %}{% endblock stylesheet %}@@ -166,7 +166,7 @@{% endblock %}{% block footer_scripts %}{% render_bundle 'vendor' 'js' %}- {% render_bundle 'demo' 'js' %}+ {% render_bundle 'storefront' 'js' %}{% endblock footer_scripts %}</body></html>diff --git a/templates/cart/index.html b/templates/cart/index.htmlindex c52df83d6c..67589f8c5d 100644--- a/templates/cart/index.html+++ b/templates/cart/index.html@@ -13,11 +13,6 @@</ul>{% endblock breadcrumb %}-{% block footer_scripts %}- {{ block.super }}- {% render_bundle 'cart' 'js' %}-{% endblock footer_scripts %}-{% block content %}<div class="cart">{% if cart_lines %}diff --git a/webpack.config.js b/webpack.config.jsindex 1443aa5f8b..9fcaf55a29 100644--- a/webpack.config.js+++ b/webpack.config.js@@ -28,10 +28,8 @@ var providePlugin = new webpack.ProvidePlugin({var config = {entry: {- cart: './saleor/static/js/cart.js',dashboard: './saleor/static/js/dashboard.js',storefront: './saleor/static/js/storefront.js',- demo: './saleor/static/js/demo/storefront.js',vendor: ['bootstrap','jquery',