Merge branch 'develop' into 'master'
fix markdown editor for descriptions content See merge request engineering/make-post-sell/make_post_sell!31
This commit is contained in:
commit
4ffbce63ed
5 changed files with 8 additions and 4 deletions
|
|
@ -11,6 +11,7 @@ memopoly.com:
|
|||
- sudo /opt/salt-call-state-highstate.sh
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "develop"'
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
|
||||
|
||||
my.makepostsell.com:
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ class Product(RBase, Base):
|
|||
return f"{request.host_url}/{p_or_c}/{self.id}/{self.slug}"
|
||||
return f"{request.host_url}/{p_or_c}/{self.id}"
|
||||
|
||||
def absolute_edit_url(self, request):
|
||||
def absolute_edit_url(self, request, subject=""):
|
||||
"""
|
||||
The absolute URI to the product edit page.
|
||||
|
||||
|
|
@ -387,7 +387,8 @@ class Product(RBase, Base):
|
|||
|
||||
https://makepostsell.com/p/product-uuid/edit
|
||||
"""
|
||||
|
||||
if subject:
|
||||
return f"{self.absolute_url(request, slug=False)}/{subject}/edit"
|
||||
return f"{self.absolute_url(request, slug=False)}/edit"
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ def includeme(config):
|
|||
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_description_edit", "/c/{product_id}/description/edit")
|
||||
config.add_route("content_edit2", "/c/{product_id}/{slug:.*}/edit")
|
||||
config.add_route("content_slug", "/c/{product_id}/{slug:.*}")
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Your cover (<code>thumbnail1</code>) will show up on search pages.
|
|||
<br />
|
||||
<br />
|
||||
|
||||
<label for="description_input">Description <a href="/p/{{ product.id }}/description/edit">(advanced editor)</a></label> Supports Markdown and some HTML
|
||||
<label for="description_input">Description <a href="{{ product.absolute_edit_url(request, subject='description') }}">(advanced editor)</a></label> Supports Markdown and some HTML
|
||||
<textarea
|
||||
name = "description"
|
||||
id = "description_input"
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ def product_new(request):
|
|||
|
||||
|
||||
@view_config(route_name="product_description_edit", renderer="markup_editor.j2")
|
||||
@view_config(route_name="content_description_edit", renderer="markup_editor.j2")
|
||||
@shop_editor_required()
|
||||
def product_edit_description(request):
|
||||
product = request.product
|
||||
|
|
@ -187,7 +188,7 @@ def product_edit_description(request):
|
|||
"markup_subject": f"Product Description for {product.title}",
|
||||
"markup_rendered": product.description_html,
|
||||
"markup_raw": product.description,
|
||||
"markup_form_path": f"{product.absolute_url(request, slug=False)}/description",
|
||||
"markup_form_path": f"{product.absolute_edit_url(request, subject='description')}",
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue