Init Django-SHOP

This commit is contained in:
2021-02-23 22:57:30 +00:00
parent 8842939839
commit b4a79a6890
109 changed files with 5734 additions and 160 deletions

View File

@@ -0,0 +1 @@
{% extends "weirdlittleempire/pages/error.html" %}

View File

@@ -0,0 +1 @@
{% extends "weirdlittleempire/pages/error.html" %}

View File

@@ -0,0 +1 @@
{% extends "weirdlittleempire/pages/error.html" %}

View File

@@ -0,0 +1 @@
{% extends "shop/cart/editable.html" %}

View File

@@ -0,0 +1,12 @@
{% extends "shop/catalog/available-product-add2cart.html" %}
{% load i18n %}
{% block available-quantity-in-stock %}{# intentionally empty #}{% endblock %}
{% block change-purchasing-quantity %}
<div class="d-flex flex-column w-25" ng-hide="context.availability.quantity">
<div class="lead mt-1">
{% trans "This item has already been sold" %}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends "weirdlittleempire/pages/default.html" %}
{% load cms_tags sekizai_tags sass_tags %}
{% block title %}{{ product.product_name }}{% endblock %}
{% block breadcrumb %}{% with extra_ance=product.product_name %}
{% if product.show_breadcrumb %}{% include "shop/breadcrumb/default.html" %}{% endif %}
{% endwith %}{% endblock %}
{% block main-content %}
{# the first `render_placeholder` is only required for editing the page #}
{% render_placeholder product.placeholder %}{% render_placeholder product.placeholder as product_details %}
{% if not product_details %}
<div class="container">
<div class="row">
<div class="col">
<h1>{% render_model product "product_name" %}</h1>
<p class="lead">Edit this page, then switch into <em>Structure</em> mode and add plugins to placeholder <code> {{ product.placeholder.slot }} </code>.</p>
</div>
</div>
</div>
{% endif %}
{% endblock main-content %}

View File

@@ -0,0 +1,9 @@
{% load static sekizai_tags %}
{% addtoblock "js" %}<script src="{% static 'shop/js/filter-form.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% add_data "ng-requires" "django.shop.filter" %}
<form shop-product-filter="manufacturer" style="margin-bottom: 10px;">
{{ filter.filter_set.form.as_div }}
</form>

View File

@@ -0,0 +1,23 @@
{% extends "weirdlittleempire/pages/default.html" %}
{% load cms_tags sekizai_tags sass_tags %}
{% block title %}{{ product.product_name }}{% endblock %}
{% block breadcrumb %}{% with extra_ance=product.product_name %}
{% include "shop/breadcrumb/default.html" %}
{% endwith %}{% endblock %}
{% block main-content %}
<div class="container">
<div class="row">
<div class="col">
<h1>{% render_model product "product_name" %}</h1>
{# the first `render_placeholder` is only required for editing the page #}
{% render_placeholder product.placeholder %}{% render_placeholder product.placeholder as product_details %}
{% if not product_details %}
<p class="lead">Edit this page, then switch into <em>Structure</em> mode and add plugins to placeholder <code> {{ product.placeholder.slot }} </code>.</p>
{% endif %}
</div>
</div>
</div>
{% endblock main-content %}

View File

@@ -0,0 +1,36 @@
{% extends "weirdlittleempire/catalog/product-detail.html" %}
{% load i18n cms_tags thumbnail %}
{% block main-content %}
{% thumbnail product.images.first 250x250 crop as thumb %}
<div class="container">
<div class="row">
<div class="col col-md-10 offset-md-1">
<h1>{% render_model product "product_name" %}</h1>
<div class="media mb-3 flex-column flex-md-row">
<img class="mr-3 mb-3" src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}" alt="{{ product.product_name }}">
<div class="media-body">
{{ product.description|safe }}
</div>
</div>
<h4>{% trans "Details" %}</h4>
<ul class="list-group mb-3">
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Card Type" %}:</div>
<strong>{{ product.get_card_type_display }}</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Storage capacity" %}:</div>
<strong>{{ product.storage }} GB</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Manufacturer" %}:</div>
<strong>{{ product.manufacturer }}</strong>
</li>
</ul>
<!-- include "Add to Cart" dialog box -->
{% include "shop/catalog/available-product-add2cart.html" with card_css_classes="mb-3" %}
</div>
</div>
</div>
{% endblock main-content %}

View File

@@ -0,0 +1,18 @@
{% extends "shop/catalog/available-product-add2cart.html" %}
{% load i18n %}
{% block add-to-cart-url %}{{ product.get_absolute_url }}/add-smartphone-to-cart{% endblock %}
{% block available-quantity-in-stock %}
<div class="d-flex flex-column">
<label for="product_code">{% trans "Internal Storage" %}</label>
<select class="form-control" name="product_code" ng-model="context.product_code" ng-change="updateContext()" >
{% for smartphone in product.variants.all %}
<option value="{{ smartphone.product_code }}">
{% if smartphone.storage == 0 %}{% trans "Pluggable" %}{% else %}{{ smartphone.storage }} GB{% endif %}
</option>
{% endfor %}
</select>
</div>
{{ block.super }}
{% endblock %}

View File

@@ -0,0 +1,71 @@
{% extends "weirdlittleempire/catalog/product-detail.html" %}
{% load i18n static cms_tags sekizai_tags sass_tags %}
{% block main-content %}
{% addtoblock "css" %}<link href="{% sass_src 'shop/css/bsp-scrollpanel.scss' %}" rel="stylesheet" type="text/css" />{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-bootstrap-plus/src/scrollpanel/scrollpanel.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% add_data "ng-requires" "bs-plus.scrollpanel" %}
<div class="container">
<div class="row">
<div class="col col-md-10 offset-md-1">
<h1>{% render_model product "product_name" %}</h1>
<bsp-scrollpanel class="shop-product-detail">
<ul>{% for img in product.images.all %}
<li><img src="{{ img.url }}" alt="{{ product.product_name }}" /></li>
{% endfor %}</ul>
</bsp-scrollpanel>
</div>
<div class="col col-md-10 offset-md-1">
<h4>{% trans "Details" %}</h4>
{{ product.description|safe }}
<ul class="list-group mb-3">
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Manufacturer" %}:</div>
<strong>{{ product.manufacturer }}</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Battery" %}:</div>
<strong>{{ product.get_battery_type_display }} ({{ product.battery_capacity }} mAh)</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "RAM Storage" %}:</div>
<strong>{{ product.ram_storage }} MB</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "WiFi Connectivity" %}:</div>
<strong>{{ product.wifi_connectivity }}</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">Bluetooth:</div>
<strong>{{ product.get_bluetooth_display }}</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">GPS:</div>
<strong><i class="fa {{ product.gps|yesno:'fa-check,fa-times' }}"></i></strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Dimensions" %}:</div>
<strong>{{ product.width }} mm (w) &times; {{ product.height }} mm (h)</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Weight" %}:</div>
<strong>{{ product.weight }} g</strong>
</li>
<li class="list-group-item d-flex">
<div class="w-50">{% trans "Screen size" %}:</div>
<strong>{{ product.screen_size }} ({% trans "inch" %})</strong>
</li>
</ul>
<!-- include "Add to Cart" dialog box -->
{% include "weirdlittleempire/catalog/smartphone-add2cart.html" with use_modal_dialog=True card_css_classes="mb-3" %}
</div>
</div>
</div>
{% include "shop/catalog/bsp-scrollpanel.tmpl.html" %}
{% endblock main-content %}

