Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Restrict styleguide access to staff
Marcin Gębala8af7793f99a6
diff --git a/saleor/core/views.py b/saleor/core/views.pyindex e862648f66..e0c9f30dd7 100644--- a/saleor/core/views.py+++ b/saleor/core/views.py@@ -1,6 +1,9 @@from django.template.response import TemplateResponse++from ..dashboard.views import staff_member_requiredfrom ..product.utils import products_with_availability, products_for_homepage+def home(request):products = products_for_homepage()[:8]products = products_with_availability(@@ -9,6 +12,7 @@ def home(request):request, 'home.html',{'products': products, 'parent': None})++@staff_member_requireddef styleguide(request):- return TemplateResponse(- request, 'styleguide.html')+ return TemplateResponse(request, 'styleguide.html')diff --git a/templates/base.html b/templates/base.htmlindex f79a2fd197..c6de3005a6 100644--- a/templates/base.html+++ b/templates/base.html@@ -184,6 +184,11 @@{% trans "Dashboard" context "Main navigation item" %}</a></li>+ <li>+ <a href="{% url "styleguide" %}">+ {% trans "Style guide" context "Main navigation item" %}+ </a>+ </li>{% endif %}<li><a href="{% url "profile:details" %}">diff --git a/templates/styleguide.html b/templates/styleguide.htmlindex c991c82adb..25fa366c51 100644--- a/templates/styleguide.html+++ b/templates/styleguide.html@@ -47,7 +47,7 @@<div class="col-md-9 styleguide__content"><div class="styleguide__content__note"><h3>Note</h3>- <p> if you’re using a recent version of IE, Firefox, Safari or Chrome (though not Opera), you can edit the text in sections marked with edit icon <img src="{% static "images/text-cursor.svg" %}">. Check how our componentst will look like in your language and with your content.</p>+ <p>If you’re using a recent version of IE, Firefox, Safari or Chrome (though not Opera), you can edit the text in sections marked with edit icon <img src="{% static "images/text-cursor.svg" %}">. Check how our componentst will look like in your language and with your content.</p></div><hr><div id="typography" class="styleguide__content__block">