|
| 1 | +<form method="post" |
| 2 | + action="/wb.testimonial/create" <!--- Standard form action (fallback) ---> |
| 3 | + enctype="multipart/form-data" |
| 4 | + hx-post="/web.testimonials/create" <!--- HTMX action ---> |
| 5 | + hx-target="#testimonial-form-container" <!--- Target the container holding this form ---> |
| 6 | + hx-swap="outerHTML" <!--- Replace the container with the response ---> |
| 7 | + hx-encoding="multipart/form-data"> <!--- Needed for file uploads ---> |
| 8 | + |
| 9 | + <!--- Placeholder for server-side validation messages (HTMX will replace this whole form on error/success) ---> |
| 10 | + <div id="form-messages"></div> |
| 11 | + |
| 12 | + <!--- Company Name ---> |
| 13 | + <div class="mb-3"> |
| 14 | + <label for="companyName" class="form-label">Company Name</label> |
| 15 | + <input type="text" |
| 16 | + name="companyName" |
| 17 | + id="companyName" |
| 18 | + class="form-control" |
| 19 | + required> |
| 20 | + </div> |
| 21 | + |
| 22 | + <!--- Testimonial Text ---> |
| 23 | + <div class="mb-3"> |
| 24 | + <label for="testimonialText" class="form-label">Your Testimonial</label> |
| 25 | + <textarea name="testimonialText" |
| 26 | + id="testimonialText" |
| 27 | + class="form-control" |
| 28 | + rows="5" |
| 29 | + required |
| 30 | + minlength="20" |
| 31 | + maxlength="500"></textarea> |
| 32 | + <div class="form-text">Please share your experience (20-500 characters).</div> |
| 33 | + </div> |
| 34 | + |
| 35 | + <!--- Rating ---> |
| 36 | + <div class="mb-3"> |
| 37 | + <label class="form-label">Rating (1-5 Stars)</label> |
| 38 | + <div class="d-flex"> |
| 39 | + <!-- Loop from 1 to 5 --> |
| 40 | + <div class="form-check form-check-inline"> |
| 41 | + <input class="form-check-input" type="radio" name="rating" id="rating1" value="1" required> |
| 42 | + <label class="form-check-label" for="rating1">1 Star</label> |
| 43 | + </div> |
| 44 | + <div class="form-check form-check-inline"> |
| 45 | + <input class="form-check-input" type="radio" name="rating" id="rating2" value="2"> |
| 46 | + <label class="form-check-label" for="rating2">2 Stars</label> |
| 47 | + </div> |
| 48 | + <div class="form-check form-check-inline"> |
| 49 | + <input class="form-check-input" type="radio" name="rating" id="rating3" value="3"> |
| 50 | + <label class="form-check-label" for="rating3">3 Stars</label> |
| 51 | + </div> |
| 52 | + <div class="form-check form-check-inline"> |
| 53 | + <input class="form-check-input" type="radio" name="rating" id="rating4" value="4"> |
| 54 | + <label class="form-check-label" for="rating4">4 Stars</label> |
| 55 | + </div> |
| 56 | + <div class="form-check form-check-inline"> |
| 57 | + <input class="form-check-input" type="radio" name="rating" id="rating5" value="5"> |
| 58 | + <label class="form-check-label" for="rating5">5 Stars</label> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + |
| 63 | + <!--- Experience Level ---> |
| 64 | + <div class="mb-3"> |
| 65 | + <label for="experienceLevel" class="form-label">Your Experience Level with Wheels.dev</label> |
| 66 | + <select name="experienceLevel" |
| 67 | + id="experienceLevel" |
| 68 | + class="form-select" |
| 69 | + required> |
| 70 | + <option value="" selected disabled>-- Select Level --</option> |
| 71 | + <option value="Beginner">Beginner</option> |
| 72 | + <option value="Intermediate">Intermediate</option> |
| 73 | + <option value="Advanced">Advanced</option> |
| 74 | + <option value="Expert">Expert</option> |
| 75 | + </select> |
| 76 | + </div> |
| 77 | + |
| 78 | + <!--- Website URL ---> |
| 79 | + <div class="mb-3"> |
| 80 | + <label for="websiteUrl" class="form-label">Company Website (Optional)</label> |
| 81 | + <input type="url" |
| 82 | + name="websiteUrl" |
| 83 | + id="websiteUrl" |
| 84 | + class="form-control" |
| 85 | + placeholder="https://..."> |
| 86 | + </div> |
| 87 | + |
| 88 | + <!--- Social Media Links ---> |
| 89 | + <div class="mb-3"> |
| 90 | + <label for="socialMediaLinks" class="form-label">Social Media Link (Optional)</label> |
| 91 | + <input type="url" |
| 92 | + name="socialMediaLinks" |
| 93 | + id="socialMediaLinks" |
| 94 | + class="form-control" |
| 95 | + placeholder="https://linkedin.com/in/..."> |
| 96 | + </div> |
| 97 | + |
| 98 | + <!--- Logo Upload ---> |
| 99 | + <div class="mb-3"> |
| 100 | + <label for="logo" class="form-label">Company Logo (Optional)</label> |
| 101 | + <input type="file" |
| 102 | + name="logo" |
| 103 | + id="logo" |
| 104 | + class="form-control" |
| 105 | + accept="image/jpeg, image/png, image/gif, image/webp"> <!--- Hint for file types ---> |
| 106 | + <div class="form-text">Upload JPG, PNG, GIF, or WEBP.</div> |
| 107 | + </div> |
| 108 | + |
| 109 | + <!--- Display Permission ---> |
| 110 | + <div class="mb-3 form-check"> |
| 111 | + <input type="checkbox" |
| 112 | + name="displayPermission" |
| 113 | + id="displayPermission" |
| 114 | + value="true" <!--- Value sent when checked ---> |
| 115 | + class="form-check-input"> |
| 116 | + <label class="form-check-label" for="displayPermission">I grant permission to display this testimonial publicly.</label> |
| 117 | + <input type="hidden" name="displayPermission" value="false"> |
| 118 | + </div> |
| 119 | + |
| 120 | + <!--- Submit Button ---> |
| 121 | + <div class="d-grid"> |
| 122 | + <button type="submit" class="btn btn-primary">Submit Testimonial</button> |
| 123 | + </div> |
| 124 | + |
| 125 | +</form> |
0 commit comments