Rename product blueprint URL param slug → product_slug in templates

Avoids collision with app-level url_value_preprocessor that pops
"slug" for page-level routing. All url_for() calls for product
endpoints now use product_slug= instead of slug=.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 10:24:49 +00:00
parent 2a9dfaa749
commit 0d40dfaeca
6 changed files with 6 additions and 6 deletions

View File

@@ -2,6 +2,6 @@
{% if g.rights.admin %}
{% from 'macros/admin_nav.html' import admin_nav_item %}
{{admin_nav_item(
url_for('market.browse.product.admin', slug=slug)
url_for('market.browse.product.admin', product_slug=slug)
)}}
{% endif %}

View File

@@ -2,7 +2,7 @@
{% import '_types/product/prices.html' as prices %}
{% set prices_ns = namespace() %}
{{ prices.set_prices(p, prices_ns) }}
{% set item_href = url_for('market.browse.product.product_detail', slug=p.slug)|host %}
{% set item_href = url_for('market.browse.product.product_detail', product_slug=p.slug)|host %}
<div class="flex flex-col rounded-xl bg-white shadow hover:shadow-md transition overflow-hidden relative">
{# ❤️ like button overlay - OUTSIDE the link #}
{% if g.user %}

View File

@@ -1,6 +1,6 @@
<button
class="flex items-center gap-1 {% if liked %} text-red-600 {% else %} text-stone-300 {% endif %} hover:text-red-600 transition-colors w-[1em] h-[1em]"
hx-post="{{ like_url if like_url else url_for('market.browse.product.like_toggle', slug=slug)|host }}"
hx-post="{{ like_url if like_url else url_for('market.browse.product.like_toggle', product_slug=slug)|host }}"
hx-target="this"
hx-swap="outerHTML"
hx-push-url="false"

View File

@@ -1,7 +1,7 @@
{% import 'macros/links.html' as links %}
{% macro header_row(oob=False) %}
{% call links.menu_row(id='product-admin-row', oob=oob) %}
{% call links.link(url_for('market.browse.product.admin', slug=d.slug), hx_select_search ) %}
{% call links.link(url_for('market.browse.product.admin', product_slug=d.slug), hx_select_search ) %}
admin!!
{% endcall %}
{% call links.desktop_nav() %}

View File

@@ -15,7 +15,7 @@
{% block ___app_title %}
{% import 'macros/links.html' as links %}
{% call links.menu_row() %}
{% call links.link(url_for('market.browse.product.admin', slug=slug), hx_select_search) %}
{% call links.link(url_for('market.browse.product.admin', product_slug=slug), hx_select_search) %}
{{ links.admin() }}
{% endcall %}
{% call links.desktop_nav() %}

View File

@@ -1,7 +1,7 @@
{% import 'macros/links.html' as links %}
{% macro header_row(oob=False) %}
{% call links.menu_row(id='product-row', oob=oob) %}
{% call links.link(url_for('market.browse.product.product_detail', slug=d.slug), hx_select_search ) %}
{% call links.link(url_for('market.browse.product.product_detail', product_slug=d.slug), hx_select_search ) %}
{% include '_types/product/_title.html' %}
{% endcall %}
{% include '_types/product/_prices.html' %}