View File

@@ -0,0 +1,6 @@
{% extends "shop/email/base.html" %}
{% load post_office %}
{% block email-logo %}
<img src="{% inline_image 'weirdlittleempire/django-shop-logo.png' %}" width="200" style="margin: 20px auto; display: block;" />
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "shop/email/password-reset-body.html" %}
{% load post_office %}
{% block email-logo %}
<img src="{% inline_image 'weirdlittleempire/django-shop-logo.png' %}" width="200" style="margin: 20px auto; display: block;" />
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "shop/email/register-user-body.html" %}
{% load post_office %}
{% block email-logo %}
<img src="{% inline_image 'weirdlittleempire/django-shop-logo.png' %}" width="200" style="margin: 20px auto; display: block;" />
{% endblock %}

View File

@@ -0,0 +1,67 @@
{% load static cms_tags sekizai_tags djng_tags i18n %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" ng-app="myShop">
<head>
<title>{% block title %}django SHOP demo{% endblock %}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="{{ ROBOTS_META_TAGS }}" />
<meta name="description" content="{% block meta-description %}{% endblock %}" />
{% block head %}{% endblock head %}
{% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %}
</head>
{% addtoblock "js" %}<script src="{% static 'node_modules/angular/angular.min.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-sanitize/angular-sanitize.min.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-i18n/' %}{% djng_locale_script 'de' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-animate/angular-animate.min.js' %}" type="text/javascript"></script>{% endaddtoblock %}
<body>
{% cms_toolbar %}
<header>
{% block header %}{% endblock %}
</header>
{% block toast-messages %}{% include "shop/messages.html" %}{% endblock %}
<main>
{% block breadcrumb %}{% endblock %}
{% block main-content %}
<div class="container">
<div class="row shop-starter-template">
<div class="col">
<h1>Base Template</h1>
<p class="lead">This document does not contain any content yet.</p>
</div>
</div>
</div>
{% endblock main-content %}
</main>
<footer class="footer">
{% block footer %}{% endblock footer %}
</footer>
{% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %}
<script type="text/javascript">
angular.module('myShop', ['ngAnimate', 'ngSanitize', {% with_data "ng-requires" as ng_requires %}
{% for module in ng_requires %}'{{ module }}'{% if not forloop.last %}, {% endif %}{% endfor %}{% end_with_data %}
]).config(['$httpProvider', '$locationProvider', '$sanitizeProvider', function($httpProvider, $locationProvider, $sanitizeProvider) {
$httpProvider.defaults.headers.common['X-CSRFToken'] = '{{ csrf_token }}';
$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
$locationProvider.html5Mode({
enabled: true,
requireBase: false,
rewriteLinks: false
});
$sanitizeProvider.addValidAttrs(['srcset']);
}]){% with_data "ng-config" as configs %}
{% for config in configs %}.config({{ config }}){% endfor %};
{% end_with_data %}
</script>
</body>
</html>

View File

@@ -0,0 +1,36 @@
{% extends "weirdlittleempire/pages/base.html" %}
{% load static cms_tags i18n sekizai_tags sass_tags %}
{% block title %}{% page_attribute "page_title" %}{% endblock %}
{% block head %}
{{ block.super }}
{% addtoblock "css" %}<link href="{% sass_src 'weirdlittleempire/css/default.scss' %}" rel="stylesheet" type="text/css" />{% endaddtoblock %}
{% endblock head %}
{% block header %}
{% include "weirdlittleempire/pages/navbar.html" with navbar_classes="navbar-expand-lg navbar-light bg-light fixed-top" %}
{% endblock header %}
{% block breadcrumb %}
{% placeholder "Breadcrumb" %}
{% endblock breadcrumb %}
{% block main-content %}{% placeholder "Main Content" inherit or %}
<div class="container">
<div class="row shop-starter-template">
<div class="col">
<h1>Default Template</h1>
<p class="lead">Use this placeholder as a quick way to start editing a new CMS page.<br/>
All you have to do is to append <code>?edit</code> to the URL and switch to “Structure” mode.</p>
</div>
</div>
</div>
{% endplaceholder %}{% endblock main-content %}
{% block footer %}{% static_placeholder "Static Footer" or %}
<div class="container">
<p class="text-muted">Place sticky footer content here.</p>
</div>
{% endstatic_placeholder %}{% endblock footer %}

View File

@@ -0,0 +1,19 @@
{% extends "weirdlittleempire/pages/default.html" %}%}
{% load i18n cms_tags %}
{% block breadcrumb %}{% endblock %}
{% page_url 'shop-login' as login_url %}
{% block main-content %}
<div class="container mt-5">
<div class="row">
<div class="col col-sm-10 col-md-8 offset-sm-1 offset-md-2">
<h3>{{ detail|default:"Forbidden" }}</h3>
{% if status_code == 403 and login_url %}
<p>{% blocktrans %}In case you have ordered anything on this site before, please <a href="{{ login_url }}">sign in</a> and try again.{% endblocktrans %}</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,49 @@
{% extends "bootstrap4/includes/ng-nav-navbar.html" %}
{% load static i18n cms_tags menu_tags sekizai_tags sass_tags shop_tags %}
{% spaceless %}
{% page_url 'shop-watch-list' as shop_watch_list_url %}{% if not shop_watch_list_url %}{% url "shop-watch-list" as shop_watch_list_url %}{% endif %}
{% block navbar %}
<div class="container">
{% block navbar-brand %}
<div class="shop-brand-icon">
<a href="/">
<img src="{% static 'weirdlittleempire/django-shop-logo.svg' %}" alt="django-SHOP" aria-hidden="true">
</a>
</div>
{% endblock %}
{% block navbar-toggler %}{{ block.super }}{% endblock %}
<div class="collapse navbar-collapse" uib-collapse="isNavCollapsed">
<ul class="navbar-nav flex-wrap align-content-between w-100">
<li class="nav-item shop-social-icons">{% static_placeholder "Social Icons" %}</li>
<li class="mx-auto"></li>
{% include "shop/navbar/login-logout.html" with item_class="shop-secondary-menu" %}
{% with item_class="shop-secondary-menu" %}{% language_chooser "shop/navbar/language-chooser.html" %}{% endwith %}
{% include "shop/navbar/watch-icon.html" with item_class="shop-secondary-menu" %}
{% with item_class="shop-secondary-menu" %}
{% if current_page.reverse_id == 'shop-cart' or current_page.reverse_id == 'shop-watch-list' %}
{% cart_icon without %}
{% else %}
{% cart_icon unsorted %}
{% endif %}
{% endwith %}
<li class="w-100"></li>
{% with item_class="nav-item shop-primary-menu" %}{% block navbar-nav %}{{ block.super }}{% endblock %}{% endwith %}
<li class="nav-item shop-search-form">{% include "shop/navbar/search-form.html" with search_form_classes="form-inline" %}</li>
</ul>
</div>
</div>
{% addtoblock "js" %}<script src="{% static 'node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% add_data "ng-requires" "ui.bootstrap" %}
{% addtoblock "js" %}<script src="{% static 'cms_bootstrap/js/ng-nav-navbar.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'shop/js/navbar.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% add_data "ng-requires" "django.shop.navbar" %}
{% endblock navbar %}
{% endspaceless %}

