Compare commits
2 Commits
5877a7702f
...
4d00ba3dbe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d00ba3dbe | ||
|
|
d1621b8e70 |
@@ -103,7 +103,7 @@
|
|||||||
{% if g.user %}
|
{% if g.user %}
|
||||||
<form
|
<form
|
||||||
method="post"
|
method="post"
|
||||||
action="{{ url_for('page_cart.page_checkout')|host if page_post is defined and page_post else url_for('cart_global.checkout')|host }}"
|
action="{{ page_cart_url(page_post.slug, '/checkout/') if page_post is defined and page_post else cart_url('/checkout/') }}"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% set _app_slugs = {'cart': cart_url('/')} %}
|
{% set _app_slugs = {'market': market_url('/'), 'cart': cart_url('/')} %}
|
||||||
<div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
|
<div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
|
||||||
id="menu-items-nav-wrapper">
|
id="menu-items-nav-wrapper">
|
||||||
{% from 'macros/scrolling_menu.html' import scrolling_menu with context %}
|
{% from 'macros/scrolling_menu.html' import scrolling_menu with context %}
|
||||||
|
|||||||
7
utils.py
7
utils.py
@@ -39,7 +39,12 @@ def _join_url_parts(parts: List[str]) -> str:
|
|||||||
cleaned = [first.strip("/")]
|
cleaned = [first.strip("/")]
|
||||||
for seg in parts[1:]:
|
for seg in parts[1:]:
|
||||||
seg = str(seg)
|
seg = str(seg)
|
||||||
if seg.startswith("?") or seg.startswith("#"):
|
# If a later segment is already an absolute URL, use it as the base
|
||||||
|
m2 = re.match(r"^([a-zA-Z][a-zA-Z0-9+.-]*://)(.*)$", seg)
|
||||||
|
if m2:
|
||||||
|
scheme, first = m2.group(1), m2.group(2)
|
||||||
|
cleaned = [first.strip("/")]
|
||||||
|
elif seg.startswith("?") or seg.startswith("#"):
|
||||||
cleaned[-1] = cleaned[-1] + seg # attach query/fragment
|
cleaned[-1] = cleaned[-1] + seg # attach query/fragment
|
||||||
else:
|
else:
|
||||||
cleaned.append(seg.strip("/"))
|
cleaned.append(seg.strip("/"))
|
||||||
|
|||||||
Reference in New Issue
Block a user