/babillard -> /
This commit is contained in:
parent
ad460ee549
commit
d69a6daeab
4 changed files with 13 additions and 16 deletions
|
|
@ -121,7 +121,7 @@ module Marker = struct
|
|||
let thread_preview_div = Jv.get Jv.global "thread_preview_div" in
|
||||
ignore @@ Jv.set thread_preview_div "innerHTML" thread_preview;
|
||||
let thread_link = Jv.get Jv.global "thread_link" in
|
||||
let link = Format.sprintf "/babillard/%s" thread_id in
|
||||
let link = Format.sprintf "/%s" thread_id in
|
||||
ignore @@ Jv.set thread_link "href" (Jv.of_string link);
|
||||
ignore @@ Jv.set thread_link "innerText" (Jv.of_string "[View Thread]");
|
||||
let _ = Js_pretty_post.make_pretty () in
|
||||
|
|
@ -161,7 +161,7 @@ module Marker = struct
|
|||
let () =
|
||||
log "fetch thread geojson@.";
|
||||
let window = Jv.get Jv.global "window" in
|
||||
let link = Jv.of_string "/babillard/markers" in
|
||||
let link = Jv.of_string "/markers" in
|
||||
let fetchfutur = Jv.call window "fetch" [| link |] in
|
||||
ignore @@ Jv.call fetchfutur "then" [| Jv.repr markers_handle_response |]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ let newthread_post request =
|
|||
in
|
||||
match res with
|
||||
| Ok thread_id ->
|
||||
let adress = Format.asprintf "/babillard/%s" thread_id in
|
||||
let adress = Format.asprintf "/%s" thread_id in
|
||||
Dream.respond ~status:`See_Other
|
||||
~headers:[ ("Location", adress) ]
|
||||
"Your thread was posted!"
|
||||
|
|
@ -206,7 +206,7 @@ let reply_post request =
|
|||
in
|
||||
match res with
|
||||
| Ok post_id ->
|
||||
let adress = Format.sprintf "/babillard/%s#%s" parent_id post_id in
|
||||
let adress = Format.sprintf "/%s#%s" parent_id post_id in
|
||||
Dream.respond ~status:`See_Other
|
||||
~headers:[ ("Location", adress) ]
|
||||
"Your reply was posted!"
|
||||
|
|
@ -217,9 +217,7 @@ let reply_post request =
|
|||
Dream.empty `Bad_Request )
|
||||
|
||||
let redirect_to_babillard _request =
|
||||
Dream.respond ~status:`Moved_Permanently
|
||||
~headers:[ ("Location", "/babillard") ]
|
||||
""
|
||||
Dream.respond ~status:`Moved_Permanently ~headers:[ ("Location", "/") ] ""
|
||||
|
||||
let () =
|
||||
Dream.run ~secret:"yolo" ~port:3696
|
||||
|
|
@ -230,7 +228,6 @@ let () =
|
|||
*)
|
||||
@@ Dream.router
|
||||
[ Dream.get "/assets/**" (Dream.static ~loader:asset_loader "")
|
||||
; Dream.get "/" redirect_to_babillard
|
||||
; Dream.get "/about" about
|
||||
; Dream.get "/register" register_get
|
||||
; Dream.post "/register" register_post
|
||||
|
|
@ -243,13 +240,13 @@ let () =
|
|||
; Dream.get "/profile" profile_get
|
||||
; Dream.post "/profile" profile_post
|
||||
; Dream.get "/thread_view/:thread_id" thread_view
|
||||
; Dream.get "/babillard/markers" markers
|
||||
; Dream.get "/markers" markers
|
||||
; Dream.get "/post_pic/:post_id" post_image
|
||||
; Dream.get "/babillard" babillard_get
|
||||
; Dream.get "/babillard/new_thread" newthread_get
|
||||
; Dream.post "/babillard/new_thread" newthread_post
|
||||
; Dream.get "/babillard/:thread_id" thread_get
|
||||
; Dream.post "/reply/:thread_id" reply_post
|
||||
; Dream.get "/" babillard_get
|
||||
; Dream.get "/new_thread" newthread_get
|
||||
; Dream.post "/new_thread" newthread_post
|
||||
; Dream.get "/:thread_id" thread_get
|
||||
; Dream.post "/:thread_id" reply_post
|
||||
; Dream.get "/post_pic/:post_id" post_image
|
||||
]
|
||||
@@ Dream.not_found
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ let render_unsafe ~title ~content request =
|
|||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/babillard">Babillard</a>
|
||||
<a class="nav-link" href="/">Babillard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/user">Discover users</a>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ let f thread_view thread_id request =
|
|||
|
||||
% | Some _ ->
|
||||
<div class="postForm">
|
||||
<%s! Dream.form_tag ~action:( Format.sprintf "/reply/%s" thread_id)
|
||||
<%s! Dream.form_tag ~action:( Format.sprintf "/%s" thread_id)
|
||||
~enctype:`Multipart_form_data request %>
|
||||
|
||||
<label for="replyComment" id="replyCommentLabel" class="form-label">Comment:</label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue