From 4682742c2047d67b381312e73adbbbedad2d8a02 Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Wed, 20 Oct 2021 19:40:10 +0200 Subject: [PATCH] Speakers in search --- buscribe-api/buscribeapi/buscribeapi.py | 1 + buscribe-web/line.less | 21 ++++++++++++++++++--- buscribe-web/script.js | 4 +++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/buscribe-api/buscribeapi/buscribeapi.py b/buscribe-api/buscribeapi/buscribeapi.py index 9fddfbd..e8a8ed2 100644 --- a/buscribe-api/buscribeapi/buscribeapi.py +++ b/buscribe-api/buscribeapi/buscribeapi.py @@ -94,6 +94,7 @@ def get_json(): "end_time": row.end_time.isoformat(), "end_bus_time": round_bus_time(row.start_time - app.bustime_start), "verifier": row.verifier, + "speakers": row.names, "text": row.transcription_line if row.transcription_line is not None else ""} for row in results]) diff --git a/buscribe-web/line.less b/buscribe-web/line.less index 6ec4fe1..e5f0c8b 100644 --- a/buscribe-web/line.less +++ b/buscribe-web/line.less @@ -8,14 +8,18 @@ align-items: start; margin-bottom: 0.1em; - padding: 0.1em; + padding: 0.3em; max-width: 50em; + background: #606060; + .line_start_time { color: lightgray; font-family: monospace; font-size: smaller; + margin-top: 1.5ex; + grid-column: times; align-self: start; } @@ -39,10 +43,21 @@ margin-left: 0.3em; grid-column: text; - grid-row: span 2; + //grid-row: span 2; + } + + .line_speakers { + font-family: @sans-serif; + font-size: small; + + padding: 0.2em; + margin-left: 0.3em; + margin-top: 0.2em; + + grid-column: text; } } .line.verified { - background: #555; + background: #575757; } \ No newline at end of file diff --git a/buscribe-web/script.js b/buscribe-web/script.js index e24e96f..4806122 100644 --- a/buscribe-web/script.js +++ b/buscribe-web/script.js @@ -46,10 +46,12 @@ function fillResults(results) { line_div.classList.add("verified"); } + line_div.innerHTML = `
${line.start_bus_time}
-
${line.text}
+
${line.speakers == null ? "" : line.speakers.join(", ")}
${line.start_time}
+
${line.text}
`;