Added translations to the search que page and the about page. (#407)

This commit is contained in:
2023-11-22 21:48:35 +01:00
committed by GitHub
parent 762d3f9091
commit 65c41bb20c
3 changed files with 71 additions and 38 deletions

View File

@ -2,6 +2,18 @@ body {
margin: 0; margin: 0;
} }
.normal_h3 { .about-content {
float:left;
margin: 20px;
color: var(--raisin-black);
}
.about-content .normal_h3 {
margin: 0; margin: 0;
} }
.search-content {
float:left;
margin: 20px;
color: var(--raisin-black);
}

View File

@ -25,30 +25,30 @@ def layout() -> html.Div:
Returns: Returns:
A list of html element making up this page. A list of html element making up this page.
""" """
git_revision = os.getenv("GIT_HASH", "Running locally") git_revision = os.getenv("GIT_HASH", "Local Start").strip(" ,'()")
for _ in "',()":
git_revision = git_revision.replace(_, "")
git_revision = git_revision.strip()
return html.Div( return html.Div(
children=[ children=[
header_elements.create_selection_header("About"), header_elements.create_selection_header("Über uns"),
html.H3("About Us", className="normal_h3"), html.Div(
html.H3("Description"), className="about-content",
html.P(_DISTRIBUTION_METADATA["Summary"]), children=[
html.H3("Key Features", className="normal_h3"), html.H3("Beschreibung", className="normal_h3"),
html.Ul( html.P(_DISTRIBUTION_METADATA["Summary"]),
[ html.H3("Key Features", className="normal_h3"),
html.Li("Some feature."), html.Ul(
] [
), html.Li("Einige Funktionen"),
html.H3("Version", className="normal_h3"), ]
html.Ul( ),
[ html.H3("Version", className="normal_h3"),
html.Li(f"Software Version: {__version__}"), html.Ul(
html.Li(f"Build from GiT Revision: {git_revision}"), [
] html.Li(f"Softwareversion: {__version__}"),
html.Li(f"Gebaut aus GiT Revision: {git_revision}"),
]
),
],
), ),
] ]
) )

View File

@ -9,7 +9,9 @@ from aki_prj23_transparenzregister.ui import header_elements
from aki_prj23_transparenzregister.ui.session_handler import SessionHandler from aki_prj23_transparenzregister.ui.session_handler import SessionHandler
from aki_prj23_transparenzregister.utils.sql import entities from aki_prj23_transparenzregister.utils.sql import entities
dash.register_page(__name__, path_template="/search/", title="Add data mining Job") dash.register_page(
__name__, path_template="/search/", title="Data-Mining-Job hinzufügen"
)
@lru_cache @lru_cache
@ -21,22 +23,41 @@ def layout() -> html.Div:
""" """
return html.Div( return html.Div(
children=[ children=[
header_elements.create_selection_header("Search more companies"), header_elements.create_selection_header(
html.H3( "Weitere Unternehmen im Transparenzregister aufnehmen"
"Please enter a Company to add to the search queue.",
className="normal_h3",
), ),
html.P( html.Div(
"If a term is entered to the search queue data for that company will be searched for on the next run." className="search-content",
children=[
html.H3(
"Bitte geben Sie ein Unternehmen ein, um einen Data-Mining-Job hinzuzufügen!",
className="normal_h3",
),
html.P(
"Wenn ein Begriff zur Suchwarteschlange hinzugefügt wird, "
"werden Daten für dieses Unternehmen beim nächsten Lauf gesucht."
),
html.P(
"Wenn bereits nach dem Unternehmen gesucht wurde, wird dies zurückgesetzt und die Priorität erhöht."
),
html.P(
"Bitte beachten Sie, dass es einen Tag dauern kann, "
"bis Ihre abgefragten Daten abgebaut und verarbeitet sind."
),
dcc.Input(
id="input-text",
type="text",
placeholder=" Weitere Unternehmen hinzufügen",
debounce=True,
style={
"width": "200px",
"height": "20px",
"border": "1px solid",
},
),
html.P("", id="response"),
],
), ),
html.P(
"If the company was already searched for this is being reset and the priority is increased."
),
html.P(
"Please note that it can take a day until your queried data is mined and processed."
),
dcc.Input(id="input-text", type="text", placeholder="", debounce=True),
html.P("", id="response"),
] ]
) )
@ -63,4 +84,4 @@ def add_company_to_search_que(input_text: str | None) -> NoUpdate | list[str | h
else: else:
db.add(entities.MissingCompany(name=input_text, number_of_links=1000)) db.add(entities.MissingCompany(name=input_text, number_of_links=1000))
db.commit() db.commit()
return ["Added: ", html.B(input_text), " to the search que."] return [html.B(input_text), " als Data-Mining-Job hinzugefügt."]