Compare commits
96 Commits
wip_toggle
...
no-locales
| Author | SHA1 | Date | |
|---|---|---|---|
| 205a8c406b | |||
| ee9ce806e6 | |||
| 8530568757 | |||
| 45dbfe0f42 | |||
| 275daababf | |||
| 576c41a765 | |||
| 0fe3f55ee5 | |||
| 8c5d540a74 | |||
| 9c819af548 | |||
| e7bda45e0b | |||
| 5cf40645e2 | |||
| a1e9c3236c | |||
| e079d34663 | |||
| a89e400029 | |||
| 1d48f294dc | |||
| 2ba39436bc | |||
| d0a5013b71 | |||
| 58045967cb | |||
| dbe0ef9ea1 | |||
| 7f58ecb96c | |||
| 8ec566b78a | |||
| caec9e4d68 | |||
| e949ae61eb | |||
| 41464c9346 | |||
| b76090d846 | |||
| 8d7d5176d9 | |||
| 31b45ab690 | |||
| 8f6655d96c | |||
| e6574c9cda | |||
| 942373caf6 | |||
| 107cb164dd | |||
| 03f308b4b6 | |||
| 9b04a790da | |||
| 6e8317e150 | |||
| a388f7488b | |||
| 428fde15d6 | |||
| 3dd2afa4c9 | |||
| c3055a2b23 | |||
| 3c04881fe2 | |||
| c3b18e539d | |||
| 06aa56a2b8 | |||
| 2b07f3628a | |||
| 5d69bf4340 | |||
| 31ba4eaf70 | |||
| e920e03f37 | |||
| 7a6257f19f | |||
| 19b8389aca | |||
| 587500bdd4 | |||
| 0a37da4c4a | |||
| e1e53d08cd | |||
| d11118c7d7 | |||
| 2206e28d80 | |||
| 0fa3357ffc | |||
| 5e79cb3bd1 | |||
| a9a0873266 | |||
| c70908629b | |||
| d27b5545ca | |||
| 11b5eef742 | |||
| 10ec91f826 | |||
| 3b945ff8be | |||
| 103e9d4202 | |||
| efb859c843 | |||
| 66df65648b | |||
| 9969b30035 | |||
| a7d6618d34 | |||
| fc94e5ba8b | |||
| 7d39c88b9e | |||
| be0743011b | |||
| 27c67a9e8c | |||
| 926ba4487f | |||
| c3a20df68c | |||
| 9d3fa2235b | |||
| acb9e46446 | |||
| 63da81daa8 | |||
| 00cdb4f995 | |||
| d5477bd9e6 | |||
| 45efa8cbba | |||
| 917df1a7d6 | |||
| c2b38e7772 | |||
| f435f214d9 | |||
| 53e6180055 | |||
| 2b4af02db6 | |||
| 60e9d307bb | |||
| 9e593ae609 | |||
| 672f7c6eac | |||
| d6b5552122 | |||
| 0c69ca176a | |||
| d9cfa4dcaf | |||
| 2d5416ce4c | |||
| 259d424f1e | |||
| 11342e92cf | |||
| 477f89eb0c | |||
| 3c8ac0ef7e | |||
| 86059ccebd | |||
| 4ae06a3db0 | |||
| a4b2028cb1 |
17
.gitignore
vendored
@@ -1,10 +1,21 @@
|
||||
# This file should only ignore things that are generated during a build,
|
||||
# generated by common IDEs, and optional files controlled by the user that
|
||||
# affect the build (such as config.toml).
|
||||
|
||||
# Backup files created from Editors
|
||||
.#*
|
||||
.DS_Store
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
**/*~
|
||||
/target/
|
||||
|
||||
# user adaptions and configs values
|
||||
/config.toml
|
||||
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
***.rs.bk
|
||||
9
.gitmodules
vendored
@@ -1,6 +1,9 @@
|
||||
[submodule "database"]
|
||||
path = database
|
||||
url = ./database/
|
||||
[submodule "backend"]
|
||||
path = backend
|
||||
url = ./backend/
|
||||
[submodule "advotracker-db"]
|
||||
path = advotracker-db
|
||||
url = https://gitea.networkx.de:50443/rzerres/advotracker-db
|
||||
[submodule "advotrackerd"]
|
||||
path = advotrackerd
|
||||
url = https://gitea.networkx.de:50443/rzerres/advotrackerd
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "advotracker"
|
||||
name = "advotracker-framework"
|
||||
version = "0.1.0"
|
||||
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
||||
description = "Supports lawyers to capture relevant data encountered during an online legal advice\n"
|
||||
@@ -43,7 +43,8 @@ overflow-checks = true
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"backend",
|
||||
"frontend",
|
||||
"advotrackerd",
|
||||
"advotracker-db",
|
||||
"advotracker",
|
||||
"advotracker_qml",
|
||||
]
|
||||
|
||||
1
advotracker-db
Submodule
42
advotracker/Cargo.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
[package]
|
||||
name = "advotracker"
|
||||
version = "0.1.1"
|
||||
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
||||
description = "Frontend component that supports lawyers to capture relevant data encountered during an online legal advice."
|
||||
readme = "README.md"
|
||||
license = "(0BSD OR MIT)"
|
||||
edition = "2018"
|
||||
default-run = "advotracker"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = { version = "0.3", features = ["winuser"] }
|
||||
#diesel = { version = "1.4", features = [ "postgres", "sqlite" ] }
|
||||
|
||||
[dependencies]
|
||||
async-stream = "~0.2"
|
||||
chrono = { version = "~0.4.0", features = ["serde"] }
|
||||
clap = { version = "~2.33", features = ["suggestions", "color"] }
|
||||
csv = { version = "~1.1" }
|
||||
dotenv = { version = "~0.15.0" }
|
||||
envy = { version = "~0.4" }
|
||||
#lazy_static = { version = "~1.4.0" }
|
||||
log = { version = "~0.4.8" }
|
||||
#orbtk = { version = "~0.3.1-alpha3" }
|
||||
#orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }
|
||||
orbtk = { path = "../../orbtk" }
|
||||
serde = { version = "~1.0", features = ["derive"] }
|
||||
#tokio = { version = "~0.2", features = ["macros", "rt-threaded", "stream", "time"] }
|
||||
tracing = { version = "~0.1" }
|
||||
tracing-subscriber = { version = "0.2.0-alpha", features = ["tracing-log"] }
|
||||
viperus = { git = "https://github.com/maurocordioli/viperus", features = ["cache", "fmt-clap", "fmt-env", "global", "watch"] }
|
||||
|
||||
[features]
|
||||
# no features by default
|
||||
default = []
|
||||
testing = ["orbtk/debug"]
|
||||
|
||||
[package.metadata.bundle]
|
||||
name = "advotracker"
|
||||
identifier = "nwx.advotracker"
|
||||
short_description = "Online legal advice helper."
|
||||
description = "Supports lawyers to capture relevant data encountered during an online legal advice.\n"
|
||||
14
advotracker/Node.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
+[[apps]]
|
||||
+name = "advotracker_frontend"
|
||||
+width = 800
|
||||
+height = 600
|
||||
|
||||
[[apps.fonts]]
|
||||
font_family = "Material Icons"
|
||||
src = "fonts/MaterialIcons-Regular.ttf"
|
||||
[[apps.fonts]]
|
||||
font_family = "Roboto Regular"
|
||||
src = "fonts/Roboto-Regular.ttf"
|
||||
[[apps.fonts]]
|
||||
font_family = "Roboto Medium"
|
||||
src = "fonts/Roboto-Medium.ttf"
|
||||
15498
advotracker/data/POLLFNR_TEST.txt
Normal file
2498330
advotracker/data/POLLFNR_WOECHENTLICH.txt
Normal file
49
advotracker/data/bench.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
Target: debug
|
||||
[ralf@jacara-x1 frontend]$ time ../target/debug/examples/csv-import --importFile /home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt -v
|
||||
Jun 27 02:43:48.886 TRACE csv-import: "Umgebungsvariablen prüfen" state="gestartet"
|
||||
Jun 27 02:43:48.886 TRACE csv-import: environment="system" lang="de_DE.UTF-8"
|
||||
Jun 27 02:43:48.887 DEBUG csv-import: missing value for field test_lang
|
||||
Jun 27 02:43:48.887 TRACE csv-import: environment="envy" lang="de_DE.UTF-8"
|
||||
Jun 27 02:43:48.887 TRACE csv-import: "Umgebungsvariablen prüfen" state="beendet"
|
||||
Jun 27 02:43:48.887 TRACE csv-import: process="Programmargumente prüfen" state="gestartet"
|
||||
RUST_LOG=None
|
||||
Jun 27 02:43:48.887 TRACE csv_import::parse_args: verbose 1
|
||||
config_file: "csv_import.ron"
|
||||
import_file: "/home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt"
|
||||
verbosity level: 1
|
||||
Jun 27 02:43:48.887 TRACE csv-import: process="Programmargumente prüfen" state="beendet"
|
||||
Jun 27 02:43:48.887 TRACE csv-import: process="Programmlogik starten" state="gestartet"
|
||||
Jun 27 02:43:48.887 TRACE csv-import: extension=Some("txt") file=File { fd: 3, path: "/home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt", read: true, write: false }
|
||||
Jun 27 02:43:48.888 TRACE csv-import: header=StringRecord(["DION", "VERS", "POLLFNR"])
|
||||
Jun 27 02:43:57.513 TRACE csv-import: record_count=2498330
|
||||
Imported 2498330 records
|
||||
Jun 27 02:43:57.513 TRACE csv-import: process="Programmlogik beendet" state="beendet"
|
||||
|
||||
real 0m8,700s
|
||||
user 0m8,675s
|
||||
sys 0m0,017s
|
||||
|
||||
Target: release
|
||||
[ralf@jacara-x1 frontend]$ time ../target/release/examples/csv-import --importFile /home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt -v
|
||||
Jun 27 02:48:13.753 TRACE csv-import: "Umgebungsvariablen prüfen" state="gestartet"
|
||||
Jun 27 02:48:13.753 TRACE csv-import: environment="system" lang="de_DE.UTF-8"
|
||||
Jun 27 02:48:13.753 DEBUG csv-import: missing value for field test_lang
|
||||
Jun 27 02:48:13.753 TRACE csv-import: environment="envy" lang="de_DE.UTF-8"
|
||||
Jun 27 02:48:13.753 TRACE csv-import: "Umgebungsvariablen prüfen" state="beendet"
|
||||
Jun 27 02:48:13.753 TRACE csv-import: process="Programmargumente prüfen" state="gestartet"
|
||||
RUST_LOG=None
|
||||
Jun 27 02:48:13.753 TRACE csv_import::parse_args: verbose 1
|
||||
config_file: "csv_import.ron"
|
||||
import_file: "/home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt"
|
||||
verbosity level: 1
|
||||
Jun 27 02:48:13.753 TRACE csv-import: process="Programmargumente prüfen" state="beendet"
|
||||
Jun 27 02:48:13.753 TRACE csv-import: process="Programmlogik starten" state="gestartet"
|
||||
Jun 27 02:48:13.754 TRACE csv-import: extension=Some("txt") file=File { fd: 3, path: "/home/ralf/projekte/Hiedemann/Allianz_Vorgaben_Policycheck/ERG.txt", read: true, write: false }
|
||||
Jun 27 02:48:13.754 TRACE csv-import: header=StringRecord(["DION", "VERS", "POLLFNR"])
|
||||
Jun 27 02:48:14.098 TRACE csv-import: record_count=2498330
|
||||
Imported 2498330 records
|
||||
Jun 27 02:48:14.098 TRACE csv-import: process="Programmlogik beendet" state="beendet"
|
||||
|
||||
real 0m0,355s
|
||||
user 0m0,338s
|
||||
sys 0m0,017s
|
||||
7
advotracker/examples/.env
Normal file
@@ -0,0 +1,7 @@
|
||||
# set the language variable used in test-runs
|
||||
#test lang=it
|
||||
TEST_LANG=en
|
||||
#RUST_LOG=csv-import=trace
|
||||
LOG=debug
|
||||
USERNAME=ralf
|
||||
DB_DRIVER=sqlite
|
||||
@@ -35,60 +35,61 @@ impl State for MainViewState {
|
||||
if let Some(action) = self.action {
|
||||
match action {
|
||||
Action::AddItem => {
|
||||
let len = ctx.widget().get::<List>("list").len();
|
||||
let len = main_view(ctx.widget()).list().len();
|
||||
|
||||
if len < 5 {
|
||||
ctx.widget()
|
||||
.get_mut::<List>("list")
|
||||
main_view(ctx.widget())
|
||||
.list_mut()
|
||||
.push(format!("Item {}", len + 1));
|
||||
ctx.child("items").set("count", len + 1);
|
||||
ctx.child("remove-item-button").set("enabled", true);
|
||||
ctx.child("items").clone_or_default::<usize>("Item");
|
||||
items_widget(ctx.child("items")).set_count(len + 1);
|
||||
button(ctx.child("remove-item-button")).set_enabled(true);
|
||||
button(ctx.child("remove-item-button")).set_visibility(Visibility::Visible);
|
||||
|
||||
if len == 4 {
|
||||
ctx.child("add-item-button").set("enabled", false);
|
||||
button(ctx.child("add-item-button")).set_enabled(false);
|
||||
button(ctx.child("add-item-button")).set_visibility(Visibility::Collapsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
Action::RemoveItem => {
|
||||
let len = ctx.widget().get::<List>("list").len();
|
||||
let len = main_view(ctx.widget()).list().len();
|
||||
if len > 0 {
|
||||
ctx.widget().get_mut::<List>("list").remove(len - 1);
|
||||
ctx.child("items").set("count", len - 1);
|
||||
ctx.child("add-item-button").set("enabled", true);
|
||||
main_view(ctx.widget()).list_mut().remove(len - 1);
|
||||
items_widget(ctx.child("items")).set_count(len - 1);
|
||||
button(ctx.child("add-item-button")).set_enabled(true);
|
||||
button(ctx.child("add-item-button")).set_visibility(Visibility::Visible);
|
||||
|
||||
if len == 1 {
|
||||
ctx.child("remove-item-button").set("enabled", false);
|
||||
}
|
||||
button(ctx.child("remove-item-button")).set_enabled(false);
|
||||
button(ctx.child("remove-item-button")).set_visibility(Visibility::Collapsed); }
|
||||
}
|
||||
}
|
||||
Action::IncrementCounter => {
|
||||
*ctx.widget().get_mut::<usize>("counter") += 1;
|
||||
*main_view(ctx.widget()).counter_mut() += 1;
|
||||
|
||||
let counter = *ctx.widget().get::<usize>("counter");
|
||||
let counter = *main_view(ctx.widget()).counter();
|
||||
|
||||
ctx.widget().set(
|
||||
"result",
|
||||
String16::from(format!("Button count: {}", counter)),
|
||||
);
|
||||
main_view(ctx.widget())
|
||||
.set_result(String16::from(format!("Button count: {}", counter)));
|
||||
}
|
||||
Action::ClearText => {
|
||||
ctx.widget().set("text_one", String16::from(""));
|
||||
ctx.widget().set("text_two", String16::from(""));
|
||||
main_view(ctx.widget()).set_text_one(String16::default());
|
||||
main_view(ctx.widget()).set_text_two(String16::default());
|
||||
}
|
||||
Action::EntryActivated(entity) => {
|
||||
let mut widget = ctx.get_widget(entity);
|
||||
let text = widget.get_mut::<String16>("text");
|
||||
let mut text_box = text_box(ctx.get_widget(entity));
|
||||
let text = text_box.text_mut();
|
||||
println!("submitting {}", text);
|
||||
text.clear();
|
||||
}
|
||||
Action::EntryChanged(entity) => {
|
||||
let widget = ctx.get_widget(entity);
|
||||
let text = widget.get::<String16>("text");
|
||||
println!("entry changed: {}", text);
|
||||
println!("entry changed: {}", text_box(ctx.get_widget(entity)).text());
|
||||
}
|
||||
Action::ValueChanged(entity) => {
|
||||
let val =
|
||||
((*ctx.get_widget(entity).get::<f64>("val")).floor() as i32).to_string();
|
||||
ctx.child("value_text").set("text", String16::from(val));
|
||||
let val = ((slider(ctx.get_widget(entity)).val()).floor() as i32).to_string();
|
||||
|
||||
text_block(ctx.child("value_text")).set_text(String16::from(val));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,12 +100,11 @@ impl State for MainViewState {
|
||||
fn update_post_layout(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
||||
let mut selection_string = "Selected:".to_string();
|
||||
|
||||
for index in &ctx.widget().get::<SelectedIndices>("selected_indices").0 {
|
||||
for index in &main_view(ctx.widget()).selected_indices().0 {
|
||||
selection_string = format!("{} {}", selection_string, index);
|
||||
}
|
||||
|
||||
ctx.child("selection")
|
||||
.set("text", String16::from(selection_string));
|
||||
text_block(ctx.child("selection")).set_text(selection_string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,14 +174,14 @@ impl Template for MainView {
|
||||
.combo_box_list_count(10)
|
||||
.child(
|
||||
Grid::new()
|
||||
.margin(8.0)
|
||||
.margin(8.)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add(132.0)
|
||||
.add(16.0)
|
||||
.add(132.0)
|
||||
.add(16.0)
|
||||
.add(132.0),
|
||||
.add(132.)
|
||||
.add(16.)
|
||||
.add(132.)
|
||||
.add(16.)
|
||||
.add(132.),
|
||||
)
|
||||
.child(
|
||||
Stack::new()
|
||||
@@ -191,8 +191,8 @@ impl Template for MainView {
|
||||
.child(
|
||||
Button::new()
|
||||
.text("Button")
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.icon(material_font_icons::CHECK_FONT_ICON)
|
||||
.margin((0., 8., 0., 0.))
|
||||
.icon(material_icons_font::MD_CHECK)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(1))
|
||||
.on_click(move |states, _| {
|
||||
@@ -206,8 +206,8 @@ impl Template for MainView {
|
||||
.text("Primary")
|
||||
.element("button")
|
||||
.class("primary")
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.icon(material_font_icons::CHECK_FONT_ICON)
|
||||
.margin((0., 8., 0., 0.))
|
||||
.icon(material_icons_font::MD_360)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(2))
|
||||
.build(ctx),
|
||||
@@ -216,7 +216,8 @@ impl Template for MainView {
|
||||
ToggleButton::new()
|
||||
.class("single_content")
|
||||
.text("ToggleButton")
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 2., 0.))
|
||||
.icon(material_icons_font::MD_ALARM_ON)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(3))
|
||||
.build(ctx),
|
||||
@@ -224,21 +225,21 @@ impl Template for MainView {
|
||||
.child(
|
||||
CheckBox::new()
|
||||
.text("CheckBox")
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(4))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Switch::new()
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(5))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.element("h1")
|
||||
.id("value_text")
|
||||
.text("0")
|
||||
@@ -262,7 +263,7 @@ impl Template for MainView {
|
||||
TextBlock::new()
|
||||
.class("body")
|
||||
.text(("result", id))
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.attach(Grid::column(2))
|
||||
.attach(Grid::row(1))
|
||||
.build(ctx),
|
||||
@@ -271,7 +272,7 @@ impl Template for MainView {
|
||||
TextBox::new()
|
||||
.water_mark("TextBox...")
|
||||
.text(("text_one", id))
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.attach(Grid::column(2))
|
||||
.attach(Grid::row(2))
|
||||
.on_activate(move |states, entity| {
|
||||
@@ -286,7 +287,7 @@ impl Template for MainView {
|
||||
TextBox::new()
|
||||
.water_mark("TextBox...")
|
||||
.text(("text_two", id))
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.attach(Grid::column(2))
|
||||
.attach(Grid::row(2))
|
||||
.on_activate(move |states, entity| {
|
||||
@@ -299,8 +300,10 @@ impl Template for MainView {
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.class("single_content")
|
||||
.margin((0., 8., 8., 0.))
|
||||
.icon(material_icons_font::MD_CLEAR)
|
||||
.text("clear text")
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::ClearText);
|
||||
@@ -310,8 +313,8 @@ impl Template for MainView {
|
||||
)
|
||||
.child(
|
||||
NumericBox::new()
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.max(123.0)
|
||||
.margin((-0., 8., 0., 0.))
|
||||
.max(123.)
|
||||
.step(0.123)
|
||||
.val(0.123)
|
||||
.build(ctx),
|
||||
@@ -323,14 +326,14 @@ impl Template for MainView {
|
||||
.rows(
|
||||
Rows::new()
|
||||
.add("auto")
|
||||
.add(32.0)
|
||||
.add(16.0)
|
||||
.add(204.0)
|
||||
.add(32.)
|
||||
.add(16.)
|
||||
.add(204.)
|
||||
.add("auto")
|
||||
.add(192.0)
|
||||
.add(192.)
|
||||
.add("auto"),
|
||||
)
|
||||
.columns(Columns::new().add("*").add(4.0).add("*"))
|
||||
.columns(Columns::new().add("*").add(4.).add("*"))
|
||||
.attach(Grid::column(4))
|
||||
.child(
|
||||
TextBlock::new()
|
||||
@@ -350,7 +353,7 @@ impl Template for MainView {
|
||||
.get::<Vec<String>>("combo_box_list")[index]
|
||||
.clone();
|
||||
TextBlock::new()
|
||||
.margin((0.0, 0.0, 0.0, 2.0))
|
||||
.margin((0., 0., 0., 2.))
|
||||
.v_align("center")
|
||||
.text(text)
|
||||
.build(bc)
|
||||
@@ -359,7 +362,7 @@ impl Template for MainView {
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.attach(Grid::row(1))
|
||||
.margin((0.0, 8.0, 0.0, 0.0))
|
||||
.margin((0., 8., 0., 0.))
|
||||
.count(("combo_box_list_count", id))
|
||||
.build(ctx),
|
||||
)
|
||||
@@ -367,18 +370,18 @@ impl Template for MainView {
|
||||
ItemsWidget::new()
|
||||
.element("items-widget")
|
||||
.id("items")
|
||||
.padding((4.0, 4.0, 4.0, 2.0))
|
||||
.padding((4., 4., 4., 2.))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.attach(Grid::row(3))
|
||||
.margin((0.0, 0.0, 0.0, 8.0))
|
||||
.margin((0., 0., 0., 8.))
|
||||
.items_builder(move |bc, index| {
|
||||
let text = bc.get_widget(id).get::<Vec<String>>("list")
|
||||
[index]
|
||||
.clone();
|
||||
|
||||
Button::new()
|
||||
.margin((0.0, 0.0, 0.0, 2.0))
|
||||
.margin((0., 0., 0., 2.))
|
||||
.text(text)
|
||||
.build(bc)
|
||||
})
|
||||
@@ -390,12 +393,12 @@ impl Template for MainView {
|
||||
.element("button")
|
||||
.class("single_content")
|
||||
.id("remove-item-button")
|
||||
.icon(material_font_icons::MINUS_FONT_ICON)
|
||||
.icon(material_icons_font::MD_REMOVE_CIRCLE)
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::RemoveItem);
|
||||
true
|
||||
})
|
||||
.min_width(0.0)
|
||||
.min_width(0.)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(4))
|
||||
.build(ctx),
|
||||
@@ -405,12 +408,12 @@ impl Template for MainView {
|
||||
.element("button")
|
||||
.class("single_content")
|
||||
.id("add-item-button")
|
||||
.icon(material_font_icons::ADD_FONT_ICON)
|
||||
.icon(material_icons_font::MD_ADD_CIRCLE)
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::AddItem);
|
||||
true
|
||||
})
|
||||
.min_width(0.0)
|
||||
.min_width(0.)
|
||||
.attach(Grid::column(2))
|
||||
.attach(Grid::row(4))
|
||||
.build(ctx),
|
||||
@@ -421,14 +424,14 @@ impl Template for MainView {
|
||||
.attach(Grid::column_span(3))
|
||||
.attach(Grid::row(5))
|
||||
.selected_indices(id)
|
||||
.margin((0.0, 16.0, 0.0, 8.0))
|
||||
.margin((0., 16., 0., 8.))
|
||||
.items_builder(move |bc, index| {
|
||||
let text = bc
|
||||
.get_widget(id)
|
||||
.get::<Vec<String>>("selection_list")[index]
|
||||
.clone();
|
||||
TextBlock::new()
|
||||
.margin((0.0, 0.0, 0.0, 2.0))
|
||||
.margin((0., 0., 0., 2.))
|
||||
.v_align("center")
|
||||
.text(text)
|
||||
.build(bc)
|
||||
@@ -441,7 +444,7 @@ impl Template for MainView {
|
||||
TextBlock::new()
|
||||
.element("text-block")
|
||||
.id("selection")
|
||||
.max_width(120.0)
|
||||
.max_width(120.)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.attach(Grid::row(6))
|
||||
@@ -463,8 +466,8 @@ fn main() {
|
||||
.window(|ctx| {
|
||||
Window::new()
|
||||
.title("OrbTk - widgets example")
|
||||
.position((100.0, 100.0))
|
||||
.size(468.0, 730.0)
|
||||
.position((100., 100.))
|
||||
.size(468., 730.)
|
||||
.resizeable(true)
|
||||
.child(MainView::new().build(ctx))
|
||||
.build(ctx)
|
||||
37
advotracker/examples/pdf_check.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
extern crate pdf_extract;
|
||||
extern crate lopdf;
|
||||
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
use std::path;
|
||||
use std::io::BufWriter;
|
||||
use std::fs::File;
|
||||
use pdf_extract::*;
|
||||
use lopdf::*;
|
||||
|
||||
fn main() {
|
||||
//let output_kind = "html";
|
||||
//let output_kind = "txt";
|
||||
//let output_kind = "svg";
|
||||
let file = env::args().nth(1).unwrap();
|
||||
let output_kind = env::args().nth(2).unwrap_or_else(|| "txt".to_owned());
|
||||
println!("{}", file);
|
||||
let path = path::Path::new(&file);
|
||||
let filename = path.file_name().expect("expected a filename");
|
||||
let mut output_file = PathBuf::new();
|
||||
output_file.push(filename);
|
||||
output_file.set_extension(&output_kind);
|
||||
let mut output_file = BufWriter::new(File::create(output_file).expect("could not create output"));
|
||||
let doc = Document::load(path).unwrap();
|
||||
|
||||
print_metadata(&doc);
|
||||
|
||||
let mut output: Box<dyn OutputDev> = match output_kind.as_ref() {
|
||||
"txt" => Box::new(PlainTextOutput::new(&mut output_file as &mut dyn std::io::Write)),
|
||||
"html" => Box::new(HTMLOutput::new(&mut output_file)),
|
||||
"svg" => Box::new(SVGOutput::new(&mut output_file)),
|
||||
_ => panic!(),
|
||||
};
|
||||
|
||||
output_doc(&doc, output.as_mut());
|
||||
}
|
||||
581
advotracker/resources/fonts/MaterialIcons-Regular.ttf
Normal file
@@ -0,0 +1,581 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-DE">
|
||||
<head data-suburl="">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>flovanco/doit: Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk. - static/fonts/MaterialIcons-Regular.ttf at master - doit - Codeberg.org</title>
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/serviceworker.js').then(function(registration) {
|
||||
|
||||
console.info('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
}, function(err) {
|
||||
|
||||
console.info('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<meta name="theme-color" content="#6cc644">
|
||||
<meta name="author" content="flovanco" />
|
||||
<meta name="description" content="doit - Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
<meta name="keywords" content="git,non-profit,foss,oss,free,software,open,source,code,hosting">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="_csrf" content="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw" />
|
||||
<meta name="_suburl" content="" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
JavaScript code in this page.
|
||||
|
||||
Copyright (c) 2016 The Gitea Authors
|
||||
Copyright (c) 2015 The Gogs Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
---
|
||||
Licensing information for additional javascript libraries can be found at:
|
||||
{{StaticUrlPrefix}}/vendor/librejs.html
|
||||
|
||||
@licend The above is the entire license notice
|
||||
for the JavaScript code in this page.
|
||||
*/
|
||||
</script>
|
||||
<script>
|
||||
window.config = {
|
||||
StaticUrlPrefix: ''
|
||||
}
|
||||
</script>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" />
|
||||
<link rel="mask-icon" href="/img/gitea-safari.svg" color="#609926">
|
||||
<link rel="preload" href="/vendor/assets/font-awesome/css/font-awesome.min.css" as="style" onload="this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="/vendor/assets/font-awesome/css/font-awesome.min.css"></noscript>
|
||||
<link rel="stylesheet" href="/vendor/assets/octicons/octicons.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/fomantic/semantic.min.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<link rel="stylesheet" href="/css/index.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<noscript>
|
||||
<style>
|
||||
.dropdown:hover > .menu { display: block; }
|
||||
.ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/highlight/github.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style class="list-search-style"></style>
|
||||
|
||||
<script src="/vendor/plugins/promise-polyfill/polyfill.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/loadCSS.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/cssrelpreload.min.js"></script>
|
||||
|
||||
|
||||
<meta property="og:title" content="doit" />
|
||||
<meta property="og:url" content="https://codeberg.org/flovanco/doit" />
|
||||
|
||||
<meta property="og:description" content="Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
|
||||
|
||||
<meta property="og:type" content="object" />
|
||||
<meta property="og:image" content="https://codeberg.org/user/avatar/flovanco/-1" />
|
||||
|
||||
<meta property="og:site_name" content="Codeberg.org" />
|
||||
|
||||
<link rel="stylesheet" href="/codeberg.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="full height">
|
||||
<noscript>Diese Webseite funktioniert besser mit JavaScript.</noscript>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui top secondary stackable main menu following bar light">
|
||||
<div class="ui container" id="navbar">
|
||||
<div class="item brand" style="justify-content: space-between;">
|
||||
<a href="/">
|
||||
<img class="ui mini image" src="/img/gitea-sm.png">
|
||||
</a>
|
||||
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
|
||||
<i class="sidebar icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a class="item " href="/">Startseite</a>
|
||||
<a class="item " href="/explore/repos">Erkunden</a>
|
||||
|
||||
|
||||
<a class="item" href="/Codeberg/Community/issues">Codeberg Issues</a>
|
||||
<a class="item" href="https://blog.codeberg.org">Blog</a>
|
||||
<a class="item" href="https://join.codeberg.org/">Join Codeberg e.V.</a>
|
||||
<a class="item" href="https://liberapay.com/codeberg/donate">Donate</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">Hilfe</a>
|
||||
<div class="right stackable menu">
|
||||
|
||||
<a class="item" href="/user/sing_up">
|
||||
<i class="octicon octicon-person"></i> Registrieren
|
||||
</a>
|
||||
|
||||
<a class="item" rel="nofollow" href="/user/login?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fMaterialIcons-Regular.ttf">
|
||||
<i class="octicon octicon-sign-in"></i> Anmelden
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="repository file list">
|
||||
<div class="header-wrapper">
|
||||
|
||||
<div class="ui container">
|
||||
<div class="repo-header">
|
||||
<div class="ui huge breadcrumb repo-title">
|
||||
|
||||
<i class="mega-octicon octicon-repo"></i>
|
||||
|
||||
<a href="/flovanco">flovanco</a>
|
||||
<div class="divider"> / </div>
|
||||
<a href="/flovanco/doit">doit</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="repo-buttons">
|
||||
<form method="post" action="/flovanco/doit/action/watch?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fMaterialIcons-Regular.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon fa-eye-slash"></i>Beobachten
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/watchers">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="/flovanco/doit/action/star?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fMaterialIcons-Regular.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon star outline"></i>Favorisieren
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/stars">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="ui labeled button " tabindex="0">
|
||||
<a class="ui compact basic button poping up" data-content="Bitte melde dich an, um dieses Repository zu forken." rel="nofollow" href="/user/login?redirect_to=/repo/fork/3183" data-position="top center" data-variation="tiny">
|
||||
<i class="octicon octicon-repo-forked"></i>Fork
|
||||
</a>
|
||||
<a class="ui basic label" href="/flovanco/doit/forks">
|
||||
0
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui tabs container">
|
||||
|
||||
<div class="ui tabular stackable menu navbar">
|
||||
|
||||
<a class="active item" href="/flovanco/doit">
|
||||
<i class="octicon octicon-code"></i> Code
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/issues">
|
||||
<i class="octicon octicon-issue-opened"></i> Issues <span class="ui blue small label">4</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/pulls">
|
||||
<i class="octicon octicon-git-pull-request"></i> Pull-Requests <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/releases">
|
||||
<i class="octicon octicon-tag"></i> Releases <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/wiki" >
|
||||
<i class="octicon octicon-book"></i> Wiki
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/activity">
|
||||
<i class="octicon octicon-pulse"></i> Aktivität
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui tabs divider"></div>
|
||||
</div>
|
||||
|
||||
<div class="ui container">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui repo-description">
|
||||
<div id="repo-desc">
|
||||
<span class="description has-emoji">Task app based on OrbTk <a href="https://gitlab.redox-os.org/redox-os/orbtk" rel="nofollow">https://gitlab.redox-os.org/redox-os/orbtk</a>.</span>
|
||||
<a class="link" href=""></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui" id="repo-topics">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hide" id="validate_prompt">
|
||||
<span id="count_prompt">Du kannst nicht mehr als 25 Themen auswählen</span>
|
||||
<span id="format_prompt">Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.</span>
|
||||
</div>
|
||||
|
||||
<div class="ui segment sub-menu">
|
||||
<div class="ui two horizontal center link list">
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/commits/branch/master"><i class="octicon octicon-history"></i> <b>57</b> Commits</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/branches/"><i class="octicon octicon-git-branch"></i> <b>2</b> Branches</a>
|
||||
</div>
|
||||
<div class="item">
|
||||
<a class="ui" href="#"><i class="octicon octicon-database"></i> <b>922KB</b></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
|
||||
<div class="fitted item choose reference">
|
||||
<div class="ui floating filter dropdown custom" data-can-create-branch="false" data-no-results="Keine Ergebnisse verfügbar.">
|
||||
<div class="ui basic small compact button" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible">
|
||||
<span class="text">
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Branch:
|
||||
<strong>master</strong>
|
||||
</span>
|
||||
<i class="dropdown icon"></i>
|
||||
</div>
|
||||
<div class="data" style="display: none" data-mode="branches">
|
||||
|
||||
<div class="item branch selected" data-url="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf">master</div>
|
||||
|
||||
<div class="item branch " data-url="/flovanco/doit/src/branch/overview/static/fonts/MaterialIcons-Regular.ttf">overview</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="menu transition" :class="{visible: menuVisible}" v-if="menuVisible" v-cloak>
|
||||
<div class="ui icon search input">
|
||||
<i class="filter icon"></i>
|
||||
<input name="search" ref="searchField" v-model="searchTerm" @keydown="keydown($event)" placeholder="Branch oder Tag filtern...">
|
||||
</div>
|
||||
<div class="header branch-tag-choice">
|
||||
<div class="ui grid">
|
||||
<div class="two column row">
|
||||
<a class="reference column" href="#" @click="mode = 'branches'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'branches'}">
|
||||
<i class="octicon octicon-git-branch"></i> Branches
|
||||
</span>
|
||||
</a>
|
||||
<a class="reference column" href="#" @click="mode = 'tags'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'tags'}">
|
||||
<i class="reference tags icon"></i> Tags
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scrolling menu" ref="scrollContainer">
|
||||
<div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active == index}" @click="selectItem(item)" :ref="'listItem' + index">${ item.name }</div>
|
||||
<div class="item" v-if="showCreateNewBranch" :class="{active: active == filteredItems.length}" :ref="'listItem' + filteredItems.length">
|
||||
<a href="#" @click="createNewBranch()">
|
||||
<div>
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Erstelle Branch <strong>${ searchTerm }</strong>
|
||||
</div>
|
||||
<div class="text small">
|
||||
|
||||
von „master“
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<form ref="newBranchForm" action="/flovanco/doit/branches/_new/branch/master" method="post">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<input type="hidden" name="new_branch_name" v-model="searchTerm">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message" v-if="showNoResults">${ noResults }</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="/flovanco/doit/src/branch/master" title="doit">doit</a><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static" title="static">static</a></span><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static/fonts" title="fonts">fonts</a></span><span class="divider">/</span><span class="active section" title="MaterialIcons-Regular.ttf">MaterialIcons-Regular.ttf</span></span></div>
|
||||
|
||||
<div class="right fitted item" id="file-buttons">
|
||||
<div class="ui tiny blue buttons">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header">
|
||||
<div class="file-header-left">
|
||||
|
||||
<div class="file-info text grey normal mono">
|
||||
|
||||
|
||||
<div class="file-info-entry">
|
||||
125KB
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="file-header-right">
|
||||
<div class="ui right file-actions">
|
||||
<div class="ui buttons">
|
||||
<a class="ui button" href="/flovanco/doit/raw/branch/master/static/fonts/MaterialIcons-Regular.ttf">Originalformat</a>
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/src/commit/417acaf7ac867ed47ab73e7e66f07f15f1f124cc/static/fonts/MaterialIcons-Regular.ttf">Permalink</a>
|
||||
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/commits/branch/master/static/fonts/MaterialIcons-Regular.ttf">Verlauf</a>
|
||||
</div>
|
||||
|
||||
|
||||
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="Binärdateien können nicht im Webinterface bearbeitet werden." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="Du benötigst Schreibzugriff, um Änderungen an dieser Datei vorzuschlagen oder vorzunehmen." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</h4>
|
||||
<div class="ui attached table unstackable segment">
|
||||
<div class="file-view has-emoji">
|
||||
|
||||
<div class="view-raw ui center">
|
||||
|
||||
<a href="/flovanco/doit/raw/branch/master/static/fonts/MaterialIcons-Regular.ttf" rel="nofollow" class="btn btn-gray btn-radius">Originalformat anzeigen</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitDeleteForm() {
|
||||
var message = prompt("delete_confirm_message\n\ndelete_commit_summary", "Delete ''");
|
||||
if (message != null) {
|
||||
$("#delete-message").val(message);
|
||||
$("#delete-file-form").submit()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="ui container">
|
||||
<div class="ui left">
|
||||
|
||||
</div>
|
||||
<div class="ui right links">
|
||||
|
||||
<div class="ui language bottom floating slide up dropdown link item">
|
||||
<i class="world icon"></i>
|
||||
<div class="text">Deutsch</div>
|
||||
<div class="menu">
|
||||
|
||||
<a lang="de-DE" class="item active selected" href="#">Deutsch</a>
|
||||
|
||||
<a lang="en-US" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=en-US">English</a>
|
||||
|
||||
<a lang="zh-CN" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=zh-CN">简体中文</a>
|
||||
|
||||
<a lang="zh-HK" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=zh-HK">繁體中文(香港)</a>
|
||||
|
||||
<a lang="zh-TW" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=zh-TW">繁體中文(台灣)</a>
|
||||
|
||||
<a lang="fr-FR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=fr-FR">français</a>
|
||||
|
||||
<a lang="nl-NL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=nl-NL">Nederlands</a>
|
||||
|
||||
<a lang="lv-LV" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=lv-LV">latviešu</a>
|
||||
|
||||
<a lang="ru-RU" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=ru-RU">русский</a>
|
||||
|
||||
<a lang="uk-UA" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=uk-UA">Українська</a>
|
||||
|
||||
<a lang="ja-JP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=ja-JP">日本語</a>
|
||||
|
||||
<a lang="es-ES" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=es-ES">español</a>
|
||||
|
||||
<a lang="pt-BR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=pt-BR">português do Brasil</a>
|
||||
|
||||
<a lang="pl-PL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=pl-PL">polski</a>
|
||||
|
||||
<a lang="bg-BG" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=bg-BG">български</a>
|
||||
|
||||
<a lang="it-IT" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=it-IT">italiano</a>
|
||||
|
||||
<a lang="fi-FI" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=fi-FI">suomi</a>
|
||||
|
||||
<a lang="tr-TR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=tr-TR">Türkçe</a>
|
||||
|
||||
<a lang="cs-CZ" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=cs-CZ">čeština</a>
|
||||
|
||||
<a lang="sr-SP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=sr-SP">српски</a>
|
||||
|
||||
<a lang="sv-SE" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=sv-SE">svenska</a>
|
||||
|
||||
<a lang="ko-KR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/MaterialIcons-Regular.ttf?lang=ko-KR">한국어</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a href="/vendor/librejs.html" data-jslicense="1">JavaScript licenses</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/PrivacyPolicy.md">Privacy Policy</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Satzung.md">Bylaws/Satzung</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Imprint.md">Imprint/Impressum</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/TermsOfUse.md">Terms of Use</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/jquery/jquery.min.js?v=3.4.1"></script>
|
||||
<script src="/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1"></script>
|
||||
<script src="/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/highlight/highlight.pack.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/emojify/emojify.custom.js"></script>
|
||||
<script src="/vendor/plugins/clipboard/clipboard.min.js"></script>
|
||||
<script src="/vendor/plugins/vue/vue.min.js"></script>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/fomantic/semantic.min.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
<script src="/js/index.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
BIN
advotracker/resources/fonts/MaterialIcons-Regular_orbtk.ttf
Normal file
581
advotracker/resources/fonts/Roboto-Medium.ttf
Normal file
@@ -0,0 +1,581 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-DE">
|
||||
<head data-suburl="">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>flovanco/doit: Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk. - static/fonts/Roboto-Medium.ttf at master - doit - Codeberg.org</title>
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/serviceworker.js').then(function(registration) {
|
||||
|
||||
console.info('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
}, function(err) {
|
||||
|
||||
console.info('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<meta name="theme-color" content="#6cc644">
|
||||
<meta name="author" content="flovanco" />
|
||||
<meta name="description" content="doit - Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
<meta name="keywords" content="git,non-profit,foss,oss,free,software,open,source,code,hosting">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="_csrf" content="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw" />
|
||||
<meta name="_suburl" content="" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
JavaScript code in this page.
|
||||
|
||||
Copyright (c) 2016 The Gitea Authors
|
||||
Copyright (c) 2015 The Gogs Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
---
|
||||
Licensing information for additional javascript libraries can be found at:
|
||||
{{StaticUrlPrefix}}/vendor/librejs.html
|
||||
|
||||
@licend The above is the entire license notice
|
||||
for the JavaScript code in this page.
|
||||
*/
|
||||
</script>
|
||||
<script>
|
||||
window.config = {
|
||||
StaticUrlPrefix: ''
|
||||
}
|
||||
</script>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" />
|
||||
<link rel="mask-icon" href="/img/gitea-safari.svg" color="#609926">
|
||||
<link rel="preload" href="/vendor/assets/font-awesome/css/font-awesome.min.css" as="style" onload="this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="/vendor/assets/font-awesome/css/font-awesome.min.css"></noscript>
|
||||
<link rel="stylesheet" href="/vendor/assets/octicons/octicons.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/fomantic/semantic.min.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<link rel="stylesheet" href="/css/index.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<noscript>
|
||||
<style>
|
||||
.dropdown:hover > .menu { display: block; }
|
||||
.ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/highlight/github.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style class="list-search-style"></style>
|
||||
|
||||
<script src="/vendor/plugins/promise-polyfill/polyfill.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/loadCSS.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/cssrelpreload.min.js"></script>
|
||||
|
||||
|
||||
<meta property="og:title" content="doit" />
|
||||
<meta property="og:url" content="https://codeberg.org/flovanco/doit" />
|
||||
|
||||
<meta property="og:description" content="Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
|
||||
|
||||
<meta property="og:type" content="object" />
|
||||
<meta property="og:image" content="https://codeberg.org/user/avatar/flovanco/-1" />
|
||||
|
||||
<meta property="og:site_name" content="Codeberg.org" />
|
||||
|
||||
<link rel="stylesheet" href="/codeberg.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="full height">
|
||||
<noscript>Diese Webseite funktioniert besser mit JavaScript.</noscript>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui top secondary stackable main menu following bar light">
|
||||
<div class="ui container" id="navbar">
|
||||
<div class="item brand" style="justify-content: space-between;">
|
||||
<a href="/">
|
||||
<img class="ui mini image" src="/img/gitea-sm.png">
|
||||
</a>
|
||||
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
|
||||
<i class="sidebar icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a class="item " href="/">Startseite</a>
|
||||
<a class="item " href="/explore/repos">Erkunden</a>
|
||||
|
||||
|
||||
<a class="item" href="/Codeberg/Community/issues">Codeberg Issues</a>
|
||||
<a class="item" href="https://blog.codeberg.org">Blog</a>
|
||||
<a class="item" href="https://join.codeberg.org/">Join Codeberg e.V.</a>
|
||||
<a class="item" href="https://liberapay.com/codeberg/donate">Donate</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">Hilfe</a>
|
||||
<div class="right stackable menu">
|
||||
|
||||
<a class="item" href="/user/sing_up">
|
||||
<i class="octicon octicon-person"></i> Registrieren
|
||||
</a>
|
||||
|
||||
<a class="item" rel="nofollow" href="/user/login?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Medium.ttf">
|
||||
<i class="octicon octicon-sign-in"></i> Anmelden
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="repository file list">
|
||||
<div class="header-wrapper">
|
||||
|
||||
<div class="ui container">
|
||||
<div class="repo-header">
|
||||
<div class="ui huge breadcrumb repo-title">
|
||||
|
||||
<i class="mega-octicon octicon-repo"></i>
|
||||
|
||||
<a href="/flovanco">flovanco</a>
|
||||
<div class="divider"> / </div>
|
||||
<a href="/flovanco/doit">doit</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="repo-buttons">
|
||||
<form method="post" action="/flovanco/doit/action/watch?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Medium.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon fa-eye-slash"></i>Beobachten
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/watchers">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="/flovanco/doit/action/star?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Medium.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon star outline"></i>Favorisieren
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/stars">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="ui labeled button " tabindex="0">
|
||||
<a class="ui compact basic button poping up" data-content="Bitte melde dich an, um dieses Repository zu forken." rel="nofollow" href="/user/login?redirect_to=/repo/fork/3183" data-position="top center" data-variation="tiny">
|
||||
<i class="octicon octicon-repo-forked"></i>Fork
|
||||
</a>
|
||||
<a class="ui basic label" href="/flovanco/doit/forks">
|
||||
0
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui tabs container">
|
||||
|
||||
<div class="ui tabular stackable menu navbar">
|
||||
|
||||
<a class="active item" href="/flovanco/doit">
|
||||
<i class="octicon octicon-code"></i> Code
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/issues">
|
||||
<i class="octicon octicon-issue-opened"></i> Issues <span class="ui blue small label">4</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/pulls">
|
||||
<i class="octicon octicon-git-pull-request"></i> Pull-Requests <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/releases">
|
||||
<i class="octicon octicon-tag"></i> Releases <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/wiki" >
|
||||
<i class="octicon octicon-book"></i> Wiki
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/activity">
|
||||
<i class="octicon octicon-pulse"></i> Aktivität
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui tabs divider"></div>
|
||||
</div>
|
||||
|
||||
<div class="ui container">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui repo-description">
|
||||
<div id="repo-desc">
|
||||
<span class="description has-emoji">Task app based on OrbTk <a href="https://gitlab.redox-os.org/redox-os/orbtk" rel="nofollow">https://gitlab.redox-os.org/redox-os/orbtk</a>.</span>
|
||||
<a class="link" href=""></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui" id="repo-topics">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hide" id="validate_prompt">
|
||||
<span id="count_prompt">Du kannst nicht mehr als 25 Themen auswählen</span>
|
||||
<span id="format_prompt">Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.</span>
|
||||
</div>
|
||||
|
||||
<div class="ui segment sub-menu">
|
||||
<div class="ui two horizontal center link list">
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/commits/branch/master"><i class="octicon octicon-history"></i> <b>57</b> Commits</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/branches/"><i class="octicon octicon-git-branch"></i> <b>2</b> Branches</a>
|
||||
</div>
|
||||
<div class="item">
|
||||
<a class="ui" href="#"><i class="octicon octicon-database"></i> <b>922KB</b></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
|
||||
<div class="fitted item choose reference">
|
||||
<div class="ui floating filter dropdown custom" data-can-create-branch="false" data-no-results="Keine Ergebnisse verfügbar.">
|
||||
<div class="ui basic small compact button" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible">
|
||||
<span class="text">
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Branch:
|
||||
<strong>master</strong>
|
||||
</span>
|
||||
<i class="dropdown icon"></i>
|
||||
</div>
|
||||
<div class="data" style="display: none" data-mode="branches">
|
||||
|
||||
<div class="item branch selected" data-url="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf">master</div>
|
||||
|
||||
<div class="item branch " data-url="/flovanco/doit/src/branch/overview/static/fonts/Roboto-Medium.ttf">overview</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="menu transition" :class="{visible: menuVisible}" v-if="menuVisible" v-cloak>
|
||||
<div class="ui icon search input">
|
||||
<i class="filter icon"></i>
|
||||
<input name="search" ref="searchField" v-model="searchTerm" @keydown="keydown($event)" placeholder="Branch oder Tag filtern...">
|
||||
</div>
|
||||
<div class="header branch-tag-choice">
|
||||
<div class="ui grid">
|
||||
<div class="two column row">
|
||||
<a class="reference column" href="#" @click="mode = 'branches'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'branches'}">
|
||||
<i class="octicon octicon-git-branch"></i> Branches
|
||||
</span>
|
||||
</a>
|
||||
<a class="reference column" href="#" @click="mode = 'tags'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'tags'}">
|
||||
<i class="reference tags icon"></i> Tags
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scrolling menu" ref="scrollContainer">
|
||||
<div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active == index}" @click="selectItem(item)" :ref="'listItem' + index">${ item.name }</div>
|
||||
<div class="item" v-if="showCreateNewBranch" :class="{active: active == filteredItems.length}" :ref="'listItem' + filteredItems.length">
|
||||
<a href="#" @click="createNewBranch()">
|
||||
<div>
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Erstelle Branch <strong>${ searchTerm }</strong>
|
||||
</div>
|
||||
<div class="text small">
|
||||
|
||||
von „master“
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<form ref="newBranchForm" action="/flovanco/doit/branches/_new/branch/master" method="post">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<input type="hidden" name="new_branch_name" v-model="searchTerm">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message" v-if="showNoResults">${ noResults }</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="/flovanco/doit/src/branch/master" title="doit">doit</a><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static" title="static">static</a></span><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static/fonts" title="fonts">fonts</a></span><span class="divider">/</span><span class="active section" title="Roboto-Medium.ttf">Roboto-Medium.ttf</span></span></div>
|
||||
|
||||
<div class="right fitted item" id="file-buttons">
|
||||
<div class="ui tiny blue buttons">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header">
|
||||
<div class="file-header-left">
|
||||
|
||||
<div class="file-info text grey normal mono">
|
||||
|
||||
|
||||
<div class="file-info-entry">
|
||||
134KB
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="file-header-right">
|
||||
<div class="ui right file-actions">
|
||||
<div class="ui buttons">
|
||||
<a class="ui button" href="/flovanco/doit/raw/branch/master/static/fonts/Roboto-Medium.ttf">Originalformat</a>
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/src/commit/417acaf7ac867ed47ab73e7e66f07f15f1f124cc/static/fonts/Roboto-Medium.ttf">Permalink</a>
|
||||
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/commits/branch/master/static/fonts/Roboto-Medium.ttf">Verlauf</a>
|
||||
</div>
|
||||
|
||||
|
||||
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="Binärdateien können nicht im Webinterface bearbeitet werden." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="Du benötigst Schreibzugriff, um Änderungen an dieser Datei vorzuschlagen oder vorzunehmen." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</h4>
|
||||
<div class="ui attached table unstackable segment">
|
||||
<div class="file-view has-emoji">
|
||||
|
||||
<div class="view-raw ui center">
|
||||
|
||||
<a href="/flovanco/doit/raw/branch/master/static/fonts/Roboto-Medium.ttf" rel="nofollow" class="btn btn-gray btn-radius">Originalformat anzeigen</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitDeleteForm() {
|
||||
var message = prompt("delete_confirm_message\n\ndelete_commit_summary", "Delete ''");
|
||||
if (message != null) {
|
||||
$("#delete-message").val(message);
|
||||
$("#delete-file-form").submit()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="ui container">
|
||||
<div class="ui left">
|
||||
|
||||
</div>
|
||||
<div class="ui right links">
|
||||
|
||||
<div class="ui language bottom floating slide up dropdown link item">
|
||||
<i class="world icon"></i>
|
||||
<div class="text">Deutsch</div>
|
||||
<div class="menu">
|
||||
|
||||
<a lang="de-DE" class="item active selected" href="#">Deutsch</a>
|
||||
|
||||
<a lang="en-US" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=en-US">English</a>
|
||||
|
||||
<a lang="zh-CN" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=zh-CN">简体中文</a>
|
||||
|
||||
<a lang="zh-HK" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=zh-HK">繁體中文(香港)</a>
|
||||
|
||||
<a lang="zh-TW" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=zh-TW">繁體中文(台灣)</a>
|
||||
|
||||
<a lang="fr-FR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=fr-FR">français</a>
|
||||
|
||||
<a lang="nl-NL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=nl-NL">Nederlands</a>
|
||||
|
||||
<a lang="lv-LV" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=lv-LV">latviešu</a>
|
||||
|
||||
<a lang="ru-RU" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=ru-RU">русский</a>
|
||||
|
||||
<a lang="uk-UA" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=uk-UA">Українська</a>
|
||||
|
||||
<a lang="ja-JP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=ja-JP">日本語</a>
|
||||
|
||||
<a lang="es-ES" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=es-ES">español</a>
|
||||
|
||||
<a lang="pt-BR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=pt-BR">português do Brasil</a>
|
||||
|
||||
<a lang="pl-PL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=pl-PL">polski</a>
|
||||
|
||||
<a lang="bg-BG" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=bg-BG">български</a>
|
||||
|
||||
<a lang="it-IT" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=it-IT">italiano</a>
|
||||
|
||||
<a lang="fi-FI" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=fi-FI">suomi</a>
|
||||
|
||||
<a lang="tr-TR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=tr-TR">Türkçe</a>
|
||||
|
||||
<a lang="cs-CZ" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=cs-CZ">čeština</a>
|
||||
|
||||
<a lang="sr-SP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=sr-SP">српски</a>
|
||||
|
||||
<a lang="sv-SE" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=sv-SE">svenska</a>
|
||||
|
||||
<a lang="ko-KR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Medium.ttf?lang=ko-KR">한국어</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a href="/vendor/librejs.html" data-jslicense="1">JavaScript licenses</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/PrivacyPolicy.md">Privacy Policy</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Satzung.md">Bylaws/Satzung</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Imprint.md">Imprint/Impressum</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/TermsOfUse.md">Terms of Use</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/jquery/jquery.min.js?v=3.4.1"></script>
|
||||
<script src="/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1"></script>
|
||||
<script src="/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/highlight/highlight.pack.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/emojify/emojify.custom.js"></script>
|
||||
<script src="/vendor/plugins/clipboard/clipboard.min.js"></script>
|
||||
<script src="/vendor/plugins/vue/vue.min.js"></script>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/fomantic/semantic.min.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
<script src="/js/index.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
581
advotracker/resources/fonts/Roboto-Regular.ttf
Normal file
@@ -0,0 +1,581 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-DE">
|
||||
<head data-suburl="">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>flovanco/doit: Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk. - static/fonts/Roboto-Regular.ttf at master - doit - Codeberg.org</title>
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/serviceworker.js').then(function(registration) {
|
||||
|
||||
console.info('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
}, function(err) {
|
||||
|
||||
console.info('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<meta name="theme-color" content="#6cc644">
|
||||
<meta name="author" content="flovanco" />
|
||||
<meta name="description" content="doit - Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
<meta name="keywords" content="git,non-profit,foss,oss,free,software,open,source,code,hosting">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<meta name="_csrf" content="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw" />
|
||||
<meta name="_suburl" content="" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
JavaScript code in this page.
|
||||
|
||||
Copyright (c) 2016 The Gitea Authors
|
||||
Copyright (c) 2015 The Gogs Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
---
|
||||
Licensing information for additional javascript libraries can be found at:
|
||||
{{StaticUrlPrefix}}/vendor/librejs.html
|
||||
|
||||
@licend The above is the entire license notice
|
||||
for the JavaScript code in this page.
|
||||
*/
|
||||
</script>
|
||||
<script>
|
||||
window.config = {
|
||||
StaticUrlPrefix: ''
|
||||
}
|
||||
</script>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" />
|
||||
<link rel="mask-icon" href="/img/gitea-safari.svg" color="#609926">
|
||||
<link rel="preload" href="/vendor/assets/font-awesome/css/font-awesome.min.css" as="style" onload="this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="/vendor/assets/font-awesome/css/font-awesome.min.css"></noscript>
|
||||
<link rel="stylesheet" href="/vendor/assets/octicons/octicons.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/fomantic/semantic.min.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<link rel="stylesheet" href="/css/index.css?v=6b0a0a50c7fb0aaef957cb0ab4f596e7">
|
||||
<noscript>
|
||||
<style>
|
||||
.dropdown:hover > .menu { display: block; }
|
||||
.ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/vendor/plugins/highlight/github.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style class="list-search-style"></style>
|
||||
|
||||
<script src="/vendor/plugins/promise-polyfill/polyfill.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/loadCSS.min.js"></script>
|
||||
<script src="/vendor/plugins/cssrelpreload/cssrelpreload.min.js"></script>
|
||||
|
||||
|
||||
<meta property="og:title" content="doit" />
|
||||
<meta property="og:url" content="https://codeberg.org/flovanco/doit" />
|
||||
|
||||
<meta property="og:description" content="Task app based on OrbTk https://gitlab.redox-os.org/redox-os/orbtk." />
|
||||
|
||||
|
||||
<meta property="og:type" content="object" />
|
||||
<meta property="og:image" content="https://codeberg.org/user/avatar/flovanco/-1" />
|
||||
|
||||
<meta property="og:site_name" content="Codeberg.org" />
|
||||
|
||||
<link rel="stylesheet" href="/codeberg.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="full height">
|
||||
<noscript>Diese Webseite funktioniert besser mit JavaScript.</noscript>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui top secondary stackable main menu following bar light">
|
||||
<div class="ui container" id="navbar">
|
||||
<div class="item brand" style="justify-content: space-between;">
|
||||
<a href="/">
|
||||
<img class="ui mini image" src="/img/gitea-sm.png">
|
||||
</a>
|
||||
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
|
||||
<i class="sidebar icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a class="item " href="/">Startseite</a>
|
||||
<a class="item " href="/explore/repos">Erkunden</a>
|
||||
|
||||
|
||||
<a class="item" href="/Codeberg/Community/issues">Codeberg Issues</a>
|
||||
<a class="item" href="https://blog.codeberg.org">Blog</a>
|
||||
<a class="item" href="https://join.codeberg.org/">Join Codeberg e.V.</a>
|
||||
<a class="item" href="https://liberapay.com/codeberg/donate">Donate</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">Hilfe</a>
|
||||
<div class="right stackable menu">
|
||||
|
||||
<a class="item" href="/user/sing_up">
|
||||
<i class="octicon octicon-person"></i> Registrieren
|
||||
</a>
|
||||
|
||||
<a class="item" rel="nofollow" href="/user/login?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Regular.ttf">
|
||||
<i class="octicon octicon-sign-in"></i> Anmelden
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="repository file list">
|
||||
<div class="header-wrapper">
|
||||
|
||||
<div class="ui container">
|
||||
<div class="repo-header">
|
||||
<div class="ui huge breadcrumb repo-title">
|
||||
|
||||
<i class="mega-octicon octicon-repo"></i>
|
||||
|
||||
<a href="/flovanco">flovanco</a>
|
||||
<div class="divider"> / </div>
|
||||
<a href="/flovanco/doit">doit</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="repo-buttons">
|
||||
<form method="post" action="/flovanco/doit/action/watch?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Regular.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon fa-eye-slash"></i>Beobachten
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/watchers">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="/flovanco/doit/action/star?redirect_to=%2fflovanco%2fdoit%2fsrc%2fbranch%2fmaster%2fstatic%2ffonts%2fRoboto-Regular.ttf">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<div class="ui labeled button" tabindex="0">
|
||||
<button type="submit" class="ui compact basic button">
|
||||
<i class="icon star outline"></i>Favorisieren
|
||||
</button>
|
||||
<a class="ui basic label" href="/flovanco/doit/stars">
|
||||
1
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="ui labeled button " tabindex="0">
|
||||
<a class="ui compact basic button poping up" data-content="Bitte melde dich an, um dieses Repository zu forken." rel="nofollow" href="/user/login?redirect_to=/repo/fork/3183" data-position="top center" data-variation="tiny">
|
||||
<i class="octicon octicon-repo-forked"></i>Fork
|
||||
</a>
|
||||
<a class="ui basic label" href="/flovanco/doit/forks">
|
||||
0
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui tabs container">
|
||||
|
||||
<div class="ui tabular stackable menu navbar">
|
||||
|
||||
<a class="active item" href="/flovanco/doit">
|
||||
<i class="octicon octicon-code"></i> Code
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/issues">
|
||||
<i class="octicon octicon-issue-opened"></i> Issues <span class="ui blue small label">4</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/pulls">
|
||||
<i class="octicon octicon-git-pull-request"></i> Pull-Requests <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/releases">
|
||||
<i class="octicon octicon-tag"></i> Releases <span class="ui gray small label">0</span>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/wiki" >
|
||||
<i class="octicon octicon-book"></i> Wiki
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class=" item" href="/flovanco/doit/activity">
|
||||
<i class="octicon octicon-pulse"></i> Aktivität
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui tabs divider"></div>
|
||||
</div>
|
||||
|
||||
<div class="ui container">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="ui repo-description">
|
||||
<div id="repo-desc">
|
||||
<span class="description has-emoji">Task app based on OrbTk <a href="https://gitlab.redox-os.org/redox-os/orbtk" rel="nofollow">https://gitlab.redox-os.org/redox-os/orbtk</a>.</span>
|
||||
<a class="link" href=""></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="ui" id="repo-topics">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="hide" id="validate_prompt">
|
||||
<span id="count_prompt">Du kannst nicht mehr als 25 Themen auswählen</span>
|
||||
<span id="format_prompt">Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.</span>
|
||||
</div>
|
||||
|
||||
<div class="ui segment sub-menu">
|
||||
<div class="ui two horizontal center link list">
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/commits/branch/master"><i class="octicon octicon-history"></i> <b>57</b> Commits</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="item">
|
||||
<a class="ui" href="/flovanco/doit/branches/"><i class="octicon octicon-git-branch"></i> <b>2</b> Branches</a>
|
||||
</div>
|
||||
<div class="item">
|
||||
<a class="ui" href="#"><i class="octicon octicon-database"></i> <b>922KB</b></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
|
||||
<div class="fitted item choose reference">
|
||||
<div class="ui floating filter dropdown custom" data-can-create-branch="false" data-no-results="Keine Ergebnisse verfügbar.">
|
||||
<div class="ui basic small compact button" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible">
|
||||
<span class="text">
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Branch:
|
||||
<strong>master</strong>
|
||||
</span>
|
||||
<i class="dropdown icon"></i>
|
||||
</div>
|
||||
<div class="data" style="display: none" data-mode="branches">
|
||||
|
||||
<div class="item branch selected" data-url="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf">master</div>
|
||||
|
||||
<div class="item branch " data-url="/flovanco/doit/src/branch/overview/static/fonts/Roboto-Regular.ttf">overview</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="menu transition" :class="{visible: menuVisible}" v-if="menuVisible" v-cloak>
|
||||
<div class="ui icon search input">
|
||||
<i class="filter icon"></i>
|
||||
<input name="search" ref="searchField" v-model="searchTerm" @keydown="keydown($event)" placeholder="Branch oder Tag filtern...">
|
||||
</div>
|
||||
<div class="header branch-tag-choice">
|
||||
<div class="ui grid">
|
||||
<div class="two column row">
|
||||
<a class="reference column" href="#" @click="mode = 'branches'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'branches'}">
|
||||
<i class="octicon octicon-git-branch"></i> Branches
|
||||
</span>
|
||||
</a>
|
||||
<a class="reference column" href="#" @click="mode = 'tags'; focusSearchField()">
|
||||
<span class="text" :class="{black: mode == 'tags'}">
|
||||
<i class="reference tags icon"></i> Tags
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scrolling menu" ref="scrollContainer">
|
||||
<div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active == index}" @click="selectItem(item)" :ref="'listItem' + index">${ item.name }</div>
|
||||
<div class="item" v-if="showCreateNewBranch" :class="{active: active == filteredItems.length}" :ref="'listItem' + filteredItems.length">
|
||||
<a href="#" @click="createNewBranch()">
|
||||
<div>
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
Erstelle Branch <strong>${ searchTerm }</strong>
|
||||
</div>
|
||||
<div class="text small">
|
||||
|
||||
von „master“
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<form ref="newBranchForm" action="/flovanco/doit/branches/_new/branch/master" method="post">
|
||||
<input type="hidden" name="_csrf" value="PG49nQsNVNDzL7j830GxV6baicY6MTU5MjMzNDMwNzQ5ODk4MzkwMw">
|
||||
<input type="hidden" name="new_branch_name" v-model="searchTerm">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message" v-if="showNoResults">${ noResults }</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="/flovanco/doit/src/branch/master" title="doit">doit</a><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static" title="static">static</a></span><span class="divider">/</span><span class="section"><a href="/flovanco/doit/src/branch/master/static/fonts" title="fonts">fonts</a></span><span class="divider">/</span><span class="active section" title="Roboto-Regular.ttf">Roboto-Regular.ttf</span></span></div>
|
||||
|
||||
<div class="right fitted item" id="file-buttons">
|
||||
<div class="ui tiny blue buttons">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
</div>
|
||||
<div class="fitted item">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-size-8 non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header">
|
||||
<div class="file-header-left">
|
||||
|
||||
<div class="file-info text grey normal mono">
|
||||
|
||||
|
||||
<div class="file-info-entry">
|
||||
142KB
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="file-header-right">
|
||||
<div class="ui right file-actions">
|
||||
<div class="ui buttons">
|
||||
<a class="ui button" href="/flovanco/doit/raw/branch/master/static/fonts/Roboto-Regular.ttf">Originalformat</a>
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/src/commit/417acaf7ac867ed47ab73e7e66f07f15f1f124cc/static/fonts/Roboto-Regular.ttf">Permalink</a>
|
||||
|
||||
|
||||
<a class="ui button" href="/flovanco/doit/commits/branch/master/static/fonts/Roboto-Regular.ttf">Verlauf</a>
|
||||
</div>
|
||||
|
||||
|
||||
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="Binärdateien können nicht im Webinterface bearbeitet werden." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="Du benötigst Schreibzugriff, um Änderungen an dieser Datei vorzuschlagen oder vorzunehmen." data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</h4>
|
||||
<div class="ui attached table unstackable segment">
|
||||
<div class="file-view has-emoji">
|
||||
|
||||
<div class="view-raw ui center">
|
||||
|
||||
<a href="/flovanco/doit/raw/branch/master/static/fonts/Roboto-Regular.ttf" rel="nofollow" class="btn btn-gray btn-radius">Originalformat anzeigen</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitDeleteForm() {
|
||||
var message = prompt("delete_confirm_message\n\ndelete_commit_summary", "Delete ''");
|
||||
if (message != null) {
|
||||
$("#delete-message").val(message);
|
||||
$("#delete-file-form").submit()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="ui container">
|
||||
<div class="ui left">
|
||||
|
||||
</div>
|
||||
<div class="ui right links">
|
||||
|
||||
<div class="ui language bottom floating slide up dropdown link item">
|
||||
<i class="world icon"></i>
|
||||
<div class="text">Deutsch</div>
|
||||
<div class="menu">
|
||||
|
||||
<a lang="de-DE" class="item active selected" href="#">Deutsch</a>
|
||||
|
||||
<a lang="en-US" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=en-US">English</a>
|
||||
|
||||
<a lang="zh-CN" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=zh-CN">简体中文</a>
|
||||
|
||||
<a lang="zh-HK" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=zh-HK">繁體中文(香港)</a>
|
||||
|
||||
<a lang="zh-TW" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=zh-TW">繁體中文(台灣)</a>
|
||||
|
||||
<a lang="fr-FR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=fr-FR">français</a>
|
||||
|
||||
<a lang="nl-NL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=nl-NL">Nederlands</a>
|
||||
|
||||
<a lang="lv-LV" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=lv-LV">latviešu</a>
|
||||
|
||||
<a lang="ru-RU" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=ru-RU">русский</a>
|
||||
|
||||
<a lang="uk-UA" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=uk-UA">Українська</a>
|
||||
|
||||
<a lang="ja-JP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=ja-JP">日本語</a>
|
||||
|
||||
<a lang="es-ES" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=es-ES">español</a>
|
||||
|
||||
<a lang="pt-BR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=pt-BR">português do Brasil</a>
|
||||
|
||||
<a lang="pl-PL" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=pl-PL">polski</a>
|
||||
|
||||
<a lang="bg-BG" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=bg-BG">български</a>
|
||||
|
||||
<a lang="it-IT" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=it-IT">italiano</a>
|
||||
|
||||
<a lang="fi-FI" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=fi-FI">suomi</a>
|
||||
|
||||
<a lang="tr-TR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=tr-TR">Türkçe</a>
|
||||
|
||||
<a lang="cs-CZ" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=cs-CZ">čeština</a>
|
||||
|
||||
<a lang="sr-SP" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=sr-SP">српски</a>
|
||||
|
||||
<a lang="sv-SE" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=sv-SE">svenska</a>
|
||||
|
||||
<a lang="ko-KR" class="item " href="/flovanco/doit/src/branch/master/static/fonts/Roboto-Regular.ttf?lang=ko-KR">한국어</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a href="/vendor/librejs.html" data-jslicense="1">JavaScript licenses</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/PrivacyPolicy.md">Privacy Policy</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Satzung.md">Bylaws/Satzung</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/Imprint.md">Imprint/Impressum</a>
|
||||
<a target="_blank" rel="noopener" href="/codeberg/org/src/branch/master/TermsOfUse.md">Terms of Use</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/jquery/jquery.min.js?v=3.4.1"></script>
|
||||
<script src="/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1"></script>
|
||||
<script src="/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/highlight/highlight.pack.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/vendor/plugins/emojify/emojify.custom.js"></script>
|
||||
<script src="/vendor/plugins/clipboard/clipboard.min.js"></script>
|
||||
<script src="/vendor/plugins/vue/vue.min.js"></script>
|
||||
|
||||
|
||||
<script src="/vendor/plugins/fomantic/semantic.min.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
<script src="/js/index.js?v=6b0a0a50c7fb0aaef957cb0ab4f596e7"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 768 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 455 KiB After Width: | Height: | Size: 455 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB |
BIN
advotracker/resources/images/orbtk_logo.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
advotracker/resources/images/rust_logo.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB |
217
advotracker/resources/stylesheets/advotracker-test.css
Normal file
@@ -0,0 +1,217 @@
|
||||
.my_header {
|
||||
font-size: 24;
|
||||
}
|
||||
|
||||
/* defaults: dark.css
|
||||
* {
|
||||
background: #ffffff;
|
||||
font-size: 16;
|
||||
font-family: "Roboto Medium";
|
||||
icon-size: 16;
|
||||
icon-family: "Material Icons";
|
||||
}
|
||||
|
||||
window {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.h1 {
|
||||
font-size: 36;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
.top_bar {
|
||||
padding-left: 4;
|
||||
padding-right: 4;
|
||||
min-height: 150;
|
||||
background: #ffffff;
|
||||
border-color: #5b0f22;
|
||||
}
|
||||
|
||||
.bottom_bar {
|
||||
height: 40;
|
||||
background: #ffffff;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
font-family: "Roboto Medium";
|
||||
background: transparent;
|
||||
border-width: 2;
|
||||
border-color: #5b0f22;
|
||||
border-radius: 2;
|
||||
padding: 6;
|
||||
}
|
||||
|
||||
.text_form {
|
||||
background: #ffffff;
|
||||
}
|
||||
.text_block {
|
||||
background: #ffffff;
|
||||
border-color: #5b0f22;
|
||||
border-width: 0;
|
||||
color: #5b0f22;
|
||||
}
|
||||
|
||||
text_box:empty {
|
||||
color: #9E9E9E
|
||||
}
|
||||
|
||||
text_box:focus {
|
||||
border-color: #f8de4c;
|
||||
}
|
||||
|
||||
/*
|
||||
text_box.inplace {
|
||||
color: #dfebf5;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
border-width: 1;
|
||||
border-radius: 2;
|
||||
padding: 6;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
text_box.inplace:focus {
|
||||
background: #ffffff;
|
||||
border-color: #5b0f22;
|
||||
}
|
||||
|
||||
text_box.inplace:empty {
|
||||
color: #9E9E9E
|
||||
}
|
||||
|
||||
.icon_only {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.icon_only:active {
|
||||
icon-color: #5b0f22;
|
||||
background: #5b0f22;
|
||||
}
|
||||
|
||||
.icon_only:disabled {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
items-widget {
|
||||
padding: 0;
|
||||
border-color: transparent;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
list-view-item {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
height: 62;
|
||||
}
|
||||
|
||||
list-view-item:active {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
policy_check.text_box {
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
policy_list.text_box {
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
policy_list.text_box {
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
.transparent {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.transparent:active {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.item_button {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
.separator {
|
||||
background: #f8de4c;
|
||||
color: #f8de4c;
|
||||
border-width: 2;
|
||||
border-color: #5b0f22;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
const LINK_WATER_COLOR
|
||||
color: #dfebf5;
|
||||
const LYNCH_COLOR
|
||||
color: #647b91;
|
||||
const BOMBAY_COLOR
|
||||
color: #adb3B8;
|
||||
const SLATE_GRAY_COLOR
|
||||
color: #6c7a90;
|
||||
const BRIGHT_GRAY_COLOR
|
||||
color: #3b434a;
|
||||
const MATERIAL_RED_COLOR
|
||||
color: #5b0f22;
|
||||
|
||||
.header {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.content {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
text-box {
|
||||
color: #5b0f22;
|
||||
}
|
||||
|
||||
text-block {
|
||||
color: #5b0f22;
|
||||
}
|
||||
|
||||
top-bar {
|
||||
color: #5b0f22;
|
||||
background: #fafafa;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
light-text {
|
||||
color: #dfebf5;
|
||||
}
|
||||
*/
|
||||
|
||||
/* // Hiedemann blue */
|
||||
/* color: #a5b3bf; */
|
||||
|
||||
/* // Hiedemann red */
|
||||
/* color: #5b0f22; */
|
||||
|
||||
/* // Hiedemann darkgrey */
|
||||
/* color: #879488; */
|
||||
|
||||
/* // Hiedemann grey */
|
||||
/* color: ##b6c3b7; */
|
||||
|
||||
|
||||
|
||||
/* // Qt Green */
|
||||
/* color: #41cd52; */
|
||||
|
||||
/* // lightgrey */
|
||||
/* color: #f0f0f0; */
|
||||
|
||||
/* Accent=#5b0f22 */
|
||||
/* Foreground=#000000 */
|
||||
/* Background=#f0f0f0 */
|
||||
75
advotracker/resources/stylesheets/advotracker.css
Normal file
@@ -0,0 +1,75 @@
|
||||
.top_bar {
|
||||
padding-left: 4;
|
||||
padding-right: 4;
|
||||
min-height: 52;
|
||||
background: #475b6e;
|
||||
}
|
||||
|
||||
.bottom_bar {
|
||||
height: 40;
|
||||
background: #475b6e;
|
||||
}
|
||||
|
||||
.header {
|
||||
font-size: 24;
|
||||
font-family: "Roboto Medium";
|
||||
}
|
||||
|
||||
text_box.inplace {
|
||||
color: #dfebf5;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
border-width: 1;
|
||||
border-radius: 2;
|
||||
padding: 6;
|
||||
}
|
||||
|
||||
text_box.inplace:focus {
|
||||
background: #3b434a;
|
||||
border-color: #5b0f22;
|
||||
}
|
||||
|
||||
text_box.inplace:empty {
|
||||
color: #9E9E9E;
|
||||
border-color: #5b0f22;
|
||||
}
|
||||
|
||||
.icon_only {
|
||||
background: #5b0f22;
|
||||
icon-color: #ffffff;
|
||||
spacing: 0;
|
||||
}
|
||||
|
||||
.icon_only:active {
|
||||
background: #5b0f22;
|
||||
icon-color: #ffffff;
|
||||
}
|
||||
|
||||
.icon_only:disabled {
|
||||
icon-color: #ffffff;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
items-widget {
|
||||
padding: 0;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.transparent {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.transparent:active {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.item_button {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.separator {
|
||||
background: #212121;
|
||||
}
|
||||
48
advotracker/resources/stylesheets/policyholder_check.css
Normal file
@@ -0,0 +1,48 @@
|
||||
.header {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.content {
|
||||
background: #fafafa;
|
||||
}
|
||||
.content {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
text-box {
|
||||
color: #5b0f22;
|
||||
}
|
||||
|
||||
text-block {
|
||||
color: #5b0f22;
|
||||
}
|
||||
|
||||
/*
|
||||
light-text {
|
||||
color: #dfebf5;
|
||||
}
|
||||
*/
|
||||
|
||||
/* // Hiedemann blue */
|
||||
/* color: #a5b3bf; */
|
||||
|
||||
/* // Hiedemann red */
|
||||
/* color: #5b0f22; */
|
||||
|
||||
/* // Hiedemann darkgrey */
|
||||
/* color: #879488; */
|
||||
|
||||
/* // Hiedemann grey */
|
||||
/* color: ##b6c3b7; */
|
||||
|
||||
|
||||
|
||||
/* // Qt Green */
|
||||
/* color: #41cd52; */
|
||||
|
||||
/* // lightgrey */
|
||||
/* color: #f0f0f0; */
|
||||
|
||||
/* Accent=#5b0f22 */
|
||||
/* Foreground=#000000 */
|
||||
/* Background=#f0f0f0 */
|
||||
91
advotracker/resources/stylesheets/theme.css
Normal file
@@ -0,0 +1,91 @@
|
||||
.top_bar {
|
||||
padding-left: 4;
|
||||
padding-right: 4;
|
||||
min-height: 52;
|
||||
background: #475b6e;
|
||||
}
|
||||
|
||||
.bottom_bar {
|
||||
height: 40;
|
||||
background: #475b6e;
|
||||
}
|
||||
|
||||
.header {
|
||||
font-size: 64;
|
||||
font-family: "Roboto Medium";
|
||||
}
|
||||
|
||||
text_box.inplace {
|
||||
color: #dfebf5;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
border-width: 1;
|
||||
border-radius: 2;
|
||||
padding: 6;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
text_box.inplace:focus {
|
||||
background: #3b434a;
|
||||
border-color: #f8de4c;;
|
||||
}
|
||||
|
||||
text_box.inplace:empty {
|
||||
color: #9E9E9E
|
||||
}
|
||||
|
||||
.icon_only {
|
||||
icon-color: #dfebf5;
|
||||
background: transparent;
|
||||
spacing: 0;
|
||||
}
|
||||
|
||||
.icon_only:active {
|
||||
background: #516475;
|
||||
icon-color: #dfebf5;
|
||||
}
|
||||
|
||||
.icon_only:disabled {
|
||||
icon-color: #949ca5;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
items-widget {
|
||||
padding: 0;
|
||||
border-color: transparent;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
list-view-item {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
height: 62;
|
||||
}
|
||||
|
||||
list-view-item:active {
|
||||
background: #516475;
|
||||
}
|
||||
|
||||
overview_view.text_box {
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
.transparent {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.transparent:active {
|
||||
icon-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.item_button {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
font-size: 48;
|
||||
}
|
||||
|
||||
.separator {
|
||||
background: #212121;
|
||||
}
|
||||
7
advotracker/src/bin/csv-test/.env
Normal file
@@ -0,0 +1,7 @@
|
||||
# set the language variable used in test-runs
|
||||
#test lang=de
|
||||
TEST_LANG=en
|
||||
#RUST_LOG=csv-test=trace
|
||||
RUST_LOG=trace
|
||||
USERNAME=ralf
|
||||
DB_DRIVER=sqlite
|
||||
23
advotracker/src/bin/csv-test/POLLFNR_MINI.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
DION VERS POLLFNR
|
||||
1 AS 1
|
||||
1 AS 11
|
||||
1 AS 123456789
|
||||
9 AS 99
|
||||
9 AS 999
|
||||
1 AS 1511111111
|
||||
1 AS 1511111119
|
||||
1 AS 9000000001
|
||||
1 AS 9000000002
|
||||
1 AS 9999999991
|
||||
1 AS 9999999992
|
||||
1 AS 9999999999
|
||||
3 AS 1515735920
|
||||
3 AS 9999999991
|
||||
3 AS 9999999992
|
||||
3 AS 9999999999
|
||||
9 AS 9927764110
|
||||
9 AS 9927764251
|
||||
9 AS 9927764426
|
||||
9 AS 9999999991
|
||||
9 AS 9999999992
|
||||
9 AS 9999999999
|
||||
15498
advotracker/src/bin/csv-test/POLLFNR_TEST.txt
Normal file
1
advotracker/src/bin/csv-test/POLLFNR_WOECHENTLICH.txt
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../data/POLLFNR_WOECHENTLICH.txt
|
||||
388
advotracker/src/bin/csv-test/main.rs
Normal file
@@ -0,0 +1,388 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use chrono::{Local, DateTime};
|
||||
//use serde::{Deserialize, Serialize};
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
use std::{error::Error, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{debug, trace, Level};
|
||||
|
||||
use advotracker::data::structures::{PolicyCode, PolicyList, PolicyDataList, PolicyData};
|
||||
|
||||
// include modules
|
||||
mod parse_args;
|
||||
|
||||
/// respect environment variables set in .env files
|
||||
/// located in the current call directory
|
||||
/// this is primarily used in testing scenarios (eg. debugging)
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Environment {
|
||||
test_lang: String,
|
||||
log: String,
|
||||
}
|
||||
|
||||
/// export as csv format
|
||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||
/// https://blog.burntsushi.net/csv/
|
||||
fn export(p: &mut String, lang: &String) -> Result<usize, Box<dyn Error>> {
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
//use std::ffi::OsStr;
|
||||
use std::io::prelude::*;
|
||||
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "main",
|
||||
state = "started",
|
||||
date_start = ?dt_start.to_string());
|
||||
|
||||
// Note: slash syntax also works on Windows!
|
||||
let path = Path::new(p);
|
||||
|
||||
// only create files with a '.txt' extensions
|
||||
//let extension = path.extension();
|
||||
// match extension {
|
||||
// //Some(String) => println!("file extension ok!"),
|
||||
// //_ => extension = OsStr::new("txt")
|
||||
// _ => println!("got file extension {:?}", extension)
|
||||
// };
|
||||
|
||||
// open the file descriptor
|
||||
let mut file = File::create(path)?;
|
||||
trace!(target: "csv-export", extension = ?path.extension(), file = ?file);
|
||||
|
||||
// Build the CSV writer and push selected records.
|
||||
//for result in csv_reader.records() {
|
||||
let mut count = 0;
|
||||
file.write_all(b"Allianz DirectCall Protokoll!")?;
|
||||
count += 1;
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
//println!("Duration: {:#?}", duration);
|
||||
|
||||
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
||||
trace!(target: "csv-test", process = "csv-import", state = "finished");
|
||||
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
/// import from csv format
|
||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||
/// https://blog.burntsushi.net/csv/
|
||||
fn import(p: &mut String, data_list: &mut PolicyDataList,
|
||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
||||
-> Result<usize, Box<dyn Error>> {
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "csv-import",
|
||||
state = "started",
|
||||
date_start = ?dt_start.to_string());
|
||||
|
||||
// Note: slash syntax also workd on Windows!
|
||||
let path = Path::new(p);
|
||||
|
||||
// must be a readable file
|
||||
trace!(target: "csv-test", path = ?path);
|
||||
let valid = path.is_file();
|
||||
//println!("is_file: {}", valid);
|
||||
|
||||
//if let Some(res) = valid
|
||||
assert_eq!(path.is_file(), true);
|
||||
|
||||
// only accept files with '.txt' extensions
|
||||
let extension = path.extension();
|
||||
assert_eq!(extension, Some(OsStr::new("txt")));
|
||||
|
||||
// open the file
|
||||
let file = File::open(path)?;
|
||||
|
||||
trace!(target: "csv-test",
|
||||
extension = ?extension,
|
||||
file = ?file,
|
||||
data_list = ?data_list.name);
|
||||
|
||||
// Build the CSV reader and iterate over each record.
|
||||
let mut csv_reader = csv::ReaderBuilder::new()
|
||||
.has_headers(true)
|
||||
.delimiter(b' ')
|
||||
.flexible(true)
|
||||
//.comment(Some(b'#'))
|
||||
//.from_reader(io::stdin());
|
||||
//.from_path(path);
|
||||
.from_reader(file);
|
||||
{
|
||||
// We nest this call in its own scope because of lifetimes.
|
||||
let headers = csv_reader.headers()?;
|
||||
trace!(target: "csv-test", header = ?headers);
|
||||
}
|
||||
|
||||
// Deserialize the input data and push result to target vector
|
||||
let mut count = 0;
|
||||
for result in csv_reader.deserialize() {
|
||||
// The iterator yields Result<StringRecord, Error>, so we check the
|
||||
// error here.
|
||||
let record: PolicyData = result?;
|
||||
//println!("{:?}", record);
|
||||
|
||||
// WIP: write to redis backend
|
||||
// append the policy_number to the HashMap
|
||||
policy_numbers.insert(record.policy_number, record.policy_code);
|
||||
|
||||
// push record as new vector elements
|
||||
data_list.push(record);
|
||||
|
||||
count +=1;
|
||||
}
|
||||
|
||||
// Tests
|
||||
// Takes a reference and returns Option<&V>
|
||||
let test_policy_number : usize = 1511111111;
|
||||
match policy_numbers.get(&test_policy_number) {
|
||||
Some(policy_code) => {
|
||||
println!("Policy-Number {:?} {:?}",
|
||||
test_policy_number, policy_code);
|
||||
},
|
||||
_ => println!("1. No number found!"),
|
||||
}
|
||||
|
||||
let test_policy_number_2 : usize = 9999999991;
|
||||
match policy_numbers.get(&test_policy_number_2) {
|
||||
Some(policy_code) => { println!("Policy-Number: {:?} {:?}",
|
||||
test_policy_number, policy_code);
|
||||
},
|
||||
_ => println!("2. No number found!"),
|
||||
}
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
|
||||
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "csv-import",
|
||||
state = "finished",
|
||||
date_stop = ?dt_end.to_string());
|
||||
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
/// validate a given policy number
|
||||
/// result will return true or false
|
||||
fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
||||
-> Result<bool, Box<dyn std::error::Error>> {
|
||||
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "policy-validation",
|
||||
state = "started",
|
||||
policy_number = ?policy_number,
|
||||
policy_list = ?policy_list.name,
|
||||
elements = ?policy_list.policy_data.len(),
|
||||
date_start = ?dt_start.to_string());
|
||||
//println!("Policy_number list: {:?}", policy_list.policy_data);
|
||||
|
||||
// WIP: testcode to collect policy_number via iterator
|
||||
//println!("policy_number: {:?}", policy_list.policy_data[1].policy_number);
|
||||
//println!("Policy_number list: {:?}", policy_list.policy_data);
|
||||
// println!("policy_list: {:?} (with {:?} elements)",
|
||||
// policy_list.name, policy_list.policy_data.len());
|
||||
|
||||
|
||||
// policy_list.into_iter()
|
||||
// .filter(|num| matches(w, w1))
|
||||
// .clone
|
||||
// .collect::<Vec<policy_number>>()
|
||||
// let my_num = policy_list.policy_data.iter()
|
||||
// .map(|policy_number| {
|
||||
// policy_number
|
||||
// })
|
||||
// .collect::<Vec<_>>();
|
||||
|
||||
//println!("My policy_numbers: {:?}", my_num);
|
||||
|
||||
// let mut my_policy_list = [
|
||||
// [ ("Jack", 20), ("Jane", 23), ("Jill", 18), ("John", 19), ],
|
||||
// [ ("Bill", 17), ("Brenda", 16), ("Brad", 18), ("Barbara", 17), ]
|
||||
// ];
|
||||
|
||||
// let teams_in_score_order = teams
|
||||
// .iter_mut()
|
||||
// .map(|team| {
|
||||
// team.sort_by(|&a, &b| a.1.cmp(&b.1).reverse());
|
||||
// team
|
||||
// })
|
||||
// .collect::<Vec<_>>();
|
||||
|
||||
//println!("Teams: {:?}", teams_in_score_order);
|
||||
|
||||
// if policy_list.policy_data.iter().any(|v| v == policy_number) {
|
||||
// println!("{:?} contains {}", policy_list.name, policy_number);
|
||||
// } else {
|
||||
// println!("{:?} doesn't contain {}", policy_list, policy_number);
|
||||
//}
|
||||
|
||||
// let test: Vec<_> = vec!["one", "two", "three"];
|
||||
// let index: usize = test.iter().enumerate().find(|&r| r.1.to_string() == "two".to_string()).unwrap().0;
|
||||
// println!("index: {:?} -> {:?}", index, test[index]);
|
||||
|
||||
//let index: usize = test.iter().enumerate().find(|&r| r.policy_number == "two".to_string()).unwrap().0;
|
||||
|
||||
let mut result = false;
|
||||
match policy_numbers.get(&policy_number) {
|
||||
Some(&policy_code) => {
|
||||
println!("policy_number: {} ({:?})",
|
||||
policy_number, policy_code);
|
||||
result = true;
|
||||
trace!(target: "csv-test",
|
||||
policy_number = ?policy_number,
|
||||
validation = "success",
|
||||
policy_code = ?policy_code);
|
||||
},
|
||||
_ => {
|
||||
println!("Noop! Number isn't valid!");
|
||||
trace!(target: "csv-test",
|
||||
policy_number = ?policy_number,
|
||||
validation = "failed");
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "policy-validation",
|
||||
state = "finished",
|
||||
date_stop = ?dt_end.to_string(),
|
||||
duration = ?duration);
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
use dotenv::dotenv;
|
||||
use parse_args::parse_args;
|
||||
//use std::process;
|
||||
//use std::sync::Arc;
|
||||
use tracing_subscriber::fmt;
|
||||
use viperus::Viperus;
|
||||
|
||||
//static DEFAULT_FILTER: &str = concat!(module_path!(), "=", "trace");
|
||||
|
||||
// initialize the tracing subsystem
|
||||
// a drop in replacement for classical logging
|
||||
// reference: https://tokio.rs/blog/2019-08-tracing/
|
||||
let span = tracing::span!(Level::TRACE, "csv-test");
|
||||
let _enter = span.enter();
|
||||
let subscriber = fmt::Subscriber::builder()
|
||||
.with_env_filter("trace")
|
||||
//.with_max_level(tracing::Level::DEBUG)
|
||||
.finish();
|
||||
|
||||
tracing::subscriber::with_default(subscriber, || {
|
||||
// get system environment
|
||||
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
||||
trace!(target: "csv-test", message = "parse-environment", state = "started");
|
||||
//debug!(message = ?res, state = ?state);
|
||||
trace!(target: "csv-test", environment = "system", lang = ?lang);
|
||||
|
||||
// testing environment: read from .env file
|
||||
dotenv().ok();
|
||||
match envy::from_env::<Environment>() {
|
||||
Ok(environment) => {
|
||||
if environment.test_lang != lang { lang = environment.test_lang; }
|
||||
},
|
||||
Err(e) => { debug!(target: "csv-test", "{}", e); }
|
||||
}
|
||||
// how to handle unumplemented lang resources??
|
||||
trace!(target: "csv-test", environment = "envy", lang = ?lang);
|
||||
trace!(target: "csv-test", message = "parse-enviroment", state = "finished");
|
||||
|
||||
// initialize viperus structure
|
||||
let mut v = Viperus::new();
|
||||
|
||||
// parse commandline arguments
|
||||
trace!(target: "csv-test", process = "parse-arguments", state = "started");
|
||||
|
||||
let _ = parse_args(&mut v);
|
||||
trace!(target: "csv-test", process = "parse-arguments", state = "finished");
|
||||
//trace!(target: "Viperus", "Config results: {:?}", v);
|
||||
|
||||
// main tasks
|
||||
trace!(target: "csv-test", process = "main", state = "started");
|
||||
|
||||
// importing policy code elements from csv-file
|
||||
let policy_list = PolicyList::new("Allianz Versicherungsnummen-List");
|
||||
println!("Policy List {:?} ", policy_list.name);
|
||||
|
||||
let mut policy_data = PolicyDataList::new("Allianz-Import 20200628");
|
||||
println!("Policy Data List {:?} ", policy_data.name);
|
||||
|
||||
let mut policy_numbers : HashMap<usize, PolicyCode> = HashMap::new();
|
||||
|
||||
let mut csv_import_path = v.get::<String>("import_file").unwrap();
|
||||
match import(&mut csv_import_path, &mut policy_data,
|
||||
&mut policy_numbers, &lang) {
|
||||
Ok(count) => {
|
||||
println!("Imported {:?} records", count);
|
||||
}
|
||||
Err(err) => {
|
||||
println!("error running Csv-Test: {}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// test if policy_number is_valid
|
||||
let test_policy_number = v.get::<i32>("test_policy_number").unwrap() as usize;
|
||||
trace!(target: "csv-test", test_policy_number = ?test_policy_number);
|
||||
//let policy_number : usize = 1999999999;
|
||||
//match is_valid(&policy_number, &policy_data, &mut policy_numbers, &lang) {
|
||||
// Ok(true) => {
|
||||
// use Hashmap method 'get' to check if we have the given key
|
||||
match &policy_numbers.get(&test_policy_number) {
|
||||
Some(&policy_code) => {
|
||||
println!("policy-validation success");
|
||||
println!("policy_number: {} ({:?})",
|
||||
test_policy_number, policy_code);
|
||||
}
|
||||
_ => {
|
||||
println!("Policy-validation failed");
|
||||
//println!("Nuup! Number isn't valid!");
|
||||
},
|
||||
}
|
||||
|
||||
// export policy code elements to csv-file
|
||||
let mut csv_export_path = v.get::<String>("export_file").unwrap();
|
||||
match export(&mut csv_export_path, &lang) {
|
||||
Ok(count) => {
|
||||
println!("Exported {:?} records", count);
|
||||
}
|
||||
Err(err) => {
|
||||
println!("error running CSV-Export: {}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
trace!(target: "csv-test",
|
||||
process = "main",
|
||||
state = "finished");
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
216
advotracker/src/bin/csv-test/parse_args.rs
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
// parse CLI commandline arguments with clap
|
||||
use clap::{crate_authors, crate_description, crate_name, crate_version, App, Arg};
|
||||
|
||||
//use log::{debug, info, trace, warn};
|
||||
use std::env;
|
||||
use tracing::trace;
|
||||
use viperus::Viperus;
|
||||
|
||||
/// Parse the commandline arguments and preset default values
|
||||
/// Precedence: defaults -> config-file -> environment -> commandline
|
||||
pub fn parse_args(v: &mut Viperus) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if cfg!(feature = "fmt-clap") {
|
||||
trace!(target: "Viperus", "Viperus feature 'fmt-clap' enabled.");
|
||||
println!("Using feature fmt-clap");
|
||||
}
|
||||
|
||||
// preset default key/value pairs (lowest priority)
|
||||
v.add_default("config_file", String::from("csv_import.ron"));
|
||||
v.add_default("import_file", String::from("POLLFNR_WOECHENTLICH.txt"));
|
||||
v.add_default("export_file", String::from(""));
|
||||
v.add_default("test_policy_number", 123456789);
|
||||
v.add_default("to_email_address_file", String::from("Allianz RA-Hotline <smr-rahotline@allianz.de>"));
|
||||
v.add_default("from_email_address_file", String::from("Allianz-Hotline RA-Hiedemann <azhotline@hiedemann.de>"));
|
||||
//v.add_default("username", String::from("nctalkbot"));
|
||||
//v.add_default("password", String::from("botpassword"));
|
||||
v.add_default("verbose", 0);
|
||||
|
||||
|
||||
// CLI arguments are defined inline
|
||||
let matches = App::new("csv-test")
|
||||
.name(crate_name!())
|
||||
.version(crate_version!())
|
||||
.author(crate_authors!())
|
||||
.about(crate_description!())
|
||||
.after_help("
|
||||
Testprogramm: Allianz Online-Beratung Im/Export CSV-Daten
|
||||
Direct-Call via IVR-System (Interactive Voice Response)
|
||||
SMR Deckungssummen-Prüfung: 089 92529 60211
|
||||
SMR Unerledigt: 089 92529 60222")
|
||||
.template(
|
||||
"\
|
||||
{bin} v{version}
|
||||
{about}
|
||||
|
||||
{all-args}
|
||||
|
||||
(C) 2020 {author}
|
||||
{after-help}",
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("configFile")
|
||||
.short("c")
|
||||
.long("configFile")
|
||||
.value_name("FILE")
|
||||
.help("Select a config file")
|
||||
.default_value("csv_import.ron")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("importFile")
|
||||
.short("i")
|
||||
.long("importFile")
|
||||
.help("Select source file for the csv-import")
|
||||
.default_value("POLLFNR_WOECHENTLICH.txt")
|
||||
//.default_value("POLLFNR_MINI.txt")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("exportFile")
|
||||
.short("e")
|
||||
.long("exportFile")
|
||||
.help("Select target file for the csv-export")
|
||||
.default_value("RA-Hiedemann_DirectCall.txt")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("fromEmailAddress")
|
||||
.short("f")
|
||||
.long("fromEmailAddress")
|
||||
.help("Select the sender email-address (From:)")
|
||||
.default_value("Allianz-Hotline RA-Hiedemann <azhotline@hiedemann.de>")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("toEmailAddress")
|
||||
.short("t")
|
||||
.long("toEmailAddress")
|
||||
.help("Select the target email-address (To:)")
|
||||
.default_value("Allianz RA-Hotline <smr-rahotline@allianz.de>")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("testPolicyNumber")
|
||||
.short("p")
|
||||
.long("testPolicyNumber")
|
||||
.help("Test validity of given policy number")
|
||||
//.default_value("")
|
||||
.takes_value(true),
|
||||
)
|
||||
// .arg(
|
||||
// Arg::with_name("username")
|
||||
// .short("u")
|
||||
// .long("username")
|
||||
// .help("Sets username")
|
||||
// .takes_value(true),
|
||||
// )
|
||||
// .arg(
|
||||
// Arg::with_name("password")
|
||||
// .short("P")
|
||||
// .long("password")
|
||||
// .help("Sets password")
|
||||
// .takes_value(true),
|
||||
// )
|
||||
.arg(
|
||||
Arg::with_name("verbose")
|
||||
.short("v")
|
||||
.long("verbose")
|
||||
.help("Sets verbosity level")
|
||||
.multiple(true),
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
if matches.occurrences_of("verbose") > 0 {
|
||||
// clap is using i64, viperus i32
|
||||
let n = matches.occurrences_of("verbose") as i32;
|
||||
v.add("verbose", n);
|
||||
}
|
||||
|
||||
// preset the prefix for relevant environment variables ("ADVOTRACKER_")
|
||||
let mut env_prefix: String = crate_name!().to_uppercase();
|
||||
env_prefix.push_str("_");
|
||||
v.set_env_prefix(&env_prefix);
|
||||
|
||||
// respect dotenv environment (e.g for testing)
|
||||
// -> overwrites the preset default values
|
||||
println!(
|
||||
"RUST_LOG={}",
|
||||
dotenv::var("RUST_LOG").unwrap_or_else(|_| String::from("None"))
|
||||
);
|
||||
|
||||
// enable caching and automatic update of environment values
|
||||
v.cache(true);
|
||||
v.automatic_env(true);
|
||||
|
||||
// load user selected call arguments
|
||||
// -> overwrites values given via environment variables
|
||||
v.load_clap(matches)?;
|
||||
|
||||
// bond the clap names to camel_case rust variable names
|
||||
v.bond_clap("configFile", "config_file");
|
||||
v.bond_clap("importFile", "import_file");
|
||||
v.bond_clap("exportFile", "export_file");
|
||||
v.bond_clap("toEmailAddress", "to_email_address");
|
||||
v.bond_clap("fromEmailAddress", "from_email_address");
|
||||
v.bond_clap("testPolicyNumber", "test_policy_number");
|
||||
//v.bond_clap("username", "username");
|
||||
//v.bond_clap("password", "password");
|
||||
v.bond_clap("verbose", "verbose");
|
||||
|
||||
trace!("verbose {:?}", v.get::<i32>("verbose").unwrap());
|
||||
if v.get::<i32>("verbose").unwrap() > 0 {
|
||||
println!(
|
||||
"config_file: {:?}",
|
||||
v.get::<String>("config_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"import_file: {:?}",
|
||||
v.get::<String>("import_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"export_file: {:?}",
|
||||
v.get::<String>("export_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"to_email_address: {:?}",
|
||||
v.get::<String>("to_email_address").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"from_email_address: {:?}",
|
||||
v.get::<String>("from_email_address").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"test_policy_number: {:?}",
|
||||
v.get::<i32>("test_policy_number").unwrap_or_default()
|
||||
);
|
||||
// println!(
|
||||
// "username: {:?}",
|
||||
// v.get::<String>("username").unwrap_or_default()
|
||||
// );
|
||||
// println!(
|
||||
// "password: {:?}",
|
||||
// v.get::<String>("password").unwrap_or_default()
|
||||
// ); // only for testing now
|
||||
|
||||
println!(
|
||||
"verbosity level: {:?}",
|
||||
v.get::<i32>("verbose").unwrap_or_default()
|
||||
);
|
||||
}
|
||||
|
||||
if v.get::<i32>("verbose").unwrap() > 1 {
|
||||
println!("\nEnvironment:");
|
||||
for (key, value) in env::vars() {
|
||||
println!("{}={}", key, value);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
235
advotracker/src/bin/policycheck.rs
Normal file
@@ -0,0 +1,235 @@
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
||||
//use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
||||
|
||||
//#[cfg(feature = "light-theme")]
|
||||
static WIDGET_EXT: &'static str = include_str!("../../resources/stylesheets/policyholder_check.css");
|
||||
|
||||
fn get_theme() -> ThemeValue {
|
||||
//ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
||||
ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
||||
.extension_css(WIDGET_EXT)
|
||||
.build()
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
enum Action {
|
||||
//ClearText,
|
||||
EntryActivated(Entity),
|
||||
EntryChanged(Entity),
|
||||
//ValueChanged(Entity),
|
||||
//ValueOk,
|
||||
//ValueNone,
|
||||
}
|
||||
|
||||
#[derive(AsAny)]
|
||||
pub struct MainViewState {
|
||||
action: Option<Action>,
|
||||
}
|
||||
|
||||
impl Default for MainViewState {
|
||||
fn default() -> Self {
|
||||
MainViewState { action: None }
|
||||
}
|
||||
}
|
||||
|
||||
impl MainViewState {
|
||||
fn action(&mut self, action: impl Into<Option<Action>>) {
|
||||
self.action = action.into();
|
||||
}
|
||||
}
|
||||
|
||||
impl State for MainViewState {
|
||||
fn update(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
||||
if let Some(action) = self.action {
|
||||
match action {
|
||||
// Action::ClearText => {
|
||||
// ctx.widget().set("policynumber", String16::from(""));
|
||||
// }
|
||||
// Action::ValueOk => {
|
||||
// //let mut text_box = TextBox::get(ctx.get_widget(entity));
|
||||
// //let text = text_box.text_mut();
|
||||
// //ctx.widget().set("policynumber", background("#4d4c4c"));
|
||||
// }
|
||||
// Action::ValueNone => {
|
||||
// //let mut text_box = TextBox::get(ctx.get_widget(entity));
|
||||
// //let text = text_box.text_mut();
|
||||
// //ctx.widget().set("policynumber", background("#5b0f22"));
|
||||
//}
|
||||
Action::EntryActivated(entity) => {
|
||||
let mut text_box = TextBox::get(ctx.get_widget(entity));
|
||||
let text = text_box.text_mut();
|
||||
//let mut widget = ctx.get_widget(entity);
|
||||
//let text = widget.get_mut::<String16>("text");
|
||||
println!("got value policynumber: {}", text);
|
||||
//text.clear();
|
||||
}
|
||||
Action::EntryChanged(entity) => {
|
||||
let widget = ctx.get_widget(entity);
|
||||
let text = widget.get::<String16>("text");
|
||||
println!("entry changed: {}", text);
|
||||
}
|
||||
// Action::ValueChanged(entity) => {
|
||||
// let val =
|
||||
// ((*ctx.get_widget(entity).get::<f64>("val")).floor() as i32).to_string();
|
||||
// ctx.child("value_text").set("text", String16::from(val));
|
||||
//}
|
||||
}
|
||||
|
||||
self.action = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
|
||||
TextBlock::new()
|
||||
.text(text)
|
||||
.element("text-block")
|
||||
.class("h1")
|
||||
.build(ctx)
|
||||
}
|
||||
|
||||
widget!(
|
||||
MainView<MainViewState> {
|
||||
sum_policynumbers: usize,
|
||||
policynumber: String16,
|
||||
result: String16
|
||||
}
|
||||
);
|
||||
|
||||
impl Template for MainView {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
||||
self.name("MainView").child(
|
||||
//.result("Anzahl Versicherungsnummern: 0")
|
||||
//.result("Policyholders count: 0").sum_policynumbers(0)
|
||||
//.sum_policynumbers(0)
|
||||
Grid::new()
|
||||
.background("#fafafa")
|
||||
//.width(200.0)
|
||||
//.height(360.0)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add(150.0)
|
||||
.add("*")
|
||||
//.add(120.0)
|
||||
//.add("auto")
|
||||
.add(150.0)
|
||||
.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::new()
|
||||
.add("*")
|
||||
.add("*")
|
||||
.build(),
|
||||
)
|
||||
.child(
|
||||
Grid::new()
|
||||
.element("policyholder_check")
|
||||
.margin((4.0, 24.0, 24.0, 4.0))
|
||||
.min_width(180.0)
|
||||
.min_height(80.0)
|
||||
.attach(Grid::column(1))
|
||||
.attach(Grid::row(0))
|
||||
.child(
|
||||
Stack::new()
|
||||
.spacing(8.0)
|
||||
.orientation("vertical")
|
||||
.h_align("center")
|
||||
//.child(create_header(ctx, "Validation number policyholder"))
|
||||
.child(create_header(ctx, "Validierung Versicherungsnummer"))
|
||||
.child(
|
||||
TextBox::new()
|
||||
//.class("text_box")
|
||||
// overwriting the class defaults
|
||||
/* .background("transparent")
|
||||
.foreground("#9dafbf")
|
||||
.background("#fafafa")
|
||||
/* .foreground(colors::LINK_WATER_COLOR) */
|
||||
.border_brush("#5b0f22")
|
||||
.border_width(5)
|
||||
.border_radius(15) */
|
||||
//.name("policynumber")
|
||||
.focused(true)
|
||||
.water_mark("Versicherungs-Nr...")
|
||||
//.text("Number policyholder", id)
|
||||
.text(("policynumber", id))
|
||||
.font_size(24.0)
|
||||
.h_align("stretch")
|
||||
.on_activate(move |states, entity| {
|
||||
state(id, states).action(Action::EntryActivated(entity));
|
||||
})
|
||||
.on_changed(move |states, entity| {
|
||||
state(id, states).action(Action::EntryChanged(entity));
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.element("text-block")
|
||||
.id("result")
|
||||
.min_width(80.0)
|
||||
.max_width(180.0)
|
||||
//.text("Result:")
|
||||
.text("Ergebnis:")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
.child(
|
||||
Grid::new()
|
||||
.element("logo_customer")
|
||||
.margin((9.0, 16.0, 16.0, 9.0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(1))
|
||||
.v_align("end")
|
||||
.child(
|
||||
ImageWidget::new()
|
||||
.image("./resources/images/hiedemann_logo.png")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Grid::new()
|
||||
.element("logo_vendor")
|
||||
.margin((9.0, 16.0, 16.0, 9.0))
|
||||
.attach(Grid::column(2))
|
||||
.attach(Grid::row(1))
|
||||
.v_align("end")
|
||||
.child(
|
||||
ImageWidget::new()
|
||||
.image("./resources/images/networkx_logo.png")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
) // MainView
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Application::new()
|
||||
.window(|ctx| {
|
||||
Window::new()
|
||||
//.title("OrbTk - Policyholder checker example")
|
||||
.name("MainWindow")
|
||||
.title("AdvoTracker - Versicherungsnummern")
|
||||
.position((-500.0, -100.0))
|
||||
.size(480.0, 260.0)
|
||||
.min_width(460.0)
|
||||
.min_height(180.0)
|
||||
.resizeable(true)
|
||||
.theme(get_theme())
|
||||
.child(MainView::new().build(ctx))
|
||||
.build(ctx)
|
||||
})
|
||||
.run();
|
||||
}
|
||||
|
||||
// helper to request MainViewState
|
||||
fn state<'a>(id: Entity, states: &'a mut StatesContext) -> &'a mut MainViewState {
|
||||
states.get_mut(id)
|
||||
}
|
||||
1
advotracker/src/bin/resources
Symbolic link
@@ -0,0 +1 @@
|
||||
../../resources
|
||||
59
advotracker/src/callbacks/global_state.rs
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use orbtk::prelude::*;
|
||||
|
||||
//use crate::data::keys;
|
||||
use crate::{
|
||||
data::structures::PolicyList,
|
||||
data::keys::*
|
||||
};
|
||||
|
||||
/// Provides generic methods to handle states of datatypes (e.g. used in `PolicyList`).
|
||||
pub trait GlobalState {
|
||||
/// Navigates to the given entity.
|
||||
fn navigate(&self, to: Entity, ctx: &mut Context<'_>) {
|
||||
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
|
||||
let mut old_focused_element = ctx.get_widget(old_focused_element);
|
||||
old_focused_element.set("focused", false);
|
||||
old_focused_element.update_theme_by_state(false);
|
||||
}
|
||||
ctx.window().get_mut::<Global>("global").focused_widget = None;
|
||||
ctx.widget().set("visibility", Visibility::Collapsed);
|
||||
ctx.get_widget(to).set("visibility", Visibility::Visible);
|
||||
}
|
||||
|
||||
/// Get the text of a widget.
|
||||
fn get_text(&self, ctx: &mut Context<'_>, entity: Entity) -> Option<String> {
|
||||
let mut widget = ctx.get_widget(entity);
|
||||
|
||||
let entry = widget.get_mut::<String>("text");
|
||||
if entry.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let copy = entry.to_string();
|
||||
entry.clear();
|
||||
Some(copy)
|
||||
}
|
||||
|
||||
/// Save the our data structure and convert it to `ron` file format.
|
||||
/// The cargo package identifier (here: 'nwx.advotracker') is taken to create the app directory.
|
||||
/// in users 'settings directory'. The directory location is OS dependant
|
||||
/// (Windows: AppData, Unix: XDG_CONFIG_HOME, MacOS: $HOME/Library/Preferences).
|
||||
/// The data is stored in filename PROP_ADVOTRACKER (here: `advotracker.ron`)
|
||||
|
||||
fn save(&self, registry: &mut Registry, ctx: &mut Context<'_>) {
|
||||
registry
|
||||
.get::<Settings>("settings")
|
||||
.save(
|
||||
PROP_ADVOTRACKER,
|
||||
ctx.widget().get::<PolicyList>(PROP_ADVOTRACKER),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
21
advotracker/src/callbacks/mod.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// global helper functions
|
||||
pub mod global_state;
|
||||
|
||||
/// policycheck helper functions
|
||||
pub mod policycheck_state;
|
||||
|
||||
// /// policylist helper functions
|
||||
// pub mod policylist_state;
|
||||
|
||||
// /// policydata helper functions
|
||||
// pub mod policydata_state;
|
||||
|
||||
/// policy verification methods
|
||||
pub mod policy_check;
|
||||
64
advotracker/src/callbacks/policy_check.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use chrono::{Local, DateTime};
|
||||
//use serde::Deserialize;
|
||||
//use std::env;
|
||||
//use std::{error::Error, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{info, trace};
|
||||
|
||||
use crate::data::structures::{PolicyCode, PolicyDataList};
|
||||
|
||||
/// validate a given policy number
|
||||
/// result will return true or false
|
||||
pub fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
||||
-> Result<bool, Box<dyn std::error::Error>> {
|
||||
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "advotracker",
|
||||
process = ?"validation",
|
||||
state = ?"started",
|
||||
policy_number = ?policy_number,
|
||||
policy_list = ?policy_list.name,
|
||||
elements = ?policy_list.policy_data.len(),
|
||||
date_start = ?dt_start.to_string());
|
||||
|
||||
let mut result = false;
|
||||
match policy_numbers.get(&policy_number) {
|
||||
Some(&policy_code) => {
|
||||
println!("policy_number: {} ({:?})",
|
||||
policy_number, policy_code);
|
||||
info!("policy-check => {} ({:?})", policy_number, policy_code);
|
||||
result = true;
|
||||
trace!(target: "advotracker",
|
||||
policy_number = ?policy_number,
|
||||
validation = "success",
|
||||
policy_code = ?policy_code);
|
||||
},
|
||||
_ => {
|
||||
println!("Noop! Number isn't valid!");
|
||||
info!("policy-check => {}", policy_number);
|
||||
trace!(target: "csv-test",
|
||||
policy_number = ?policy_number,
|
||||
validation = "failed");
|
||||
},
|
||||
}
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
|
||||
trace!(target: "advotracker",
|
||||
process = "validation",
|
||||
state = "finished",
|
||||
date_stop = ?dt_end.to_string(),
|
||||
duration = ?duration);
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
355
advotracker/src/callbacks/policycheck_state.rs
Normal file
@@ -0,0 +1,355 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use dotenv::dotenv;
|
||||
use orbtk::prelude::*;
|
||||
use serde::Deserialize;
|
||||
use std::{env, process};
|
||||
use std::collections::HashMap;
|
||||
use tracing::{debug, error, info, trace};
|
||||
|
||||
use crate::services::imports::allianzdirectcall::import;
|
||||
//use crate::callbacks::policy_check::is_valid;
|
||||
|
||||
use crate::{
|
||||
callbacks::global_state::GlobalState,
|
||||
data::structures::{PolicyCheck, PolicyCode, PolicyDataList, PolicyList},
|
||||
data::keys::*,
|
||||
};
|
||||
|
||||
/// Actions that can execute on the task view.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Action {
|
||||
ClearEntry(Entity),
|
||||
InputTextChanged(Entity),
|
||||
OpenMenu(Entity),
|
||||
ParseEntry(Entity),
|
||||
RemoveFocus(Entity),
|
||||
SetEntry(Entity),
|
||||
SetVisibility(Entity),
|
||||
TextChanged(Entity, usize),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Environment {
|
||||
test_lang: String,
|
||||
log: String,
|
||||
}
|
||||
|
||||
/// Handles the requests of the `PolicyCheckView`.
|
||||
#[derive(Default, AsAny)]
|
||||
pub struct PolicyCheckState {
|
||||
action: Option<Action>,
|
||||
label_result_text_block: Entity,
|
||||
last_focused: Option<Entity>,
|
||||
menu_button: Entity,
|
||||
//policy_check_clean_button: Entity,
|
||||
policy_check: PolicyCheck,
|
||||
policy_data_count: usize,
|
||||
//policy_number_text_box: Entity,
|
||||
policy_numbers: HashMap<usize, PolicyCode>
|
||||
}
|
||||
|
||||
impl GlobalState for PolicyCheckState {}
|
||||
|
||||
/// method definitions, that react on any given state change inside the view
|
||||
impl PolicyCheckState {
|
||||
/// Sets a new action.
|
||||
pub fn action(&mut self, action: Action) {
|
||||
self.action = action.into();
|
||||
}
|
||||
|
||||
pub fn create_hashmap(&mut self) -> Result<(), Box<dyn std::error::Error>> {
|
||||
// WIP: redundant lang selection (already in main!)
|
||||
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
||||
// testing environment: read from .env file
|
||||
dotenv().ok();
|
||||
match envy::from_env::<Environment>() {
|
||||
Ok(environment) => {
|
||||
if environment.test_lang != lang { lang = environment.test_lang; }
|
||||
},
|
||||
Err(e) => { debug!(target: "advotracker", "{}", e); }
|
||||
}
|
||||
|
||||
// importing policy code elements from csv-file
|
||||
let policy_list = PolicyList::new("Allianz Versicherungsnummen-List");
|
||||
//println!("Policy List {:?} ", policy_list.name);
|
||||
|
||||
let mut policy_data = PolicyDataList::new("Allianz-Import latest");
|
||||
//println!("Policy Data List {:?} ", policy_data.name);
|
||||
|
||||
let mut policy_numbers : HashMap<usize, PolicyCode> = HashMap::new();
|
||||
|
||||
// Wip: use cli parameter stored in viperus ...
|
||||
//let mut csv_import_path = v.get::<String>("import_file").unwrap();
|
||||
let mut csv_import_path = String::from("POLLFNR_WOECHENTLICH.txt");
|
||||
//println!("Importing from: {:?}", csv_import_path);
|
||||
match import(&mut csv_import_path, &mut policy_data,
|
||||
&mut policy_numbers, &lang) {
|
||||
Ok(count) => {
|
||||
self.policy_data_count = count;
|
||||
//println!("Imported {:?} records", self.policy_data_count);
|
||||
}
|
||||
Err(err) => {
|
||||
//println!("error running CSV-Import: {}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
self.policy_numbers = policy_numbers;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Clear text in text box.
|
||||
pub fn clear_entry(&mut self, text_box: Entity, ctx: &mut Context<'_>) {
|
||||
let mut text_box = TextBox::get(ctx.get_widget(text_box));
|
||||
let text = text_box.text_mut();
|
||||
//println!("reset {}", text);
|
||||
}
|
||||
|
||||
/// Open menu.
|
||||
pub fn open_menu(&mut self, text_block: Entity, ctx: &mut Context<'_>) {
|
||||
let mut text_block = TextBlock::get(ctx.get_widget(text_block));
|
||||
let text = text_block.text_mut();
|
||||
//println!("Menu text: {}", text);
|
||||
}
|
||||
|
||||
fn parse_entry(&mut self, policy_check_policy_number: Entity,
|
||||
ctx: &mut Context<'_>) {
|
||||
let policy_string = ctx.get_widget(policy_check_policy_number).get::<String16>("text").as_string();
|
||||
let policy_number_length = policy_string.len();
|
||||
|
||||
trace!(target: "advotracker", state = "parsing", policy_number = ?policy_string);
|
||||
|
||||
// Parse policy code: "AS-123456789"
|
||||
// DION VERS POLLFNR
|
||||
// 1 AS 1515735810
|
||||
if policy_number_length == 10 {
|
||||
let mut label_wrapper : TextBlockCtx<'_> = text_block(ctx.child("policy_check_label_result"));
|
||||
let string_label = "Prüfungsergebnis:".to_string();
|
||||
// needs to be an integer
|
||||
match policy_string.parse::<usize>() {
|
||||
Ok(p) => {
|
||||
//println!(" ... verify policy Number {:?}", p);
|
||||
label_wrapper.set_text(string_label);
|
||||
label_wrapper.set_visibility(Visibility::Visible);
|
||||
label_wrapper.set_enabled(true);
|
||||
let mut result_wrapper: TextBlockCtx<'_> = text_block(ctx.child("policy_check_result"));
|
||||
result_wrapper.set_text("Prüfung läuft ...");
|
||||
match self.policy_numbers.get(&p) {
|
||||
// check hashmap value field
|
||||
Some(policy_code) => {
|
||||
trace!(target: "advotracker", state = "success",
|
||||
policy_number = ?p, policy_code = ?policy_code);
|
||||
result_wrapper.set_enabled(true);
|
||||
let string_result = format!("gütig! => vollständig: 1-{:?}-{}",
|
||||
policy_code, p);
|
||||
result_wrapper.set_text(string_result);
|
||||
}
|
||||
_ => {
|
||||
trace!(target: "advotracker", state = "failed",
|
||||
policy_number = ?p);
|
||||
result_wrapper.set_enabled(true);
|
||||
result_wrapper.set_text("noop, ungültig!");
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
trace!(target: "advotracker", state = "error", error_type = "invalid type");
|
||||
// Feedback
|
||||
let mut result_wrapper: TextBlockCtx<'_> = text_block(ctx.child("policy_check_result"));
|
||||
result_wrapper.set_enabled(true);
|
||||
result_wrapper.set_text("bitte nur Nummern erfassen!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if policy_number_length < 10 {
|
||||
//println!("Policy number is to short!");
|
||||
let mut text_block_wrapper: TextBlockCtx<'_> = text_block(ctx.child("policy_check_result"));
|
||||
text_block_wrapper.set_enabled(true);
|
||||
text_block_wrapper.set_text("zu kurz!");
|
||||
//ctx.get_widget(policy_check_policy_number).set("policy_check_result", true);
|
||||
//ctx.child(ID_POLICY_CHECK_POLICY_NUMBER).set("text", String::from(""));
|
||||
}
|
||||
if policy_number_length > 10 {
|
||||
//println!("Policy number is to big!");
|
||||
let mut text_block_wrapper: TextBlockCtx<'_> = text_block(ctx.child("policy_check_result"));
|
||||
text_block_wrapper.set_enabled(true);
|
||||
text_block_wrapper.set_text("zu lang!");
|
||||
}
|
||||
}
|
||||
|
||||
/// If TextBox 'policy_check_policy_number' is empty, disable button "clear"
|
||||
/// otherwise enabled it.
|
||||
// fn set_policy_check_clear_button(&self, policy_check_policy_number: Entity, ctx: &mut Context<' >) {
|
||||
// if ctx.get_widget(clear_button).get::<String>("policy_check_policy_number").is_empty() {
|
||||
// ctx.get_widget(self.policy_check_clear_button).set("enabled", false);
|
||||
// } else {
|
||||
// ctx.get_widget(self.policy_check_clear_button).set("enabled", true);
|
||||
// }
|
||||
|
||||
// ctx.get_widget(self.policy_check_policy_number).update_theme_by_state(true);
|
||||
// }
|
||||
|
||||
/// Change status of given text box to edit mode.
|
||||
fn set_entry(&self, policy_check_policy_number: Entity, ctx: &mut Context<'_>) {
|
||||
if *ctx.get_widget(policy_check_policy_number).get::<bool>("focused") {
|
||||
//let mut my_ctx: WidgetContainer<'_> = ctx.widget();
|
||||
//let mut child: WidgetContainer<'_> = ctx.get_widget(policy_check_policy_number);
|
||||
//ctx.get_widget(policy_check_policy_number).set("enabled", true);
|
||||
let mut text_box_wrapper: TextBoxCtx<'_> = text_box(ctx.child("policy_check_policy_number"));
|
||||
//ctx.push_event_by_window(FocusEvent::RemoveFocus(policy_check_policy_number));
|
||||
text_box_wrapper.set_visibility( Visibility::Visible);
|
||||
text_box_wrapper.set_enabled(true);
|
||||
text_box_wrapper.set_text("");
|
||||
text_box_wrapper.set_water_mark("Neue Eingabe ...");
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(old_focused_element));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Change visibility of the result label
|
||||
fn set_visibility(&self, entity: Entity, ctx: &mut Context<'_>) {
|
||||
if ctx.get_widget(entity).get::<String16>("text").is_empty() {
|
||||
text_block(ctx.child(ID_POLICY_CHECK_LABEL_RESULT)).set_visibility(Visibility::Visible);
|
||||
} else {
|
||||
text_block(ctx.child(ID_POLICY_CHECK_LABEL_RESULT)).set_visibility(Visibility::Collapsed);
|
||||
//ctx.get_widget(self.policy_check_label_policy_number).set("enabled", false);
|
||||
}
|
||||
|
||||
ctx.get_widget(self.label_result_text_block).update_theme_by_state(true);
|
||||
}
|
||||
|
||||
// Update count of elements in the policy data list.
|
||||
fn update_data_count(&self, ctx: &mut Context<'_>) {
|
||||
// old api syntax
|
||||
let data_list_count = ctx.widget().get::<PolicyDataList>(PROP_POLICY_DATA_LIST).len();
|
||||
ctx.widget().set(PROP_POLICY_DATA_COUNT, data_list_count);
|
||||
}
|
||||
}
|
||||
|
||||
/// upported states for our view
|
||||
impl State for PolicyCheckState {
|
||||
fn init(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
||||
self.menu_button = ctx
|
||||
.entity_of_child(ID_POLICY_CHECK_MENU_BUTTON)
|
||||
.expect("PolicyCheckState.init: Can't find entity id defined as resource 'ID_POLICY_CHECK_POLICY_MENU_BUTTON'.");
|
||||
// self.policy_number_text_box = ctx
|
||||
// .entity_of_child(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
// .expect("PolicyCheckState.init: Can't find entity id defined as resource 'ID_POLICY_CHECK_POLICY_NUMBER'.");
|
||||
|
||||
// import data
|
||||
// WIP: for now, only import once per session
|
||||
if self.policy_data_count == 0 {
|
||||
match self.create_hashmap() {
|
||||
Ok(()) => {
|
||||
//let res = t!("policy.hashmap.success", lang);
|
||||
//println!("{:?}", res);
|
||||
info!("hashmap has: {:?} entries", self.policy_data_count);
|
||||
trace!(target: "advotracker",
|
||||
hashmap_status = "new import",
|
||||
hashmap_entries = ?self.policy_data_count);
|
||||
}
|
||||
_ => {
|
||||
// let res = t!("policy.hashmap.failed", lang);
|
||||
// println
|
||||
// !("{:?}", res);
|
||||
error!("Creation of a hashmap failed!");
|
||||
trace!(target: "advotracker", hashmap_status = "failed");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//println!("Already imported {} records.", self.policy_data_count);
|
||||
trace!(target: "advotracker",
|
||||
hashmap_status = "consume",
|
||||
hashmap_entries = ?self.policy_data_count);
|
||||
}
|
||||
|
||||
// // Load the saved data from a file in 'ron' format into our data structure.
|
||||
// // The cargo package identifier (default: 'nwx.advotracker') is used as the
|
||||
// // app directory name. The directory location is OS dependant
|
||||
// // (Windows: AppData, Unix: XDG_CONFIG_HOME, MacOS: $HOME/Library/Preferences).
|
||||
// // The filename is taken from the propertey PROP_ADVOTRACKER (default: 'advotracker'.ron).
|
||||
// if let Ok(policy_data) = registry
|
||||
// .get::<Settings>("settings")
|
||||
// .load::<PolicyDataList>(PROP_ADVOTRACKER)
|
||||
// {
|
||||
// ctx.widget().set(PROP_ADVOTRACKER, policy_data);
|
||||
// }
|
||||
|
||||
// number of elements in the restored policy data
|
||||
//policy_data_count = policy_data.len().clone;
|
||||
//self.update_data_count(ctx);
|
||||
}
|
||||
|
||||
fn update(&mut self, _registry: &mut Registry, ctx: &mut Context<'_>) {
|
||||
// clear focus on focus moved
|
||||
if self.last_focused != ctx.window().get::<Global>("global").focused_widget {
|
||||
if let Some(last_focused) = self.last_focused {
|
||||
ctx.get_widget(last_focused).set("focused", false);
|
||||
// widget is unvisible, but takes space to be considered
|
||||
ctx.get_widget(last_focused)
|
||||
.set("visibility", Visibility::Collapsed);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(action) = self.action {
|
||||
match action {
|
||||
Action::ClearEntry(policy_check_policy_number) => {
|
||||
ctx.get_widget(policy_check_policy_number).set("enabled", false);
|
||||
}
|
||||
Action::InputTextChanged(entity) => {
|
||||
//println!("entry changed: {}", text_box(ctx.get_widget(entity)).text());
|
||||
//self.set_check_button(policy_check_label_policy_number, ctx);
|
||||
self.set_visibility(entity, ctx);
|
||||
}
|
||||
Action::OpenMenu(text_block) => {
|
||||
self.open_menu(text_block, ctx);
|
||||
}
|
||||
Action::ParseEntry(text_box) => {
|
||||
self.parse_entry(text_box, ctx);
|
||||
ctx.get_widget(text_box).get::<String16>("text").as_string();
|
||||
//self.parse_entry(text_box, &mut policy_numbers,
|
||||
// &lang, ctx);
|
||||
}
|
||||
Action::RemoveFocus(policy_check_policy_number) => {
|
||||
ctx.get_widget(policy_check_policy_number).set("enabled", false);
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(policy_check_policy_number));
|
||||
}
|
||||
Action::SetEntry(policy_check_policy_number) => {
|
||||
//self.last_focused = Some();
|
||||
self.set_entry(policy_check_policy_number, ctx);
|
||||
}
|
||||
Action::SetVisibility(entity) => {
|
||||
//text_block(ctx.child(entity).set_visibility(Visibility::Visible));
|
||||
text_block(ctx.child(ID_POLICY_CHECK_LABEL_RESULT)).set_visibility(Visibility::Collapsed);
|
||||
}
|
||||
Action::TextChanged(entity, _index) => {
|
||||
self.set_entry(entity, ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.action = None;
|
||||
}
|
||||
|
||||
fn update_post_layout(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
||||
let string_result = "Prüfungsergebnis:".to_string();
|
||||
//string_result = format!("{} {:?}", string_result, self.??;
|
||||
text_block(ctx.child(ID_POLICY_CHECK_LABEL_RESULT)).set_text(string_result);
|
||||
text_block(ctx.child(ID_POLICY_CHECK_LABEL_RESULT)).set_visibility(Visibility::Collapsed);
|
||||
|
||||
let mut string_data_count = "Prüflisten-Elemente:".to_string();
|
||||
string_data_count = format!("{} {:?}", string_data_count, self.policy_numbers.len());
|
||||
|
||||
text_block(ctx.child(ID_POLICY_DATA_COUNT_BLOCK)).set_text(string_data_count);
|
||||
}
|
||||
}
|
||||
283
advotracker/src/callbacks/policydata_state.rs
Normal file
@@ -0,0 +1,283 @@
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
callbacks::global_state::GlobalState,
|
||||
data::{PolicyCode, PolicyData, PolicyList, Status},
|
||||
data::keys::*,
|
||||
};
|
||||
use chrono::{Utc, NaiveDateTime};
|
||||
|
||||
/// Actions that can execute on the task view.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Action {
|
||||
InputTextChanged(Entity),
|
||||
NavigateBack(),
|
||||
NewEntry(Entity),
|
||||
RemoveFocus(Entity),
|
||||
RemoveEntry(usize),
|
||||
SetDateInserted(Entity),
|
||||
SetDion(Entity),
|
||||
SetPolicyCode(Entity),
|
||||
SetPolicyNumber(Entity),
|
||||
StatusChanged(Entity, usize),
|
||||
TextChanged(Entity, usize),
|
||||
}
|
||||
|
||||
/// Handles the requests of the `PolicyDataListView`.
|
||||
#[derive(Debug, Default, AsAny)]
|
||||
pub struct PolicyDataState {
|
||||
action:Option<Action>,
|
||||
back_entity: Entity,
|
||||
last_focused: Option<Entity>,
|
||||
policy_data_add_button: Entity,
|
||||
pub policy_data_date_inserted: Entity,
|
||||
pub policy_data_dion: Entity,
|
||||
pub policy_data_policy_code: Entity,
|
||||
pub policy_data_policy_number: Entity,
|
||||
open: bool,
|
||||
}
|
||||
|
||||
/// implement of the BaseState trait for our PolicyDataState type
|
||||
impl GlobalState for PolicyDataState {}
|
||||
|
||||
/// implement the PolicyDateState type itself
|
||||
impl PolicyDataState {
|
||||
/// Sets a new action.
|
||||
pub fn action(&mut self, action: Action) {
|
||||
self.action = action.into();
|
||||
}
|
||||
|
||||
/// update number of available policy data entries.
|
||||
fn adjust_count(&self, ctx: &mut Context) {
|
||||
if let Some(index) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_list) = ctx
|
||||
.widget()
|
||||
.clone::<PolicyList>("policy_list")
|
||||
.get(index)
|
||||
{
|
||||
ctx.widget().set("policy_data_count", policy_list.len());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// If policy data element 'name' is empty, disable the add button
|
||||
/// otherwise otherwise enabled it.
|
||||
fn adjust_add_button_enabled(&self, text_box: Entity, ctx: &mut Context) {
|
||||
if ctx.get_widget(text_box).get::<String16>("name").is_empty() {
|
||||
ctx.get_widget(self.policy_data_add_button).set("enabled", false);
|
||||
} else {
|
||||
ctx.get_widget(self.policy_data_add_button).set("enabled", true);
|
||||
}
|
||||
|
||||
ctx.get_widget(self.policy_data_add_button).update_theme_by_state(true);
|
||||
}
|
||||
|
||||
/// Change status of given text box to edit mode.
|
||||
fn edit_entry(&self, text_box: Entity, ctx: &mut Context) {
|
||||
if *ctx.get_widget(text_box).get::<bool>("focused") {
|
||||
ctx.get_widget(text_box).set("enabled", false);
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(text_box));
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(old_focused_element));
|
||||
}
|
||||
|
||||
ctx.get_widget(text_box).set("enabled", true);
|
||||
|
||||
// select all
|
||||
ctx.get_widget(text_box)
|
||||
.get_mut::<TextSelection>("text_selection")
|
||||
.start_index = 0;
|
||||
ctx.get_widget(text_box)
|
||||
.get_mut::<TextSelection>("text_selection")
|
||||
.length = ctx.get_widget(text_box).get::<String16>("name").len();
|
||||
ctx.push_event_by_window(FocusEvent::RequestFocus(text_box));
|
||||
}
|
||||
|
||||
/// navigate to previous policy data entry.
|
||||
fn navigate_back(&mut self, ctx: &mut Context) {
|
||||
ctx.get_widget(self.text_box)
|
||||
.set("name", String16::from(""));
|
||||
self.open = false;
|
||||
ctx.widget().set::<Option<usize>>("list_index", None);
|
||||
ctx.widget().set("policy_data_count", 0 as usize);
|
||||
self.navigate(self.back_entity, ctx);
|
||||
}
|
||||
|
||||
/// create a new policy data member
|
||||
fn new_entry(&self, policy_number: u32, registry: &mut Registry, ctx: &mut Context) {
|
||||
let index = ctx.widget().clone::<Option<usize>>("list_index");
|
||||
|
||||
if let Some(index) = index {
|
||||
if let Some(policy_data) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyList>("policy_list")
|
||||
.get_mut(index)
|
||||
{
|
||||
policy_data.push(PolicyData {
|
||||
date_inserted: Some(Utc::now().naive_utc()),
|
||||
dion: 1,
|
||||
policy_code: PolicyCode::AS,
|
||||
policy_number,
|
||||
status: Status::Active,
|
||||
});
|
||||
}
|
||||
|
||||
self.adjust_count(ctx);
|
||||
}
|
||||
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
|
||||
pub fn open(&mut self, ctx: &mut Context) {
|
||||
if let Some(index) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
let mut name: String16 = "".into();
|
||||
let mut policy_data_count = 0;
|
||||
if let Some(policy_list) = ctx.widget().get::<PolicyList>("policy_list").get(index) {
|
||||
name = String16::from(policy_list.name.as_str());
|
||||
policy_data_count = policy_list.len();
|
||||
}
|
||||
ctx.widget().set("name", name);
|
||||
ctx.widget().set("policy_data_count", policy_data_count);
|
||||
self.open = true;
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_entry(&self, index: usize, registry: &mut Registry, ctx: &mut Context) {
|
||||
if let Some(idx) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_list) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyList>("policy_list")
|
||||
.get_mut(idx)
|
||||
{
|
||||
policy_list.remove(index);
|
||||
}
|
||||
}
|
||||
self.adjust_count(ctx);
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
|
||||
/// Toggle the selection state of the given policy number element
|
||||
fn toggle_status(
|
||||
&self,
|
||||
entry: Entity,
|
||||
index: usize,
|
||||
registry: &mut Registry,
|
||||
ctx: &mut Context,
|
||||
) {
|
||||
let invalid: bool = *ctx.get_widget(entry).get("status");
|
||||
|
||||
if let Some(idx) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_data) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyList>("policy_list")
|
||||
.get_mut(idx)
|
||||
{
|
||||
if let Some(policy_data) = policy_data.get_mut(index) {
|
||||
policy_data.status = Status::Active;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
|
||||
fn update_entry(
|
||||
&self,
|
||||
policy_data_date_inserted: Entity,
|
||||
policy_data_dion: Entity,
|
||||
policy_data_policy_code: Entity,
|
||||
policy_data_policy_number: Entity,
|
||||
index: usize,
|
||||
registry: &mut Registry,
|
||||
ctx: &mut Context,
|
||||
) {
|
||||
let date_inserted: Option<NaiveDateTime> = ctx.get_widget(policy_data_date_inserted).clone("date_inserted");
|
||||
let dion: u8 = ctx.get_widget(policy_data_dion).clone("dion");
|
||||
let policy_code: PolicyCode = ctx.get_widget(policy_data_policy_code).clone("policy_code");
|
||||
let policy_number: u32 = ctx.get_widget(policy_data_policy_number).clone("policy_number");
|
||||
|
||||
// get the index from the active widgets 'list_index' member
|
||||
if let Some(idx) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
// get view record from the active widgets 'policy_list' member
|
||||
if let Some(policy_list) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyList>("policy_list")
|
||||
.get_mut(idx)
|
||||
{
|
||||
// update the record data using the view values of the active policy_list member
|
||||
if let Some(policy_data) = policy_list.get_mut(index) {
|
||||
policy_data.date_inserted = date_inserted;
|
||||
policy_data.dion = dion;
|
||||
policy_data.policy_code = policy_code;
|
||||
policy_data.policy_number = policy_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
impl State for PolicyDataState {
|
||||
fn init(&mut self, _: &mut Registry, ctx: &mut Context) {
|
||||
self.back_entity = (*ctx.widget().get::<u32>("back_entity")).into();
|
||||
self.policy_data_add_button = ctx
|
||||
.entity_of_child(ID_POLICY_DATA_ADD_BUTTON)
|
||||
.expect("PolicyState.init: Can't find child 'Add button'.");
|
||||
self.policy_data_policy_number = ctx
|
||||
.entity_of_child(ID_POLICY_DATA_POLICY_NUMBER)
|
||||
.expect("PolicyState.init: Can't find child 'Policy Number'.");
|
||||
}
|
||||
|
||||
fn update(&mut self, registry: &mut Registry, ctx: &mut Context) {
|
||||
if !self.open {
|
||||
self.open(ctx);
|
||||
}
|
||||
if let Some(action) = self.action {
|
||||
match action {
|
||||
Action::InputTextChanged(text_box) => {
|
||||
self.adjust_add_button_enabled(text_box, ctx);
|
||||
}
|
||||
Action::NewEntry(entity) => {
|
||||
if let Some(text) = self.fetch_text(ctx, entity) {
|
||||
self.new_entry(text, registry, ctx);
|
||||
}
|
||||
}
|
||||
Action::RemoveEntry(index) => {
|
||||
self.remove_entry(index, registry, ctx);
|
||||
}
|
||||
Action::SelectionChanged(entity, index) => {
|
||||
self.toggle_selection(entity, index, registry, ctx);
|
||||
}
|
||||
Action::TextChanged(entity, index) => {
|
||||
self.update_entry(entity, index, registry, ctx);
|
||||
}
|
||||
Action::SetDateInserted(policy_data_date_inserted) => {
|
||||
self.last_focused = Some(policy_data_date_inserted);
|
||||
self.edit_entry(policy_data_date_inserted, ctx);
|
||||
}
|
||||
Action::SetDion(policy_data_dion) => {
|
||||
self.last_focused = Some(policy_data_dion);
|
||||
self.edit_entry(policy_data_policy_dion);
|
||||
}
|
||||
Action::SetPolicyCode(policy_data_policy_code) => {
|
||||
self.last_focused = Some(policy_data_policy_code);
|
||||
self.edit_entry(policy_data_policy_code, ctx);
|
||||
}
|
||||
Action::SetPolicyNumber(policy_data_policy_number) => {
|
||||
self.last_focused = Some(policy_data_policy_number);
|
||||
self.edit_entry(policy_data_policy_number, ctx);
|
||||
}
|
||||
Action::RemoveFocus(text_box) => {
|
||||
ctx.get_widget(text_box).set("enabled", false);
|
||||
ctx.push_event_by_window(FocusEvent::RemoveFocus(text_box));
|
||||
}
|
||||
Action::NavigateBack() => {
|
||||
self.navigate_back(ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.action = None;
|
||||
}
|
||||
}
|
||||
54
advotracker/src/data/keys.rs
Normal file
@@ -0,0 +1,54 @@
|
||||
// CSS => transform to RON based theme system
|
||||
// https://github.com/ron-rs/ronRon
|
||||
|
||||
// Classes
|
||||
pub static CLASS_BOTTOM_BAR: &str = "bottom_bar";
|
||||
pub static CLASS_HEADER: &str = ".my_header";
|
||||
pub static CLASS_ICON_ONLY: &str = "icon_only";
|
||||
pub static CLASS_ITEM_BUTTON: &str = "item_button";
|
||||
pub static CLASS_MENU: &str = "menu";
|
||||
pub static CLASS_POLICY_CHECK_FORM: &str = "check_form";
|
||||
pub static CLASS_TEXT_BOX: &str = "text_box";
|
||||
pub static CLASS_TEXT_BLOCK: &str = "text_block";
|
||||
pub static CLASS_TOP_BAR: &str = "top_bar";
|
||||
pub static CLASS_TRANSPARENT: &str = "transparent";
|
||||
pub static CLASS_SEPERATOR: &str = "seperator";
|
||||
|
||||
// Widget IDs (DCES: Entity[id] => [Component1, .. , Component<n>] -> data or state)
|
||||
pub static ID_POLICY_CHECK_FORM: &str = "policy_check_form";
|
||||
pub static ID_POLICY_CHECK_HEADER: &str = "policy_check_header";
|
||||
pub static ID_POLICY_CHECK_ITEMS_WIDGET: &str = "policy_check_items_widget";
|
||||
pub static ID_POLICY_CHECK_CLEAR_BUTTON: &str = "policy_check_clear_button";
|
||||
pub static ID_POLICY_CHECK_MENU_BUTTON: &str = "policy_check_menu_button";
|
||||
pub static ID_POLICY_CHECK_LABEL_POLICY_NUMBER: &str = "policy_check_label_policy_number";
|
||||
pub static ID_POLICY_CHECK_LABEL_RESULT: &str = "policy_check_label_result";
|
||||
pub static ID_POLICY_CHECK_MENU_TEXT_BLOCK: &str = "policy_check_menu_text_block";
|
||||
pub static ID_POLICY_CHECK_POLICY_NUMBER: &str = "policy_check_policy_number";
|
||||
pub static ID_POLICY_CHECK_RESULT: &str = "policy_check_result";
|
||||
pub static ID_POLICY_CHECK_WIDGET: &str = "policy_check_widget";
|
||||
|
||||
pub static ID_POLICY_DATA_ADD_BUTTON: &str = "policy_data_add_button";
|
||||
pub static ID_POLICY_DATA_COUNT_BLOCK: &str = "policy_data_count_block";
|
||||
pub static ID_POLICY_DATA_ITEMS_WIDGET: &str = "policy_data_items_widget";
|
||||
//pub static ID_POLICY_DATA_TEXT_BOX: &str = "policy_data_text_box";
|
||||
pub static ID_POLICY_DATA_DATE_INSERTED: &str = "policy_data_date_inserted";
|
||||
pub static ID_POLICY_DATA_DION: &str = "policy_data_dion";
|
||||
pub static ID_POLICY_DATA_POLICY_CODE: &str = "policy_data_policy_code";
|
||||
pub static ID_POLICY_DATA_POLICY_NUMBER: &str = "policy_data_policy_number";
|
||||
pub static ID_POLICY_DATA_STATUS: &str = "policy_data_status";
|
||||
pub static ID_POLICY_DATA_LIST_NAME: &str = "policy_data_list_name";
|
||||
|
||||
pub static ID_POLICY_LIST_ADD_BUTTON: &str = "policy_list_add_button";
|
||||
pub static ID_POLICY_LIST_ITEMS_WIDGET: &str = "policy_list_items_widget";
|
||||
//pub static ID_POLICY_LIST_TEXT_BOX: &str = "policy_list_text_box";
|
||||
//pub static ID_POLICY_LIST_TEXT_BLOCK: &str = "policy_list_text_block";
|
||||
|
||||
// Component Values (Properties)
|
||||
pub static PROP_ADVOTRACKER: &str = "advotracker";
|
||||
pub static PROP_POLICY_CHECK: &str = "policy_check";
|
||||
|
||||
pub static PROP_POLICY_DATA_LIST: &str = "policy_data_list";
|
||||
pub static PROP_POLICY_DATA_COUNT: &str = "policy_data_count";
|
||||
|
||||
pub static PROP_POLICY_LIST: &str = "policy_list";
|
||||
pub static PROP_POLICY_LIST_COUNT: &str = "policy_list_count";
|
||||
12
advotracker/src/data/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// structures with implementations
|
||||
pub mod structures;
|
||||
|
||||
/// provides orbtk widgets constants
|
||||
pub mod keys;
|
||||
346
advotracker/src/data/structures.rs
Normal file
@@ -0,0 +1,346 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use chrono::NaiveDateTime;
|
||||
use orbtk::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// An enumeration of valid policy codes.
|
||||
/// right now, only "AS" is used.
|
||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize)]
|
||||
pub enum PolicyCode {
|
||||
/// Allianz Sachversicherung
|
||||
AS
|
||||
}
|
||||
|
||||
impl Default for PolicyCode {
|
||||
fn default() -> Self { PolicyCode::AS }
|
||||
}
|
||||
|
||||
/// Classifier of the Allinaz DirectCall communication type.
|
||||
pub enum CommunicationType {
|
||||
/// Anhörung
|
||||
A,
|
||||
/// Bußgeldbescheid
|
||||
BU,
|
||||
/// Gdb
|
||||
Gdb,
|
||||
/// Geburt
|
||||
GE,
|
||||
/// Hochzeit
|
||||
HO,
|
||||
/// Kündigung
|
||||
KD,
|
||||
/// Kaufvertrag
|
||||
KV,
|
||||
/// Lohn
|
||||
LO,
|
||||
/// Nachbar
|
||||
NA,
|
||||
/// Rente
|
||||
RE,
|
||||
/// Unfallflucht
|
||||
UF,
|
||||
/// Unterhalt
|
||||
UH,
|
||||
/// Unfall
|
||||
UN,
|
||||
/// Vodafone
|
||||
VF,
|
||||
/// Vermieter
|
||||
VM,
|
||||
/// Verwaltungsrecht
|
||||
VW,
|
||||
/// Zeugins
|
||||
ZE,
|
||||
/// Typ is unspecified
|
||||
XX
|
||||
}
|
||||
|
||||
impl Default for CommunicationType {
|
||||
fn default() -> Self { CommunicationType::XX }
|
||||
}
|
||||
|
||||
/// Status of a given policy data element.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub enum Status {
|
||||
/// Active -> the policy is active an supported
|
||||
Active,
|
||||
/// Inactive -> the policy is inactive or resigned
|
||||
Inactive
|
||||
}
|
||||
|
||||
impl Default for Status {
|
||||
fn default() -> Self { Status::Active }
|
||||
}
|
||||
|
||||
/// A communication type describes possible classifications of customer calls.
|
||||
/// If the type isn't selected, the default will be 'unclassified -> XX'.
|
||||
#[derive(Default, Deserialize, Serialize)]
|
||||
pub struct CommunicationData {
|
||||
/// pub communication_type: CommunicationType,
|
||||
pub communication_type: String,
|
||||
/// A literal name describing the selected communication type
|
||||
pub communication_name: String
|
||||
}
|
||||
|
||||
/// CSV Export
|
||||
/// The structure elements are required for an export to a comma seperated text list.
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct CsvExportRecord {
|
||||
/// Versicherungsschein Code
|
||||
pub policy_code: String,
|
||||
/// Versicherungsscheinnummer (10-stellig, numerisch)
|
||||
pub policy_number: u32,
|
||||
/// Anrufer: "Vorname, Nachname"
|
||||
pub policy_holder: String,
|
||||
/// Sachverhalt: "Kurzschilderung"
|
||||
pub facts: String,
|
||||
/// Schadensart: "harm_name (harm_id)"
|
||||
pub harm_type: String,
|
||||
/// communication_type => Kommunikationszeichen: "(communication_name)"
|
||||
pub communication_name: String,
|
||||
/// ra_hotline => RA_Hotline: Kanzlei Laqua, Kanzlei Buschbell, Kanzlei DAH, Kanzlei Hiedemann
|
||||
pub ra_hotline: String, // const "Kanzlei Hiedemann",
|
||||
/// ivr_comment => Haftungs-/Deckungskommentar; #IVR (ggf. ergänzt um das Beratungsergebnis)
|
||||
pub ivr_comment: String,
|
||||
}
|
||||
|
||||
/// Harm data are list/collections of harm types. You may toggle them to an unselected state.
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct HarmData {
|
||||
/// Liste der Schadensdaten
|
||||
pub harm_data: Vec<HarmType>,
|
||||
/// Status der Schadenliste
|
||||
//pub name: String,
|
||||
pub selected: bool
|
||||
}
|
||||
|
||||
/// Harm types are destincted by a type code.
|
||||
/// The type code represents the unique harm identifier, bound with a literal name.
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct HarmType {
|
||||
/// Kennzeichen des Schadenstyps
|
||||
// Schadenersatz-RS im Verkehrsbereich (RS112)
|
||||
// Ordnungswidrigkeits-RS im Verkehrsbereich (RS122)
|
||||
// Straf-RS im Verkehrsbereich (RS121)
|
||||
// Vertrags-RS im Verkehrsbereich (RS118)
|
||||
// Vertrags-RS im Privatbereich (RS218)
|
||||
// Arbeits-RS im Berufsbereich (RS315)
|
||||
// WuG-RS im Privatbereich (RS220)
|
||||
// Sozialgerichts-RS im Privatbereich (RS216)
|
||||
// Rechtsschutz im Familien- und Erbrecht (RS217)
|
||||
// Wagnis nicht versicherbar / versichert (RS999)
|
||||
pub harm_type: String,
|
||||
/// Beschreibung des Schadenstyps
|
||||
pub harm_name: String,
|
||||
}
|
||||
|
||||
/// Structure used to verify a policy data element.
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct PolicyCheck {
|
||||
/// Versicherungsschein-Prüfnummer
|
||||
pub policy_check_number: String,
|
||||
/// Referenz zum Versicherungsschein-Typ
|
||||
pub dion: u8,
|
||||
/// Referenz zum Versicherungsschein-Typ
|
||||
pub policy_code: PolicyCode,
|
||||
/// Referenz zur Versicherungsschein-Nummer
|
||||
pub policy_number: usize,
|
||||
/// Validitätsergebnis
|
||||
pub policy_number_status: Status
|
||||
}
|
||||
|
||||
impl PolicyCheck {
|
||||
}
|
||||
|
||||
// #[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
// pub struct PolicyCheckList {
|
||||
// pub title: String,
|
||||
// pub list: Vec<PolicyCheck>
|
||||
// }
|
||||
|
||||
// impl PolicyCheckList {
|
||||
// pub fn new(title: impl Into<String>) -> Self {
|
||||
// PolicyCheckList {
|
||||
// title: title.into(),
|
||||
// ..Default::default()
|
||||
// }
|
||||
// }
|
||||
|
||||
/// Structure collecting policy data elements
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct PolicyList {
|
||||
/// Bescheibung der Versicherungsdatenliste
|
||||
pub name: String,
|
||||
/// Listenelemente der Versicherungsdatendaten
|
||||
pub policy_list: Vec<PolicyDataList>,
|
||||
}
|
||||
|
||||
/// implements helper methods, that manage lists of policy data collections
|
||||
impl PolicyList {
|
||||
/// Index auf Versicherungsliste zurückgeben (unveränderbar)
|
||||
pub fn get(&self, index: usize) -> Option<&PolicyDataList> {
|
||||
self.policy_list.get(index)
|
||||
}
|
||||
|
||||
/// Index auf Versicherungsliste zurückgeben (veränderbar)
|
||||
pub fn get_mut(&mut self, index: usize) -> Option<&mut PolicyDataList> {
|
||||
self.policy_list.get_mut(index)
|
||||
}
|
||||
|
||||
/// Neuer Eintrag am Anfang der Liste einfügen.
|
||||
pub fn insert_front(&mut self, policy_list: PolicyDataList) {
|
||||
self.policy_list.insert(0, policy_list);
|
||||
}
|
||||
|
||||
/// Prüfung ob Versicherungsliste keine Elemente enthält.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.policy_list.is_empty()
|
||||
}
|
||||
|
||||
/// Berechnet die Anzahl der Versicherungslisten Elemente.
|
||||
pub fn len(&self) -> usize {
|
||||
self.policy_list.len()
|
||||
}
|
||||
|
||||
/// Neuen Versicherungslisten-Namen erzeugen
|
||||
pub fn new(name: impl Into<String>) -> Self {
|
||||
PolicyList {
|
||||
name: name.into(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// Element der Versicherungsliste anfügen
|
||||
pub fn push(&mut self, policy_list: PolicyDataList) {
|
||||
self.policy_list.push(policy_list);
|
||||
}
|
||||
|
||||
/// Element der Versicherungsliste löschen
|
||||
pub fn remove(&mut self, index: usize) -> PolicyDataList {
|
||||
self.policy_list.remove(index)
|
||||
}
|
||||
}
|
||||
|
||||
/// Structure collects policy data elements.
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct PolicyDataList {
|
||||
/// Verfalldatum des Versicherungslisten Elements
|
||||
pub date_valid_until: Option<NaiveDateTime>,
|
||||
/// Elemente des Versicherungsobjektes
|
||||
pub policy_data: Vec<PolicyData>,
|
||||
/// Name der Versicherungsliste
|
||||
pub name: String,
|
||||
/// Status der Versicherungsliste
|
||||
pub selected: bool
|
||||
}
|
||||
|
||||
/// implements the helper methods, to manage policy data collections.
|
||||
impl PolicyDataList {
|
||||
/// Prüfung ob Versicherungselemente .
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.policy_data.is_empty()
|
||||
}
|
||||
|
||||
/// Versicherungselement am Anfang anfügen
|
||||
pub fn insert_front(&mut self, policy_data: PolicyData) {
|
||||
self.policy_data.insert(0, policy_data);
|
||||
}
|
||||
|
||||
/// Index zum Versicherungselement zurückgeben (unveränderbar)
|
||||
pub fn get(&self, index: usize) -> Option<&PolicyData> {
|
||||
self.policy_data.get(index)
|
||||
}
|
||||
|
||||
/// Index zum Versicherungselement zurückgeben (veränderbar)
|
||||
pub fn get_mut(&mut self, index: usize) -> Option<&mut PolicyData> {
|
||||
self.policy_data.get_mut(index)
|
||||
}
|
||||
|
||||
/// Berechnet die Anzahl der Versicherungselemente.
|
||||
pub fn len(&self) -> usize {
|
||||
self.policy_data.len()
|
||||
}
|
||||
|
||||
/// Neues Versicherungselement erstellen.
|
||||
pub fn new(name: impl Into<String>) -> Self {
|
||||
// the new inserted element will be active by default
|
||||
PolicyDataList {
|
||||
date_valid_until: None,
|
||||
name: name.into(),
|
||||
selected: true,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// Versicherungselement anfügen
|
||||
pub fn push(&mut self, policy_data: PolicyData) {
|
||||
self.policy_data.push(policy_data);
|
||||
}
|
||||
|
||||
/// Versicherungselement löschen
|
||||
pub fn remove(&mut self, index: usize) -> PolicyData {
|
||||
self.policy_data.remove(index)
|
||||
}
|
||||
}
|
||||
|
||||
/// Structure representing a policy data element
|
||||
/// This structure groups a set of fields that describes a policy number.
|
||||
/// The data are regularily updated via a data import from a comma seperated
|
||||
/// text file (csv file).
|
||||
/// Since we parse the source record fields to rust types (serde deserialize)
|
||||
/// the field order in our struct must meet the data field order in the source!
|
||||
/// We do use field attribute to precisely rename the source fields (header names)
|
||||
/// to our target rust field names.
|
||||
/// Referenz: POLLFNR_WOECHENTLICH.txt ->
|
||||
/// Header 'DION VERS POLLFNR'
|
||||
/// Record '1 AS 1515735810'
|
||||
// DION: Allianz id => len = 1??
|
||||
// VERS: policy_code => enum(AS; ??)
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct PolicyData {
|
||||
/// Erstellungsdatum
|
||||
pub date_inserted: Option<NaiveDateTime>,
|
||||
/// Allianz Dion
|
||||
#[serde(rename = "DION")]
|
||||
pub dion: u8,
|
||||
/// Kennzeichen des Allianz Versicherungscodes
|
||||
#[serde(rename = "VERS")]
|
||||
pub policy_code: PolicyCode,
|
||||
/// Versicherungsscheinnummer (10stellig, numerisch)
|
||||
#[serde(rename = "POLLFNR")]
|
||||
pub policy_number: usize,
|
||||
/// Status des Versicherungsscheins
|
||||
pub status: Option<Status>
|
||||
}
|
||||
|
||||
/// Policy Number Set
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct AllianzPolicyNumber {
|
||||
/// Allianz Dion
|
||||
#[serde(rename = "DION")]
|
||||
pub dion: u8,
|
||||
/// Kennzeichen des Allianz Versicherungstyps
|
||||
#[serde(rename = "VERS")]
|
||||
pub policy_code: String,
|
||||
/// 10-stellige Versicherungsscheinnummer (numerisch)
|
||||
#[serde(rename = "POLLFNR")]
|
||||
pub policy_number: usize
|
||||
}
|
||||
|
||||
// /// List of Allianz Policy Number records
|
||||
// /// The structure elements are required for an export to a comma seperated text list.
|
||||
// #[derive(Default, Debug, Deserialize)]
|
||||
// pub struct AllianzPolicyNumberList {
|
||||
// records: Vec<AllianzPolicyNumber>
|
||||
// }
|
||||
|
||||
into_property_source!(PolicyCheck);
|
||||
into_property_source!(PolicyDataList);
|
||||
into_property_source!(PolicyList);
|
||||
43
advotracker/src/lib.rs
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: 0BSD, MIT
|
||||
*/
|
||||
|
||||
//#![warn(missing_docs, rust_2018_idioms, rust_2018_compatibility)]
|
||||
#![warn(rust_2018_idioms, rust_2018_compatibility)]
|
||||
|
||||
//! advotracker
|
||||
//! Supports lawyers to capture relevant data encountered during an
|
||||
//! online legal advice.
|
||||
//! This is the frontend componet that communicates to the backend `advotrackerd`.
|
||||
//!
|
||||
//! The crate is called `advotracker` and you can depend on it via cargo:
|
||||
//!
|
||||
//! ```ini
|
||||
//! [dependencies]
|
||||
//! advotracker = { version = "~0.1" }
|
||||
//! ```
|
||||
//!
|
||||
//! WIP: provide a workflow image
|
||||
//!
|
||||
|
||||
// /// The client specific services
|
||||
// pub mod clients;
|
||||
|
||||
/// provides helper functions to manage orbtk callbacks
|
||||
pub mod callbacks;
|
||||
|
||||
/// provides data definitions
|
||||
pub mod data;
|
||||
|
||||
/// provides orbtk widget structures
|
||||
pub mod widgets;
|
||||
|
||||
/// provides services
|
||||
pub mod services;
|
||||
|
||||
// /// Provide test data
|
||||
// #[cfg!Test]
|
||||
// pub mod data;
|
||||
149
advotracker/src/main.rs
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
//#[macro_use]
|
||||
//extern crate lazy_static;
|
||||
|
||||
//use chrono::{Local, DateTime};
|
||||
//use serde::{Deserialize, Serialize};
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
//use std::process;
|
||||
//use std::{error::Error, process};
|
||||
//use std::collections::HashMap;
|
||||
use tracing::{debug, trace, Level};
|
||||
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
||||
//use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
||||
|
||||
// The Main view
|
||||
use advotracker::widgets::main_view;
|
||||
|
||||
mod parse_args;
|
||||
|
||||
/// respect environment variables set in .env files
|
||||
/// located in the current call directory
|
||||
/// this is primarily used in testing scenarios (eg. debugging)
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct Environment {
|
||||
test_lang: String,
|
||||
log: String,
|
||||
}
|
||||
|
||||
//#[cfg(feature = "light-theme")]
|
||||
static STYLESHEET: &'static str = include_str!("../resources/stylesheets/advotracker.css");
|
||||
//static STYLESHEET: &'static str = include_str!("../resources/stylesheets/policyholder-check.css");
|
||||
|
||||
fn get_theme() -> ThemeValue {
|
||||
//ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
||||
ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
||||
.extension_css(STYLESHEET)
|
||||
.build()
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
use dotenv::dotenv;
|
||||
use parse_args::parse_args;
|
||||
//use std::process;
|
||||
//use std::sync::Arc;
|
||||
use tracing_subscriber::fmt;
|
||||
use viperus::Viperus;
|
||||
|
||||
//use advotracker::callbacks::policy_check::is_valid;
|
||||
//use advotracker::data::structures::{PolicyCode, PolicyDataList, PolicyList};
|
||||
// WIP: can't push pointer by value to widget, call import in widget callback for now
|
||||
//use advotracker::services::imports::allianzdirectcall::*;
|
||||
|
||||
//static DEFAULT_FILTER: &str = concat!(module_path!(), "=", "trace");
|
||||
|
||||
// initialize the tracing subsystem
|
||||
// a drop in replacement for classical logging
|
||||
// reference: https://tokio.rs/blog/2019-08-tracing/
|
||||
let span = tracing::span!(Level::TRACE, "advotracker");
|
||||
let _enter = span.enter();
|
||||
let subscriber = fmt::Subscriber::builder()
|
||||
//.with_env_filter("trace")
|
||||
.with_max_level(tracing::Level::INFO)
|
||||
.finish();
|
||||
|
||||
tracing::subscriber::with_default(subscriber, || {
|
||||
// get system environment
|
||||
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
||||
trace!(target: "csv-test", message = "main", state = "started");
|
||||
trace!(target: "csv-test", environment = "system", lang = ?lang);
|
||||
|
||||
// testing environment: read from .env file
|
||||
dotenv().ok();
|
||||
match envy::from_env::<Environment>() {
|
||||
Ok(environment) => {
|
||||
if environment.test_lang != lang { lang = environment.test_lang; }
|
||||
},
|
||||
Err(e) => { debug!(target: "advotracker", "{}", e); }
|
||||
}
|
||||
// how to handle unumplemented lang resources??
|
||||
trace!(target: "csv-test", environment = "envy");
|
||||
|
||||
// initialize viperus structure
|
||||
let mut viperus = Viperus::new();
|
||||
|
||||
// lazy_static! {
|
||||
// static ref VIPERUS: Viperus + 'static = { let mut viperus = Viperus::new(); };
|
||||
// static ref VIPERUS_COUNT: usize = VIPERUS.len();
|
||||
// }
|
||||
// lazy_static! {
|
||||
// static ref HASHMAP: HashMap<usize, PolicyCode> = {
|
||||
// let mut policy_numbers = HashMap::new();
|
||||
// policy_numbers
|
||||
// }
|
||||
// static ref COUNT: usize = HASHMAP.len();
|
||||
// println!("The map has {} entries.", *COUNT);
|
||||
// }
|
||||
|
||||
// parse commandline arguments
|
||||
trace!(target: "csv-test", process = "parse.arguments", state = "started");
|
||||
|
||||
let _ = parse_args(&mut viperus);
|
||||
|
||||
trace!(target: "csv-test", process = "parse_argument", state = "finished");
|
||||
//trace!(target: "Viperus", "Count of Config parameters: {:?}", VIPERUS_COUNT);
|
||||
|
||||
// main tasks
|
||||
trace!(target: "csv-test", process = "main", state = "started");
|
||||
|
||||
// moved to callback: checkview_state.rs
|
||||
|
||||
Application::from_name("rzerres.advotracker")
|
||||
.window(move |ctx| {
|
||||
Window::new()
|
||||
//.title("OrbTk - Policyholder checker")
|
||||
.title("AdvoTracker - Versicherungsnummern")
|
||||
.position((500.0, 100.0))
|
||||
.size(580.0, 320.0)
|
||||
.min_width(460.0)
|
||||
.min_height(180.0)
|
||||
.resizeable(true)
|
||||
.theme(get_theme())
|
||||
.child(main_view::MainView::new().build(ctx))
|
||||
.build(ctx)
|
||||
})
|
||||
.run();
|
||||
|
||||
trace!(target: "csv-test", process = "main", state = "finished");
|
||||
});
|
||||
|
||||
Ok(())
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
220
advotracker/src/parse_args.rs
Normal file
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
// parse CLI commandline arguments with clap
|
||||
use clap::{crate_authors, crate_description, crate_name, crate_version, App, Arg};
|
||||
|
||||
//use log::{debug, info, trace, warn};
|
||||
use std::env;
|
||||
use tracing::trace;
|
||||
use viperus::Viperus;
|
||||
|
||||
/// Parse the commandline arguments and preset default values
|
||||
/// Precedence: defaults -> config-file -> environment -> commandline
|
||||
pub fn parse_args(viperus: &mut Viperus) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if cfg!(feature = "global") {
|
||||
trace!(target: "Viperus", "Viperus feature 'global' enabled.");
|
||||
//println!("Lasy static: 'VIPERUS' is accessible globaly");
|
||||
}
|
||||
|
||||
if cfg!(feature = "fmt-clap") {
|
||||
trace!(target: "Viperus", "Viperus feature 'fmt-clap' enabled.");
|
||||
//println!("Using feature fmt-clap");
|
||||
}
|
||||
|
||||
// preset default key/value pairs (lowest priority)
|
||||
viperus.add_default("config_file", String::from("csv_import.ron"));
|
||||
viperus.add_default("import_file", String::from("POLLFNR_WOECHENTLICH.txt"));
|
||||
viperus.add_default("export_file", String::from(""));
|
||||
viperus.add_default("test_policy_number", 123456789);
|
||||
viperus.add_default("to_email_address_file", String::from("Allianz RA-Hotline <smr-rahotline@allianz.de>"));
|
||||
viperus.add_default("from_email_address_file", String::from("Allianz-Hotline RA-Hiedemann <azhotline@hiedemann.de>"));
|
||||
//viperus.add_default("username", String::from("nctalkbot"));
|
||||
//viperus.add_default("password", String::from("botpassword"));
|
||||
viperus.add_default("verbose", 0);
|
||||
|
||||
// CLI arguments are defined inline
|
||||
let matches = App::new("advotracker")
|
||||
.name(crate_name!())
|
||||
.version(crate_version!())
|
||||
.author(crate_authors!())
|
||||
.about(crate_description!())
|
||||
.after_help("
|
||||
Testprogramm: Allianz Online-Beratung Im/Export CSV-Daten
|
||||
Direct-Call via IVR-System (Interactive Voice Response)
|
||||
SMR Deckungssummen-Prüfung: 089 92529 60211
|
||||
SMR Unerledigt: 089 92529 60222")
|
||||
.template(
|
||||
"\
|
||||
{bin} v{version}
|
||||
{about}
|
||||
|
||||
{all-args}
|
||||
|
||||
(C) 2020 {author}
|
||||
{after-help}",
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("configFile")
|
||||
.short("c")
|
||||
.long("configFile")
|
||||
.value_name("FILE")
|
||||
.help("Select a config file")
|
||||
.default_value("csv_import.ron")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("importFile")
|
||||
.short("i")
|
||||
.long("importFile")
|
||||
.help("Select source file for the csv-import")
|
||||
.default_value("POLLFNR_WOECHENTLICH.txt")
|
||||
//.default_value("POLLFNR_MINI.txt")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("exportFile")
|
||||
.short("e")
|
||||
.long("exportFile")
|
||||
.help("Select target file for the csv-export")
|
||||
.default_value("RA-Hiedemann_DirectCall.txt")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("fromEmailAddress")
|
||||
.short("f")
|
||||
.long("fromEmailAddress")
|
||||
.help("Select the sender email-address (From:)")
|
||||
.default_value("Allianz-Hotline RA-Hiedemann <azhotline@hiedemann.de>")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("toEmailAddress")
|
||||
.short("t")
|
||||
.long("toEmailAddress")
|
||||
.help("Select the target email-address (To:)")
|
||||
.default_value("Allianz RA-Hotline <smr-rahotline@allianz.de>")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("testPolicyNumber")
|
||||
.short("p")
|
||||
.long("testPolicyNumber")
|
||||
.help("Test validity of given policy number")
|
||||
//.default_value("")
|
||||
.takes_value(true),
|
||||
)
|
||||
// .arg(
|
||||
// Arg::with_name("username")
|
||||
// .short("u")
|
||||
// .long("username")
|
||||
// .help("Sets username")
|
||||
// .takes_value(true),
|
||||
// )
|
||||
// .arg(
|
||||
// Arg::with_name("password")
|
||||
// .short("P")
|
||||
// .long("password")
|
||||
// .help("Sets password")
|
||||
// .takes_value(true),
|
||||
// )
|
||||
.arg(
|
||||
Arg::with_name("verbose")
|
||||
.short("v")
|
||||
.long("verbose")
|
||||
.help("Sets verbosity level")
|
||||
.multiple(true),
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
if matches.occurrences_of("verbose") > 0 {
|
||||
// clap is using i64, viperus i32
|
||||
let n = matches.occurrences_of("verbose") as i32;
|
||||
viperus.add("verbose", n);
|
||||
}
|
||||
|
||||
// preset the prefix for relevant environment variables ("ADVOTRACKER_")
|
||||
let mut env_prefix: String = crate_name!().to_uppercase();
|
||||
env_prefix.push_str("_");
|
||||
viperus.set_env_prefix(&env_prefix);
|
||||
|
||||
// respect dotenv environment (e.g for testing)
|
||||
// -> overwrites the preset default values
|
||||
//println!(
|
||||
// "RUST_LOG={}",
|
||||
// dotenv::var("RUST_LOG").unwrap_or_else(|_| String::from("None"))
|
||||
//);
|
||||
|
||||
// enable caching and automatic update of environment values
|
||||
viperus.cache(true);
|
||||
viperus.automatic_env(true);
|
||||
|
||||
// load user selected call arguments
|
||||
// -> overwrites values given via environment variables
|
||||
viperus.load_clap(matches)?;
|
||||
|
||||
// bond the clap names to camel_case rust variable names
|
||||
viperus.bond_clap("configFile", "config_file");
|
||||
viperus.bond_clap("importFile", "import_file");
|
||||
viperus.bond_clap("exportFile", "export_file");
|
||||
viperus.bond_clap("toEmailAddress", "to_email_address");
|
||||
viperus.bond_clap("fromEmailAddress", "from_email_address");
|
||||
viperus.bond_clap("testPolicyNumber", "test_policy_number");
|
||||
//viperus.bond_clap("username", "username");
|
||||
//viperus.bond_clap("password", "password");
|
||||
viperus.bond_clap("verbose", "verbose");
|
||||
|
||||
trace!("verbose {:?}", viperus.get::<i32>("verbose").unwrap());
|
||||
if viperus.get::<i32>("verbose").unwrap() > 0 {
|
||||
println!(
|
||||
"config_file: {:?}",
|
||||
viperus.get::<String>("config_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"import_file: {:?}",
|
||||
viperus.get::<String>("import_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"export_file: {:?}",
|
||||
viperus.get::<String>("export_file").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"to_email_address: {:?}",
|
||||
viperus.get::<String>("to_email_address").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"from_email_address: {:?}",
|
||||
viperus.get::<String>("from_email_address").unwrap_or_default()
|
||||
);
|
||||
println!(
|
||||
"test_policy_number: {:?}",
|
||||
viperus.get::<i32>("test_policy_number").unwrap_or_default()
|
||||
);
|
||||
// println!(
|
||||
// "username: {:?}",
|
||||
// viperus.get::<String>("username").unwrap_or_default()
|
||||
// );
|
||||
// println!(
|
||||
// "password: {:?}",
|
||||
// viperus.get::<String>("password").unwrap_or_default()
|
||||
// ); // only for testing now
|
||||
|
||||
println!(
|
||||
"verbosity level: {:?}",
|
||||
viperus.get::<i32>("verbose").unwrap_or_default()
|
||||
);
|
||||
}
|
||||
|
||||
if viperus.get::<i32>("verbose").unwrap() > 1 {
|
||||
println!("\nEnvironment:");
|
||||
for (key, value) in env::vars() {
|
||||
println!("{}={}", key, value);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
36
advotracker/src/services/exports/allianzdirectcall.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
//use chrono::{Local, DateTime};
|
||||
use std::error::Error;
|
||||
//use std::collections::HashMap;
|
||||
use tracing::trace;
|
||||
|
||||
//use crate::db::redis;
|
||||
//use crate::data::structures::{PolicyCode, PolicyDataList, PolicyData};
|
||||
|
||||
/// export as csv format
|
||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||
/// https://blog.burntsushi.net/csv/
|
||||
pub fn export(p: &mut String, lang: &String) -> Result<(), Box<dyn Error>> {
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
//use std::ffi::OsStr;
|
||||
|
||||
trace!(target: "advotrackerd", process = "csv-export", state = "started");
|
||||
|
||||
// Note: slash syntax also works on Windows!
|
||||
let path = Path::new(p);
|
||||
|
||||
// open the file
|
||||
let file = File::open(path)?;
|
||||
|
||||
trace!(target: "csv.export", extension = ?path.extension(), file = ?file);
|
||||
trace!(target: "advotrackerd", process = "csv-export", state = "finished");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
9
advotracker/src/services/exports/mod.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// Exporting Allianz DirecCall data
|
||||
pub mod allianzdirectcall;
|
||||
107
advotracker/src/services/imports/allianzdirectcall.rs
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use chrono::{Local, DateTime};
|
||||
use std::error::Error;
|
||||
use std::collections::HashMap;
|
||||
use tracing::trace;
|
||||
|
||||
//use crate::db::redis;
|
||||
use crate::data::structures::{PolicyCode, PolicyDataList, PolicyData};
|
||||
//use crate::data::structures::PolicyDataList;
|
||||
|
||||
/// import AllianzDirectCall data from a csv delimeted file
|
||||
/// save records to redis backend
|
||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||
/// https://blog.burntsushi.net/csv/
|
||||
pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
||||
-> Result<usize, Box<dyn Error>> {
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
use std::ffi::OsStr;
|
||||
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "advotrackerd", process = "import", state = "started", date_start = ?dt_start.to_string());
|
||||
|
||||
// Note: slash syntax also workd on Windows!
|
||||
let path = Path::new(p);
|
||||
|
||||
// must be a readable file
|
||||
trace!(target: "advotrackerd", path = ?path);
|
||||
assert_eq!(path.is_file(), true);
|
||||
|
||||
// only accept files with '.txt' extensions
|
||||
let extension = path.extension();
|
||||
assert_eq!(extension, Some(OsStr::new("txt")));
|
||||
|
||||
// open the file
|
||||
let file = File::open(path)?;
|
||||
trace!(target: "advotrackerd", extension = ?extension, file = ?file);
|
||||
|
||||
// Build the CSV reader
|
||||
let mut csv_reader = csv::ReaderBuilder::new()
|
||||
.has_headers(true)
|
||||
.delimiter(b' ')
|
||||
//.comment(Some(b'#'))
|
||||
//.flexible(true)
|
||||
.from_reader(file);
|
||||
{
|
||||
// We nest this call in its own scope because of lifetimes.
|
||||
let headers = csv_reader.headers()?;
|
||||
trace!(target: "advotrackerd", header = ?headers);
|
||||
}
|
||||
|
||||
// Iterate over each record, deserialize und write to our structures
|
||||
let mut count = 0;
|
||||
for result in csv_reader.deserialize() {
|
||||
// The iterator yields Result<StringRecord, Error>, so we check the
|
||||
// error here.
|
||||
let record: PolicyData = result?;
|
||||
//if verbose > 3 {
|
||||
// println!("{:?}", record);
|
||||
//}
|
||||
|
||||
// WIP: write to redis backend
|
||||
// append the policy_number to the HashMap
|
||||
policy_numbers.insert(record.policy_number, record.policy_code);
|
||||
|
||||
// push record as new vector elements
|
||||
data_list.push(record);
|
||||
|
||||
count +=1;
|
||||
};
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
|
||||
trace!(target: "advotrackerd", record_count = ?count, duration = ?duration);
|
||||
|
||||
// Tests
|
||||
// Takes a reference and returns Option<&V>
|
||||
let my_policy_numbers : [usize; 2] = [1511111111, 9999999993];
|
||||
assert_eq!(my_policy_numbers, [1511111111, 9999999993]);
|
||||
for p in &my_policy_numbers {
|
||||
match policy_numbers.get(&p) {
|
||||
Some(policy_code) => {
|
||||
//println!("Test: Policy-Number {:?} => Policy-Type {:?}, as expected!",
|
||||
// p, policy_code);
|
||||
trace!(target: "advotrackerd",
|
||||
record_test = ?p, status = "success", policy_typ = ?policy_code);
|
||||
},
|
||||
_ => {
|
||||
//println!("Test: Policy-Number {:?} => not valid, can't dereference the Policy-Type as expected", p),
|
||||
trace!(target: "advotrackerd", record_fail_test = ?p, status = "failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trace!(target: "advotrackerd", process = "import", state = "finished", date_stop = ?dt_end.to_string());
|
||||
|
||||
Ok(count)
|
||||
}
|
||||
23
advotracker/src/services/imports/csv-test.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use std::error::Error;
|
||||
use std::io;
|
||||
use std::process;
|
||||
|
||||
/// import from csv format (Standard in)
|
||||
fn import() -> Result<(), Box<dyn Error>> {
|
||||
// Build the CSV reader and iterate over each record.
|
||||
let mut csv_reader = csv::Reader::from_reader(io::stdin());
|
||||
for result in csv_reader.records() {
|
||||
// The iterator yields Result<StringRecord, Error>, so we check the
|
||||
// error here.
|
||||
let record = result?;
|
||||
println!("{:?}", record);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if let Err(err) = import() {
|
||||
println!("error running example: {}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
9
advotracker/src/services/imports/mod.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// Importing Allianz DirecCall data
|
||||
pub mod allianzdirectcall;
|
||||
12
advotracker/src/services/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// advotracker import modules
|
||||
pub mod imports;
|
||||
|
||||
/// advotracker import modules
|
||||
pub mod exports;
|
||||
52
advotracker/src/widgets/main_view.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::data::structures::PolicyCheck;
|
||||
use crate::widgets::policycheck_view::PolicyCheckView;
|
||||
|
||||
widget!(MainView {
|
||||
// policy_list: PolicyList,
|
||||
// policy_data_list: PolicyDataList,
|
||||
// policylist_view: u32,
|
||||
// policydata_view: u32,
|
||||
//policycheck_view: u32
|
||||
policycheck_view: PolicyCheck
|
||||
});
|
||||
|
||||
impl Template for MainView {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||
let policycheck_view = PolicyCheckView::new()
|
||||
//.policy_number_count(0)
|
||||
//.policylist_view(id)
|
||||
.build(ctx);
|
||||
|
||||
// let policylist_view = PolicyListView::new()
|
||||
// .back_entity(policycheck_view.0)
|
||||
// .policydata_view(id)
|
||||
// .policylist_view(id)
|
||||
// .policy_list_count(id)
|
||||
// .build(ctx);
|
||||
|
||||
// let policydata_view = PolicyDataView::new()
|
||||
// .back_entity(policylist_view.0)
|
||||
// .policylist_view(id)
|
||||
// .visibility("collapsed")
|
||||
// .build(ctx);
|
||||
|
||||
self.name("MainView")
|
||||
.policycheck_view(PolicyCheck::default())
|
||||
// //.policycheck_view(0)
|
||||
// .policydata_view(policydata_view.0)
|
||||
// //.policylist_view(PolicyList::default())
|
||||
// .policylist_view(policylist_view.0)
|
||||
// .child(policydata_view)
|
||||
// .child(policylist_view)
|
||||
.child(policycheck_view)
|
||||
}
|
||||
}
|
||||
15
advotracker/src/widgets/mod.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
/// The starting point (Main View)
|
||||
pub mod main_view;
|
||||
|
||||
/// The policy check wigdet
|
||||
pub mod policycheck_view;
|
||||
|
||||
// /// The policy lists widget
|
||||
// pub mod policylist_view;
|
||||
72
advotracker/src/widgets/policycheck_menu.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
use orbtk::prelude::*;
|
||||
//use orbtk::theme::vector_graphics::material_icons_font;
|
||||
|
||||
use crate::data::keys::*;
|
||||
|
||||
//pub struct PolicyMenu {
|
||||
// pub isvalid: bool
|
||||
//}
|
||||
|
||||
widget!(
|
||||
PolicyCheckMenu {
|
||||
isvalid: String
|
||||
}
|
||||
);
|
||||
|
||||
impl Template for PolicyCheckMenu {
|
||||
fn template(self, _id: Entity, ctx: &mut BuildContext) -> Self {
|
||||
self.name("PolicyCheckMenu").child(
|
||||
Stack::new()
|
||||
.orientation("vertical")
|
||||
.spacing(8.0)
|
||||
.h_align("center")
|
||||
.child(
|
||||
Stack::new()
|
||||
.orientation("horizontal")
|
||||
.spacing(4.0)
|
||||
.h_align("start")
|
||||
.child(
|
||||
Button::new()
|
||||
.element("button-user")
|
||||
.icon("")
|
||||
.min_width(32.0)
|
||||
.max_width(32.0)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.element("menu-user")
|
||||
.min_width(80.0)
|
||||
.max_width(180.0)
|
||||
.text("angemeldeter Benutzer")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Stack::new()
|
||||
.orientation("horizontal")
|
||||
.spacing(4.0)
|
||||
.h_align("start")
|
||||
.child(
|
||||
Button::new()
|
||||
.element("button-user")
|
||||
.icon("")
|
||||
.min_width(32.0)
|
||||
.max_width(32.0)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.element("menu-quit")
|
||||
.min_width(80.0)
|
||||
.max_width(180.0)
|
||||
.text("Quit")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
}
|
||||
}
|
||||
380
advotracker/src/widgets/policycheck_view.rs
Normal file
@@ -0,0 +1,380 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
data::structures::PolicyCheck,
|
||||
data::keys::*,
|
||||
callbacks::policycheck_state::*,
|
||||
//policycheck_state::{Action, PolicyCheckState},
|
||||
};
|
||||
|
||||
|
||||
// Macro that initializes the widget structures/variables for our view (essential!)
|
||||
widget!(
|
||||
/// Dialog to enter a policy identifier/number.
|
||||
/// This identifier is checked agains a map of valid policy codes.
|
||||
PolicyCheckView<PolicyCheckState> {
|
||||
policy_check: PolicyCheck,
|
||||
policy_check_title: String16,
|
||||
policy_data_count: u32
|
||||
}
|
||||
);
|
||||
|
||||
// The template implementation for our View
|
||||
impl Template for PolicyCheckView {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||
let policy_check_menu_text_block = TextBlock::new()
|
||||
.foreground("#3b434a")
|
||||
.text("Help Menu")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_menu_button = Button::new()
|
||||
.id(ID_POLICY_CHECK_MENU_BUTTON)
|
||||
.margin((0.0, 0.0, 12.0, 12.0))
|
||||
.icon(material_icons_font::MD_MENU)
|
||||
.class(CLASS_ICON_ONLY)
|
||||
//.attach(Grid::row(0))
|
||||
.attach(Grid::column(2))
|
||||
.margin((8.0, 0.0, 2.0, 0.0))
|
||||
//.text("Menu Button")
|
||||
//.min_size(8.0, 8.0)
|
||||
.min_size(16.0, 16.0)
|
||||
.h_align("end")
|
||||
//.v_align("center")
|
||||
//.enabled(true)
|
||||
.on_mouse_down(|_, _| true)
|
||||
//.child(policycheck_menu_container)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::OpenMenu(policy_check_menu_text_block));
|
||||
true
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
|
||||
let policy_data_count_block = TextBlock::new()
|
||||
.id(ID_POLICY_DATA_COUNT_BLOCK)
|
||||
//.class(CLASS_TEXT_BLOCK)
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.margin((0., 0., 0., 16.))
|
||||
.h_align("end")
|
||||
.v_align("end")
|
||||
.enabled(true)
|
||||
.min_width(250.0)
|
||||
.min_height(45.0)
|
||||
.text("Anzahl Prüfsätze:")
|
||||
.build(ctx);
|
||||
|
||||
// let policy_check_menu_container = Container::new()
|
||||
// .id(ID_POLICY_CHECK_MENU_CONTAINER)
|
||||
// .class(CLASS_MENU)
|
||||
// .attach(Grid::row(3))
|
||||
// .attach(Grid::column(8))
|
||||
// .margin((0.0, 0.0, 4.0, 0.0))
|
||||
// .enabled(false)
|
||||
// .min_size(120.0, 180.0)
|
||||
// .v_align("center")
|
||||
// .on_click(move |ctx, _| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::NewEntry(quit));
|
||||
// true
|
||||
// })
|
||||
// .build(ctx);
|
||||
|
||||
// let policycheck_menu_container = Container::new()
|
||||
// .id(ID_POLICY_CHECK_MENU_CONTAINER)
|
||||
// .background("#dfebf5")
|
||||
// .width(200.0)
|
||||
// .height(200.0)
|
||||
// .child(
|
||||
|
||||
// The menu implemented as an overlay
|
||||
//ctx.append_child_to_overlay(policy_check_menu_button).unwrap();
|
||||
|
||||
// Starter page: check for valid policy number
|
||||
self.name("PolicyCheckView")
|
||||
// initialize struct consuming the derived default macro
|
||||
.policy_check(PolicyCheck::default())
|
||||
.child(
|
||||
Grid::new()
|
||||
.id(ID_POLICY_CHECK_WIDGET)
|
||||
.background("#fafafa")
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add(84.0)
|
||||
.add("*")
|
||||
.add(50.0)
|
||||
.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::new()
|
||||
// Top Bar
|
||||
.add("auto")
|
||||
.add(1.0)
|
||||
// Content
|
||||
.add("*")
|
||||
.add(1.0)
|
||||
// Bottom Bar
|
||||
.add(52.0)
|
||||
/* .add("auto") */
|
||||
.build(),
|
||||
)
|
||||
// Header Bar
|
||||
.child(
|
||||
//.border_color("transparent")
|
||||
Container::new()
|
||||
//.class(CLASS_TOP_BAR)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.child(
|
||||
Grid::new()
|
||||
.child(
|
||||
TextBlock::new()
|
||||
//.class(CLASS_HEADER)
|
||||
.class("h1")
|
||||
//.class(".myheader")
|
||||
.id(ID_POLICY_CHECK_HEADER)
|
||||
//.font_size(24)
|
||||
//.font("Roboto Medium")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.margin((32.0, 32.0, 32.0, 32.0))
|
||||
.text("Validierung Versicherungsnummer")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(policy_check_menu_button)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("separator")
|
||||
.attach(Grid::row(1))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
// Policy Check Form
|
||||
.child(
|
||||
Container::new()
|
||||
//.class(CLASS_POLICY_CHECK_FORM)
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.margin((16.0, 26.0, 26.0, 16.0))
|
||||
.child(
|
||||
Grid::new()
|
||||
.id(ID_POLICY_CHECK_FORM)
|
||||
.columns(
|
||||
Columns::new()
|
||||
// Labels
|
||||
.add("220.0")
|
||||
// Seperator
|
||||
.add("16.0")
|
||||
// Values
|
||||
.add("100.0")
|
||||
.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::new()
|
||||
.add("64.0")
|
||||
.add("64.0")
|
||||
.build(),
|
||||
)
|
||||
.child(
|
||||
// Labels
|
||||
Stack::new()
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(0))
|
||||
.orientation("vertical")
|
||||
//.v_align("center")
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_POLICY_NUMBER)
|
||||
//.class(CLASS_TEXT_BLOCK)
|
||||
.margin((0.0, 0.0, 16.0, 16.0))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.min_width(250.0)
|
||||
.min_height(45.0)
|
||||
//.size(250.0, 45.0)
|
||||
.text("Versicherungsnummer:")
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_RESULT)
|
||||
.class(CLASS_TEXT_BLOCK)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(1))
|
||||
.margin((0.0, 0.0, 16.0, 0.0))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.min_width(250.0)
|
||||
.text("Result:")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
.child(
|
||||
// Values
|
||||
Stack::new()
|
||||
.attach(Grid::column(1))
|
||||
.attach(Grid::row(0))
|
||||
//.attach(Grid::column_span(3))
|
||||
.orientation("vertical")
|
||||
//.margin((16.0, 16.0, 16.0, 16.0))
|
||||
//.child(policy_check_text_box)
|
||||
.child(
|
||||
TextBox::new()
|
||||
.id(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
.h_align("start")
|
||||
.width(280.0)
|
||||
.min_width(200.0)
|
||||
.margin((0.0, 0.0, 0.0, 16.0))
|
||||
.lost_focus_on_activation(false)
|
||||
.water_mark("Nummer 10-stellig")
|
||||
.text("")
|
||||
.on_activate(move |ctx, entity| {
|
||||
// Entity is entered/activated via Mouse/Keyboard
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::ParseEntry(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
// Element value has changed
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::InputTextChanged(entity));
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::SetVisibility(entity));
|
||||
//ctx.get_widget(policy_check_label_policy_number).set("visible");
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::SetVisility(entity));
|
||||
})
|
||||
// .on_mouse_down | .on_mouse_move | .on_mouse_up (move |ctx, entity| {
|
||||
// state(id, states).action(Action::AddItem);
|
||||
// })
|
||||
// .on_click(move |states, _| {
|
||||
// state(id, states).action(Action::AddItem);
|
||||
// true
|
||||
// })
|
||||
.build(ctx),
|
||||
)
|
||||
//.icon(material_icons_font::MD_ADD_CIRCLE)
|
||||
// .child()
|
||||
// NumericBox::new()
|
||||
// .id(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
// .h_align("start")
|
||||
// .width(250.0)
|
||||
// .min(1000000000)
|
||||
// .max(9999999999)
|
||||
// .val(0)
|
||||
// .min_width(200.0)
|
||||
// .margin((0.0, 0.0, 0.0, 16.0))
|
||||
// //.lost_focus_on_activation(false)
|
||||
// //.water_mark("10-stellige Nummer (ohne 'AS')")
|
||||
// //.text("")
|
||||
// //.on_activate(move |ctx, entity| {
|
||||
// // ctx.get_mut::<PolicyCheckState>(id)
|
||||
// // .action(Action::ParseEntry(entity));
|
||||
// //})
|
||||
// // .on_changed(move |ctx, entity| {
|
||||
// // ctx.get_mut::<PolicyCheckState>(id)
|
||||
// // .action(Action::InputTextChanged(entity));
|
||||
// // })
|
||||
// // .on_update(move |ctx, entity| {
|
||||
// // ctx.get_mut::<PolicyCheckState>(id)
|
||||
// // .action(Action::InputTextChanged(entity));
|
||||
// // })
|
||||
// .build(ctx),
|
||||
//)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_RESULT)
|
||||
//.id("policy_check_result")
|
||||
.h_align("start")
|
||||
.attach(Grid::column(1))
|
||||
.attach(Grid::row(1))
|
||||
.text("")
|
||||
.width(250.)
|
||||
//.margin((4.0, 0.0, 0.0, 0.0))
|
||||
//.lost_focus_on_activation(false)
|
||||
// .on_activate(move |ctx, entity| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::ParseEntry(entity));
|
||||
// })
|
||||
// .on_changed(move |ctx, entity| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::InputTextChanged(entity));
|
||||
// })
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
.build(ctx)
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("")
|
||||
.attach(Grid::row(3))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(policy_data_count_block)
|
||||
// Bottom bar
|
||||
.child(
|
||||
Container::new()
|
||||
.class(CLASS_BOTTOM_BAR)
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.v_align("end")
|
||||
.child(
|
||||
Grid::new()
|
||||
.element("logo_customer")
|
||||
.margin((9.0, 16.0, 16.0, 9.0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(1))
|
||||
.h_align("start")
|
||||
.v_align("center")
|
||||
.child(
|
||||
ImageWidget::new()
|
||||
.image("resources/images/hiedemann_logo.png")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Grid::new()
|
||||
.element("logo_vendor")
|
||||
.margin((9.0, 16.0, 16.0, 9.0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(5))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.child(
|
||||
ImageWidget::new()
|
||||
.image("resources/images/networkx_logo.png")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
//ctx.append_child_to_overlay(policycheck_menu_text_block).unwrap()
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
}
|
||||
}
|
||||
387
advotracker/src/widgets/policydata_view.rs
Normal file
@@ -0,0 +1,387 @@
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
data::{PolicyList, Status},
|
||||
keys::*,
|
||||
policydata_state::{Action, PolicyDataState},
|
||||
};
|
||||
use chrono::NaiveDateTime;
|
||||
|
||||
type ListIndex = Option<usize>;
|
||||
|
||||
// Dialog to manage policy identifiers.
|
||||
// The elements may be toggled to be deactivated. The optional value 'data_valid_until'
|
||||
// will render this value unvalid after the given date.
|
||||
widget!(
|
||||
PolicyDataView<PolicyDataState> {
|
||||
back_entity: u32,
|
||||
policy_list_count: usize,
|
||||
policylist_view: u32,
|
||||
list_index: ListIndex,
|
||||
date_valid_until: NaiveDateTime,
|
||||
policy_list: PolicyList
|
||||
});
|
||||
|
||||
impl Template for PolicyDataView {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
||||
// listing the policy elements
|
||||
let items_widget = ItemsWidget::new()
|
||||
.id(ID_POLICY_DATA_ITEMS_WIDGET)
|
||||
.v_align("start")
|
||||
.items_builder(move |ctx, index| {
|
||||
let mut date_inserted = None;
|
||||
let mut dion = 1;
|
||||
let mut policy_code = "".to_string();
|
||||
let mut policy_number = None;
|
||||
let mut status = false; // Status::<Active, Inactive>;
|
||||
|
||||
if let Some(list_index) = ctx.get_widget(id).clone::<ListIndex>("list_index") {
|
||||
if let Some(policy_data) = ctx
|
||||
.get_widget(id)
|
||||
.get::<PolicyList>(PROP_POLICY_LIST)
|
||||
.get(list_index)
|
||||
{
|
||||
if let Some(policy_data) = policy_data.get(index) {
|
||||
date_inserted = policy_data.date_inserted.clone();
|
||||
dion = policy_data.dion.clone();
|
||||
policy_code = policy_data.policy_code.clone();
|
||||
policy_number = policy_data.policy_number.clone();
|
||||
status = policy_data.status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let policy_data_status = CheckBox::new()
|
||||
.attach(Grid::column(1))
|
||||
.v_align("center")
|
||||
// status: true -> State::Active false -> State::Inactive
|
||||
.enabled(status)
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::StatusChanged(entity, index));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let policy_data_dion = TextBox::new()
|
||||
.id(ID_POLICY_DATA_DION)
|
||||
.attach(Grid::row(3))
|
||||
.v_align("center")
|
||||
.margin((4.0, 0.0, 0.0, 0.0))
|
||||
.text(dion)
|
||||
.lost_focus_on_activation(false)
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::CreateEntry(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::InputTextChanged(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let policy_data_dion = TextBox::new()
|
||||
.id(ID_POLICY_DATA_DION)
|
||||
.attach(Grid::row(5))
|
||||
.v_align("center")
|
||||
.margin((4.0, 0.0, 0.0, 0.0))
|
||||
.text(policy_code)
|
||||
.lost_focus_on_activation(false)
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::TextChanged(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::RemoveFocus(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let policy_data_policy_code = TextBox::new()
|
||||
.id(ID_POLICY_DATA_POLICY_CODE)
|
||||
.attach(Grid::row(7))
|
||||
.v_align("center")
|
||||
.margin((4.0, 0.0, 0.0, 0.0))
|
||||
.text(policy_code)
|
||||
.lost_focus_on_activation(false)
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::TextChanged(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::RemoveFocus(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
|
||||
let policy_data_policy_number = TextBox::new()
|
||||
.id(ID_POLICY_DATA_POLICY_NUMBER)
|
||||
.attach(Grid::column(9))
|
||||
.text(policy_number)
|
||||
.enabled(false)
|
||||
.v_align("center")
|
||||
.water_mark("Insert the new policy number ...")
|
||||
.class("inplace")
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::TextChanged(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::RemoveFocus(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let policy_data_date_inserted = TextBlock::new()
|
||||
.id(ID_POLICY_DATA_DATE_INSERTED)
|
||||
.attach(Grid::column(9))
|
||||
.text(date_inserted)
|
||||
.v_align("start")
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::TextChanged(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::RemoveFocus(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
Grid::new()
|
||||
.height(48.0)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add(10.0)
|
||||
.add(24.0)
|
||||
.add(8.0)
|
||||
.add(24.0)
|
||||
.add(8.0)
|
||||
.add(24.0)
|
||||
.add(8.0)
|
||||
.add("auto")
|
||||
.add(8.0)
|
||||
.add("auto")
|
||||
.add(8.0)
|
||||
.add(32.0)
|
||||
.add(4.0)
|
||||
.add(32.0)
|
||||
.add(8.0)
|
||||
.build(),
|
||||
)
|
||||
.child(policy_data_status)
|
||||
.child(policy_data_dion)
|
||||
.child(policy_data_policy_code)
|
||||
.child(policy_data_policy_number)
|
||||
.child(policy_data_date_inserted)
|
||||
.child(
|
||||
// edit active policy data element
|
||||
Button::new()
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.attach(Grid::column(11))
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_EDIT)
|
||||
//.icon("")
|
||||
.on_mouse_down(|_, _| true)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::EditEntry(text_box));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
// delete active policy data element
|
||||
Button::new()
|
||||
.class("icon_only")
|
||||
.attach(Grid::column(13))
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_DELETE)
|
||||
//.icon("")
|
||||
.on_mouse_down(|_, _| true)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::RemoveEntry(index));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
})
|
||||
.policy_data_count(PROP_POLICY_DATA_COUNT, id)
|
||||
.build(ctx);
|
||||
|
||||
let scroll_viewer = ScrollViewer::new()
|
||||
.scroll_viewer_mode(("disabled", "auto"))
|
||||
.child(items_widget)
|
||||
.build(ctx);
|
||||
|
||||
let policy_data_list_name = TextBox::new()
|
||||
.id(ID_POLICY_DATA_LIST_NAME)
|
||||
.attach(Grid::row(4))
|
||||
.v_align("center")
|
||||
.margin((4.0, 0.0, 0.0, 0.0))
|
||||
.lost_focus_on_activation(false)
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::CreateEntry(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::InputTextChanged(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
// Child page: list available policy data elements
|
||||
self.name("PolicyDataListView").child(
|
||||
Grid::new()
|
||||
.rows(
|
||||
Rows::new()
|
||||
.add(52.0)
|
||||
.add(1.0)
|
||||
.add("*")
|
||||
.add(1.0)
|
||||
.add("auto")
|
||||
.build(),
|
||||
)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add("*")
|
||||
.add(4.0)
|
||||
.add(36.0)
|
||||
.build(),
|
||||
)
|
||||
// Top Bar
|
||||
.child(
|
||||
Container::new()
|
||||
.class(CLASS_TOP_BAR)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.child(
|
||||
Grid::new()
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add(32.0)
|
||||
.add(4.0)
|
||||
.add("*")
|
||||
.add(4.0)
|
||||
.add(32.0)
|
||||
.build(),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.height(32.0)
|
||||
.icon(material_icons_font_ttf::MD_ARROW_LEFT)
|
||||
//.icon("")
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.v_align("center")
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::NavigateBack());
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.class(CLASS_HEADER)
|
||||
.attach(Grid::column(2))
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.text(("name", id))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Stack::new()
|
||||
.class(CLASS_HEADER)
|
||||
.attach(Grid::column(3))
|
||||
.h_align("start")
|
||||
.orientation("horizontal")
|
||||
.child(
|
||||
TextBox::new()
|
||||
.class(CLASS_HEADER)
|
||||
//.v_align("center")
|
||||
.h_align("start")
|
||||
.text(("Anzahl:", id))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.class(CLASS_HEADER)
|
||||
.id(PROP_POLICY_DATA_COUNT)
|
||||
.attach(Grid::column(3))
|
||||
//.v_align("center")
|
||||
.h_align("end")
|
||||
.text("policy_data_count")
|
||||
.build(ctx),
|
||||
)
|
||||
.build,
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("separator")
|
||||
.attach(Grid::row(1))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
// Content
|
||||
.child(
|
||||
Container::new()
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.child(scroll_viewer)
|
||||
.child(
|
||||
ScrollIndicator::new()
|
||||
.padding((0.0, 4.0, 0.0, 0.0))
|
||||
.content_id(items_widget.0)
|
||||
.scroll_offset(scroll_viewer)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("separator")
|
||||
.attach(Grid::row(3))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
// Bottom bar
|
||||
.child(
|
||||
Container::new()
|
||||
.class(CLASS_BOTTOM_BAR)
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(policy_data_list_name)
|
||||
.child(
|
||||
Button::new()
|
||||
.id(ID_POLICY_DATA_ADD_BUTTON)
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(2))
|
||||
.margin((0.0, 0.0, 4.0, 0.0))
|
||||
.enabled(false)
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_ADD_CIRCLE)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyDataState>(id)
|
||||
.action(Action::CreateEntry(policy_data_list_name));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
base_state::BaseState,
|
||||
data::{PolicyData, PolicyList},
|
||||
data::{PolicyDataList, PolicyList},
|
||||
keys::*,
|
||||
};
|
||||
|
||||
@@ -13,18 +13,18 @@ pub enum Action {
|
||||
NewEntry(Entity),
|
||||
RemoveFocus(Entity),
|
||||
RemoveEntry(usize),
|
||||
OpenPolicyList(Entity),
|
||||
OpenPolicyList(usize),
|
||||
SetEntry(Entity),
|
||||
TextChanged(Entity, usize),
|
||||
}
|
||||
|
||||
/// Handles the requests of the `OverviewView`.
|
||||
/// Handles the requests of the `PolicyListView`.
|
||||
#[derive(Default, AsAny)]
|
||||
pub struct PolicyListState {
|
||||
action:Option<Action>,
|
||||
add_button: Entity,
|
||||
items_widget: Entity,
|
||||
policylist_view: Entity,
|
||||
policydata_view: Entity,
|
||||
last_focused: Option<Entity>,
|
||||
text_box: Entity,
|
||||
}
|
||||
@@ -54,39 +54,32 @@ impl PolicyListState {
|
||||
} else {
|
||||
Button::get(ctx.child("add_button")).set_enabled(true);
|
||||
}
|
||||
// new syntax missing
|
||||
// new syntax not implemented yet
|
||||
ctx.get_widget(self.add_button).update_theme_by_state(true);
|
||||
}
|
||||
|
||||
/// update number of available policy data entries.
|
||||
/// update number of available policy list entries.
|
||||
fn adjust_count(&self, ctx: &mut Context) {
|
||||
if let Some(index) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_data) = ctx
|
||||
.widget()
|
||||
.clone::<PolicyList>("policy_list")
|
||||
.get(index)
|
||||
{
|
||||
ctx.widget().set("policy_list_count", policy_data.len());
|
||||
}
|
||||
}
|
||||
let policy_list_count = ctx.widget().get::<PolicyList>(PROP_POLICY_LIST).len();
|
||||
ctx.widget().set(PROP_POLICY_LIST_COUNT, policy_list_count);
|
||||
}
|
||||
|
||||
// Creates a new policy list.
|
||||
fn new_entry(&self, text: String, registry: &mut Registry, ctx: &mut Context) {
|
||||
// Creates a new policy data list.
|
||||
fn new_entry(&self, name: String, registry: &mut Registry, ctx: &mut Context) {
|
||||
ctx.widget()
|
||||
.get_mut::<PolicyList>(PROP_POLICY_LIST)
|
||||
.push(PolicyList::new(text));
|
||||
.push(PolicyList::new(name));
|
||||
self.adjust_count(ctx);
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
|
||||
// opens a policy list.
|
||||
// opens a given policy list name.
|
||||
fn open_policy_list(&self, index: usize, ctx: &mut Context) {
|
||||
ctx.get_widget(self.text_box)
|
||||
.set("name", String::from(""));
|
||||
ctx.get_widget(self.policy_list)
|
||||
.set("text", String16::from(""));
|
||||
ctx.get_widget(self.policydata_view)
|
||||
.set("list_index", Some(index));
|
||||
self.navigate(self.policy_list, ctx);
|
||||
self.navigate(self.policydata_view, ctx);
|
||||
}
|
||||
|
||||
// removes a policy list.
|
||||
@@ -122,52 +115,6 @@ impl PolicyListState {
|
||||
ctx.push_event_by_window(FocusEvent::RequestFocus(text_box));
|
||||
}
|
||||
|
||||
/// Toggle the invalid element of the given policy data entry
|
||||
fn toggle_invalid(
|
||||
&self,
|
||||
entry: Entity,
|
||||
index: usize,
|
||||
registry: &mut Registry,
|
||||
ctx: &mut Context,
|
||||
) {
|
||||
let invalid: bool = *ctx.get_widget(entry).get("invalid");
|
||||
|
||||
if let Some(idx) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_list) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyData>("policy_list")
|
||||
.get_mut(idx)
|
||||
{
|
||||
if let Some(policy_list) = policy_list.get_mut(index) {
|
||||
policy_list.selected = selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
|
||||
fn update_entry(
|
||||
&self,
|
||||
text_box: Entity,
|
||||
index: usize,
|
||||
registry: &mut Registry,
|
||||
ctx: &mut Context,
|
||||
) {
|
||||
let text: String16 = ctx.get_widget(text_box).clone("text");
|
||||
|
||||
if let Some(idx) = ctx.widget().clone::<Option<usize>>("list_index") {
|
||||
if let Some(policy_list) = ctx
|
||||
.widget()
|
||||
.get_mut::<PolicyList>("policy_list")
|
||||
.get_mut(idx)
|
||||
{
|
||||
if let Some(task) = policy_list.get_mut(index) {
|
||||
task.text = text.to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
self.save(registry, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
impl State for PolicyListState {
|
||||
@@ -181,13 +128,14 @@ impl State for PolicyListState {
|
||||
self.items_widget = ctx
|
||||
.entity_of_child(ID_POLICY_LIST_ITEMS_WIDGET)
|
||||
.expect("PolicyListState.init: Child 'Items widget' not found.");
|
||||
self.policy_list = (*ctx.widget().get::<u32>("policy_list_view")).into();
|
||||
self.policydata_view = (*ctx.widget()
|
||||
.get::<u32>("policy_list_view")).into();
|
||||
|
||||
if let Ok(tasks) = registry
|
||||
if let Ok(policy_list_name) = registry
|
||||
.get::<Settings>("settings")
|
||||
.load::<PolicyList>(PROP_POLICY_LIST)
|
||||
{
|
||||
ctx.widget().set(PROP_POLICY_LIST, tasks);
|
||||
ctx.widget().set(PROP_POLICY_LIST, policy_list_name);
|
||||
}
|
||||
|
||||
self.adjust_count(ctx);
|
||||
@@ -209,8 +157,8 @@ impl State for PolicyListState {
|
||||
self.adjust_add_button_enabled(text_box, ctx);
|
||||
}
|
||||
Action::NewEntry(entity) => {
|
||||
if let Some(text) = self.fetch_text(ctx, entity) {
|
||||
self.new_entry(text, registry, ctx);
|
||||
if let Some(name) = self.fetch_text(ctx, entity) {
|
||||
self.new_entry(name, registry, ctx);
|
||||
}
|
||||
}
|
||||
Action::RemoveEntry(index) => {
|
||||
282
advotracker/src/widgets/policylist_view.rs
Normal file
@@ -0,0 +1,282 @@
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
data::PolicyList,
|
||||
keys::*,
|
||||
//policylist_state::{Action, PolicyListState},
|
||||
policylist_state::*,
|
||||
};
|
||||
|
||||
//type ListIndex = Option<usize>;
|
||||
|
||||
widget!(
|
||||
/// Dialog selecting a list of policy identifiers.
|
||||
/// The lists groups a collection of policy codes.
|
||||
PolicyListView<PolicyListState> {
|
||||
back_entity: u32,
|
||||
policy_list: PolicyList,
|
||||
policy_list_count: usize,
|
||||
policydata_view: u32
|
||||
}
|
||||
);
|
||||
|
||||
impl Template for PolicyListView {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
||||
// collect the DCES elements of our 'policy lists' view
|
||||
let items_widget = ItemsWidget::new()
|
||||
.id(ID_POLICY_LIST_ITEMS_WIDGET)
|
||||
.v_align("start")
|
||||
.items_builder(move |ctx, index| {
|
||||
let mut name = "".to_string();
|
||||
|
||||
if let Some(policy_list) = ctx
|
||||
.get_widget(id)
|
||||
.get::<PolicyList>(PROP_POLICY_LIST)
|
||||
.get(index)
|
||||
{
|
||||
name = policy_list.name.clone();
|
||||
}
|
||||
|
||||
// plus button: open new policy
|
||||
let new_list_button = Button::new()
|
||||
.min_height(48.0)
|
||||
.class(CLASS_ITEM_BUTTON)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column_span(1))
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::OpenPolicyList(index));
|
||||
true
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let text_block = TextBlock::new()
|
||||
.foreground(new_list_button)
|
||||
.margin((14.0, 0.0, 0.0, 0.0))
|
||||
.v_align("center")
|
||||
.attach(Grid::column(0))
|
||||
.text(name)
|
||||
.element("text-box")
|
||||
.build(ctx);
|
||||
|
||||
let text_box = TextBox::new()
|
||||
.margin((8.0, 0.0, 0.0, 0.0))
|
||||
.visibility("collapsed")
|
||||
.v_align("center")
|
||||
.water_mark("Insert name of a new policy collection ...")
|
||||
.attach(Grid::column(0))
|
||||
.text(text_block)
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::TextChanged(entity, index));
|
||||
})
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::RemoveFocus(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
Grid::new()
|
||||
.height(48.0)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add("*")
|
||||
.add(8.0)
|
||||
.add(32.0)
|
||||
.add(4.0)
|
||||
.add(32.0)
|
||||
.add(8.0)
|
||||
.build(),
|
||||
)
|
||||
.child(new_list_button)
|
||||
.child(text_box)
|
||||
.child(text_block)
|
||||
.child(
|
||||
// toggle if text_box is focused
|
||||
ToggleButton::new()
|
||||
.selected(("focused", text_box))
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.attach(Grid::column(2))
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
// .selected(("focused", text_box))
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.attach(Grid::column(2))
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_ADD)
|
||||
//.icon(material_icons_font_ttf::MD_EDIT)
|
||||
//.icon("")
|
||||
.on_mouse_down(|_, _| true)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::SetEntry(text_box));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.class("icon_only")
|
||||
.attach(Grid::column(4))
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_DELETE)
|
||||
//.icon("")
|
||||
.on_mouse_down(|_, _| true)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::RemoveEntry(index));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx)
|
||||
})
|
||||
.count((PROP_POLICY_LIST_COUNT, id))
|
||||
.build(ctx);
|
||||
|
||||
// create new policy list element
|
||||
let policy_list_text_box = TextBox::new()
|
||||
.id(ID_POLICY_LIST_TEXT_BOX)
|
||||
.attach(Grid::row(4))
|
||||
.v_align("center")
|
||||
.margin((4.0, 0.0, 0.0, 2.0))
|
||||
.lost_focus_on_activation(false)
|
||||
.on_activate(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::NewEntry(entity));
|
||||
})
|
||||
.on_changed(move |ctx, entity| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::InputTextChanged(entity));
|
||||
})
|
||||
.build(ctx);
|
||||
|
||||
let scroll_viewer = ScrollViewer::new()
|
||||
.scroll_viewer_mode(("disabled", "auto"))
|
||||
.child(items_widget)
|
||||
.build(ctx);
|
||||
|
||||
// Child page: list available policy lists
|
||||
self.name("PolicyListView")
|
||||
.policy_list(PolicyList::default())
|
||||
.policy_list_count(0)
|
||||
.child(
|
||||
Grid::new()
|
||||
.rows(
|
||||
Rows::new()
|
||||
.add(52.0)
|
||||
.add(1.0)
|
||||
.add("*")
|
||||
.add(1.0)
|
||||
.add(40.0)
|
||||
.build(),
|
||||
)
|
||||
.columns(
|
||||
Columns::new()
|
||||
.add("*")
|
||||
.add(4.0)
|
||||
.add(36.0)
|
||||
.build(),
|
||||
)
|
||||
// Content
|
||||
.child(
|
||||
Container::new()
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.child(scroll_viewer)
|
||||
.child(
|
||||
ScrollIndicator::new()
|
||||
.padding((0.0, 4.0, 0.0, 0.0))
|
||||
.content_id(items_widget.0)
|
||||
.scroll_offset(scroll_viewer)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
// Top Bar
|
||||
.child(
|
||||
Container::new()
|
||||
.class(CLASS_TOP_BAR)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.child(
|
||||
Grid::new()
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.class(CLASS_HEADER)
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.text("Lists of policy data collections")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("separator")
|
||||
.attach(Grid::row(1))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Container::new()
|
||||
.class("separator")
|
||||
.attach(Grid::row(3))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
// Bottom bar
|
||||
.child(
|
||||
Container::new()
|
||||
.class(CLASS_BOTTOM_BAR)
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
// workaround, todo fix scroll viewer mouse behavior in OrbTk
|
||||
Button::new()
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(3))
|
||||
.on_mouse_down(|_, _| true)
|
||||
.on_mouse_up(|_, _| true)
|
||||
.on_click(|_, _| true)
|
||||
.class(CLASS_TRANSPARENT)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(policy_list_text_box)
|
||||
.child(
|
||||
Button::new()
|
||||
.id(ID_POLICY_LIST_ADD_BUTTON)
|
||||
.class(CLASS_ICON_ONLY)
|
||||
.attach(Grid::row(4))
|
||||
.attach(Grid::column(2))
|
||||
.margin((0.0, 0.0, 4.0, 0.0))
|
||||
.enabled(false)
|
||||
.min_size(32.0, 32.0)
|
||||
.v_align("center")
|
||||
.icon(material_icons_font_ttf::MD_ADD)
|
||||
.on_click(move |ctx, _| {
|
||||
ctx.get_mut::<PolicyListState>(id)
|
||||
.action(Action::NewEntry(policy_list_text_box));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
}
|
||||
}
|
||||