Merge branch 'only-show-available-buttons-for-shop-editor' into 'master'

Only show available buttons for shop editors

See merge request engineering/make-post-sell/make_post_sell!13
This commit is contained in:
Russell Ballestrini 2024-06-21 23:48:15 +00:00
commit 1126485acd
3 changed files with 8 additions and 2 deletions

View file

@ -12,17 +12,21 @@
<br/>
<a href="/c/new" class="shop-new-button mps-button">&#65291; New Content</a>
{% if request.user in request.shop.owners %}
<br/>
<br/>
<a href="/coupon/new" class="shop-new-button mps-button">&#65291; New Coupon</a>
{% endif %}
<br/>
<br/>
<a href="/p/new" class="shop-new-button mps-button">&#65291; New Product</a>
{% if request.user in request.shop.owners %}
<br/>
<br/>
<a href="/s/locations/new" class="shop-new-button mps-button">&#65291; New Shop Location</a>
{% endif %}
{% if request.is_saas_domain %}
<br />

View file

@ -16,6 +16,7 @@
<br/>
<a href="/s/{{ request.shop.id }}/products" class="product-edit-button mps-button">&nbsp View Products</a>
{% if request.user in request.shop.owners %}
<br/>
<br/>
<a href="/s/{{ request.shop.id }}/coupons" class="product-edit-button mps-button">&nbsp View Coupons</a>
@ -27,6 +28,7 @@
<br/>
<br/>
<a href="/s/{{ request.shop.id }}/settings" class="product-edit-button mps-button">&#9881; &nbsp Shop Settings</a>
{% endif %}
<br/>
<br/>

View file

@ -12,13 +12,13 @@
{% for location in locations %}
<li>
<a href="{{ request.route_url('shop_location_switch', shop_id=shop.id, location_id=location.id, _query={'next': request.params.get('next', request.url)}) }}">{{ location.name }}</a>
{% if request.user and request.user.can_edit_shop(request.shop) %}
{% if request.user in request.shop.owners %}
<a href="{{ request.route_url('shop_location_edit', shop_id=shop.id, location_id=location.id) }}" class="button">&#9881; edit</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% if request.user and request.user.can_edit_shop(request.shop) %}
{% if request.user in request.shop.owners %}
<a href="{{ request.route_url('shop_location_new', shop_id=shop.id) }}" class="shop-new-button mps-button">Add New Location</a>
{% endif %}
</section>