View File

@@ -0,0 +1,54 @@
{% load static i18n cascade_tags djng_tags sekizai_tags sass_tags %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" ng-app="myShop">
<head>
<title>Test page</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="{{ ROBOTS_META_TAGS }}" />
<meta name="description" content="{% block meta-description %}{% endblock %}" />
{% block head %}{% endblock head %}
{% render_block "css" postprocessor "shop.sekizai_processors.compress" %}
</head>
{% addtoblock "css" %}<link href="{% sass_src 'weirdlittleempire/css/default.scss' %}" rel="stylesheet" type="text/css" />{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular/angular.min.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-sanitize/angular-sanitize.min.js' %}"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-i18n/' %}{% djng_locale_script 'de' %}"></script>{% endaddtoblock %}
{% addtoblock "js" %}<script src="{% static 'node_modules/angular-animate/angular-animate.min.js' %}"></script>{% endaddtoblock %}
<body>
<header>
{% include "weirdlittleempire/pages/navbar.html" with navbar_classes="navbar-default navbar-fixed-top" %}
</header>
<main>
{% render_cascade "weirdlittleempire/strides/home.json" %}
</main>
<footer class="footer">
{% block footer %}{% endblock footer %}
</footer>
{% render_block "js" postprocessor "shop.sekizai_processors.compress" %}
<script type="text/javascript">
angular.module('myShop', ['ngAnimate', 'ngSanitize', {% with_data "ng-requires" as ng_requires %}
{% for module in ng_requires %}'{{ module }}'{% if not forloop.last %}, {% endif %}{% endfor %}{% end_with_data %}
]).config(['$httpProvider', '$locationProvider', function($httpProvider, $locationProvider) {
$httpProvider.defaults.headers.common['X-CSRFToken'] = '{{ csrf_token }}';
$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
$locationProvider.html5Mode({
enabled: true,
requireBase: false,
rewriteLinks: false
});
}]){% with_data "ng-config" as configs %}
{% for config in configs %}.config({{ config }}){% endfor %};
{% end_with_data %}
</script>
</body>
</html>

View File

@@ -0,0 +1,6 @@
{% extends "shop/print/delivery-note.html" %}
{% load static %}
{% block header %}
<img src="{% static 'weirdlittleempire/django-shop-logo.svg' %}" class="shop-logo" alt="django-SHOP" height="45">
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "shop/print/invoice.html" %}
{% load static %}
{% block header %}
<img src="{% static 'weirdlittleempire/django-shop-logo.svg' %}" class="shop-logo" alt="django-SHOP" height="45">
{% endblock %}

