diff --git a/make_post_sell/routes.py b/make_post_sell/routes.py index d1bf545..5944116 100644 --- a/make_post_sell/routes.py +++ b/make_post_sell/routes.py @@ -110,6 +110,8 @@ def includeme(config): # content routes. config.add_route("content_new", "/c/new") config.add_route("content", "/c/{content_id}") + config.add_route("content_edit", "/c/{product_id}/edit") + config.add_route("content_edit2", "/c/{product_id}/{slug:.*}/edit") config.add_route("content_slug", "/c/{product_id}/{slug:.*}") # product routes. diff --git a/make_post_sell/templates/content.j2 b/make_post_sell/templates/content.j2 index 15438d8..e3db005 100644 --- a/make_post_sell/templates/content.j2 +++ b/make_post_sell/templates/content.j2 @@ -19,7 +19,7 @@ {%- block call_to_action -%} {% if request.user.can_edit_shop(request.shop) %} -✎ Edit +✎ Edit {% endif %} {%- endblock call_to_action -%} diff --git a/make_post_sell/templates/product_edit.j2 b/make_post_sell/templates/product_edit.j2 index 90ac596..f5f23c1 100644 --- a/make_post_sell/templates/product_edit.j2 +++ b/make_post_sell/templates/product_edit.j2 @@ -161,7 +161,7 @@ Your cover (thumbnail1) will show up on search pages.
-
+

Edit Title, Description, or Visibility

diff --git a/make_post_sell/views/product.py b/make_post_sell/views/product.py index 62542c1..329ba35 100644 --- a/make_post_sell/views/product.py +++ b/make_post_sell/views/product.py @@ -193,6 +193,8 @@ def product_edit_description(request): @view_config(route_name="product_edit", renderer="product_edit.j2") @view_config(route_name="product_edit2", renderer="product_edit.j2") +@view_config(route_name="content_edit", renderer="product_edit.j2") +@view_config(route_name="content_edit2", renderer="product_edit.j2") @shop_editor_required() def product_edit(request): product_modified = False @@ -312,7 +314,7 @@ def product_edit(request): # redirect back to this page to clear # the params posted by the s3 webhooks. - return HTTPFound(f"/p/{product.id}/{product.slug}/edit?uploaded={file_key}") + return HTTPFound(f"{product.absolute_edit_url(request)}?uploaded={file_key}") if product_modified and product.error_message is None: request.dbsession.add(product)