geochan/src/post_form.eml.html
2022-12-31 06:59:39 +01:00

33 lines
1.7 KiB
HTML

let f thread_id request =
% let action = match thread_id with |None -> "/" | Some id -> Format.sprintf "/thread/%s" id in
% let checkboxes = match thread_id with |None -> Format.asprintf "%a" Pp_babillard.pp_checkboxes () | Some _id -> "" in
<div class="post-form">
<%s! Dream.form_tag ~action ~enctype:`Multipart_form_data request %>
% begin if Option.is_none thread_id then
<input type="hidden" id="lat-input" name="lat-input">
<input type="hidden" id="lng-input" name="lng-input">
<label for="subject" id="subject-label" class="form-label">Subject</label>
<input name="subject" type="text" class="form-control" id="subject" aria-labelledby="subject-label" />
% end;
<label for="comment" id="comment-label" class="form-label">Comment</label>
<textarea name="comment" type="text" class="form-control" id="comment" aria-labelledby="comment-label"></textarea>
<label for="tags" id="tags-label" class="form-label">Tags</label>
<%s! checkboxes %>
<input name="tags" type="text" class="form-control" id="tags" aria-labelledby="tags-label" />
<label for="file" id="file-label" class="form-label">Picture:</label>
<input id="file" name="file" aria-describedby="file-label" type="file" accept="image/png,image/jpeg,image/webp,image/gif">
<label for="alt" id="alt-label" class="form-label off">Image description:</label>
<input name="alt" type="text" class="form-control off" id="alt" aria-labelledby="alt-label" />
% begin match thread_id with
% | None ->
<br />
<button type="submit" class="btn btn-primary" id="submit-button" disabled>Make Thread</button>
% | Some _id ->
<button type="submit" class="btn btn-primary" id="submit-button">Reply</button>
% end;
</form>
</div>