Skip to content

Saleor Core: the high performance, composable, headless commerce API.

WIP Drop logic in templates related to view/edit permissions

Pacu23772fd57b4a7
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.py
index 80b634d2c9..e094965cf0 100644
--- a/saleor/dashboard/product/views.py
+++ b/saleor/dashboard/product/views.py
@@ -202,7 +202,8 @@ def ajax_products_list(request):
Response format is that of a Select2 JS widget.
"""
queryset = (
- Product.objects.all() if request.user.has_perm('product.manage_products')
+ Product.objects.all()
+ if request.user.has_perm('product.manage_products')
else Product.objects.available_products())
search_query = request.GET.get('q', '')
if search_query:
diff --git a/templates/dashboard/base.html b/templates/dashboard/base.html
index 78340bb3cc..84e97c0cef 100644
--- a/templates/dashboard/base.html
+++ b/templates/dashboard/base.html
@@ -96,33 +96,27 @@
{% trans "Home" context "Dashboard homepage" %}
</a>
</li>
- {% if perms.product.manage_products or perms.product.manage_products %}
+ {% if perms.product.manage_products %}
<li class="side-nav-section" id="first">
<p>
{% trans "Catalogue" context "Dashboard catalogue" %}
</p>
<ul>
- {% if perms.product.manage_products %}
<li class="{% block menu_products_class %}{% endblock %}">
<a href="{% url 'dashboard:product-list' %}">
{% trans "Products" context "Dashboard products list" %}
</a>
</li>
- {% endif %}
- {% if perms.product.manage_products %}
<li class="{% block menu_categories_class %}{% endblock %}">
<a href="{% url 'dashboard:category-list' %}">
{% trans "Categories" context "Dashboard categories list" %}
</a>
</li>
- {% endif %}
- {% if perms.product.manage_products %}
<li class="{% block menu_collections_class %}{% endblock %}">
<a href="{% url 'dashboard:collection-list' %}">
{% trans "Collections" context "Dashboard side navigation link" %}
</a>
</li>
- {% endif %}
</ul>
</li>
{% endif %}
diff --git a/templates/dashboard/category/detail.html b/templates/dashboard/category/detail.html
index 8f6365fb99..40370a218e 100644
--- a/templates/dashboard/category/detail.html
+++ b/templates/dashboard/category/detail.html
@@ -89,7 +89,6 @@
{% endif %}
</div>
</div>
- {% if perms.product.manage_products %}
<div class="card-action">
<a class="btn-flat waves-effect" href="{% url 'dashboard:category-edit' root_pk=root.pk %}">
{% trans "Edit category" context "Category detail view action" %}
@@ -98,7 +97,6 @@
{% trans "Remove category" context "Category detail view action" %}
</a>
</div>
- {% endif %}
</div>
<div class="card">
<div class="card-content">
@@ -121,9 +119,7 @@
{% trans "Description" context "Category list table header description" as label %}
{% sorting_header 'description' label is_wide=True %}
- {% if perms.product.manage_products %}
- <th></th>
- {% endif %}
+ <th></th>
</tr>
</thead>
<tbody>
@@ -139,16 +135,14 @@
&nbsp;
{% endif %}
</td>
- {% if perms.product.manage_products %}
- <td class="right-align ignore-link">
- <a href="{% url 'dashboard:category-edit' root_pk=node.pk %}" class="btn-flat waves-effect">
- {% trans 'Edit' context 'Category edit action' %}
- </a>
- <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:category-delete' pk=node.pk %}">
- {% trans "Remove" context "Category list action link" %}
- </a>
- </td>
- {% endif %}
+ <td class="right-align ignore-link">
+ <a href="{% url 'dashboard:category-edit' root_pk=node.pk %}" class="btn-flat waves-effect">
+ {% trans 'Edit' context 'Category edit action' %}
+ </a>
+ <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:category-delete' pk=node.pk %}">
+ {% trans "Remove" context "Category list action link" %}
+ </a>
+ </td>
</tr>
{% empty %}
<tr>
diff --git a/templates/dashboard/category/list.html b/templates/dashboard/category/list.html
index 027d1899f2..64527b4b7b 100644
--- a/templates/dashboard/category/list.html
+++ b/templates/dashboard/category/list.html
@@ -18,13 +18,11 @@
{% endblock %}
{% block header_extra %}
- {% if perms.product.manage_products %}
- <div class="btn-fab-fixed">
- <a href="{% url 'dashboard:category-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans 'Add category' context 'Category list add button text' %}">
- <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:category-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans 'Add category' context 'Category list add button text' %}">
+ <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/collection/detail.html b/templates/dashboard/collection/detail.html
index 6a467c2b48..8a83a4888d 100644
--- a/templates/dashboard/collection/detail.html
+++ b/templates/dashboard/collection/detail.html
@@ -23,23 +23,21 @@
{% block header_extra %}
{% if collection.pk %}
- {% if perms.product.manage_products %}
- <a class="dropdown-button right" href="#" data-activates="collection-delete" data-constrainwidth="false">
- <svg data-src="{% static "dashboard/images/more-vert.svg" %}" height="24" width="24" />
- </a>
- <ul id="collection-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:collection-delete' pk=collection.pk %}">
- {% trans "Remove collection" context "Collection action" %}
- </a>
- </li>
- <li>
- <a href="{{ collection.get_absolute_url }}">
- {% trans "View on site" context "Collection action" %}
- </a>
- </li>
- </ul>
- {% endif %}
+ <a class="dropdown-button right" href="#" data-activates="collection-delete" data-constrainwidth="false">
+ <svg data-src="{% static "dashboard/images/more-vert.svg" %}" height="24" width="24" />
+ </a>
+ <ul id="collection-delete" class="dropdown-content">
+ <li>
+ <a class="modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:collection-delete' pk=collection.pk %}">
+ {% trans "Remove collection" context "Collection action" %}
+ </a>
+ </li>
+ <li>
+ <a href="{{ collection.get_absolute_url }}">
+ {% trans "View on site" context "Collection action" %}
+ </a>
+ </li>
+ </ul>
{% endif %}
{% endblock %}
diff --git a/templates/dashboard/collection/list.html b/templates/dashboard/collection/list.html
index 6a258c9a17..9cf8ec3f60 100644
--- a/templates/dashboard/collection/list.html
+++ b/templates/dashboard/collection/list.html
@@ -20,13 +20,11 @@
{% endblock %}
{% block header_extra %}
- {% if perms.product.manage_products %}
- <div class="btn-fab-fixed">
- <a href="{% url 'dashboard:collection-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add collection" context 'Collections list add button text' %}">
- <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:collection-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add collection" context 'Collections list add button text' %}">
+ <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
+ </a>
+ </div>
{% endblock %}
{% block content %}
@@ -50,7 +48,7 @@
</thead>
{% for node in collections %}
<tbody>
- <tr data-action-go="{% if perms.product.manage_products %}{% url 'dashboard:collection-update' node.pk %}{% endif %}">
+ <tr data-action-go="{% url 'dashboard:collection-update' node.pk %}">
<td>
{{ node.name }}
</td>
diff --git a/templates/dashboard/customer/detail.html b/templates/dashboard/customer/detail.html
index c443fa5825..bacd89ad09 100644
--- a/templates/dashboard/customer/detail.html
+++ b/templates/dashboard/customer/detail.html
@@ -70,14 +70,12 @@
{% endif %}
</div>
<div class="card-action">
- {% if perms.account.manage_users %}
- <a href="{% url 'dashboard:customer-update' customer.pk %}" class="btn-flat waves-effect">
- {% trans "Edit customer" context "Customer action" %}
- </a>
- <a href="#base-modal" data-href="{% url 'dashboard:customer-delete' pk=customer.pk %}" class="modal-trigger-custom btn-flat waves-effect">
- {% trans "Remove customer" context "Customer action" %}
- </a>
- {% endif %}
+ <a href="{% url 'dashboard:customer-update' customer.pk %}" class="btn-flat waves-effect">
+ {% trans "Edit customer" context "Customer action" %}
+ </a>
+ <a href="#base-modal" data-href="{% url 'dashboard:customer-delete' pk=customer.pk %}" class="modal-trigger-custom btn-flat waves-effect">
+ {% trans "Remove customer" context "Customer action" %}
+ </a>
{% if perms.account.impersonate_user %}
<a href="{% url 'impersonate-start' uid=customer.pk %}" class="btn-flat waves-effect">
{% trans 'Impersonate customer' context 'Customer impersonate action' %}
@@ -160,13 +158,11 @@
</div>
{% endif %}
</div>
- {% if perms.account.manage_users %}
- <div class="card-action">
- <a data-href="{% url "dashboard:customer-add-note" customer_pk=customer.pk %}" class="modal-trigger-custom btn-flat waves-effect" href="#base-modal">
- {% trans "Add note" context "Customer notes card action" %}
- </a>
- </div>
- {% endif %}
+ <div class="card-action">
+ <a data-href="{% url "dashboard:customer-add-note" customer_pk=customer.pk %}" class="modal-trigger-custom btn-flat waves-effect" href="#base-modal">
+ {% trans "Add note" context "Customer notes card action" %}
+ </a>
+ </div>
</div>
</div>
diff --git a/templates/dashboard/customer/form.html b/templates/dashboard/customer/form.html
index 74fb7d6034..79e3964c32 100644
--- a/templates/dashboard/customer/form.html
+++ b/templates/dashboard/customer/form.html
@@ -53,7 +53,6 @@
</div>
</div>
</div>
- {% if perms.account.manage_users %}
<div class="card-action right-align">
{% if customer.pk %}
<a href="{% url 'dashboard:customer-details' pk=customer.pk %}" class="btn-flat waves-effect">
@@ -71,7 +70,6 @@
</button>
{% endif %}
</div>
- {% endif %}
</form>
{% endif %}
</div>
diff --git a/templates/dashboard/customer/list.html b/templates/dashboard/customer/list.html
index a63c70cdf7..49dd83eb01 100644
--- a/templates/dashboard/customer/list.html
+++ b/templates/dashboard/customer/list.html
@@ -13,7 +13,7 @@
{% block menu_customers_class %}active{% endblock %}
{% block header_extra %}
- {% if perms.account.manage_staff %}
+ {% if perms.account.manage_users %}
<div class="btn-fab-fixed">
<a href="{% url 'dashboard:customer-create' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add customer" context "Customer list add button text" %}" >
<svg data-src="{% static "dashboard/images/add.svg" %}" />
diff --git a/templates/dashboard/discount/sale/list.html b/templates/dashboard/discount/sale/list.html
index f520e81230..d8d2daceaf 100644
--- a/templates/dashboard/discount/sale/list.html
+++ b/templates/dashboard/discount/sale/list.html
@@ -22,14 +22,12 @@
{% block menu_discounts_class %} active{% endblock %}
{% block header_extra %}
- {% if perms.discount.manage_sales %}
- <div class="btn-fab-fixed">
- <a href="{% url 'dashboard:sale-add' %}" class="btn-fab-default waves-effect waves-light"
- title="{% trans "Add sale" context "Sale (discount) list add button text" %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:sale-add' %}" class="btn-fab-default waves-effect waves-light"
+ title="{% trans "Add sale" context "Sale (discount) list add button text" %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ </div>
{% endblock %}
{% block content %}
@@ -50,7 +48,7 @@
</thead>
<tbody>
{% for sale in sales %}
- <tr data-action-go="{% if perms.sale.manage_sales %}{% url 'dashboard:sale-update' pk=sale.pk %}{% endif %}">
+ <tr data-action-go="{% url 'dashboard:sale-update' pk=sale.pk %}">
<td>
{{ sale }}
</td>
diff --git a/templates/dashboard/discount/voucher/list.html b/templates/dashboard/discount/voucher/list.html
index 27fb4c8536..014f9a9876 100644
--- a/templates/dashboard/discount/voucher/list.html
+++ b/templates/dashboard/discount/voucher/list.html
@@ -24,13 +24,11 @@
{% block menu_discounts_class %} active{% endblock %}
{% block header_extra %}
- {% if perms.discount.manage_vouchers %}
- <div class="btn-fab-fixed">
- <a href="{% url 'dashboard:voucher-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add voucher" context "Voucher list add button text" %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:voucher-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add voucher" context "Voucher list add button text" %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ </div>
{% endblock %}
{% block content %}
@@ -67,7 +65,7 @@
</thead>
{% for voucher in vouchers %}
<tbody>
- <tr data-action-go="{% if perms.voucher.manage_vouchers %}{% url 'dashboard:voucher-update' pk=voucher.pk %}{% endif %}">
+ <tr data-action-go="{% url 'dashboard:voucher-update' pk=voucher.pk %}">
<td>
{{ voucher }}
</td>
diff --git a/templates/dashboard/includes/_menu_items.html b/templates/dashboard/includes/_menu_items.html
index 035341a532..31bba42137 100644
--- a/templates/dashboard/includes/_menu_items.html
+++ b/templates/dashboard/includes/_menu_items.html
@@ -17,9 +17,7 @@
<table class="bordered highlight responsive data-table data-table-description">
<thead>
<tr>
- {% if perms.menu.manage_menus %}
- <th class="data-table-icon"></th>
- {% endif %}
+ <th class="data-table-icon"></th>
{% trans "Name" context "Menu items list table header name" as label %}
{% sorting_header 'name' label is_wide=True %}
@@ -27,39 +25,33 @@
{% trans "Points to" context "Menu items list table header points to" as label %}
<th>{{ label }}</th>
- {% if perms.menu.manage_menus %}
- <th></th>
- {% endif %}
+ <th></th>
</tr>
</thead>
<tbody class="sortable-items" data-post-url="{% if menu_item %}{% url 'dashboard:menu-items-reorder' menu_pk=menu.pk root_pk=menu_item.pk %}{% else %}{% url 'dashboard:menu-items-reorder' menu_pk=menu.pk %}{% endif %}" data-post-name="ordered_menu_items">
{% for item in menu_items %}
<tr data-action-go="{% url 'dashboard:menu-item-details' menu_pk=menu.pk item_pk=item.pk %}" class="sortable-item" data-id="{{ item.pk }}">
- {% if perms.menu.manage_menus %}
- <td class="data-table-icon ignore-link sortable__drag-area">
- <svg data-src="{% static "dashboard/images/reorder.svg" %}" height="20" width="20" fill="#000" />
- </td>
- {% endif %}
+ <td class="data-table-icon ignore-link sortable__drag-area">
+ <svg data-src="{% static "dashboard/images/reorder.svg" %}" height="20" width="20" fill="#000" />
+ </td>
<td>
{{ item.name }}
</td>
<td>
{{ item.destination_display }}
</td>
- {% if perms.menu.manage_menus %}
- <td class="right-align ignore-link">
- <a href="{% url 'dashboard:menu-item-edit' menu_pk=menu.pk item_pk=item.pk %}" class="btn-flat waves-effect">
- {% trans 'Edit' context 'Menu item edit action' %}
- </a>
- <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:menu-item-delete' menu_pk=menu.pk item_pk=item.pk %}">
- {% trans "Remove" context "Menu item list action link" %}
- </a>
- </td>
- {% endif %}
+ <td class="right-align ignore-link">
+ <a href="{% url 'dashboard:menu-item-edit' menu_pk=menu.pk item_pk=item.pk %}" class="btn-flat waves-effect">
+ {% trans 'Edit' context 'Menu item edit action' %}
+ </a>
+ <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:menu-item-delete' menu_pk=menu.pk item_pk=item.pk %}">
+ {% trans "Remove" context "Menu item list action link" %}
+ </a>
+ </td>
</tr>
{% empty %}
<tr>
- <td colspan="{% if perms.menu.manage_menus %}4{% else %}2{% endif %}">{% trans "No menu items" context "Empty list of menu items" %}</td>
+ <td colspan="4">{% trans "No menu items" context "Empty list of menu items" %}</td>
</tr>
{% endfor %}
</tbody>
diff --git a/templates/dashboard/menu/detail.html b/templates/dashboard/menu/detail.html
index 7e0ded4444..355588ded9 100644
--- a/templates/dashboard/menu/detail.html
+++ b/templates/dashboard/menu/detail.html
@@ -43,7 +43,6 @@
{{ menu.name }}
</span>
</div>
- {% if perms.product.manage_menus %}
<div class="card-action">
<a class="btn-flat waves-effect" href="{% url "dashboard:menu-edit" pk=menu.pk %}">
{% trans "Edit menu" context "Menu detail view action" %}
@@ -52,7 +51,6 @@
{% trans "Remove menu" context "Menu detail view action" %}
</a>
</div>
- {% endif %}
</div>
{% include 'dashboard/includes/_menu_items.html' with menu=menu menu_items=menu_items %}
</div>
diff --git a/templates/dashboard/menu/item/detail.html b/templates/dashboard/menu/item/detail.html
index ce37fdbe1c..4e93a7a16c 100644
--- a/templates/dashboard/menu/item/detail.html
+++ b/templates/dashboard/menu/item/detail.html
@@ -80,7 +80,6 @@
</div>
</div>
</div>
- {% if perms.product.manage_menus %}
<div class="card-action">
<a class="btn-flat waves-effect" href="{% url "dashboard:menu-item-edit" menu_pk=menu.pk item_pk=menu_item.pk %}">
{% trans "Edit menu item" context "Menu item detail view action" %}
@@ -89,7 +88,6 @@
{% trans "Remove menu item" context "Menu item detail view action" %}
</a>
</div>
- {% endif %}
</div>
{% if menu_item.level < 2 %}
{% include 'dashboard/includes/_menu_items.html' with menu=menu menu_items=menu_items root_item=menu_item %}
diff --git a/templates/dashboard/menu/list.html b/templates/dashboard/menu/list.html
index b15a4b7a9c..e3cc177ade 100644
--- a/templates/dashboard/menu/list.html
+++ b/templates/dashboard/menu/list.html
@@ -16,13 +16,11 @@
{% endblock %}
{% block header_extra %}
- {% if perms.product.manage_menus %}
- <div class="btn-fab-fixed">
- <a href="{% url 'dashboard:menu-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans 'Add menu' context 'Menu list add button text' %}">
- <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a href="{% url 'dashboard:menu-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans 'Add menu' context 'Menu list add button text' %}">
+ <svg data-src="{% static 'dashboard/images/add.svg' %}"/>
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
@@ -89,18 +87,16 @@
</div>
<div class="row">
{{ assign_menu_form.bottom_menu|materializecss }}
- </div>
+ </div>
</div>
- {% if perms.menu.manage_menus %}
- <div class="card-action right-align">
- <div class="col s12">
- <button type="submit" class="btn waves-effect right">
- {% trans "Save" context "Dashboard update action" %}
- </button>
- </div>
- <div class="clearfix"></div>
+ <div class="card-action right-align">
+ <div class="col s12">
+ <button type="submit" class="btn waves-effect right">
+ {% trans "Save" context "Dashboard update action" %}
+ </button>
</div>
- {% endif %}
+ <div class="clearfix"></div>
+ </div>
</form>
</div>
</div>
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index 6dfcee3ba9..012c75b4c0 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -26,23 +26,20 @@
<svg data-src="{% static "dashboard/images/more-vert.svg" %}" height="24" width="24" />
</a>
<ul id="context-menu" class="dropdown-content">
- {% if perms.order.manage_orders %}
- {% if order.can_cancel %}
- <li>
- <a href="#base-modal" data-href="{% url "dashboard:order-cancel" order_pk=order.pk %}" class="modal-trigger-custom">
- {% trans "Cancel Order" context "Order detail action" %}
- </a>
- </li>
- {% endif %}
- {% if order.is_draft %}
- <li>
- <a href="#base-modal" data-href="{% url "dashboard:draft-order-delete" order_pk=order.pk %}" class="modal-trigger-custom">
- {% trans "Remove draft order" context "Order detail action" %}
- </a>
- </li>
- {% endif %}
+ {% if order.can_cancel %}
+ <li>
+ <a href="#base-modal" data-href="{% url "dashboard:order-cancel" order_pk=order.pk %}" class="modal-trigger-custom">
+ {% trans "Cancel Order" context "Order detail action" %}
+ </a>
+ </li>
{% endif %}
- {% if not order.is_draft %}
+ {% if order.is_draft %}
+ <li>
+ <a href="#base-modal" data-href="{% url "dashboard:draft-order-delete" order_pk=order.pk %}" class="modal-trigger-custom">
+ {% trans "Remove draft order" context "Order detail action" %}
+ </a>
+ </li>
+ {% else %}
<li>
<a class="btn-print" href="#">
{% trans "Print" context "Order detail action" %}
@@ -158,7 +155,7 @@
</tbody>
</table>
</div>
- {% if perms.order.manage_orders and not order.is_draft %}
+ {% if not order.is_draft %}
{% if can_capture or can_refund or can_release or can_mark_as_paid %}
<div class="data-table-action">
{% if can_capture %}
@@ -190,7 +187,7 @@
<div class="card-content card-border">
<span class="card-title black-text">
{% trans "Customer" context "Order details summary header" %}
- {% if perms.order.manage_orders and order.is_draft %}
+ {% if order.is_draft %}
<span class="right">
<a href="#base-modal" data-href="{% url "dashboard:order-customer-edit" order_pk=order.pk %}" class="btn-flat waves-effect modal-trigger-custom"
title="{% trans "Edit customer details" context "Order customer details action title" %}">
@@ -214,13 +211,11 @@
<div class="card-content card-border">
<span class="card-title black-text">
{% trans "Shipping address" context "" %}
- {% if perms.order.manage_orders %}
- <span class="right">
- <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}" class="btn-flat waves-effect">
- {% trans "Edit" context "Dashboard edit action" %}
- </a>
- </span>
- {% endif %}
+ <span class="right">
+ <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}" class="btn-flat waves-effect">
+ {% trans "Edit" context "Dashboard edit action" %}
+ </a>
+ </span>
</span>
{% if order.shipping_address %}
{% format_address order.shipping_address %}
@@ -231,14 +226,12 @@
{% endif %}
<div class="card-content">
<span class="card-title black-text">
- {% trans "Billing address" context "" %}
- {% if perms.order.manage_orders %}
- <span class="right">
- <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}" class="btn-flat waves-effect">
- {% trans "Edit" context "Dashboard edit action" %}
- </a>
- </span>
- {% endif %}
+ {% trans "Billing address" context "" %}
+ <span class="right">
+ <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}" class="btn-flat waves-effect">
+ {% trans "Edit" context "Dashboard edit action" %}
+ </a>
+ </span>
</span>
{% if order.billing_address %}
{% if order.billing_address == order.shipping_address %}
@@ -313,7 +306,7 @@
{% price line.unit_price order.display_gross_prices %}
</td>
<td class="right-align">
- {% if perms.order.manage_orders and order.is_draft %}
+ {% if order.is_draft %}
<a class="dropdown-button" href="#" data-activates="line-actions-{{ line.pk }}" data-constrainwidth="false">
{{ line.quantity }}
<svg data-src="{% static "dashboard/images/arrow-drop-down.svg" %}" width="24" height="24" />
@@ -345,7 +338,7 @@
{% trans "Subtotal" context "Order subtotal" %}
</p>
<p>
- {% if perms.order.manage_orders and order.is_draft %}
+ {% if order.is_draft %}
<a href="#base-modal" data-href="{% url 'dashboard:order-shipping-edit' order_pk=order.pk %}"
class="modal-trigger-custom" title="{% trans "Edit shipping" context "Order totals action" %}">
{% if order.shipping_method_name %}
@@ -375,7 +368,7 @@
</p>
{% if order.is_draft or order.discount_amount %}
<p>
- {% if perms.order.manage_orders and order.is_draft %}
+ {% if order.is_draft %}
<a class="dropdown-button" href="#" data-activates="discount-menu" data-constrainwidth="false">
{% if order.discount_name %}
{% blocktrans trimmed with voucher=order.discount_name context "Order totals header" %}
@@ -430,37 +423,33 @@
</tbody>
</table>
</div>
- {% if perms.order.manage_orders %}
- <div class="data-table-action">
- {% if perms.order.manage_orders %}
- {% if order.is_open %}
- <a href="{% url 'dashboard:fulfill-order-lines' order_pk=order.pk %}" class="btn-flat waves-effect" title="{% trans "Fulfill order" context "Order summary card action title" %}">
- {% trans "Fulfill" context "Order summary card action" %}
- </a>
- {% endif %}
- {% if order.is_draft %}
- <a href="#base-modal" data-href="{% url 'dashboard:add-variant-to-order' order_pk=order.pk %}" class="btn-flat waves-effect modal-trigger-custom" title="{% trans "Add product to order" context "Order summary card action title" %}">
- {% trans "Add product" context "Order summary card action" %}
- </a>
- {% endif %}
- <span class="right">
- {% if order.is_draft %}
- <a href="#base-modal" data-href="{% url 'dashboard:create-order-from-draft' order_pk=order.pk %}" class="btn waves-effect modal-trigger-custom" title="{% trans "Create order" context "Order summary card action title" %}">
- {% trans "Create order" context "Order summary card action" %}
- </a>
- {% endif %}
- </span>
- {% endif %}
- {% if not order.is_draft %}
- <a href="{% url 'dashboard:order-invoice' order_pk=order.pk %}" class="btn-flat waves-effect" target="_blank">
- {% trans "Invoice" context "Order detail action" %}
- </a>
- <a href="{% url 'order:details' token=order.token %}" class="btn-flat waves-effect" target="_blank">
- {% trans "View on site" context "Order detail action" %}
+ <div class="data-table-action">
+ {% if order.is_open %}
+ <a href="{% url 'dashboard:fulfill-order-lines' order_pk=order.pk %}" class="btn-flat waves-effect" title="{% trans "Fulfill order" context "Order summary card action title" %}">
+ {% trans "Fulfill" context "Order summary card action" %}
+ </a>
+ {% endif %}
+ {% if order.is_draft %}
+ <a href="#base-modal" data-href="{% url 'dashboard:add-variant-to-order' order_pk=order.pk %}" class="btn-flat waves-effect modal-trigger-custom" title="{% trans "Add product to order" context "Order summary card action title" %}">
+ {% trans "Add product" context "Order summary card action" %}
+ </a>
+ {% endif %}
+ <span class="right">
+ {% if order.is_draft %}
+ <a href="#base-modal" data-href="{% url 'dashboard:create-order-from-draft' order_pk=order.pk %}" class="btn waves-effect modal-trigger-custom" title="{% trans "Create order" context "Order summary card action title" %}">
+ {% trans "Create order" context "Order summary card action" %}
</a>
{% endif %}
- </div>
- {% endif %}
+ </span>
+ {% if not order.is_draft %}
+ <a href="{% url 'dashboard:order-invoice' order_pk=order.pk %}" class="btn-flat waves-effect" target="_blank">
+ {% trans "Invoice" context "Order detail action" %}
+ </a>
+ <a href="{% url 'order:details' token=order.token %}" class="btn-flat waves-effect" target="_blank">
+ {% trans "View on site" context "Order detail action" %}
+ </a>
+ {% endif %}
+ </div>
</div>
{% for fulfillment in order_fulfillments %}
<div class="card shipment-table">
@@ -507,7 +496,7 @@
</tbody>
</table>
</div>
- {% if perms.order.manage_orders and fulfillment.can_edit %}
+ {% if fulfillment.can_edit %}
<div class="data-table-action">
<a href="#base-modal" data-href="{% url 'dashboard:fulfillment-cancel' order_pk=order.pk fulfillment_pk=fulfillment.pk %}"
class="btn-flat waves-effect modal-trigger-custom" title="{% trans "Cancel fulfillment" context "Fulfillment summary card action title" %}">
@@ -549,13 +538,11 @@
</p>
{% endif %}
</div>
- {% if perms.order.manage_orders %}
- <div class="card-action">
- <a data-href="{% url "dashboard:order-add-note" order_pk=order.pk %}" class="modal-trigger-custom btn-flat waves-effect" href="#base-modal">
- {% trans "Add note" context "Order notes card action" %}
- </a>
- </div>
- {% endif %}
+ <div class="card-action">
+ <a data-href="{% url "dashboard:order-add-note" order_pk=order.pk %}" class="modal-trigger-custom btn-flat waves-effect" href="#base-modal">
+ {% trans "Add note" context "Order notes card action" %}
+ </a>
+ </div>
</div>
</div>
</div>
diff --git a/templates/dashboard/order/list.html b/templates/dashboard/order/list.html
index f12bd85198..2e3ea2e83b 100644
--- a/templates/dashboard/order/list.html
+++ b/templates/dashboard/order/list.html
@@ -13,17 +13,15 @@
{% block menu_orders_class %}active{% endblock %}
{% block header_extra %}
- {% if perms.order.manage_orders %}
- <div class="btn-fab-fixed">
- <form method="POST" action="{% url "dashboard:order-create" %}">
- {% csrf_token %}
- <label class="btn-fab-default waves-effect waves-light svg-submit-btn" title="{% trans "Add order" context "Order list add button text" %}">
- <input type="submit" />
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </label>
- </form>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <form method="POST" action="{% url "dashboard:order-create" %}">
+ {% csrf_token %}
+ <label class="btn-fab-default waves-effect waves-light svg-submit-btn" title="{% trans "Add order" context "Order list add button text" %}">
+ <input type="submit" />
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </label>
+ </form>
+ </div>
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/page/detail.html b/templates/dashboard/page/detail.html
index 24b08ba3e9..c6a90d1feb 100644
--- a/templates/dashboard/page/detail.html
+++ b/templates/dashboard/page/detail.html
@@ -45,14 +45,12 @@
{{ page.get_full_url }}
</div>
<div class="card-action">
- {% if perms.page.manage_pages %}
- <a href="{% url 'dashboard:page-update' page.pk %}" class="btn-flat waves-effect">
- {% trans "Edit page" context "Page action" %}
- </a>
- <a href="#base-modal" data-href="{% url 'dashboard:page-delete' pk=page.pk %}" class="modal-trigger-custom btn-flat waves-effect">
- {% trans "Remove page" context "Page action" %}
- </a>
- {% endif %}
+ <a href="{% url 'dashboard:page-update' page.pk %}" class="btn-flat waves-effect">
+ {% trans "Edit page" context "Page action" %}
+ </a>
+ <a href="#base-modal" data-href="{% url 'dashboard:page-delete' pk=page.pk %}" class="modal-trigger-custom btn-flat waves-effect">
+ {% trans "Remove page" context "Page action" %}
+ </a>
<a href="{% url "page:details" slug=page.slug %}" target="_blank" class="btn-flat waves-effect">
{% trans "View on site" context "Page action" %}
</a>
diff --git a/templates/dashboard/page/list.html b/templates/dashboard/page/list.html
index 0589f9632a..c2dcce0906 100644
--- a/templates/dashboard/page/list.html
+++ b/templates/dashboard/page/list.html
@@ -11,15 +11,13 @@
{% block body_class %}body-page{% endblock %}
{% block header_extra %}
- {% if perms.page.manage_pages %}
- <div class="btn-fab-fixed">
- <a class="btn-fab-default waves-effect waves-light"
- href="{% url 'dashboard:page-add' %}"
- title="{% trans "Add page" context "Page list add button text" %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a class="btn-fab-default waves-effect waves-light"
+ href="{% url 'dashboard:page-add' %}"
+ title="{% trans "Add page" context "Page list add button text" %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/detail.html b/templates/dashboard/product/detail.html
index 7df20f8161..56d6a2cbc8 100644
--- a/templates/dashboard/product/detail.html
+++ b/templates/dashboard/product/detail.html
@@ -36,33 +36,31 @@
<div class="col s12 l8">
<div class="card">
<div class="card-content">
- {% if perms.product.manage_products %}
- <div class="product-header">
- <div class="product-header__title">
- <span class="card-title">
- {{ product }}
- </span>
- </div>
- <div class="product-header__switch">
- <form id="toggle-publish-form" action="{% url 'dashboard:product-publish' product.pk %}">
- {% csrf_token %}
- <div class="switch" id="product-is-published">
- <label>
- <input id="toggle-publish-switch" type="checkbox" {% if product.is_published %} checked {% endif %}>
- <span class="lever"></span>
- <span class="label">
- {% if product.is_published %}
- {% trans "Published" context "Product field" %}
- {% else %}
- {% trans "Draft" context "Product field" %}
- {% endif %}
- </span>
- </label>
- </div>
- </form>
- </div>
+ <div class="product-header">
+ <div class="product-header__title">
+ <span class="card-title">
+ {{ product }}
+ </span>
</div>
- {% endif %}
+ <div class="product-header__switch">
+ <form id="toggle-publish-form" action="{% url 'dashboard:product-publish' product.pk %}">
+ {% csrf_token %}
+ <div class="switch" id="product-is-published">
+ <label>
+ <input id="toggle-publish-switch" type="checkbox" {% if product.is_published %} checked {% endif %}>
+ <span class="lever"></span>
+ <span class="label">
+ {% if product.is_published %}
+ {% trans "Published" context "Product field" %}
+ {% else %}
+ {% trans "Draft" context "Product field" %}
+ {% endif %}
+ </span>
+ </label>
+ </div>
+ </form>
+ </div>
+ </div>
<div class="row">
<div class="col s12">
<h5>{% render_availability_status product %}</h5>
@@ -73,14 +71,12 @@
</p>
</div>
<div class="card-action">
- {% if perms.product.manage_products %}
- <a href="{% url "dashboard:product-update" product.pk %}" class="btn-flat waves-effect">
- {% trans "Edit product" context "Product action" %}
- </a>
- <a href="#base-modal" data-href="{% url 'dashboard:product-delete' pk=product.pk %}" class="modal-trigger-custom btn-flat waves-effect">
- {% trans "Remove product" context "Product action" %}
- </a>
- {% endif %}
+ <a href="{% url "dashboard:product-update" product.pk %}" class="btn-flat waves-effect">
+ {% trans "Edit product" context "Product action" %}
+ </a>
+ <a href="#base-modal" data-href="{% url 'dashboard:product-delete' pk=product.pk %}" class="modal-trigger-custom btn-flat waves-effect">
+ {% trans "Remove product" context "Product action" %}
+ </a>
<a href="{{ product.get_absolute_url }}" target="_blank" class="btn-flat waves-effect">
{% trans "View on site" context "Product action" %}
</a>
@@ -91,11 +87,9 @@
<div class="card-content">
<span class="card-title">{% trans "Variant" %}</span>
</div>
- {% if perms.product.manage_products %}
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:variant-add' product_pk=product.pk %}" class="btn-flat waves-effect">{% trans "Add" %}</a>
- </div>
- {% endif %}
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:variant-add' product_pk=product.pk %}" class="btn-flat waves-effect">{% trans "Add" %}</a>
+ </div>
<div class="data-table-container">
<table class="bordered highlight responsive data-table">
<thead>
@@ -111,9 +105,7 @@
{% endif %}
</th>
<th class="right-align">{% trans "Margin" %}</th>
- {% if perms.product.manage_products %}
- <th></th>
- {% endif %}
+ <th></th>
</tr>
</thead>
<tbody>
@@ -135,9 +127,7 @@
-
{% endif %}
</td>
- {% if perms.product.manage_products %}
- <td><a href="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}" class="btn-flat waves-effect">{% trans "Edit" %}</a></td>
- {% endif %}
+ <td><a href="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}" class="btn-flat waves-effect">{% trans "Edit" %}</a></td>
</tr>
{% empty %}
<tr>
@@ -275,11 +265,9 @@
{% endfor %}
</div>
</div>
- {% if perms.product.manage_products %}
- <div class="card-action">
- <a href="{% url 'dashboard:product-image-list' product.pk %}" class="btn-flat waves-effect">{% trans "Edit images" %}</a>
- </div>
- {% endif %}
+ <div class="card-action">
+ <a href="{% url 'dashboard:product-image-list' product.pk %}" class="btn-flat waves-effect">{% trans "Edit images" %}</a>
+ </div>
</div>
</div>
</div>
diff --git a/templates/dashboard/product/list.html b/templates/dashboard/product/list.html
index 6cad8c08fa..5e22236b33 100644
--- a/templates/dashboard/product/list.html
+++ b/templates/dashboard/product/list.html
@@ -16,19 +16,17 @@
{% block header_extra %}
{% if product_types %}
- {% if perms.product.manage_products %}
- <div class="btn-fab-fixed">
- {% if product_types|length > 1 %}
- <a data-href="{% url "dashboard:product-add-select-type" %}" class="btn-fab-default waves-effect waves-light modal-trigger-custom" href="#base-modal" title="{% trans "Add product" context "Product list add button text" %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- {% else %}
- <a class="btn-fab-default waves-effect waves-light modal-trigger" href="{% url 'dashboard:product-add' product_types.0.pk %}" title="{% trans "Add product" context "Product list add button text" %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- {% endif %}
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ {% if product_types|length > 1 %}
+ <a data-href="{% url "dashboard:product-add-select-type" %}" class="btn-fab-default waves-effect waves-light modal-trigger-custom" href="#base-modal" title="{% trans "Add product" context "Product list add button text" %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ {% else %}
+ <a class="btn-fab-default waves-effect waves-light modal-trigger" href="{% url 'dashboard:product-add' product_types.0.pk %}" title="{% trans "Add product" context "Product list add button text" %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ {% endif %}
+ </div>
{% endif %}
{% endblock %}
diff --git a/templates/dashboard/product/product_attribute/detail.html b/templates/dashboard/product/product_attribute/detail.html
index e33c0698d4..3b1621a25a 100644
--- a/templates/dashboard/product/product_attribute/detail.html
+++ b/templates/dashboard/product/product_attribute/detail.html
@@ -43,7 +43,6 @@
{{ attribute.name }}
</span>
</div>
- {% if perms.product.manage_products %}
<div class="card-action">
<a class="btn-flat waves-effect" href="{% url "dashboard:product-attribute-update" attribute.pk %}">
{% trans "Edit attribute" context "Attribute detail action" %}
@@ -52,7 +51,6 @@
{% trans "Remove attribute" context "Attribute detail action" %}
</a>
</div>
- {% endif %}
</div>
</div>
<div class="col s12 l9">
@@ -60,48 +58,38 @@
<div class="card-content">
<span class="card-title">{% trans "Attribute values" %}</span>
</div>
- {% if perms.product.manage_products %}
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:product-attribute-value-add' attribute_pk=attribute.pk %}" class="btn-flat waves-effect">
- {% trans "Add" %}
- </a>
- </div>
- {% endif %}
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:product-attribute-value-add' attribute_pk=attribute.pk %}" class="btn-flat waves-effect">
+ {% trans "Add" %}
+ </a>
+ </div>
<div class="data-table-container">
<table class="bordered highlight responsive data-table">
<thead>
<tr>
- {% if perms.product.manage_products %}
- <th class="data-table-icon"></th>
- {% endif %}
+ <th class="data-table-icon"></th>
<th>{% trans "Display name" %}</th>
- {% if perms.product.manage_products %}
- <th></th>
- {% endif %}
+ <th></th>
</tr>
</thead>
<tbody class="sortable-items" data-post-url="{% url 'dashboard:product-attribute-values-reorder' attribute_pk=attribute.pk %}" data-post-name="ordered_values">
{% for value in values %}
<tr class="sortable-item" data-id="{{ value.pk }}">
- {% if perms.product.manage_products %}
- <td class="data-table-icon ignore-link sortable__drag-area">
- <svg data-src="{% static "dashboard/images/reorder.svg" %}" height="20" width="20" fill="#000" />
- </td>
- {% endif %}
+ <td class="data-table-icon ignore-link sortable__drag-area">
+ <svg data-src="{% static "dashboard/images/reorder.svg" %}" height="20" width="20" fill="#000" />
+ </td>
<td>
{{ value.name }}
</td>
- {% if perms.product.manage_products %}
- <td class="right-align">
- <a href="{% url 'dashboard:product-attribute-value-update' attribute_pk=attribute.pk value_pk=value.pk %}" class="btn-flat waves-effect">
- {% trans 'Edit' context 'Attribute choice value edit action' %}
- </a>
- <a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:product-attribute-value-delete' attribute_pk=attribute.pk value_pk=value.pk %}">
- {% trans 'Remove' context 'Attribute choice value edit action' %}
- </a>
- </td>
- {% endif %}
+ <td class="right-align">
+ <a href="{% url 'dashboard:product-attribute-value-update' attribute_pk=attribute.pk value_pk=value.pk %}" class="btn-flat waves-effect">
+ {% trans 'Edit' context 'Attribute choice value edit action' %}
+ </a>
+ <a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:product-attribute-value-delete' attribute_pk=attribute.pk value_pk=value.pk %}">
+ {% trans 'Remove' context 'Attribute choice value edit action' %}
+ </a>
+ </td>
</tr>
{% empty %}
<tr>
diff --git a/templates/dashboard/product/product_attribute/list.html b/templates/dashboard/product/product_attribute/list.html
index 4c81cd2907..841d4e08e3 100644
--- a/templates/dashboard/product/product_attribute/list.html
+++ b/templates/dashboard/product/product_attribute/list.html
@@ -13,13 +13,11 @@
{% block menu_attributes_class %}active{% endblock %}
{% block header_extra %}
- {% if perms.product.manage_products %}
<div class="btn-fab-fixed">
<a class="btn-fab-default waves-effect waves-light" href="{% url 'dashboard:product-attribute-add' %}" title="{% trans "Add attribute" context "Attribute list add button text" %}">
<svg data-src="{% static "dashboard/images/add.svg" %}" />
</a>
</div>
- {% endif %}
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/product/product_variant/detail.html b/templates/dashboard/product/product_variant/detail.html
index fc365a564e..c0e9d1565d 100644
--- a/templates/dashboard/product/product_variant/detail.html
+++ b/templates/dashboard/product/product_variant/detail.html
@@ -57,16 +57,14 @@
</div>
</div>
</div>
- {% if perms.product.manage_products %}
- <div class="card-action">
- <a class="btn-flat waves-effect" href="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}">
- {% trans "Edit variant" context "Dashboard action" %}
- </a>
- <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:variant-delete' product_pk=product.pk variant_pk=variant.pk %}">
- {% trans "Remove variant" context "Dashboard action" %}
- </a>
- </div>
- {% endif %}
+ <div class="card-action">
+ <a class="btn-flat waves-effect" href="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}">
+ {% trans "Edit variant" context "Dashboard action" %}
+ </a>
+ <a href="#base-modal" class="btn-flat waves-effect modal-trigger-custom" data-href="{% url 'dashboard:variant-delete' product_pk=product.pk variant_pk=variant.pk %}">
+ {% trans "Remove variant" context "Dashboard action" %}
+ </a>
+ </div>
</div>
</div>
<div class="col m12 l4">
@@ -187,13 +185,11 @@
{% endfor %}
</div>
</div>
- {% if perms.product.manage_products %}
- <div class="card-action">
- <a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:variant-images' product_pk=product.pk variant_pk=variant.pk %}">
- {% trans "Select images" context "Dashboard action" %}
- </a>
- </div>
- {% endif %}
+ <div class="card-action">
+ <a class="btn-flat waves-effect modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:variant-images' product_pk=product.pk variant_pk=variant.pk %}">
+ {% trans "Select images" context "Dashboard action" %}
+ </a>
+ </div>
</div>
</div>
</div>
diff --git a/templates/dashboard/shipping/detail.html b/templates/dashboard/shipping/detail.html
index fad9eb90e7..473d7789c8 100644
--- a/templates/dashboard/shipping/detail.html
+++ b/templates/dashboard/shipping/detail.html
@@ -53,7 +53,6 @@
{% endif %}
</div>
</div>
- {% if perms.shipping.manage_shipping %}
<div class="card-action">
<a class="btn-flat waves-effect" href="{% url 'dashboard:shipping-method-update' shipping_method.pk %}">
{% trans "Edit shipping method" context "Shipping method action" %}
@@ -62,7 +61,6 @@
{% trans "Remove shipping method" context "Shipping method action" %}
</a>
</div>
- {% endif %}
</div>
</div>
diff --git a/templates/dashboard/shipping/list.html b/templates/dashboard/shipping/list.html
index 557a52bfc8..6eb84e0168 100644
--- a/templates/dashboard/shipping/list.html
+++ b/templates/dashboard/shipping/list.html
@@ -22,13 +22,11 @@
{% endblock %}
{% block header_extra %}
- {% if perms.shipping.manage_shipping %}
<div class="btn-fab-fixed">
<a href="{% url 'dashboard:shipping-method-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add method" context "Shipping method list add button text" %}">
<svg data-src="{% static "dashboard/images/add.svg" %}" />
</a>
</div>
- {% endif %}
{% endblock %}
{% block content %}
@@ -53,7 +51,7 @@
</thead>
<tbody>
{% for method in shipping_methods %}
- <tr data-action-go="{% if perms.shipping.manage_shipping %}{% url 'dashboard:shipping-method-details' pk=method.pk %}{% endif %}">
+ <tr data-action-go="{% url 'dashboard:shipping-method-details' pk=method.pk %}">
<td>
{{ method }}
</td>
diff --git a/templates/dashboard/staff/detail.html b/templates/dashboard/staff/detail.html
index 640e731de5..f616f4463b 100644
--- a/templates/dashboard/staff/detail.html
+++ b/templates/dashboard/staff/detail.html
@@ -43,13 +43,11 @@
<svg data-src="{% static "dashboard/images/more-vert.svg" %}" height="24" width="24" />
</a>
<ul id="context-menu" class="dropdown-content">
- {% if perms.account.manage_staff %}
<li>
<a href="#base-modal" data-href="{% url 'dashboard:staff-delete' pk=staff_member.pk %}" class="modal-trigger-custom">
{% trans 'Remove staff member' context 'Staff member form action' %}
</a>
</li>
- {% endif %}
</ul>
{% endif %}
{% endblock %}
@@ -70,7 +68,6 @@
</div>
</div>
</div>
- {% if perms.account.manage_staff %}
<div class="card-action right-align">
<a href="{% url 'dashboard:staff-list' %}" class="btn-flat waves-effect">
{% trans "Cancel" context "Dashboard cancel action" %}
@@ -83,7 +80,6 @@
{% endif %}
</button>
</div>
- {% endif %}
</form>
{% endif %}
</div>
diff --git a/templates/dashboard/staff/list.html b/templates/dashboard/staff/list.html
index 485af01081..48e2adf032 100644
--- a/templates/dashboard/staff/list.html
+++ b/templates/dashboard/staff/list.html
@@ -13,15 +13,13 @@
{% block menu_staff_class %}active{% endblock %}
{% block header_extra %}
- {% if perms.account.manage_staff %}
- <div class="btn-fab-fixed">
- <a class="btn-fab-default waves-effect waves-light"
- title="{% trans "Add staff member" context "Staff members list add button text" %}"
- href="{% url 'dashboard:staff-create' %}">
- <svg data-src="{% static "dashboard/images/add.svg" %}" />
- </a>
- </div>
- {% endif %}
+ <div class="btn-fab-fixed">
+ <a class="btn-fab-default waves-effect waves-light"
+ title="{% trans "Add staff member" context "Staff members list add button text" %}"
+ href="{% url 'dashboard:staff-create' %}">
+ <svg data-src="{% static "dashboard/images/add.svg" %}" />
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
diff --git a/templates/dashboard/taxes/list.html b/templates/dashboard/taxes/list.html
index 261d81d70d..f539c3aef4 100644
--- a/templates/dashboard/taxes/list.html
+++ b/templates/dashboard/taxes/list.html
@@ -68,66 +68,64 @@
<div class="col s12 l3" id="filters">
{% if not is_empty %}{% filters filter_set %}{% endif %}
</div>
- {% if perms.site.manage_settings %}
- <div class="col s12 l3">
- <div class="card">
- <div class="card-content">
- <span class="card-title">
- {% trans "Configuration" context "Taxes site settings title" %}
- </span>
- <div class="row">
- <div class="col s12">
- <h4>
- {% trans "All products prices are entered with tax included" context "Site settings field" %}
- </h4>
- <p>
- {% if site.settings.include_taxes_in_prices %}
- {% trans "Yes" context "Include taxes in prices setting description" %}
- {% else %}
- {% trans "No" context "Include taxes in prices setting description" %}
- {% endif %}
- </p>
- </div>
- </div>
- <div class="row">
- <div class="col s12">
- <h4>
- {% trans "Show gross prices to customers in the storefront" context "Site settings field" %}
- </h4>
- <p>
- {% if site.settings.display_gross_prices %}
- {% trans "Yes" context "Show customers gross prices setting description" %}
- {% else %}
- {% trans "No" context "Show customers gross prices setting description" %}
- {% endif %}
- </p>
- </div>
+ <div class="col s12 l3">
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title">
+ {% trans "Configuration" context "Taxes site settings title" %}
+ </span>
+ <div class="row">
+ <div class="col s12">
+ <h4>
+ {% trans "All products prices are entered with tax included" context "Site settings field" %}
+ </h4>
+ <p>
+ {% if site.settings.include_taxes_in_prices %}
+ {% trans "Yes" context "Include taxes in prices setting description" %}
+ {% else %}
+ {% trans "No" context "Include taxes in prices setting description" %}
+ {% endif %}
+ </p>
</div>
- <div class="row">
- <div class="col s12">
- <h4>
- {% trans "Charge taxes on shipping rates" context "Site settings field" %}
- </h4>
- <p>
- {% if site.settings.charge_taxes_on_shipping %}
- {% trans "Yes" context "Charge taxes on shipping rates setting description" %}
- {% else %}
- {% trans "No" context "Charge taxes on shipping rates setting description" %}
- {% endif %}
- </p>
- </div>
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <h4>
+ {% trans "Show gross prices to customers in the storefront" context "Site settings field" %}
+ </h4>
+ <p>
+ {% if site.settings.display_gross_prices %}
+ {% trans "Yes" context "Show customers gross prices setting description" %}
+ {% else %}
+ {% trans "No" context "Show customers gross prices setting description" %}
+ {% endif %}
+ </p>
</div>
</div>
- <div class="card-action">
- <a class="btn-flat waves-effect" href="{% url 'dashboard:configure-taxes' %}">
- {% trans "Configure taxes" context "Site settings configure taxes action" %}
- </a>
- <a class="btn-flat waves-effect load-action" href="{% url 'dashboard:fetch-tax-rates' %}">
- {% trans "Fetch tax rates" context "Site settings fetch tax rates action" %}
- </a>
+ <div class="row">
+ <div class="col s12">
+ <h4>
+ {% trans "Charge taxes on shipping rates" context "Site settings field" %}
+ </h4>
+ <p>
+ {% if site.settings.charge_taxes_on_shipping %}
+ {% trans "Yes" context "Charge taxes on shipping rates setting description" %}
+ {% else %}
+ {% trans "No" context "Charge taxes on shipping rates setting description" %}
+ {% endif %}
+ </p>
+ </div>
</div>
</div>
+ <div class="card-action">
+ <a class="btn-flat waves-effect" href="{% url 'dashboard:configure-taxes' %}">
+ {% trans "Configure taxes" context "Site settings configure taxes action" %}
+ </a>
+ <a class="btn-flat waves-effect load-action" href="{% url 'dashboard:fetch-tax-rates' %}">
+ {% trans "Fetch tax rates" context "Site settings fetch tax rates action" %}
+ </a>
+ </div>
</div>
- {% endif %}
+ </div>
</div>
{% endblock %}