Skip to content

Commit 6b7b226

Browse files
Louis Tarioterikmd
Louis Tariot
andcommitted
feat(web-app): Add feedback button with internationalized tooltip
Close #525 Co-authored-by: Louis Tariot <[email protected]> Co-authored-by: Erik Martin-Dorel <[email protected]>
1 parent 3a7c42e commit 6b7b226

File tree

5 files changed

+59
-3
lines changed

5 files changed

+59
-3
lines changed

src/app/learnocaml_index_main.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,9 @@ let set_string_translations () =
642642
List.iter
643643
(fun (el, text) ->
644644
(Tyxml_js.To_dom.of_input el)##.placeholder := Js.string text)
645-
placeholder_translations
646-
645+
placeholder_translations;
646+
Manip.SetHTMLElement.title (find_component "learnocaml-main-feedback")
647+
[%i"Send feedback to Learn-OCaml developers"]
647648

648649
let () =
649650
Lwt.async_exception_hook := begin fun e ->

static/css/learnocaml_main.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,20 @@ body {
169169

170170
/* Large screen: two columns w/ menu in the left column */
171171
@media (min-width: 1000px) {
172+
#learnocaml-main-toolbar a.btn {
173+
margin-left: 17px;
174+
}
175+
176+
#learnocaml-main-toolbar a.btn > img {
177+
border: 1px #fff solid;
178+
background: linear-gradient(to bottom, #bbb 0%, #888 100%);
179+
border-radius: 5px;
180+
padding: 5px;
181+
width: 18px;
182+
box-shadow: 0 0 10px 2px rgba(0,0,0,0.4);
183+
text-align: center;
184+
}
185+
172186
#learnocaml-main-toolbar {
173187
position: absolute;
174188
left: 0; top: 0; height: 60px; width: 360px;
@@ -181,6 +195,7 @@ body {
181195
#learnocaml-main-toolbar > button {
182196
display: none;
183197
}
198+
184199
#learnocaml-main-toolbar::before {
185200
z-index: 1004;
186201
position: absolute;
@@ -215,6 +230,21 @@ body {
215230
}
216231
/* Medium screen: one column w/ popup menu */
217232
@media (max-width: 999px) {
233+
#learnocaml-main-toolbar a.btn {
234+
margin-left: 10px;
235+
}
236+
237+
#learnocaml-main-toolbar a.btn > img {
238+
border: 1px #fff solid;
239+
background: linear-gradient(to bottom, #bbb 0%, #888 100%);
240+
color: #fff;
241+
border-radius: 5px;
242+
padding: 5px;
243+
width: 18px;
244+
box-shadow: 0 0 10px 2px rgba(0,0,0,0.4);
245+
text-align: center;
246+
}
247+
218248
#learnocaml-main-toolbar {
219249
position: absolute;
220250
top: 0; left: 0px; right: 0px;
@@ -233,6 +263,7 @@ body {
233263
position: relative;
234264
display: block;
235265
}
266+
236267
#learnocaml-main-toolbar > button > * {
237268
padding: 5px;
238269
color: #eee;
@@ -280,6 +311,17 @@ body {
280311
}
281312
/* Small screen: no button labels, thinner bars & buttons */
282313
@media (max-width: 549px) {
314+
#learnocaml-main-toolbar a.btn > img {
315+
border: 1px #fff solid;
316+
background: linear-gradient(to bottom, #bbb 0%, #888 100%);
317+
color: #fff;
318+
border-radius: 4px;
319+
padding: 3px;
320+
width: 13px;
321+
box-shadow: 0 0 10px 2px rgba(0,0,0,0.4);
322+
text-align: center;
323+
}
324+
283325
#learnocaml-main-panel,
284326
#learnocaml-main-content {
285327
top: 40px;

static/icons/icon_feedback.svg

Lines changed: 5 additions & 0 deletions
Loading

static/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<div class="logo">
2626
<img src="/icons/logo_ocsf.svg">
2727
<span>Learn OCaml</span>
28+
<a class="btn" href="https://github.com/learn-ocaml-community/teaching-feedback#readme" target = "_blank">
29+
<img id="learnocaml-main-feedback" title="Send Feedback" src="/icons/icon_feedback.svg">
30+
</a>
2831
</div>
2932
</div>
3033
<div id="learnocaml-main-panel" class="hidden">

translations/fr.po

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: learn-ocaml ~dev\n"
9-
"PO-Revision-Date: 2022-12-29 00:17+0100\n"
9+
"PO-Revision-Date: 2023-04-18 19:58+0200\n"
1010
"Last-Translator: Erik Martin-Dorel <[email protected]>\n"
1111
"Language-Team: OCSF\n"
1212
"Language: french\n"
@@ -523,6 +523,10 @@ msgstr "Vous avez déjà un token ? Par ici !"
523523
msgid "Connect"
524524
msgstr "Se connecter"
525525

526+
#: File "src/app/learnocaml_index_main.ml", line 631, characters 35-50
527+
msgid "Send feedback to Learn-OCaml developers"
528+
msgstr "Envoyer un commentaire aux développeurs Learn-OCaml"
529+
526530
#: File "src/app/learnocaml_index_main.ml", line 638, characters 9-19 640,
527531
#: "src/app/learnocaml_teacher_tab.ml", 558, 22-32
528532
msgid "Nickname"
@@ -1084,3 +1088,4 @@ msgstr "Erreur inattendue:\n"
10841088

10851089
#~ msgid "This session has been closed. You can close this tab."
10861090
#~ msgstr "La session a été fermée. Vous pouvez fermer cet onglet."
1091+

0 commit comments

Comments
 (0)