2022-01-12 19:34:55 +01:00
|
|
|
let f ~board request =
|
2022-01-18 00:12:03 +01:00
|
|
|
%let board = Format.asprintf "%a" Babillard.pp_board board in
|
|
|
|
|
%let url = Format.sprintf "/%s/new_thread" board in
|
2022-01-17 23:59:50 +01:00
|
|
|
% begin match Dream.session "nick" request with
|
|
|
|
|
% | None ->
|
|
|
|
|
Login to make a new thread.
|
|
|
|
|
% | Some _nick ->
|
|
|
|
|
<script type="text/javascript" src="/assets/js/js_newthread.js" defer="defer"></script>
|
2022-01-18 00:12:03 +01:00
|
|
|
<div id="board" data-board=<%s board %> >Click the map to make a new thread:</div>
|
2022-01-17 23:59:50 +01:00
|
|
|
<div class="row mb-3">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div id="map"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6" id="newthread-form" style="visibility:hidden">
|
2022-01-24 08:38:18 +01:00
|
|
|
<div class="postForm">
|
2022-01-17 23:59:50 +01:00
|
|
|
<%s! Dream.form_tag ~action:url ~enctype:`Multipart_form_data request %>
|
2022-01-09 11:28:18 +01:00
|
|
|
<input type="hidden" id="lat_input" name="lat_input">
|
|
|
|
|
<input type="hidden" id="lng_input" name="lng_input">
|
|
|
|
|
|
|
|
|
|
<label for="subject" id="subjectLabel" class="form-label">Subject</label>
|
|
|
|
|
<input name="subject" type="text" class="form-control" id="subject" aria-labelledby="subjectLabel"></input>
|
|
|
|
|
|
|
|
|
|
<label for="threadComment" id="threadCommentLabel" class="form-label">Comment</label>
|
|
|
|
|
<textarea name="threadComment" type="text" class="form-control" id="threadComment" aria-labelledby="threadCommentLabel"></textarea>
|
|
|
|
|
|
|
|
|
|
<label for="tags" id="tagsLabel" class="form-label">Tags</label>
|
|
|
|
|
<input name="tags" type="text" class="form-control" id="tags" aria-labelledby="tagsLabel"></input>
|
|
|
|
|
|
2022-01-24 08:38:18 +01:00
|
|
|
<label for="file" id="fileLabel" class="form-label">Picture:</label>
|
|
|
|
|
<input id="file" name="file" aria-describedby="fileLabel" type="file" accept="image/*">
|
2022-01-09 11:28:18 +01:00
|
|
|
<button type="submit" class="btn btn-primary">Make Thread</button>
|
2022-01-17 23:59:50 +01:00
|
|
|
</form>
|
|
|
|
|
</div>
|
2022-01-24 08:38:18 +01:00
|
|
|
</div>
|
2022-01-17 23:59:50 +01:00
|
|
|
</div>
|
|
|
|
|
% end;
|