themes-gotham/templates/overrides/gotham/contact-form.ninjatpl
Alex Dunmow f5af05fd5f fix(gotham): noir remediation — SVG geometry guards, shortcode→SVG, hero string-vs-object, reveal no-scroll fallback, deeper blacks, seed media
- Replace ::icon:: shortcodes with explicit sized <svg><use> (events_marquee,
  membership_tiers, button, hours-location, divider).
- Add width/height presentation attrs to every <use> SVG (recipe 4d guard).
- hero: field.text -> field|get:"text"|default:field (bare-string seed fields
  no longer error the block to EMPTY — About orphaned-rule root cause).
- reveal script: rAF kick + all() no-scroll fallback 2600ms -> 650ms across all
  templates so above/below-fold content never strands invisible without scroll.
- article: render aside + vertical divider only when slots.aside is non-empty
  (kills the empty fenced right column); narrow single-column when no aside.
- presets: deeper near-black backgrounds, higher-contrast foregrounds, richer
  brass/gold accents across all five palettes (light + dark).
- divider/quote: retire busy reel-strip sunburst for clean centred gold rules.
- seed: longer members-club articles; wire licensed noir stock imagery
  (bar-scene B&W hero, bar-shelf About, bar-interior/dark-lounge blog cards).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 16:31:20 +08:00

44 lines
4.3 KiB
Plaintext

{# contact-form override — reservations enquiry. ALL form wiring preserved verbatim from builtin: bid, {% form %} action/hx attrs, honeypot, field loop, form.submitted/errors, submit target. Only inputs restyled to Art Deco. #}
{% with bid=_block_id|default:context.blockId %}
<section data-block-override="gotham:contact-form" id="contact-form-{{ bid }}" class="py-16 md:py-24 bg-background text-foreground{% if class %} {{ class }}{% endif %}">
<div class="mx-auto max-w-2xl px-4">
{% if form.submitted %}
<div class="reel-frame bg-card p-10 text-center">
<div class="mx-auto mb-4 inline-flex h-12 w-12 items-center justify-center rounded-full text-primary" style="box-shadow:inset 0 0 0 1px hsl(var(--primary));"><svg class="inline-block h-6 w-6" width="24" height="24" aria-hidden="true"><use href="/icons/lucide.svg#check"></use></svg></div>
<p class="text-lg italic" style="font-family:var(--font-body, 'Cormorant Garamond', Georgia, serif);">{{ form.message|default:successMessage|default:"Thank you. Your table request has been received." }}</p>
</div>
{% else %}
<div class="text-center">
{% if heading %}<h2 class="reel-caps text-3xl md:text-4xl" style="font-family:var(--font-heading, 'Antonio', 'Oswald', 'Bebas Neue', sans-serif);color:hsl(var(--foreground));">{{ heading }}</h2>{% endif %}
{% if description %}<p class="mt-3 text-lg italic" style="color:hsl(var(--muted-foreground));font-family:var(--font-body, 'Cormorant Garamond', Georgia, serif);">{{ description }}</p>{% endif %}
<div class="mx-auto mt-5 mb-2 h-6 w-40 reel-strip" aria-hidden="true"></div>
</div>
{% if form.errors._form %}<div class="mt-6 border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive">{{ form.errors._form }}</div>{% endif %}
{% with formAction="/api/blocks/"|add:bid|add:"/submit" formTarget="#contact-form-"|add:bid %}
{% form action=formAction hx_target=formTarget hx_swap="outerHTML" class="mt-8 grid grid-cols-1 gap-5 sm:grid-cols-2" %}
{% for field in fields %}
<div class="{% if field.width == "half" %}sm:col-span-1{% else %}sm:col-span-2{% endif %}">
{% if field.label %}<label for="cf-{{ bid }}-{{ field.name }}" class="reel-caps mb-1.5 block text-xs" style="color:hsl(var(--primary));">{{ field.label }}{% if field.required %} <span class="text-destructive">*</span>{% endif %}</label>{% endif %}
{% if field.type == "textarea" %}
<textarea id="cf-{{ bid }}-{{ field.name }}" name="{{ field.name }}" rows="5"{% if field.required %} required{% endif %}{% if field.placeholder %} placeholder="{{ field.placeholder }}"{% endif %} class="w-full rounded-none border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:border-[hsl(var(--primary))] focus:ring-1 focus:ring-ring"></textarea>
{% elif field.type == "select" %}
<select id="cf-{{ bid }}-{{ field.name }}" name="{{ field.name }}"{% if field.required %} required{% endif %} class="w-full rounded-none border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:border-[hsl(var(--primary))] focus:ring-1 focus:ring-ring">
{% if field.placeholder %}<option value="">{{ field.placeholder }}</option>{% endif %}
{% for opt in field.options %}<option value="{{ opt.value }}">{{ opt.label|default:opt.value }}</option>{% endfor %}
</select>
{% else %}
<input id="cf-{{ bid }}-{{ field.name }}" name="{{ field.name }}" type="{{ field.type|default:"text" }}"{% if field.required %} required{% endif %}{% if field.placeholder %} placeholder="{{ field.placeholder }}"{% endif %} class="w-full rounded-none border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:border-[hsl(var(--primary))] focus:ring-1 focus:ring-ring">
{% endif %}
</div>
{% endfor %}
<div class="hidden" aria-hidden="true"><label>Leave this field empty<input type="text" name="website" tabindex="-1" autocomplete="off"></label></div>
<div class="sm:col-span-2 flex justify-center">
<button type="submit" class="reel-btn inline-flex items-center justify-center">{{ submitLabel|default:"Request a table" }}</button>
</div>
{% endform %}
{% endwith %}
{% endif %}
</div>
</section>
{% endwith %}