2022-02-17 03:59:23 +01:00
|
|
|
let f request =
|
2022-01-17 23:59:50 +01:00
|
|
|
% begin match Dream.session "nick" request with
|
|
|
|
|
% | None ->
|
2022-02-20 18:02:25 +01:00
|
|
|
% let redirect = Dream.to_percent_encoded "/new_thread" in
|
2022-02-20 18:37:24 +01:00
|
|
|
<a href="/login?redirect=<%s redirect%>">Login</a> to make a new thread.
|
2022-01-17 23:59:50 +01:00
|
|
|
% | Some _nick ->
|
2022-02-18 02:39:25 +01:00
|
|
|
<script type="text/javascript" src="/assets/js/js_newthread.js" defer="defer"></script>
|
|
|
|
|
<h1>New thread</h1>
|
|
|
|
|
<div id="newthread">
|
|
|
|
|
Click the map to make a new thread:
|
|
|
|
|
</div>
|
|
|
|
|
<br />
|
|
|
|
|
<div class="row mb-3">
|
2022-01-17 23:59:50 +01:00
|
|
|
<div class="col-md-6">
|
2022-02-18 02:39:25 +01:00
|
|
|
<div id="map"></div>
|
|
|
|
|
<br />
|
2022-02-18 18:31:55 +01:00
|
|
|
<button class="btn btn-primary" id="geolocalize">Geolocalize me</button>
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
|
|
|
|
<br />
|
2022-01-17 23:59:50 +01:00
|
|
|
</div>
|
2022-01-25 14:07:28 +01:00
|
|
|
<div class="col-md-6" id="newthread-form">
|
2022-02-18 02:39:25 +01:00
|
|
|
<div class="postForm">
|
2022-02-18 20:17:24 +01:00
|
|
|
<%s! Dream.form_tag ~action:"/new_thread" ~enctype:`Multipart_form_data request %>
|
|
|
|
|
<input type="hidden" id="lat-input" name="lat-input">
|
|
|
|
|
<input type="hidden" id="lng-input" name="lng-input">
|
2022-01-09 11:28:18 +01:00
|
|
|
|
2022-02-18 20:17:24 +01:00
|
|
|
<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"></input>
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
2022-02-18 20:17:24 +01:00
|
|
|
<label for="thread-comment" id="thread-comment-label" class="form-label">Comment</label>
|
|
|
|
|
<textarea name="thread-comment" type="text" class="form-control" id="thread-comment" aria-labelledby="thread-comment-label"></textarea>
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
2022-02-18 20:17:24 +01:00
|
|
|
<label for="tags" id="tags-label" class="form-label">Tags</label>
|
|
|
|
|
<input name="tags" type="text" class="form-control" id="tags" aria-labelledby="tags-label"></input>
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
2022-02-18 20:17:24 +01:00
|
|
|
<label for="file" id="file-label" class="form-label">Picture:</label>
|
|
|
|
|
<input id="file" name="file" aria-describedby="file-label" type="file" accept="image/*">
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
2022-02-18 20:17:24 +01:00
|
|
|
<label for="alt" id="alt-label" class="form-label">Image description:</label>
|
|
|
|
|
<input name="alt" type="text" class="form-control" id="alt" aria-labelledby="alt-label"></input>
|
2022-02-19 12:12:57 +01:00
|
|
|
<br />
|
2022-02-18 02:39:25 +01:00
|
|
|
<button type="submit" class="btn btn-primary">Make Thread</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2022-01-24 08:38:18 +01:00
|
|
|
</div>
|
2022-02-18 02:39:25 +01:00
|
|
|
</div>
|
2022-01-17 23:59:50 +01:00
|
|
|
% end;
|