kopia lustrzana https://github.com/longclawshop/longclaw
rodzic
109b7b214c
commit
2594246221
|
@ -5,11 +5,11 @@ cache: pip
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: TOX_ENV=py35-django-213
|
- env: TOX_ENV=py35-django-225
|
||||||
python: 3.5
|
python: 3.5
|
||||||
- env: TOX_ENV=py36-django-213
|
- env: TOX_ENV=py36-django-225
|
||||||
python: 3.6
|
python: 3.6
|
||||||
- env: TOX_ENV=py37-django-213
|
- env: TOX_ENV=py37-django-225
|
||||||
python: 3.7
|
python: 3.7
|
||||||
dist: xenial
|
dist: xenial
|
||||||
sudo: true
|
sudo: true
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from rest_framework.decorators import detail_route, list_route
|
from rest_framework.decorators import action
|
||||||
from rest_framework import permissions, status, viewsets
|
from rest_framework import permissions, status, viewsets
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from longclaw.basket.models import BasketItem
|
from longclaw.basket.models import BasketItem
|
||||||
|
@ -85,7 +85,7 @@ class BasketViewSet(viewsets.ModelViewSet):
|
||||||
return Response(data=serializer.data,
|
return Response(data=serializer.data,
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
|
|
||||||
@list_route(methods=['get'])
|
@action(detail=False, methods=['get'])
|
||||||
def total_items(self, request):
|
def total_items(self, request):
|
||||||
"""
|
"""
|
||||||
Get total number of items in the basket
|
Get total number of items in the basket
|
||||||
|
@ -96,7 +96,7 @@ class BasketViewSet(viewsets.ModelViewSet):
|
||||||
|
|
||||||
return Response(data={"quantity": n_total}, status=status.HTTP_200_OK)
|
return Response(data={"quantity": n_total}, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
@detail_route(methods=['get'])
|
@action(detail=True, methods=['get'])
|
||||||
def item_count(self, request, variant_id=None):
|
def item_count(self, request, variant_id=None):
|
||||||
"""
|
"""
|
||||||
Get quantity of a single item in the basket
|
Get quantity of a single item in the basket
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from rest_framework import viewsets, permissions, status
|
from rest_framework import viewsets, permissions, status
|
||||||
from rest_framework.decorators import detail_route, list_route
|
from rest_framework.decorators import action
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from longclaw.contrib.productrequests.serializers import ProductRequestSerializer
|
from longclaw.contrib.productrequests.serializers import ProductRequestSerializer
|
||||||
|
@ -31,7 +31,7 @@ class ProductRequestViewSet(viewsets.ModelViewSet):
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@list_route(methods=['get'])
|
@action(detail=False, methods=['get'])
|
||||||
def requests_for_variant(self, request, variant_id=None):
|
def requests_for_variant(self, request, variant_id=None):
|
||||||
"""Get all the requests for a single variant
|
"""Get all the requests for a single variant
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from rest_framework.decorators import detail_route
|
from rest_framework.decorators import action
|
||||||
from rest_framework import permissions, status, viewsets
|
from rest_framework import permissions, status, viewsets
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from longclaw.orders.models import Order
|
from longclaw.orders.models import Order
|
||||||
|
@ -10,7 +10,7 @@ class OrderViewSet(viewsets.ModelViewSet):
|
||||||
permission_classes = [permissions.IsAdminUser]
|
permission_classes = [permissions.IsAdminUser]
|
||||||
queryset = Order.objects.all()
|
queryset = Order.objects.all()
|
||||||
|
|
||||||
@detail_route(methods=['post'])
|
@action(detail=True, methods=['post'])
|
||||||
def refund_order(self, request, pk):
|
def refund_order(self, request, pk):
|
||||||
"""Refund the order specified by the pk
|
"""Refund the order specified by the pk
|
||||||
"""
|
"""
|
||||||
|
@ -18,7 +18,7 @@ class OrderViewSet(viewsets.ModelViewSet):
|
||||||
order.refund()
|
order.refund()
|
||||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
@detail_route(methods=['post'])
|
@action(detail=True, methods=['post'])
|
||||||
def fulfill_order(self, request, pk):
|
def fulfill_order(self, request, pk):
|
||||||
"""Mark the order specified by pk as fulfilled
|
"""Mark the order specified by pk as fulfilled
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,6 +24,7 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
|
||||||
'wagtail.contrib.forms',
|
'wagtail.contrib.forms',
|
||||||
|
@ -63,6 +64,7 @@ MIDDLEWARE = [
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'wagtail.core.middleware.SiteMiddleware',
|
'wagtail.core.middleware.SiteMiddleware',
|
||||||
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
|
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
|
||||||
]
|
]
|
||||||
|
@ -79,6 +81,7 @@ TEMPLATES = [
|
||||||
'django.template.context_processors.debug',
|
'django.template.context_processors.debug',
|
||||||
'django.template.context_processors.request',
|
'django.template.context_processors.request',
|
||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
'longclaw.configuration.context_processors.currency',
|
'longclaw.configuration.context_processors.currency',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -87,10 +87,10 @@ setup(
|
||||||
],
|
],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django>=2.1',
|
'django==2.2.5',
|
||||||
'wagtail>=2.3',
|
'wagtail==2.6.2',
|
||||||
'django-countries>=5.3.2',
|
'django-countries==5.5',
|
||||||
'django-extensions>=2.1.4',
|
'django-extensions==2.2.1',
|
||||||
'djangorestframework>=3.9.0',
|
'djangorestframework>=3.9.0',
|
||||||
'django-ipware>=2.1.0'
|
'django-ipware>=2.1.0'
|
||||||
],
|
],
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -1,13 +1,13 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
{py35,py36,py37}-django-213
|
{py35,py36,py37}-django-225
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONPATH = {toxinidir}:{toxinidir}/longclaw
|
PYTHONPATH = {toxinidir}:{toxinidir}/longclaw
|
||||||
commands = coverage run --source longclaw runtests.py
|
commands = coverage run --source longclaw runtests.py
|
||||||
coverage xml --omit=*/apps.py,*/migrations/*,*/__init__.py,*/gateways/braintree.py,*/gateways/stripe.py,*/bin/longclaw.py
|
coverage xml --omit=*/apps.py,*/migrations/*,*/__init__.py,*/gateways/braintree.py,*/gateways/stripe.py,*/bin/longclaw.py
|
||||||
deps =
|
deps =
|
||||||
django-213: Django==2.1.3
|
django-225: Django==2.2.5
|
||||||
-r{toxinidir}/requirements_dev.txt
|
-r{toxinidir}/requirements_dev.txt
|
||||||
basepython =
|
basepython =
|
||||||
py37: python3.7
|
py37: python3.7
|
||||||
|
|
|
@ -91,18 +91,12 @@ class Index extends React.Component {
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
|
|
||||||
const FeatureCallout = () => (
|
const QuickStart = () => (
|
||||||
<div
|
<Block layout="twoColumn">
|
||||||
className="productShowcaseSection paddingBottom"
|
className="productShowcaseSection paddingBottom"
|
||||||
style={{textAlign: 'center'}}>
|
style={{textAlign: 'center'}}>
|
||||||
<h2>Features</h2>
|
<h2>Quick Start</h2>
|
||||||
<ul>
|
</Block>
|
||||||
<li>Fully customisable product catalog management. Capture any attribute of your product</li>
|
|
||||||
<li>Fully integrated with Wagtail - Use all features of Wagtail as normal (add a blog, articles or any other wagtail plugin)</li>
|
|
||||||
<li>Multiple payment backend integrations; Stripe, Braintree, Paypal...</li>
|
|
||||||
<li>Dashboard view in the Wagtail admin shows statistics about your shop</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const Support = () => (
|
const Support = () => (
|
||||||
|
@ -215,6 +209,7 @@ class Index extends React.Component {
|
||||||
<HomeSplash siteConfig={siteConfig} language={language} />
|
<HomeSplash siteConfig={siteConfig} language={language} />
|
||||||
<div className="mainContainer">
|
<div className="mainContainer">
|
||||||
<Features />
|
<Features />
|
||||||
|
<QuickStart />
|
||||||
<Support />
|
<Support />
|
||||||
<Showcase />
|
<Showcase />
|
||||||
</div>
|
</div>
|
||||||
|
|
Ładowanie…
Reference in New Issue