fix: resolve nested Jinja2 comment causing template error
The feature_gate.html macro file had nested {# #} comments in the
documentation block which broke Jinja2 parsing. Nested comments
are not supported in Jinja2 - the inner {# was interpreted as
closing the outer comment, causing the example code to execute.
Removed Jinja2 syntax from the documentation examples to prevent
parsing issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,23 +1,25 @@
|
|||||||
{# =============================================================================
|
{#
|
||||||
|
=============================================================================
|
||||||
Feature Gate Macros
|
Feature Gate Macros
|
||||||
|
|
||||||
Provides macros for tier-based feature gating in templates.
|
Provides macros for tier-based feature gating in templates.
|
||||||
Uses Alpine.js $store.features for dynamic checking.
|
Uses Alpine.js $store.features for dynamic checking.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
{% from "shared/macros/feature_gate.html" import feature_gate, feature_locked, upgrade_banner %}
|
from "shared/macros/feature_gate.html" import feature_gate, feature_locked, upgrade_banner
|
||||||
|
|
||||||
{# Show content only if feature is available #}
|
Show content only if feature is available:
|
||||||
{% call feature_gate("analytics_dashboard") %}
|
call feature_gate("analytics_dashboard")
|
||||||
<div>Analytics content here</div>
|
<div>Analytics content here</div>
|
||||||
{% endcall %}
|
endcall
|
||||||
|
|
||||||
{# Show locked state with upgrade prompt #}
|
Show locked state with upgrade prompt:
|
||||||
{{ feature_locked("analytics_dashboard", "Analytics Dashboard", "View advanced analytics") }}
|
feature_locked("analytics_dashboard", "Analytics Dashboard", "View advanced analytics")
|
||||||
|
|
||||||
{# Show upgrade banner #}
|
Show upgrade banner:
|
||||||
{{ upgrade_banner("analytics_dashboard") }}
|
upgrade_banner("analytics_dashboard")
|
||||||
============================================================================= #}
|
=============================================================================
|
||||||
|
#}
|
||||||
|
|
||||||
|
|
||||||
{# =============================================================================
|
{# =============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user