Fix WebMCP schema validity on contact form (#13)
## Summary Follow-up to PR #12 / Lighthouse agentic-browsing audit on `/contact` (score 0.88). - Add `toolparamdescription` to all contact form fields for WebMCP schema validity - Move reCAPTCHA outside the annotated `<form>` so `g-recaptcha-response` is excluded from the declarative tool schema - Always render `toolname` / `tooldescription` on the contact form (not gated by `WEBMCP_ENABLED`) - Override `django_recaptcha/widget_v3.html` to associate captcha with `form="contact-form"` - Update docs with HTTPS Lighthouse commands ## Test plan - [x] `python manage.py test public.tests` — 21 tests pass - [ ] Deploy and re-run Lighthouse agentic-browsing on `https://aimloperations.com/contact` - [ ] Confirm `webmcp-schema-validity` passes (expected overall score 1.0) Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{% include "django_recaptcha/includes/js_v3.html" %}
|
||||
<input
|
||||
type="hidden"
|
||||
name="{{ widget.name }}"
|
||||
class="g-recaptcha"
|
||||
form="contact-form"
|
||||
{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}
|
||||
>
|
||||
@@ -33,41 +33,53 @@
|
||||
|
||||
<div class="card">
|
||||
<h2 class="card-title contact-form-heading" id="contact-form-heading" style="margin-bottom: 2rem;">Send Us a Message</h2>
|
||||
<form action="{% url 'contact' %}" method="POST" aria-labelledby="contact-form-heading"
|
||||
{% if webmcp_enabled %}toolname="submit_contact_inquiry" tooldescription="Submit a contact inquiry to AI ML Operations"{% endif %}>
|
||||
<form id="contact-form" action="{% url 'contact' %}" method="POST" aria-labelledby="contact-form-heading"
|
||||
toolname="submit_contact_inquiry"
|
||||
tooldescription="Submit a contact inquiry to AI ML Operations">
|
||||
{% csrf_token %}
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="contact-name">Your Name</label>
|
||||
<input type="text" class="form-control" name="name" id="contact-name" autocomplete="name" required>
|
||||
<input type="text" class="form-control" name="name" id="contact-name" autocomplete="name" required
|
||||
toolparamdescription="Full name of the person submitting the inquiry.">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="contact-email">Your Email</label>
|
||||
<input type="email" class="form-control" name="email" id="contact-email" autocomplete="email" required>
|
||||
<input type="email" class="form-control" name="email" id="contact-email" autocomplete="email" required
|
||||
toolparamdescription="Email address where AI ML Operations can reply.">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="contact-subject">Subject</label>
|
||||
<input type="text" class="form-control" name="subject" id="contact-subject" value="{{ request.GET.subject|default:'' }}" required>
|
||||
<input type="text" class="form-control" name="subject" id="contact-subject" value="{{ request.GET.subject|default:'' }}" required
|
||||
toolparamdescription="Short summary of the inquiry topic or service of interest.">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="contact-message">Message</label>
|
||||
<textarea name="message" class="form-control" id="contact-message" rows="5" placeholder="What workflow is costing you the most time? What systems does it touch?"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{% if capchaForm %}
|
||||
{{ capchaForm }}
|
||||
{% endif %}
|
||||
<textarea name="message" class="form-control" id="contact-message" rows="5"
|
||||
placeholder="What workflow is costing you the most time? What systems does it touch?"
|
||||
toolparamdescription="Optional details about the workflow, bottleneck, or systems involved."></textarea>
|
||||
</div>
|
||||
|
||||
{% if not capchaForm %}
|
||||
<button class="btn" type="submit"
|
||||
data-tianji-event="contact_form_submit">
|
||||
Send Message
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% if capchaForm %}
|
||||
<div class="form-group contact-captcha-group">
|
||||
{{ capchaForm }}
|
||||
</div>
|
||||
<button class="btn" type="submit" form="contact-form"
|
||||
data-tianji-event="contact_form_submit">
|
||||
Send Message
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user