diff --git a/make_post_sell/routes.py b/make_post_sell/routes.py index af32eab..d1bf545 100644 --- a/make_post_sell/routes.py +++ b/make_post_sell/routes.py @@ -76,9 +76,9 @@ def includeme(config): config.add_route("coupon2", "/s/{shop_id}/coupon/{coupon_id}/{slug:.*}") # shop_location routes. - config.add_route("shop_location_new", "/s/{shop_id}/locations/new") + config.add_route("shop_location_new", "/s/locations/new") config.add_route("shop_location_edit", "/s/{shop_id}/locations/{location_id}/edit") - config.add_route("shop_locations", "/s/{shop_id}/locations") + config.add_route("shop_locations", "/s/locations") config.add_route( "shop_location_switch", "/s/{shop_id}/location/{location_id}/switch" ) diff --git a/make_post_sell/templates/actions_new.j2 b/make_post_sell/templates/actions_new.j2 index fe943d9..1220482 100644 --- a/make_post_sell/templates/actions_new.j2 +++ b/make_post_sell/templates/actions_new.j2 @@ -20,6 +20,10 @@
+ New Product +
+
+ + New Shop Location + {% if request.is_saas_domain %}

diff --git a/make_post_sell/templates/actions_view.j2 b/make_post_sell/templates/actions_view.j2 index 8028276..ced9e6d 100644 --- a/make_post_sell/templates/actions_view.j2 +++ b/make_post_sell/templates/actions_view.j2 @@ -30,7 +30,7 @@

- 🏠   Shop Locations + 🏠   Shop Locations {% if request.is_saas_domain %}
diff --git a/make_post_sell/views/shop_location.py b/make_post_sell/views/shop_location.py index bef01c1..4c81dd0 100644 --- a/make_post_sell/views/shop_location.py +++ b/make_post_sell/views/shop_location.py @@ -17,7 +17,7 @@ def bool_to_checkbox(boolean): @view_config(route_name="shop_location_new", renderer="shop_location_form.j2") @shop_owner_required() def shop_location_new(request): - shop = get_shop_by_id(request.dbsession, request.matchdict["shop_id"]) + shop = request.shop if not shop: request.session.flash(("Shop not found.", "error")) @@ -188,7 +188,7 @@ def shop_location_switch(request): request.session.flash( ("Location not found or does not belong to this shop.", "error") ) - return HTTPFound(request.route_url("shop_locations", shop_id=shop_id)) + return HTTPFound(request.route_url("shop_locations")) # Update the session with the selected location request.session["shop_location_id"] = str(location.id)