Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display image if different. Display fn.oc sn of possible merges #1454

Merged
merged 2 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/mergeDisplay.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ let print conf base p =
Output.print_sstring conf "<label class=\"custom-control-label\" for=\"";
Output.print_string conf (get_iper p |> string_of_iper |> Mutil.encode);
Output.print_sstring conf "\">";
Output.print_sstring conf
(Printf.sprintf "%s.%d %s"
(get_first_name p |> sou base)
(get_occ p)
(get_surname p |> sou base));
Output.print_sstring conf "</label></div>")
list;
Output.print_sstring conf
Expand Down
16 changes: 13 additions & 3 deletions lib/mergeIndDisplay.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ let print_differences conf base branches p1 p2 =
Output.print_sstring conf {|>|};
Output.printf conf {|<label class="custom-control-label" for="|};
Output.print_sstring conf name;
Output.print_sstring conf (string_of_int i);
Output.print_sstring conf {|">|};
Output.print_string conf x;
Output.print_sstring conf {|</label></div>|}
Expand Down Expand Up @@ -95,11 +96,20 @@ let print_differences conf base branches p1 p2 =
match Image.get_portrait conf base p with
| Some (`Url url) ->
({|<img src="|} ^<^ escape_html url
^>^ {|" style="max-width:75px;max-height:100px">|}
^>^ {|" style="max-width:75px;max-height:100px">|} ^ url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we apply escape_html to url?

This print the url as text next to the image?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably suppress this escape_url.
The same comment applies to string_of_image_url in perso.ml

:> Adef.safe_string)
| Some (`Path path) ->
(* TODO: ?? *)
(escape_html path :> Adef.safe_string)
let k = Image.default_portrait_filename base p in
let s = Unix.stat path in
Printf.sprintf
{|<img src="%sm=IM&d=%s&%s&k=%s" \
style="max-width:75px;max-height:100px"> %s|}
(commd conf :> string)
(string_of_int
@@ int_of_float (mod_float s.Unix.st_mtime (float_of_int max_int)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this information to make src from a path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how portraits are displayed. Not sure I remember the reasons for the various parameters

(acces conf base p : Adef.escaped_string :> string)
k path
|> Adef.safe
| None -> Adef.safe "");
string_field
(transl conf "public name" |> Adef.safe)
Expand Down
Loading