Skip to content

Commit

Permalink
Set value attr of search input based on current query on papers and r…
Browse files Browse the repository at this point in the history
…elease page (#1747)
  • Loading branch information
oyenuga17 authored and Cuihtlauac ALVARADO committed Nov 13, 2023
1 parent 0de24fe commit 18d04fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ocamlorg_frontend/pages/papers.eml
Expand Up @@ -58,6 +58,7 @@ Layout.render
~name:"q"
~label:"Search for a paper"
~button_attrs:{|type="submit"|}
~input_attrs:("value=\"" ^ Dream.html_escape search ^ "\"")
""
%>
</form>
Expand All @@ -72,7 +73,7 @@ Layout.render
</div>
<% | _ -> %>
<table class="max-w-5xl lg:max-w-full align-top block lg:table">
<thead class="bg-body-700 text-white text-left rounded-xl">
<thead class="hidden lg:table-header-group bg-body-700 text-default text-left rounded-xl">
<tr>
<th class="py-4 px-6 rounded-l-lg text-x w-2/5">Title</th>
<th class="py-4 px-6">Years</th>
Expand Down
1 change: 1 addition & 0 deletions src/ocamlorg_frontend/pages/releases.eml
Expand Up @@ -22,6 +22,7 @@ Layout.render
~name:"q"
~label:"Search for a release"
~button_attrs:{|type="submit"|}
~input_attrs:("value=\"" ^ Dream.html_escape search ^ "\"")
""
%>
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/handler.ml
Expand Up @@ -177,7 +177,7 @@ let releases req =
| None -> Data.Release.all
| Some search -> search_release search Data.Release.all
in
Dream.html (Ocamlorg_frontend.releases releases)
Dream.html (Ocamlorg_frontend.releases ?search releases)

let release req =
let version = Dream.param req "id" in
Expand Down

0 comments on commit 18d04fc

Please sign in to comment.