View File

@@ -0,0 +1,2 @@
{% extends "shop/products/cart-product-media.html" %}
{% block sample-image %}{% include "shop/products/sample-image.html" %}{% endblock %}

View File

@@ -0,0 +1,4 @@
{% load thumbnail %}
{% thumbnail product.sample_image 244x244 crop as thumb %}
{% thumbnail product.sample_image 488x488 crop as thumb2 %}
<img class="img-fluid" src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}" srcset="{{ thumb.url }} 1x, {{ thumb2.url }} 2x" />

View File

@@ -0,0 +1,7 @@
{% extends "shop/products/dropdown-product-media.html" %}
{% load thumbnail %}
{% block sample-image %}
{% thumbnail product.sample_image 50x50 crop as thumb %}
{% thumbnail product.sample_image 100x100 crop as thumb2 %}
<img class="mr-1" width="{{ thumb.width }}" height="{{ thumb.height }}" src="{{ thumb.url }}" srcset="{{ thumb.url }} 1x, {{ thumb2.url }} 2x" />
{% endblock %}

View File

@@ -0,0 +1 @@
{% extends "shop/products/sample-image.path" %}

View File

@@ -0,0 +1,2 @@
{% extends "shop/products/order-product-media.html" %}
{% block sample-image %}{% include "shop/products/sample-image.html" %}{% endblock %}

View File

@@ -0,0 +1,2 @@
{% extends "shop/products/print-product-media.html" %}
{% block print-image %}{% include "shop/products/print-image.html" %}{% endblock %}

View File

@@ -0,0 +1,2 @@
{% extends "shop/products/search-product-media.html" %}
{% block sample-image %}{% include "shop/products/sample-image.html" %}{% endblock %}

View File

@@ -0,0 +1,5 @@
{% extends "weirdlittleempire/products/search-product-media.html" %}
{% block media-body %}
<h4 class="media-heading"><a href="{{ product.get_absolute_url }}">{{ product.product_name }}</a></h4>
{{ product.description|truncatewords_html:50 }}
{% endblock %}

View File

@@ -0,0 +1,5 @@
{% extends "weirdlittleempire/products/search-product-media.html" %}
{% block media-body %}
<h4 class="media-heading"><a href="{{ product.get_absolute_url }}">{{ product.product_name }}</a></h4>
{{ product.caption|truncatewords_html:50 }}
{% endblock %}

View File

@@ -0,0 +1 @@
{% extends "weirdlittleempire/products/cart-product-media.html" %}

View File

@@ -0,0 +1,3 @@
{% load shop_search_tags %}
{% include "weirdlittleempire/search/indexes/product.txt" %}
{% render_placeholder product.placeholder %}

View File

@@ -0,0 +1,3 @@
{{ product.caption }}
{{ product.manufacturer }}{% for page in product.cms_pages.public %}
{{ page.get_title }}{% endfor %}

View File

@@ -0,0 +1,3 @@
{% include "weirdlittleempire/search/indexes/product.txt" %}
{{ product.description }}
{{ product.get_card_type_display }} {{ product.storage }}GB

View File

@@ -0,0 +1,4 @@
{% include "myshop/search/indexes/product.txt" %}
{{ product.description }}
{{ product.operating_system }}{% for variant in product.get_product_variants %}
{{ variant.storage}}GB{% endfor %}