Compare commits
200 Commits
no-locales
...
wip_toggle
| Author | SHA1 | Date | |
|---|---|---|---|
| fafd38f210 | |||
| 667a2e39bf | |||
| c90099e1cf | |||
| 9624567dbd | |||
| 014b98bd85 | |||
| 8fd512b83f | |||
| 85f9fdf7db | |||
| c4d6506dee | |||
| 646955c0fb | |||
| df6bae482c | |||
| 00ad56ce71 | |||
| 6350d14ce7 | |||
| e8a86e8afd | |||
| 26cea8e844 | |||
| 48545d2879 | |||
| b352f2a581 | |||
| 89a6842106 | |||
| 76e6e7503f | |||
| 520b959302 | |||
| 7d459516d9 | |||
| c511bdd62f | |||
| 40f715a79a | |||
| 6ea1f95ef0 | |||
| 8986812038 | |||
| e0eb0c5c90 | |||
| a1541ae307 | |||
| c66335951f | |||
| d0e661d5d0 | |||
| 2253c2892b | |||
| 8cc9ba5782 | |||
| ef8b884efa | |||
| 6b7ae9d17d | |||
| f0e9014fb7 | |||
| 0ba99b3fb2 | |||
| f0d5f82549 | |||
| d2a188eee6 | |||
| e297c82b85 | |||
| f87ab8ce08 | |||
| 0c16237c6c | |||
| 777fff3776 | |||
| c949b5fe32 | |||
| 0afe1f3bf8 | |||
| bf54cb2242 | |||
| 5b79229c00 | |||
| 16a538a805 | |||
| a887ffef1f | |||
| 65c2da7706 | |||
| 0467f601f0 | |||
| 8a50e1ea78 | |||
| c54cca5f22 | |||
| bf638ac196 | |||
| 06e68adce6 | |||
| 645ea50350 | |||
| 13d56e2e05 | |||
| ef63f62734 | |||
| 5aff69c526 | |||
| 70e2e7f1e5 | |||
| 3697bc567a | |||
| ece95344bf | |||
| 69405aaa76 | |||
| cd82f62a82 | |||
| eb7a3608d7 | |||
| b6b12c45bb | |||
| 9b9afc2b5a | |||
| 094fb6d0ea | |||
| f983eca9aa | |||
| bceec88741 | |||
| daaa544e93 | |||
| 33da48b1b1 | |||
| 046812e04f | |||
| bd70ad653b | |||
| ac855d0a54 | |||
| b099064776 | |||
| 65bec5a4a1 | |||
| 276c0fb5f0 | |||
| 0f97202fbb | |||
| e91b91a2db | |||
| 25de70e75c | |||
| 9fffb093c3 | |||
| 11d12718e8 | |||
| 6e4ba029b7 | |||
| fd61f90277 | |||
| ffa8c18efb | |||
| 3d913e7127 | |||
| 8ca257bf5c | |||
| 6907c0c393 | |||
| 9e1a1e7359 | |||
| 16f174d53a | |||
| 4406efc955 | |||
| 20ddd78a8d | |||
| 863826a294 | |||
| 53d8f80b75 | |||
| 555a02fcc3 | |||
| 4d2427a058 | |||
| 5eeb80cdd4 | |||
| aa26e6634d | |||
| 19ad9198d0 | |||
| e62fb8e990 | |||
| d3d3be1442 | |||
| b579d039f1 | |||
| c5334ac898 | |||
| 224606d72e | |||
| 4e0b8166f2 | |||
| 193f2de7ea | |||
| e2ced73db9 | |||
| 09ec027e79 | |||
| 656ffae9bf | |||
| 9753c37477 | |||
| f503fc9713 | |||
| 8564aaaf8d | |||
| 947e79eea4 | |||
| a9f7c62e3d | |||
| c0d8e7a898 | |||
| 7a82640fd6 | |||
| f9453ee18c | |||
| f9dd2e3797 | |||
| ea57346119 | |||
| e7ef33ee40 | |||
| 5a5bbb5d5e | |||
| e8c7d78de3 | |||
| bf0ee18f55 | |||
| b709c90682 | |||
| 32405504a7 | |||
| 891919b64d | |||
| 40896c6b8e | |||
| 9beeaa7190 | |||
| 7e604f050a | |||
| ebaf05132f | |||
| ce7f802d3a | |||
| d7da1335b1 | |||
| d6703e8df6 | |||
| 24b9b08566 | |||
| 274a96b908 | |||
| 65e0ce3319 | |||
| 77d41f733e | |||
| 18588ce75f | |||
| d5788b9848 | |||
| e853975c86 | |||
| bc161878b3 | |||
| d0c7a16ac7 | |||
| 5745a3bd6c | |||
| 7196013bb2 | |||
| 1aebd4338f | |||
| 6f668bf4c3 | |||
| 97622ba5f5 | |||
| 533ae6f8d2 | |||
| 23c1875272 | |||
| 02d388c14f | |||
| 016595d702 | |||
| 8506b0ce90 | |||
| 74fc662a67 | |||
| 4f3a63425a | |||
| 42dcd82df2 | |||
| 82c1aab492 | |||
| cf375770c1 | |||
| da24fea764 | |||
| 321b868bb8 | |||
| 5f4d01d919 | |||
| 8f7be15ef3 | |||
| cddb47b3ad | |||
| 56aa6ac72c | |||
| bde94bcce1 | |||
| 8a1f92e44d | |||
| 267680f547 | |||
| ea4bcaabd6 | |||
| 268207318d | |||
| 5dc3fa1509 | |||
| d57827ca4e | |||
| 97a5a966d3 | |||
| 5016cb6b47 | |||
| 84e7a86bb3 | |||
| b7e6d269dc | |||
| 0582c1be43 | |||
| 507f13ade3 | |||
| 2bc37f6a24 | |||
| 985cee4f0b | |||
| 267c4faa2c | |||
| 22ecaaa0fe | |||
| 9c2beabd33 | |||
| 53702555a3 | |||
| c3e939c6bb | |||
| dd8c840cf9 | |||
| 9e65ef198a | |||
| 6a7d9a39d1 | |||
| 3b889d24e6 | |||
| a6b6f84fec | |||
| de99076e53 | |||
| 8a8941f0cf | |||
| 29b3876264 | |||
| 62c786b671 | |||
| 717dc9ba03 | |||
| d4ae415ece | |||
| 9354ea29ab | |||
| 7600f1b8df | |||
| f3af573bd7 | |||
| e93c19aacc | |||
| 930d916e3f | |||
| 2159cc0c24 | |||
| 36e90081b5 | |||
| a59d364b62 |
@@ -3,8 +3,8 @@ name = "advotracker-framework"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
||||||
description = "Supports lawyers to capture relevant data encountered during an online legal advice\n"
|
description = "Supports lawyers to capture relevant data encountered during an online legal advice\n"
|
||||||
repository = "https://github.com/rzerres/advotracker"
|
repository = "https://gitea.networkx.de:50443/rzerres/advotracker"
|
||||||
homepage = "https://github.com/rzerres/advotracker"
|
homepage = "https://gitea.networkx.de:50443/rzerres/advotracker"
|
||||||
documentation = "https://docs.rs/advotracker"
|
documentation = "https://docs.rs/advotracker"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "0BSD OR MIT"
|
license = "0BSD OR MIT"
|
||||||
|
|||||||
147
README.md
@@ -1,24 +1,145 @@
|
|||||||
<!-- AdvoTracker.markdown -->
|
<!-- AdvoTracker README.md -->
|
||||||
<!-- version: 1.1 -->
|
<!-- version: 0.1.3 -->
|
||||||
|
|
||||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
|
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
|
||||||
<!-- markdown-toc end -->
|
<!-- markdown-toc end -->
|
||||||
|
|
||||||
# AdvoTracker - Hotline tool für Advokaten #
|
## About
|
||||||
|
|
||||||
AdvoTracker unterstützt Anwälte bei der Erfassung von Mandatsdaten zu einer Online-Beratung.
|
`AdvoTracker` supports lawyers to capture relevant data encountered during an online
|
||||||
|
legal advice.
|
||||||
|
|
||||||
Das Tool wurde als multi-Pattform Anwendung konzipiert.
|
The application components are implemented using the programming language *Rust*.
|
||||||
|
The graphical user interface (GUI) uses the class-lib *OrbTk*, which is natively
|
||||||
|
encoded in *Rust* as well.
|
||||||
|
|
||||||
Als Programmiersprache wird *Rust* verwendet. Die Implementierung der
|
`AdvoTracker` can be deployed on every target operating system that is officialy
|
||||||
GUI Elemente erfolgt mit der Klassenbibliothek *OrbTk*.
|
supported by the `OrbTK` toolkit. Currently included are:
|
||||||
|
|
||||||
Als Dokumentationsquellen wird auf die offiziellen Projektseiten [Rust Book][^1] und [OrbTk][^2] verwiesen.
|
* macOS
|
||||||
|
* Linux
|
||||||
|
* openBSD
|
||||||
|
* Redox OS
|
||||||
|
* Web-Browser
|
||||||
|
* Windows
|
||||||
|
|
||||||
# Internationalisierung #
|
Porting to and in activ development are:
|
||||||
|
|
||||||
In allen Dialogen und Meldungen erfolgt die Ausgabe entsprechend der Sprache, die als
|
* Android
|
||||||
aktive Sprache in der Umgebungsvariable definiert ist (default: LANG = en_US.UTF8 ) ausgewählt.
|
* iOS
|
||||||
|
* ubuntu Touch
|
||||||
|
|
||||||
|
Reference is made to the official project pages of [Rust Book][^1] and [OrbTk][^2]
|
||||||
|
as documentation sources.
|
||||||
|
|
||||||
|
## Internationalization
|
||||||
|
|
||||||
|
Dialogs and messages generated inside the application will respect the system language
|
||||||
|
of the active user. This is adaptable via the environment variable
|
||||||
|
(default: LANG = en_US.UTF8 ).
|
||||||
|
|
||||||
|
Within the source code you can find translated constants in the subdirectory 'locales'
|
||||||
|
(<src-root>/advotracker/src/locales/advotracker.json).
|
||||||
|
For every supported language-string, you will find a block starting with the
|
||||||
|
generic message code, followed by the target language translation. Translation lines
|
||||||
|
are identified by its ISO Code (e.g. de_DE.UTF8, es_ES.UTF8).
|
||||||
|
|
||||||
|
## Installation from source code
|
||||||
|
|
||||||
|
You can either download the `Advotracker` source code as a Zip-File or using `git`
|
||||||
|
from projects repositoy URL.
|
||||||
|
|
||||||
|
The source code is subdiveded in three submodules:
|
||||||
|
|
||||||
|
* advotracker
|
||||||
|
* advotrackerd
|
||||||
|
* advotracker-db
|
||||||
|
|
||||||
|
Currently the given WEB-URL certificate is signed by a Microsoft CA.
|
||||||
|
Since this CA can't be verified from offical CA-lists you have to proceed as follows:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ cd <your_path>
|
||||||
|
$ git -c http.https://gitea.networkx.de:50443.sslverify=false \
|
||||||
|
clone --recurse-submodules --jobs=10 \
|
||||||
|
https://gitea.networkx.de:50443/rzerres/advotracker
|
||||||
|
```
|
||||||
|
To compile the target binary code, you have to use rusts toolchain.
|
||||||
|
If this isn't already installed on your development system, please go ahead
|
||||||
|
and either use the official supported installation tool from the rust communtiy
|
||||||
|
([rustup][^3]). As an alternitiv, you can download and install the compiler package
|
||||||
|
using your systems package manager.
|
||||||
|
|
||||||
|
### native operating system binaries
|
||||||
|
|
||||||
|
A binary compatible with your target operating system will be compiled
|
||||||
|
with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ cd <advotracker_root>
|
||||||
|
$ cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
The toolchain also allows to cross-compile for other operating systems. Please
|
||||||
|
consult the rust documentation for further instructions.
|
||||||
|
|
||||||
|
### web-browser application
|
||||||
|
|
||||||
|
- **Prerequisits**
|
||||||
|
|
||||||
|
To run as a browser, electron or cordova app, you have to install cargo-node:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install -f cargo-node
|
||||||
|
```
|
||||||
|
|
||||||
|
cargo-node will require a working version of `npm` (>=v6.9.0).
|
||||||
|
You may download [Node.js][^4], which includes npm as well.
|
||||||
|
|
||||||
|
- **Start as browser app**
|
||||||
|
|
||||||
|
You can run `Advotracker` as a web-browser app with the following call.
|
||||||
|
Once the app is running, you can connect to it opening the given URL
|
||||||
|
in you Web-Browser.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo node run --target browser --bin advotracker
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Start as electron app**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo node run --target electron advotracker
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Start as android app**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo node run --target android --bin advotracker
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build and run documentation
|
||||||
|
|
||||||
|
You can build and view the latest documentation by executing the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo doc --no-deps --open
|
||||||
|
```
|
||||||
|
This will render the web-pages, collecting the documentation paragraphs in the
|
||||||
|
source-code. When finished, it will open a new tab in your web browser
|
||||||
|
presenting the documentation.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install the compiled binary you can use rust package manager `cargo` as well.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd <advotracker_root>
|
||||||
|
$ cargo install
|
||||||
|
```
|
||||||
|
|
||||||
|
In addition, you will need to copy the resource folder into your target directory.
|
||||||
|
This will provide the access to used fonts, images und stylesheets.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -28,7 +149,7 @@ This work is licensed under a [Creative Common License 4.0][License-CC_BY]
|
|||||||
|
|
||||||
![Creative Common Logo][Logo-CC_BY]
|
![Creative Common Logo][Logo-CC_BY]
|
||||||
|
|
||||||
© 2020 Ralf Zerres, Networkx GmbH
|
<EFBFBD> 2020 Ralf Zerres, Networkx GmbH
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -36,3 +157,5 @@ Foodnotes
|
|||||||
|
|
||||||
[^1]: Rust Book: https://doc.rust-lang.org/book/
|
[^1]: Rust Book: https://doc.rust-lang.org/book/
|
||||||
[^2]: OrbTK GUI: https://gitlab.redox-os.org/redox-os/orbtk
|
[^2]: OrbTK GUI: https://gitlab.redox-os.org/redox-os/orbtk
|
||||||
|
[^3]: Rustup: https://rustup.rs/
|
||||||
|
[^4]: Node.js: https://nodejs.org/dist/v10.16.3/
|
||||||
|
|||||||
16
advotracker/.env
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
###
|
||||||
|
# .env
|
||||||
|
# will overwrite standard environment viariables
|
||||||
|
###
|
||||||
|
# set the language variable used in test-runs
|
||||||
|
#test LANG=es-ES
|
||||||
|
#test LANG=it-IT
|
||||||
|
#test LANG=C
|
||||||
|
# set the language variable (overwriting standard Enviroment)
|
||||||
|
#TEST_LANG=de_DE
|
||||||
|
#TEST_LANG=C
|
||||||
|
#RUST_LOG=advotracker=trace
|
||||||
|
RUST_LOG=trace
|
||||||
|
#RUST_LOG=none
|
||||||
|
USERNAME=hiedemann
|
||||||
|
DB_DRIVER=sqlite
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "advotracker"
|
name = "advotracker"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
||||||
description = "Frontend component that supports lawyers to capture relevant data encountered during an online legal advice."
|
description = "Frontend component that supports lawyers to capture relevant data encountered during an online legal advice."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -8,6 +8,10 @@ license = "(0BSD OR MIT)"
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
default-run = "advotracker"
|
default-run = "advotracker"
|
||||||
|
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "/usr/bin/x86_64-w64-mingw32-gcc"
|
||||||
|
ar = "/usr/x86_64-w64-mingw32i/bin/ar"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
winapi = { version = "0.3", features = ["winuser"] }
|
winapi = { version = "0.3", features = ["winuser"] }
|
||||||
#diesel = { version = "1.4", features = [ "postgres", "sqlite" ] }
|
#diesel = { version = "1.4", features = [ "postgres", "sqlite" ] }
|
||||||
@@ -19,21 +23,23 @@ clap = { version = "~2.33", features = ["suggestions", "color"] }
|
|||||||
csv = { version = "~1.1" }
|
csv = { version = "~1.1" }
|
||||||
dotenv = { version = "~0.15.0" }
|
dotenv = { version = "~0.15.0" }
|
||||||
envy = { version = "~0.4" }
|
envy = { version = "~0.4" }
|
||||||
#lazy_static = { version = "~1.4.0" }
|
lazy_static = { version = "~1.4.0" }
|
||||||
log = { version = "~0.4.8" }
|
log = { version = "~0.4.8" }
|
||||||
#orbtk = { version = "~0.3.1-alpha3" }
|
locales = { version = "~0.1" }
|
||||||
#orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }
|
#orbtk = { version = "~0.3.1-alpha4" }
|
||||||
orbtk = { path = "../../orbtk" }
|
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" }
|
||||||
|
#orbtk = { path = "../../orbtk" }
|
||||||
serde = { version = "~1.0", features = ["derive"] }
|
serde = { version = "~1.0", features = ["derive"] }
|
||||||
#tokio = { version = "~0.2", features = ["macros", "rt-threaded", "stream", "time"] }
|
#tokio = { version = "~0.2", features = ["macros", "rt-threaded", "stream", "time"] }
|
||||||
tracing = { version = "~0.1" }
|
tracing = { version = "~0.1" }
|
||||||
tracing-subscriber = { version = "0.2.0-alpha", features = ["tracing-log"] }
|
tracing-subscriber = { version = "~0.2.0", features = ["tracing-log"] }
|
||||||
viperus = { git = "https://github.com/maurocordioli/viperus", features = ["cache", "fmt-clap", "fmt-env", "global", "watch"] }
|
viperus = { git = "https://github.com/maurocordioli/viperus", features = ["cache", "fmt-clap", "fmt-env", "global", "watch"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# no features by default
|
# no features by default
|
||||||
default = []
|
default = []
|
||||||
testing = ["orbtk/debug"]
|
debug = ["orbtk/debug"]
|
||||||
|
light = []
|
||||||
|
|
||||||
[package.metadata.bundle]
|
[package.metadata.bundle]
|
||||||
name = "advotracker"
|
name = "advotracker"
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
+[[apps]]
|
[[apps]]
|
||||||
+name = "advotracker_frontend"
|
name = "advotracker"
|
||||||
+width = 800
|
width = 580
|
||||||
+height = 600
|
height = 280
|
||||||
|
assets = "resources/advotracker"
|
||||||
[[apps.fonts]]
|
[[apps.fonts]]
|
||||||
font_family = "Material Icons"
|
font_family = "MaterialIcons-Regular"
|
||||||
src = "fonts/MaterialIcons-Regular.ttf"
|
src = "resources/fonts/MaterialIcons.ttf"
|
||||||
[[apps.fonts]]
|
|
||||||
font_family = "Roboto Regular"
|
|
||||||
src = "fonts/Roboto-Regular.ttf"
|
|
||||||
[[apps.fonts]]
|
|
||||||
font_family = "Roboto Medium"
|
|
||||||
src = "fonts/Roboto-Medium.ttf"
|
|
||||||
|
|||||||
46
advotracker/assets/advotracker/advotracker_de_DE.ron
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// *
|
||||||
|
// * advotracker - Hotline tackingtool for Advocats
|
||||||
|
// *
|
||||||
|
// * Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
// * SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
// */
|
||||||
|
|
||||||
|
// the language class
|
||||||
|
Dictionary (
|
||||||
|
// the map of active identifiers
|
||||||
|
// like a struct, but keys are also values instead of just beenig identifiers
|
||||||
|
words: {
|
||||||
|
// policycheck_view
|
||||||
|
"Validation policy number": "Prüfung Versicherungsnummer",
|
||||||
|
"Policy number": "Versicherungsnummer",
|
||||||
|
"Policy code": "ID der Vers.-Nummer",
|
||||||
|
"Checklist elements: ": "Prüflistenelemente: ",
|
||||||
|
"Check result": "Prüfungsergebnis",
|
||||||
|
"Importing data": "Importiere Datensätze",
|
||||||
|
"Processing time": "Bearbeitungszeit",
|
||||||
|
"Error:": "Fehler:",
|
||||||
|
"Reason": "Grund",
|
||||||
|
"Policy number is to long": "Die Nummer ist zu lang",
|
||||||
|
"Policy number is to short": "Die Nummer ist zu kurz",
|
||||||
|
"The given policy number is invalid": "Die Versicherungsnummer ist ungültig",
|
||||||
|
"The given policy number is valid": "Die Versicherungsnummer ist gültig",
|
||||||
|
"Only numbers are valid": "Nur Nummern sind zulässig",
|
||||||
|
"Account": "Benutzer",
|
||||||
|
"Toggle theme": "Thema wechseln",
|
||||||
|
"Quit": "Beenden",
|
||||||
|
|
||||||
|
// localization view
|
||||||
|
"Language ID": "Sprache ID",
|
||||||
|
"Localization dialog": "Lokalisierungs-Dialog",
|
||||||
|
"German": "Deutsch",
|
||||||
|
"English": "Englisch",
|
||||||
|
|
||||||
|
// configuration view
|
||||||
|
"Configuration settings": "Konfigurationseinstellungen",
|
||||||
|
"Configuration file": "Konfigurationsdatei",
|
||||||
|
"Language Id": "Sprach-Id",
|
||||||
|
"Default theme": "Standard-Thema",
|
||||||
|
"load": "laden",
|
||||||
|
"save": "speichern"
|
||||||
|
}
|
||||||
|
)
|
||||||
54
advotracker/assets/advotracker/default_dark.ron
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
Theme (
|
||||||
|
styles: {
|
||||||
|
"button_menu": (
|
||||||
|
base: "button",
|
||||||
|
properties: {
|
||||||
|
"padding": 4,
|
||||||
|
"border_radius": 0,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"container_form": (
|
||||||
|
base: "container",
|
||||||
|
properties: {
|
||||||
|
"padding": 14,
|
||||||
|
"border_width": 1,
|
||||||
|
"border_radius": 0,
|
||||||
|
"border_brush": "$CONTAINER_BORDER",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"configuration_form": (
|
||||||
|
base: "container",
|
||||||
|
properties: {
|
||||||
|
"margin": 4,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"container_progress": (
|
||||||
|
base: "container",
|
||||||
|
properties: {
|
||||||
|
"padding": 14,
|
||||||
|
//"border_width": 1,
|
||||||
|
//"border_radius": 0,
|
||||||
|
"border_brush": "$CONTAINER_BORDER",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"popup_progress": (
|
||||||
|
base: "popup",
|
||||||
|
properties: {
|
||||||
|
//"background": "$BACKGROUND",
|
||||||
|
"padding": 4,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"text_block_progress": (
|
||||||
|
base: "small_text",
|
||||||
|
properties: {
|
||||||
|
"background": "$PROGRESS_BAR_BACKGROUND",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
"stack_progress": (
|
||||||
|
base: "container",
|
||||||
|
properties: {
|
||||||
|
"spacing": 10,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
10
advotracker/assets/advotracker/fluent_dark.ron
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Theme (
|
||||||
|
styles: {
|
||||||
|
"container_form": (
|
||||||
|
base: "container",
|
||||||
|
properties: {
|
||||||
|
"border": 1,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
0
advotracker/assets/advotracker/fluent_light.ron
Normal file
BIN
advotracker/assets/advotracker/hiedemann_logo.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
advotracker/assets/fonts/CynthoPro-Regular.otf
Normal file
|
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 |
152
advotracker/assets/icons/advotracker/Hiedemann_Logo.svg
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="105mm"
|
||||||
|
height="74mm"
|
||||||
|
viewBox="0 0 105 74"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||||
|
sodipodi:docname="Hiedemann_Logo.svg">
|
||||||
|
<title
|
||||||
|
id="title850">Hiedemann Rechtsanwälte</title>
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
units="mm"
|
||||||
|
inkscape:snap-global="true"
|
||||||
|
inkscape:snap-grids="true"
|
||||||
|
inkscape:snap-nodes="true"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-height="1088"
|
||||||
|
inkscape:window-width="2048"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:document-rotation="0"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:cy="285.11146"
|
||||||
|
inkscape:cx="343.98278"
|
||||||
|
inkscape:zoom="1.4564683"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
borderopacity="1.0"
|
||||||
|
bordercolor="#666666"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
id="base" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>Hiedemann Rechtsanwälte</dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Hiedemann Rechtsanwälte</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<dc:publisher>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Networkx GmbH</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:publisher>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:title>Hiedemann Rechtsanwälte</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
inkscape:label="Rahmen"
|
||||||
|
id="layer2"
|
||||||
|
inkscape:groupmode="layer" />
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="layer1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
inkscape:label="Logo">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="96"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-filename="/data/development/advotracker/advotracker/resources/images/hiedemann_logo.png"
|
||||||
|
transform="matrix(0.5,0,0,0.5,26.483775,16.188821)"
|
||||||
|
id="g1005">
|
||||||
|
<g
|
||||||
|
id="g910"
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(-1.958558,18.772823)"
|
||||||
|
inkscape:export-filename="/data/development/advotracker/advotracker/resources/images/hiedemann_logo.png"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-ydpi="96">
|
||||||
|
<rect
|
||||||
|
ry="6.2927017"
|
||||||
|
rx="0.08973857"
|
||||||
|
y="1.2013354"
|
||||||
|
x="4.9724188"
|
||||||
|
height="24.806967"
|
||||||
|
width="99.907379"
|
||||||
|
id="rect852"
|
||||||
|
style="vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.0926207;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g1098"
|
||||||
|
transform="matrix(1.3250965,0,0,1.3250965,-38.983201,-118.19402)"
|
||||||
|
inkscape:export-filename="/data/development/advotracker/advotracker/resources/images/hiedemann_logo.png"
|
||||||
|
inkscape:export-xdpi="96"
|
||||||
|
inkscape:export-ydpi="96">
|
||||||
|
<text
|
||||||
|
transform="scale(0.95388348,1.0483461)"
|
||||||
|
id="text835"
|
||||||
|
y="108.37959"
|
||||||
|
x="36.210163"
|
||||||
|
style="font-size:8.71712px;line-height:125%;font-family:FreeSans;-inkscape-font-specification:'FreeSans, Normal';letter-spacing:2.60261px;word-spacing:0px;writing-mode:lr-tb;fill:#c46069;fill-opacity:1;stroke:#000000;stroke-width:0.363212px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8.71712px;font-family:'Cyntho Pro';-inkscape-font-specification:'Cyntho Pro, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#c46069;fill-opacity:1;stroke:none;stroke-width:0.363212px"
|
||||||
|
y="108.37959"
|
||||||
|
x="36.210163"
|
||||||
|
id="tspan833"
|
||||||
|
sodipodi:role="line">HIEDE<tspan
|
||||||
|
id="tspan889"
|
||||||
|
style="letter-spacing:1.31762px">M</tspan><tspan
|
||||||
|
id="tspan883"
|
||||||
|
style="letter-spacing:1.31762px;stroke-width:0.363212px">A</tspan>NN</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611px;line-height:125%;font-family:FreeSans;-inkscape-font-specification:'FreeSans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;letter-spacing:3.43958px;word-spacing:0px;writing-mode:lr-tb;fill:#9d9b9b;fill-opacity:1;stroke:none;stroke-width:0.444725px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="40.402027"
|
||||||
|
y="104.09837"
|
||||||
|
id="text853"
|
||||||
|
transform="scale(0.86606999,1.1546411)"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan851"
|
||||||
|
x="40.402027"
|
||||||
|
y="104.09837"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;font-family:'Cyntho Pro';-inkscape-font-specification:'Cyntho Pro';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#9d9b9b;fill-opacity:1;stroke:none;stroke-width:0.444725px"><tspan
|
||||||
|
id="tspan925"
|
||||||
|
style="letter-spacing:3.70417px">REC</tspan><tspan
|
||||||
|
style="letter-spacing:3.33375px"
|
||||||
|
id="tspan1083">HT</tspan><tspan
|
||||||
|
style="letter-spacing:2.92894px"
|
||||||
|
id="tspan1075">S</tspan><tspan
|
||||||
|
style="letter-spacing:3.23585px"
|
||||||
|
id="tspan1069">AN</tspan><tspan
|
||||||
|
id="tspan921"
|
||||||
|
style="letter-spacing:2.94746px">WÄLTE</tspan></tspan></text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.3 KiB |
|
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: 71 KiB After Width: | Height: | Size: 71 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 |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -11,6 +11,7 @@ enum Action {
|
|||||||
ValueChanged(Entity),
|
ValueChanged(Entity),
|
||||||
IncrementCounter,
|
IncrementCounter,
|
||||||
RemoveItem,
|
RemoveItem,
|
||||||
|
ToggleTheme(Entity),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(AsAny)]
|
#[derive(AsAny)]
|
||||||
@@ -31,7 +32,7 @@ impl MainViewState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl State for MainViewState {
|
impl State for MainViewState {
|
||||||
fn update(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
fn update(&mut self, _: &mut Registry, ctx: &mut Context) {
|
||||||
if let Some(action) = self.action {
|
if let Some(action) = self.action {
|
||||||
match action {
|
match action {
|
||||||
Action::AddItem => {
|
Action::AddItem => {
|
||||||
@@ -48,7 +49,8 @@ impl State for MainViewState {
|
|||||||
|
|
||||||
if len == 4 {
|
if len == 4 {
|
||||||
button(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);
|
button(ctx.child("add-item-button"))
|
||||||
|
.set_visibility(Visibility::Collapsed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +64,9 @@ impl State for MainViewState {
|
|||||||
|
|
||||||
if len == 1 {
|
if len == 1 {
|
||||||
button(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); }
|
button(ctx.child("remove-item-button"))
|
||||||
|
.set_visibility(Visibility::Collapsed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Action::IncrementCounter => {
|
Action::IncrementCounter => {
|
||||||
@@ -86,10 +90,14 @@ impl State for MainViewState {
|
|||||||
Action::EntryChanged(entity) => {
|
Action::EntryChanged(entity) => {
|
||||||
println!("entry changed: {}", text_box(ctx.get_widget(entity)).text());
|
println!("entry changed: {}", text_box(ctx.get_widget(entity)).text());
|
||||||
}
|
}
|
||||||
Action::ValueChanged(entity) => {
|
Action::ValueChanged(_entity) => {
|
||||||
let val = ((slider(ctx.get_widget(entity)).val()).floor() as i32).to_string();
|
//println!("Slider value changed");
|
||||||
|
}
|
||||||
|
Action::ToggleTheme(entity) => {
|
||||||
|
let light = *ctx.get_widget(entity).get::<bool>("selected");
|
||||||
|
|
||||||
text_block(ctx.child("value_text")).set_text(String16::from(val));
|
let theme = if light { light_theme() } else { dark_theme() };
|
||||||
|
ctx.switch_theme(theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +105,7 @@ impl State for MainViewState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_post_layout(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
fn update_post_layout(&mut self, _: &mut Registry, ctx: &mut Context) {
|
||||||
let mut selection_string = "Selected:".to_string();
|
let mut selection_string = "Selected:".to_string();
|
||||||
|
|
||||||
for index in &main_view(ctx.widget()).selected_indices().0 {
|
for index in &main_view(ctx.widget()).selected_indices().0 {
|
||||||
@@ -109,11 +117,7 @@ impl State for MainViewState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
|
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
|
||||||
TextBlock::new()
|
TextBlock::new().text(text).style("header").build(ctx)
|
||||||
.text(text)
|
|
||||||
.element("text-block")
|
|
||||||
.class("h1")
|
|
||||||
.build(ctx)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type List = Vec<String>;
|
type List = Vec<String>;
|
||||||
@@ -136,6 +140,14 @@ widget!(
|
|||||||
|
|
||||||
impl Template for MainView {
|
impl Template for MainView {
|
||||||
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
||||||
|
let slider = Slider::new()
|
||||||
|
.min(0.0)
|
||||||
|
.max(1.0)
|
||||||
|
.on_changed(move |states, entity| {
|
||||||
|
state(id, states).action(Action::ValueChanged(entity));
|
||||||
|
})
|
||||||
|
.build(ctx);
|
||||||
|
|
||||||
self.name("MainView")
|
self.name("MainView")
|
||||||
.result("Button count: 0")
|
.result("Button count: 0")
|
||||||
.counter(0)
|
.counter(0)
|
||||||
@@ -147,16 +159,16 @@ impl Template for MainView {
|
|||||||
])
|
])
|
||||||
.list_count(3)
|
.list_count(3)
|
||||||
.selection_list(vec![
|
.selection_list(vec![
|
||||||
"Item 1".to_string(),
|
"Select Item 1".to_string(),
|
||||||
"Item 2".to_string(),
|
"Select Item 2".to_string(),
|
||||||
"Item 3".to_string(),
|
"Select Item 3".to_string(),
|
||||||
"Item 4".to_string(),
|
"Select Item 4".to_string(),
|
||||||
"Item 5".to_string(),
|
"Select Item 5".to_string(),
|
||||||
"Item 6".to_string(),
|
"Select Item 6".to_string(),
|
||||||
"Item 7".to_string(),
|
"Select Item 7".to_string(),
|
||||||
"Item 8".to_string(),
|
"Select Item 8".to_string(),
|
||||||
"Item 9".to_string(),
|
"Select Item 9".to_string(),
|
||||||
"Item 10".to_string(),
|
"Select Item 10".to_string(),
|
||||||
])
|
])
|
||||||
.combo_box_list(vec![
|
.combo_box_list(vec![
|
||||||
"CB 1".to_string(),
|
"CB 1".to_string(),
|
||||||
@@ -174,24 +186,20 @@ impl Template for MainView {
|
|||||||
.combo_box_list_count(10)
|
.combo_box_list_count(10)
|
||||||
.child(
|
.child(
|
||||||
Grid::new()
|
Grid::new()
|
||||||
.margin(8.)
|
.margin(8)
|
||||||
.columns(
|
.columns(Columns::new().add(132).add(16).add(132).add(16).add(132))
|
||||||
Columns::new()
|
.rows(Rows::new().add("*").add(32))
|
||||||
.add(132.)
|
|
||||||
.add(16.)
|
|
||||||
.add(132.)
|
|
||||||
.add(16.)
|
|
||||||
.add(132.),
|
|
||||||
)
|
|
||||||
.child(
|
.child(
|
||||||
|
// Row 0
|
||||||
Stack::new()
|
Stack::new()
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(0))
|
||||||
// Column 0
|
// Column 0
|
||||||
.child(create_header(ctx, "Buttons"))
|
.child(create_header(ctx, "Buttons"))
|
||||||
.child(
|
.child(
|
||||||
Button::new()
|
Button::new()
|
||||||
.text("Button")
|
.text("Button")
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.icon(material_icons_font::MD_CHECK)
|
.icon(material_icons_font::MD_CHECK)
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(1))
|
.attach(Grid::row(1))
|
||||||
@@ -204,9 +212,8 @@ impl Template for MainView {
|
|||||||
.child(
|
.child(
|
||||||
Button::new()
|
Button::new()
|
||||||
.text("Primary")
|
.text("Primary")
|
||||||
.element("button")
|
.style("button_primary")
|
||||||
.class("primary")
|
.margin((0, 8, 0, 0))
|
||||||
.margin((0., 8., 0., 0.))
|
|
||||||
.icon(material_icons_font::MD_360)
|
.icon(material_icons_font::MD_360)
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(2))
|
.attach(Grid::row(2))
|
||||||
@@ -214,9 +221,9 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
ToggleButton::new()
|
ToggleButton::new()
|
||||||
.class("single_content")
|
.style("button_single_content")
|
||||||
.text("ToggleButton")
|
.text("ToggleButton")
|
||||||
.margin((0., 8., 2., 0.))
|
.margin((0, 8, 2, 0))
|
||||||
.icon(material_icons_font::MD_ALARM_ON)
|
.icon(material_icons_font::MD_ALARM_ON)
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(3))
|
.attach(Grid::row(3))
|
||||||
@@ -225,45 +232,38 @@ impl Template for MainView {
|
|||||||
.child(
|
.child(
|
||||||
CheckBox::new()
|
CheckBox::new()
|
||||||
.text("CheckBox")
|
.text("CheckBox")
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(4))
|
.attach(Grid::row(4))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Switch::new()
|
Switch::new()
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(5))
|
.attach(Grid::row(5))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
|
.child(slider)
|
||||||
.child(
|
.child(
|
||||||
TextBlock::new()
|
ProgressBar::new()
|
||||||
.margin((0., 8., 0., 0.))
|
.val(slider)
|
||||||
.element("h1")
|
.margin((0, 8, 0, 0))
|
||||||
.id("value_text")
|
|
||||||
.text("0")
|
|
||||||
.h_align("center")
|
|
||||||
.build(ctx),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
Slider::new()
|
|
||||||
.on_changed(move |states, entity| {
|
|
||||||
state(id, states).action(Action::ValueChanged(entity));
|
|
||||||
})
|
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Stack::new()
|
Stack::new()
|
||||||
|
// Column 2
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(0))
|
||||||
.child(create_header(ctx, "Text"))
|
.child(create_header(ctx, "Text"))
|
||||||
.child(
|
.child(
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.class("body")
|
.style("body")
|
||||||
.text(("result", id))
|
.text(("result", id))
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
.attach(Grid::row(1))
|
.attach(Grid::row(1))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
@@ -272,7 +272,7 @@ impl Template for MainView {
|
|||||||
TextBox::new()
|
TextBox::new()
|
||||||
.water_mark("TextBox...")
|
.water_mark("TextBox...")
|
||||||
.text(("text_one", id))
|
.text(("text_one", id))
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
.attach(Grid::row(2))
|
.attach(Grid::row(2))
|
||||||
.on_activate(move |states, entity| {
|
.on_activate(move |states, entity| {
|
||||||
@@ -287,7 +287,7 @@ impl Template for MainView {
|
|||||||
TextBox::new()
|
TextBox::new()
|
||||||
.water_mark("TextBox...")
|
.water_mark("TextBox...")
|
||||||
.text(("text_two", id))
|
.text(("text_two", id))
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
.attach(Grid::row(2))
|
.attach(Grid::row(2))
|
||||||
.on_activate(move |states, entity| {
|
.on_activate(move |states, entity| {
|
||||||
@@ -300,11 +300,10 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new()
|
Button::new()
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.class("single_content")
|
.style("button_single_content")
|
||||||
.margin((0., 8., 8., 0.))
|
|
||||||
.icon(material_icons_font::MD_CLEAR)
|
|
||||||
.text("clear text")
|
.text("clear text")
|
||||||
|
.icon(material_icons_font::MD_CLEAR)
|
||||||
.on_click(move |states, _| {
|
.on_click(move |states, _| {
|
||||||
state(id, states).action(Action::ClearText);
|
state(id, states).action(Action::ClearText);
|
||||||
true
|
true
|
||||||
@@ -313,8 +312,8 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
NumericBox::new()
|
NumericBox::new()
|
||||||
.margin((-0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.max(123.)
|
.max(123)
|
||||||
.step(0.123)
|
.step(0.123)
|
||||||
.val(0.123)
|
.val(0.123)
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
@@ -322,24 +321,25 @@ impl Template for MainView {
|
|||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
|
// Column 4
|
||||||
Grid::new()
|
Grid::new()
|
||||||
.rows(
|
.rows(
|
||||||
Rows::new()
|
Rows::new()
|
||||||
.add("auto")
|
.add("auto")
|
||||||
.add(32.)
|
.add(32)
|
||||||
.add(16.)
|
.add(16)
|
||||||
.add(204.)
|
.add(204)
|
||||||
.add("auto")
|
.add("auto")
|
||||||
.add(192.)
|
.add(192)
|
||||||
.add("auto"),
|
.add("auto"),
|
||||||
)
|
)
|
||||||
.columns(Columns::new().add("*").add(4.).add("*"))
|
.columns(Columns::new().add("*").add(4).add("*"))
|
||||||
.attach(Grid::column(4))
|
.attach(Grid::column(4))
|
||||||
|
.attach(Grid::row(0))
|
||||||
.child(
|
.child(
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.text("Items")
|
.text("Items")
|
||||||
.element("text-block")
|
.style("header")
|
||||||
.class("h1")
|
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::column_span(3))
|
.attach(Grid::column_span(3))
|
||||||
.attach(Grid::row(0))
|
.attach(Grid::row(0))
|
||||||
@@ -353,7 +353,8 @@ impl Template for MainView {
|
|||||||
.get::<Vec<String>>("combo_box_list")[index]
|
.get::<Vec<String>>("combo_box_list")[index]
|
||||||
.clone();
|
.clone();
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.margin((0., 0., 0., 2.))
|
.style("small_text")
|
||||||
|
.margin((0, 0, 0, 2))
|
||||||
.v_align("center")
|
.v_align("center")
|
||||||
.text(text)
|
.text(text)
|
||||||
.build(bc)
|
.build(bc)
|
||||||
@@ -362,58 +363,53 @@ impl Template for MainView {
|
|||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::column_span(3))
|
.attach(Grid::column_span(3))
|
||||||
.attach(Grid::row(1))
|
.attach(Grid::row(1))
|
||||||
.margin((0., 8., 0., 0.))
|
.margin((0, 8, 0, 0))
|
||||||
.count(("combo_box_list_count", id))
|
.count(("combo_box_list_count", id))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
ItemsWidget::new()
|
ItemsWidget::new()
|
||||||
.element("items-widget")
|
|
||||||
.id("items")
|
.id("items")
|
||||||
.padding((4., 4., 4., 2.))
|
.padding((4, 4, 4, 2))
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::column_span(3))
|
.attach(Grid::column_span(3))
|
||||||
.attach(Grid::row(3))
|
.attach(Grid::row(3))
|
||||||
.margin((0., 0., 0., 8.))
|
.margin((0, 0, 0, 8))
|
||||||
|
// bc = build-context
|
||||||
.items_builder(move |bc, index| {
|
.items_builder(move |bc, index| {
|
||||||
let text = bc.get_widget(id).get::<Vec<String>>("list")
|
let text = bc.get_widget(id).get::<Vec<String>>("list")
|
||||||
[index]
|
[index]
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
Button::new()
|
Button::new().margin((0, 0, 0, 2)).text(text).build(bc)
|
||||||
.margin((0., 0., 0., 2.))
|
|
||||||
.text(text)
|
|
||||||
.build(bc)
|
|
||||||
})
|
})
|
||||||
.count(("list_count", id))
|
.count(("list_count", id))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new()
|
Button::new()
|
||||||
.element("button")
|
.style("button_single_content")
|
||||||
.class("single_content")
|
|
||||||
.id("remove-item-button")
|
.id("remove-item-button")
|
||||||
.icon(material_icons_font::MD_REMOVE_CIRCLE)
|
.icon(material_icons_font::MD_REMOVE_CIRCLE)
|
||||||
.on_click(move |states, _| {
|
.on_click(move |states, _| {
|
||||||
state(id, states).action(Action::RemoveItem);
|
state(id, states).action(Action::RemoveItem);
|
||||||
true
|
true
|
||||||
})
|
})
|
||||||
.min_width(0.)
|
.min_width(0)
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(4))
|
.attach(Grid::row(4))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new()
|
Button::new()
|
||||||
.element("button")
|
.style("button_single_content")
|
||||||
.class("single_content")
|
|
||||||
.id("add-item-button")
|
.id("add-item-button")
|
||||||
.icon(material_icons_font::MD_ADD_CIRCLE)
|
.icon(material_icons_font::MD_ADD_CIRCLE)
|
||||||
.on_click(move |states, _| {
|
.on_click(move |states, _| {
|
||||||
state(id, states).action(Action::AddItem);
|
state(id, states).action(Action::AddItem);
|
||||||
true
|
true
|
||||||
})
|
})
|
||||||
.min_width(0.)
|
.min_width(0)
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
.attach(Grid::row(4))
|
.attach(Grid::row(4))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
@@ -424,27 +420,28 @@ impl Template for MainView {
|
|||||||
.attach(Grid::column_span(3))
|
.attach(Grid::column_span(3))
|
||||||
.attach(Grid::row(5))
|
.attach(Grid::row(5))
|
||||||
.selected_indices(id)
|
.selected_indices(id)
|
||||||
.margin((0., 16., 0., 8.))
|
.margin((0, 16, 0, 8))
|
||||||
.items_builder(move |bc, index| {
|
.items_builder(move |bc, index| {
|
||||||
let text = bc
|
let text = bc
|
||||||
.get_widget(id)
|
.get_widget(id)
|
||||||
.get::<Vec<String>>("selection_list")[index]
|
.get::<Vec<String>>("selection_list")[index]
|
||||||
.clone();
|
.clone();
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.margin((0., 0., 0., 2.))
|
.margin((0, 0, 0, 2))
|
||||||
.v_align("center")
|
.v_align("center")
|
||||||
.text(text)
|
.text(text)
|
||||||
.build(bc)
|
.build(bc)
|
||||||
})
|
})
|
||||||
|
.on_selection_changed(|_, _, _| println!("Selection changed"))
|
||||||
.count(("selection_list_count", id))
|
.count(("selection_list_count", id))
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
// todo: wrong text width????
|
// todo: wrong text width????
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.element("text-block")
|
.style("body")
|
||||||
.id("selection")
|
.id("selection")
|
||||||
.max_width(120.)
|
.max_width(120)
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::column_span(3))
|
.attach(Grid::column_span(3))
|
||||||
.attach(Grid::row(6))
|
.attach(Grid::row(6))
|
||||||
@@ -453,6 +450,30 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
|
.child(
|
||||||
|
// Row 1
|
||||||
|
Stack::new()
|
||||||
|
.orientation("horizontal")
|
||||||
|
.attach(Grid::row(1))
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.style("body")
|
||||||
|
.text("Toggle theme: ")
|
||||||
|
.v_align("center")
|
||||||
|
.margin((0, 0, 4, 0))
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Switch::new()
|
||||||
|
.on_changed(move |states, entity| {
|
||||||
|
state(id, states).action(Action::ToggleTheme(entity));
|
||||||
|
})
|
||||||
|
.v_align("center")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
.build(ctx),
|
.build(ctx),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -460,14 +481,14 @@ impl Template for MainView {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// use this only if you want to run it as web application.
|
// use this only if you want to run it as web application.
|
||||||
//orbtk::initialize();
|
orbtk::initialize();
|
||||||
|
|
||||||
Application::new()
|
Application::new()
|
||||||
.window(|ctx| {
|
.window(|ctx| {
|
||||||
Window::new()
|
Window::new()
|
||||||
.title("OrbTk - widgets example")
|
.title("OrbTk - widgets example")
|
||||||
.position((100., 100.))
|
.position((100, 100))
|
||||||
.size(468., 730.)
|
.size(468, 730)
|
||||||
.resizeable(true)
|
.resizeable(true)
|
||||||
.child(MainView::new().build(ctx))
|
.child(MainView::new().build(ctx))
|
||||||
.build(ctx)
|
.build(ctx)
|
||||||
|
|||||||
124
advotracker/examples/increment_progress_bar.rs
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
//use std::sync::mpsc;
|
||||||
|
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
use orbtk::shell::WindowRequest;
|
||||||
|
|
||||||
|
static ID_CHECK_POLICY_NUMBER: &'static str = "ID_CHECK_POLICY_NUMBER";
|
||||||
|
static ID_PROGRESS_BAR: &'static str = "ID_PROGRESS_BAR";
|
||||||
|
|
||||||
|
enum Action {
|
||||||
|
ParsePolicyNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default, AsAny)]
|
||||||
|
struct MainViewState {
|
||||||
|
action: Option<Action>,
|
||||||
|
progress_bar: Entity,
|
||||||
|
text_box: Entity,
|
||||||
|
progress_counter: f64
|
||||||
|
//records: HashMap::<String, String>,
|
||||||
|
//record_counter: u64
|
||||||
|
}
|
||||||
|
|
||||||
|
impl State for MainViewState {
|
||||||
|
fn init(&mut self, _: &mut Registry, ctx: &mut Context) {
|
||||||
|
self.text_box = ctx.entity_of_child(ID_CHECK_POLICY_NUMBER).expect("Cannot get TextBox!");
|
||||||
|
self.progress_bar = ctx.entity_of_child(ID_PROGRESS_BAR).expect("Cannot get progress bar !");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update(&mut self, _: &mut Registry, ctx: &mut Context) {
|
||||||
|
// if there is an action, process it
|
||||||
|
if let Some(action) = &self.action {
|
||||||
|
match action {
|
||||||
|
Action::ParsePolicyNumber => {
|
||||||
|
let value_to_parse = ctx.get_widget(self.text_box).get::<String16>("text").clone();
|
||||||
|
self.parse_policy_number(value_to_parse, ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Reset action
|
||||||
|
self.action = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MainViewState {
|
||||||
|
fn action(&mut self, action: Action) {
|
||||||
|
self.action = Some(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn parse_policy_number(&mut self, _value: String16, ctx: &mut Context) {
|
||||||
|
self.import_csv(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn import_csv(&mut self, ctx: &mut Context) {
|
||||||
|
// code to import csv file into a hashmap
|
||||||
|
// will read in number_of_records = 100%
|
||||||
|
// progress_counter should be incremented, if
|
||||||
|
// read_in_loop will reach next 10% -> self.progress_counter += 0.1
|
||||||
|
// now fire an event to update the widget
|
||||||
|
|
||||||
|
// question: how to fire up the event inside import_csv function,
|
||||||
|
// without the need to mute "ID_CHECK_POLICY_NUMBER" ?
|
||||||
|
|
||||||
|
// given code just increments, if you change "ID_CHECK_POLICY_NUMBER"
|
||||||
|
self.progress_counter += 0.1;
|
||||||
|
self.update_progress(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update_progress(&self, ctx: &mut Context) {
|
||||||
|
// create a mpsc::Sender<WindowRequest> object
|
||||||
|
let sender = ctx.window_sender();
|
||||||
|
let mut pgbar = ctx.get_widget(self.progress_bar);
|
||||||
|
pgbar.set::<f64>("val", self.progress_counter);
|
||||||
|
// redraw screen if sender has changed
|
||||||
|
// only way to trigger a redraw: create an event
|
||||||
|
sender.send(WindowRequest::Redraw).unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
widget!(MainView<MainViewState>);
|
||||||
|
|
||||||
|
impl Template for MainView {
|
||||||
|
fn template(self, id: Entity, ctx: &mut BuildContext) -> Self {
|
||||||
|
self
|
||||||
|
.margin(32.0)
|
||||||
|
.child(
|
||||||
|
Stack::new()
|
||||||
|
.orientation("vertical")
|
||||||
|
.h_align("center")
|
||||||
|
.v_align("top")
|
||||||
|
.spacing(8.0)
|
||||||
|
.child(
|
||||||
|
TextBox::new()
|
||||||
|
.id(ID_CHECK_POLICY_NUMBER)
|
||||||
|
.water_mark("Mut value and type <Return>")
|
||||||
|
.on_activate(move |states, _entity| {
|
||||||
|
// you have to fire a new event to be able to get in the update() with access to Context
|
||||||
|
states.get_mut::<MainViewState>(id).action(Action::ParsePolicyNumber);
|
||||||
|
})
|
||||||
|
.build(ctx)
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
ProgressBar::new()
|
||||||
|
.id(ID_PROGRESS_BAR)
|
||||||
|
.build(ctx)
|
||||||
|
)
|
||||||
|
.build(ctx)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
Application::new()
|
||||||
|
.window(|ctx| {
|
||||||
|
Window::new()
|
||||||
|
.title("incroment_progress_bar skeleton")
|
||||||
|
.position((100.0, 100.0))
|
||||||
|
.size(420.0, 730.0)
|
||||||
|
.resizeable(true)
|
||||||
|
.child(MainView::new().build(ctx))
|
||||||
|
.build(ctx)
|
||||||
|
})
|
||||||
|
.run();
|
||||||
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
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());
|
|
||||||
}
|
|
||||||
@@ -1,235 +0,0 @@
|
|||||||
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,32 +0,0 @@
|
|||||||
.header {
|
|
||||||
background: #444e55;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
text_box {
|
|
||||||
background: transparent;
|
|
||||||
border-width: 0;
|
|
||||||
color: #9dafbf;
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
#input {
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-block {
|
|
||||||
font-size: 42;
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
#input {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
border-radius: 1;
|
|
||||||
font-size: 20;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
.header {
|
|
||||||
background: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
text_box {
|
|
||||||
color: #4d4c4c;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-block {
|
|
||||||
color: #4d4c4c;
|
|
||||||
}
|
|
||||||
@@ -1,581 +0,0 @@
|
|||||||
<!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>
|
|
||||||
|
|
||||||
@@ -1,581 +0,0 @@
|
|||||||
<!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>
|
|
||||||
|
|
||||||
@@ -1,581 +0,0 @@
|
|||||||
<!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>
|
|
||||||
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
* {
|
|
||||||
font-size: 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
lynch {
|
|
||||||
background: #647b91;
|
|
||||||
}
|
|
||||||
|
|
||||||
bluebayoux {
|
|
||||||
background: #516475;
|
|
||||||
}
|
|
||||||
|
|
||||||
linkwater {
|
|
||||||
background: #dfebf5;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
light-text {
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
goldendream {
|
|
||||||
background: #efd035;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 237 KiB |
@@ -1,25 +0,0 @@
|
|||||||
* {
|
|
||||||
font-size: 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
lynch {
|
|
||||||
background: #647b91;
|
|
||||||
}
|
|
||||||
|
|
||||||
bluebayoux {
|
|
||||||
background: #516475;
|
|
||||||
}
|
|
||||||
|
|
||||||
linkwater {
|
|
||||||
background: #dfebf5;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
light-text {
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
goldendream {
|
|
||||||
background: #efd035;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
.header {
|
|
||||||
background: #444e55;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-box {
|
|
||||||
background: transparent;
|
|
||||||
border-width: 0;
|
|
||||||
color: #9dafbf;
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
#input {
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-block {
|
|
||||||
font-size: 42;
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
#input {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
border-radius: 1;
|
|
||||||
font-size: 20;
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
* {
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
background: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-box {
|
|
||||||
color: #4d4c4c;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-block {
|
|
||||||
color: #4d4c4c;
|
|
||||||
}
|
|
||||||
|
|
||||||
light-text {
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
.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 */
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
.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;
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
* {
|
|
||||||
font-size: 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
lynch {
|
|
||||||
background: #647b91;
|
|
||||||
}
|
|
||||||
|
|
||||||
bluebayoux {
|
|
||||||
background: #516475;
|
|
||||||
}
|
|
||||||
|
|
||||||
linkwater {
|
|
||||||
background: #dfebf5;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
light-text {
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
goldendream {
|
|
||||||
background: #efd035;
|
|
||||||
color: #3b434a;
|
|
||||||
}
|
|
||||||
|
|
||||||
lightgrey {
|
|
||||||
#f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
darkgrey {
|
|
||||||
#879488;
|
|
||||||
}
|
|
||||||
|
|
||||||
grey {
|
|
||||||
#b6c3b7;
|
|
||||||
}
|
|
||||||
|
|
||||||
Indigo-bases {
|
|
||||||
#5c6bc0;
|
|
||||||
}
|
|
||||||
|
|
||||||
hiedemann-blue {
|
|
||||||
#a5b3bf;
|
|
||||||
}
|
|
||||||
|
|
||||||
hiedemann-red {
|
|
||||||
color: #5b0f22;
|
|
||||||
}
|
|
||||||
|
|
||||||
hiedemann {
|
|
||||||
background: #5b0f22;
|
|
||||||
color: #879488;
|
|
||||||
//color: #3b434a;
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
* {
|
|
||||||
font-size: 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
background: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.background {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-box {
|
|
||||||
color: #5b0f22;
|
|
||||||
}
|
|
||||||
|
|
||||||
text-block {
|
|
||||||
color: #5b0f22;
|
|
||||||
}
|
|
||||||
|
|
||||||
light-text {
|
|
||||||
color: #dfebf5;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* // Hiedemann blue */
|
|
||||||
/* color: #a5b3bf; */
|
|
||||||
/* color: #4d4c4c; */
|
|
||||||
|
|
||||||
/* // 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 */
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
.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 */
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
.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;
|
|
||||||
}
|
|
||||||
@@ -1 +1 @@
|
|||||||
../../../data/POLLFNR_WOECHENTLICH.txt
|
../../../advotrackerd/data/POLLFNR_WOECHENTLICH.txt
|
||||||
98
advotracker/src/bin/csv-test/locales/csv-test_json.bak
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"err.lang.not_found": {
|
||||||
|
"de_DE.UTF-8": "Konnte die Umgebungsvarialbe LANG nicht auslesen",
|
||||||
|
"de": "Konnte die Umgebungsvarialbe LANG nicht auslesen",
|
||||||
|
"en": "Couldn't read LANG"
|
||||||
|
},
|
||||||
|
"err.user.not_found": {
|
||||||
|
"fr": "Utilisateur introuvable: $email, $id",
|
||||||
|
"de-DE.UTF-8": "Anwender nicht gefunden: $email, $id",
|
||||||
|
"de": "Anwender nicht gefunden: $email, $id",
|
||||||
|
"en": "User not found: $email, $id"
|
||||||
|
},
|
||||||
|
"main.started": {
|
||||||
|
"de_DE.UTF-8": "Programmlogik starten",
|
||||||
|
"de": "Programmlogik starten",
|
||||||
|
"en": "Program logic started"
|
||||||
|
},
|
||||||
|
"main.finished": {
|
||||||
|
"de_DE.UTF-8": "Programmlogik beendet",
|
||||||
|
"de": "Programmlogik beendet",
|
||||||
|
"en": "Program logic finished"
|
||||||
|
},
|
||||||
|
"parse.arguments": {
|
||||||
|
"de_DE.UTF-8": "Programmargumente prüfen",
|
||||||
|
"de": "Programmargumente prüfen",
|
||||||
|
"en": "Parsing arguments"
|
||||||
|
},
|
||||||
|
"parse.environment": {
|
||||||
|
"de_DE.UTF-8": "Umgebungsvariablen prüfen",
|
||||||
|
"de": "Umgebungsvariablen prüfen",
|
||||||
|
"en": "Parsing environment"
|
||||||
|
},
|
||||||
|
"parse.results": {
|
||||||
|
"de_DE.UTF-8": "Ergebnisse der Konfigurations-Parameterprüfung",
|
||||||
|
"de": "Ergebnisse der Konfigurationsparameterprüfung",
|
||||||
|
"en": "Config parsing results"
|
||||||
|
},
|
||||||
|
"config.name": {
|
||||||
|
"de_DE.UTF-8": "Konfigurationswert für",
|
||||||
|
"de": "Konfigurationswert für",
|
||||||
|
"en": "Config Value for"
|
||||||
|
},
|
||||||
|
"config.name.lang": {
|
||||||
|
"de_DE.UTF-8": "Sprach-Code",
|
||||||
|
"de": "Sprach-Code",
|
||||||
|
"en": "Language code"
|
||||||
|
},
|
||||||
|
"config.name.verbositylevel": {
|
||||||
|
"de_DE.UTF-8": "Ausgabe-Ebene",
|
||||||
|
"de": "Ausgabe-Ebene",
|
||||||
|
"en": "verbosity level"
|
||||||
|
},
|
||||||
|
"config.name.environment": {
|
||||||
|
"de_DE.UTF-8": "Umgebungsvariablen",
|
||||||
|
"de": "Umgebungsvariablen",
|
||||||
|
"en": "environment"
|
||||||
|
},
|
||||||
|
"config.name.configfile": {
|
||||||
|
"de_DE.UTF-8": "Konfigurations-Datei",
|
||||||
|
"de": "Konfigurations-Datei",
|
||||||
|
"en": "config file"
|
||||||
|
},
|
||||||
|
"config.name.dbdriver": {
|
||||||
|
"de_DE.UTF-8": "Datenbank-Treiber",
|
||||||
|
"de": "Datenbank-Treiber",
|
||||||
|
"en": "database driver"
|
||||||
|
},
|
||||||
|
"csv_import.started": {
|
||||||
|
"de_DE.UTF-8": "importieren von einer csv-datei gestartet",
|
||||||
|
"de": "importieren von einer csv-datei gestartet",
|
||||||
|
"en": "import from a csv-file started"
|
||||||
|
},
|
||||||
|
"csv_import.finished": {
|
||||||
|
"de_DE.UTF-8": "importieren von einer csv-datei beendet",
|
||||||
|
"de": "importieren von einer csv-datei beendet",
|
||||||
|
"en": "import from a csv-file finished"
|
||||||
|
},
|
||||||
|
"csv_export.started": {
|
||||||
|
"de_DE.UTF-8": "exportieren in eine csv-datei gestartet",
|
||||||
|
"de": "exportieren in eine csv-datei gestartet",
|
||||||
|
"en": "export to csv-file started"
|
||||||
|
},
|
||||||
|
"csv_export.finished": {
|
||||||
|
"de_DE.UTF-8": "exportieren in eine csv-datei beendet",
|
||||||
|
"de": "exportieren in eine csv-datei beendet",
|
||||||
|
"en": "export to csv-file finished"
|
||||||
|
},
|
||||||
|
"state.started": {
|
||||||
|
"de_DE.UTF-8": "gestartet",
|
||||||
|
"de": "gestartet",
|
||||||
|
"en": "started"
|
||||||
|
},
|
||||||
|
"state.finished": {
|
||||||
|
"de_DE.UTF-8": "beendet",
|
||||||
|
"de": "beended",
|
||||||
|
"en": "finished"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use chrono::{Local, DateTime};
|
use chrono::{Local, DateTime};
|
||||||
|
use locales::t;
|
||||||
//use serde::{Deserialize, Serialize};
|
//use serde::{Deserialize, Serialize};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::env;
|
use std::env;
|
||||||
@@ -30,17 +31,19 @@ struct Environment {
|
|||||||
/// export as csv format
|
/// export as csv format
|
||||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||||
/// https://blog.burntsushi.net/csv/
|
/// https://blog.burntsushi.net/csv/
|
||||||
fn export(p: &mut String, lang: &String) -> Result<usize, Box<dyn Error>> {
|
fn export(p: &mut String, lang: &String) -> Result<u64, Box<dyn Error>> {
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
//use std::ffi::OsStr;
|
//use std::ffi::OsStr;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
|
|
||||||
|
let mut res = t!("csv.export.started", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
let dt_start: DateTime<Local> = Local::now();
|
let dt_start: DateTime<Local> = Local::now();
|
||||||
|
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
process = "main",
|
process = ?res,
|
||||||
state = "started",
|
state = ?state,
|
||||||
date_start = ?dt_start.to_string());
|
date_start = ?dt_start.to_string());
|
||||||
|
|
||||||
// Note: slash syntax also works on Windows!
|
// Note: slash syntax also works on Windows!
|
||||||
@@ -66,10 +69,12 @@ fn export(p: &mut String, lang: &String) -> Result<usize, Box<dyn Error>> {
|
|||||||
|
|
||||||
let dt_end: DateTime<Local> = Local::now();
|
let dt_end: DateTime<Local> = Local::now();
|
||||||
let duration = dt_end.signed_duration_since(dt_start);
|
let duration = dt_end.signed_duration_since(dt_start);
|
||||||
//println!("Duration: {:#?}", duration);
|
println!("Duration: {:#?}", duration);
|
||||||
|
|
||||||
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
||||||
trace!(target: "csv-test", process = "csv-import", state = "finished");
|
state = t!("state.finished", lang);
|
||||||
|
res = t!("csv.import.finished", lang);
|
||||||
|
trace!(target: "csv-test", process = ?res, state = ?state);
|
||||||
|
|
||||||
Ok(count)
|
Ok(count)
|
||||||
}
|
}
|
||||||
@@ -78,17 +83,19 @@ fn export(p: &mut String, lang: &String) -> Result<usize, Box<dyn Error>> {
|
|||||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||||
/// https://blog.burntsushi.net/csv/
|
/// https://blog.burntsushi.net/csv/
|
||||||
fn import(p: &mut String, data_list: &mut PolicyDataList,
|
fn import(p: &mut String, data_list: &mut PolicyDataList,
|
||||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
policy_numbers: &mut HashMap<u64, PolicyCode>, lang: &String)
|
||||||
-> Result<usize, Box<dyn Error>> {
|
-> Result<u64, Box<dyn Error>> {
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
||||||
|
let mut res = t!("csv.import.started", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
let dt_start: DateTime<Local> = Local::now();
|
let dt_start: DateTime<Local> = Local::now();
|
||||||
|
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
process = "csv-import",
|
process = ?res,
|
||||||
state = "started",
|
state = ?state,
|
||||||
date_start = ?dt_start.to_string());
|
date_start = ?dt_start.to_string());
|
||||||
|
|
||||||
// Note: slash syntax also workd on Windows!
|
// Note: slash syntax also workd on Windows!
|
||||||
@@ -97,7 +104,7 @@ fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
// must be a readable file
|
// must be a readable file
|
||||||
trace!(target: "csv-test", path = ?path);
|
trace!(target: "csv-test", path = ?path);
|
||||||
let valid = path.is_file();
|
let valid = path.is_file();
|
||||||
//println!("is_file: {}", valid);
|
println!("is_file: {}", valid);
|
||||||
|
|
||||||
//if let Some(res) = valid
|
//if let Some(res) = valid
|
||||||
assert_eq!(path.is_file(), true);
|
assert_eq!(path.is_file(), true);
|
||||||
@@ -147,33 +154,16 @@ fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
count +=1;
|
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 dt_end: DateTime<Local> = Local::now();
|
||||||
let duration = dt_end.signed_duration_since(dt_start);
|
let duration = dt_end.signed_duration_since(dt_start);
|
||||||
|
|
||||||
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
trace!(target: "csv-test", record_count = ?count, duration = ?duration);
|
||||||
|
|
||||||
|
state = t!("state.finished", lang);
|
||||||
|
res = t!("csv.import.finished", lang);
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
process = "csv-import",
|
process = ?res,
|
||||||
state = "finished",
|
state = ?state,
|
||||||
date_stop = ?dt_end.to_string());
|
date_stop = ?dt_end.to_string());
|
||||||
|
|
||||||
Ok(count)
|
Ok(count)
|
||||||
@@ -182,15 +172,17 @@ fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
/// validate a given policy number
|
/// validate a given policy number
|
||||||
/// result will return true or false
|
/// result will return true or false
|
||||||
fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
fn is_valid(policy_number: &u64, policy_list: &PolicyDataList,
|
||||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
policy_numbers: &mut HashMap<u64, PolicyCode>, lang: &String)
|
||||||
-> Result<bool, Box<dyn std::error::Error>> {
|
-> Result<bool, Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
|
let mut res = t!("policy.validation.started", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
let dt_start: DateTime<Local> = Local::now();
|
let dt_start: DateTime<Local> = Local::now();
|
||||||
|
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
process = "policy-validation",
|
process = ?res,
|
||||||
state = "started",
|
state = ?state,
|
||||||
policy_number = ?policy_number,
|
policy_number = ?policy_number,
|
||||||
policy_list = ?policy_list.name,
|
policy_list = ?policy_list.name,
|
||||||
elements = ?policy_list.policy_data.len(),
|
elements = ?policy_list.policy_data.len(),
|
||||||
@@ -246,19 +238,22 @@ fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
|||||||
let mut result = false;
|
let mut result = false;
|
||||||
match policy_numbers.get(&policy_number) {
|
match policy_numbers.get(&policy_number) {
|
||||||
Some(&policy_code) => {
|
Some(&policy_code) => {
|
||||||
|
let res = t!("policy.validation.success", lang);
|
||||||
println!("policy_number: {} ({:?})",
|
println!("policy_number: {} ({:?})",
|
||||||
policy_number, policy_code);
|
policy_number, policy_code);
|
||||||
result = true;
|
result = true;
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
policy_number = ?policy_number,
|
policy_number = ?policy_number,
|
||||||
validation = "success",
|
validation = ?res,
|
||||||
policy_code = ?policy_code);
|
policy_code = ?policy_code);
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
println!("Noop! Number isn't valid!");
|
let res = t!("policy.validation.failed", lang);
|
||||||
|
//println!("Noop! Number isn't valid!");
|
||||||
|
println!("{:?}", res);
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
policy_number = ?policy_number,
|
policy_number = ?policy_number,
|
||||||
validation = "failed");
|
validation = ?res);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,9 +261,11 @@ fn is_valid(policy_number: &usize, policy_list: &PolicyDataList,
|
|||||||
let dt_end: DateTime<Local> = Local::now();
|
let dt_end: DateTime<Local> = Local::now();
|
||||||
let duration = dt_end.signed_duration_since(dt_start);
|
let duration = dt_end.signed_duration_since(dt_start);
|
||||||
|
|
||||||
|
res = t!("policy.validation.finished", lang);
|
||||||
|
state = t!("state.finished", lang);
|
||||||
trace!(target: "csv-test",
|
trace!(target: "csv-test",
|
||||||
process = "policy-validation",
|
process = ?res,
|
||||||
state = "finished",
|
state = ?state,
|
||||||
date_stop = ?dt_end.to_string(),
|
date_stop = ?dt_end.to_string(),
|
||||||
duration = ?duration);
|
duration = ?duration);
|
||||||
|
|
||||||
@@ -298,7 +295,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
tracing::subscriber::with_default(subscriber, || {
|
tracing::subscriber::with_default(subscriber, || {
|
||||||
// get system environment
|
// get system environment
|
||||||
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
||||||
trace!(target: "csv-test", message = "parse-environment", state = "started");
|
let mut res = t!("parse.environment", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
|
trace!(target: "csv-test", message = ?res, state = ?state);
|
||||||
//debug!(message = ?res, state = ?state);
|
//debug!(message = ?res, state = ?state);
|
||||||
trace!(target: "csv-test", environment = "system", lang = ?lang);
|
trace!(target: "csv-test", environment = "system", lang = ?lang);
|
||||||
|
|
||||||
@@ -311,21 +310,28 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Err(e) => { debug!(target: "csv-test", "{}", e); }
|
Err(e) => { debug!(target: "csv-test", "{}", e); }
|
||||||
}
|
}
|
||||||
// how to handle unumplemented lang resources??
|
// how to handle unumplemented lang resources??
|
||||||
|
res = t!("parse.environment", lang);
|
||||||
trace!(target: "csv-test", environment = "envy", lang = ?lang);
|
trace!(target: "csv-test", environment = "envy", lang = ?lang);
|
||||||
trace!(target: "csv-test", message = "parse-enviroment", state = "finished");
|
state = t!("state.finished", lang);
|
||||||
|
trace!(target: "csv-test", message = ?res, state = ?state);
|
||||||
|
|
||||||
// initialize viperus structure
|
// initialize viperus structure
|
||||||
let mut v = Viperus::new();
|
let mut v = Viperus::new();
|
||||||
|
|
||||||
// parse commandline arguments
|
// parse commandline arguments
|
||||||
trace!(target: "csv-test", process = "parse-arguments", state = "started");
|
res = t!("parse.arguments", lang);
|
||||||
|
state = t!("state.started", lang);
|
||||||
|
trace!(target: "csv-test", process = ?res, state = ?state);
|
||||||
|
|
||||||
let _ = parse_args(&mut v);
|
let _ = parse_args(&mut v);
|
||||||
trace!(target: "csv-test", process = "parse-arguments", state = "finished");
|
state = t!("state.finished", lang);
|
||||||
|
trace!(target: "csv-test", process = ?res, state = ?state);
|
||||||
//trace!(target: "Viperus", "Config results: {:?}", v);
|
//trace!(target: "Viperus", "Config results: {:?}", v);
|
||||||
|
|
||||||
// main tasks
|
// main tasks
|
||||||
trace!(target: "csv-test", process = "main", state = "started");
|
res = t!("main.started", lang);
|
||||||
|
state = t!("state.started", lang);
|
||||||
|
trace!(target: "csv-test", process = ?res, state = ?state);
|
||||||
|
|
||||||
// importing policy code elements from csv-file
|
// importing policy code elements from csv-file
|
||||||
let policy_list = PolicyList::new("Allianz Versicherungsnummen-List");
|
let policy_list = PolicyList::new("Allianz Versicherungsnummen-List");
|
||||||
@@ -334,7 +340,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let mut policy_data = PolicyDataList::new("Allianz-Import 20200628");
|
let mut policy_data = PolicyDataList::new("Allianz-Import 20200628");
|
||||||
println!("Policy Data List {:?} ", policy_data.name);
|
println!("Policy Data List {:?} ", policy_data.name);
|
||||||
|
|
||||||
let mut policy_numbers : HashMap<usize, PolicyCode> = HashMap::new();
|
let mut policy_numbers : HashMap<u64, PolicyCode> = HashMap::new();
|
||||||
|
|
||||||
let mut csv_import_path = v.get::<String>("import_file").unwrap();
|
let mut csv_import_path = v.get::<String>("import_file").unwrap();
|
||||||
match import(&mut csv_import_path, &mut policy_data,
|
match import(&mut csv_import_path, &mut policy_data,
|
||||||
@@ -349,20 +355,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// test if policy_number is_valid
|
// test if policy_number is_valid
|
||||||
let test_policy_number = v.get::<i32>("test_policy_number").unwrap() as usize;
|
let test_policy_number = v.get::<i32>("test_policy_number").unwrap() as u64;
|
||||||
trace!(target: "csv-test", test_policy_number = ?test_policy_number);
|
trace!(target: "csv-test", test_policy_number = ?test_policy_number);
|
||||||
//let policy_number : usize = 1999999999;
|
//let policy_number : u64 = 1999999999;
|
||||||
//match is_valid(&policy_number, &policy_data, &mut policy_numbers, &lang) {
|
//match is_valid(&policy_number, &policy_data, &mut policy_numbers, &lang) {
|
||||||
// Ok(true) => {
|
// Ok(true) => {
|
||||||
// use Hashmap method 'get' to check if we have the given key
|
// use Hashmap method 'get' to check if we have the given key
|
||||||
match &policy_numbers.get(&test_policy_number) {
|
match policy_numbers.get(&test_policy_number) {
|
||||||
Some(&policy_code) => {
|
Some(&policy_code) => {
|
||||||
println!("policy-validation success");
|
let res = t!("policy.validation.success", lang);
|
||||||
|
println!("{:?}", res);
|
||||||
println!("policy_number: {} ({:?})",
|
println!("policy_number: {} ({:?})",
|
||||||
test_policy_number, policy_code);
|
test_policy_number, policy_code);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
println!("Policy-validation failed");
|
let res = t!("policy.validation.failed", lang);
|
||||||
|
println!("{:?}", res);
|
||||||
//println!("Nuup! Number isn't valid!");
|
//println!("Nuup! Number isn't valid!");
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -379,9 +387,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trace!(target: "csv-test",
|
state = t!("state.finished", lang);
|
||||||
process = "main",
|
res = t!("main.finished", lang);
|
||||||
state = "finished");
|
trace!(target: "csv-test", process = ?res, state = ?state);
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
use orbtk::prelude::*;
|
use orbtk::prelude::*;
|
||||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
|
||||||
//use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
|
||||||
|
|
||||||
//#[cfg(feature = "light-theme")]
|
// use orbtk::theme::DEFAULT_THEME_CSS;
|
||||||
static WIDGET_EXT: &'static str = include_str!("../../resources/stylesheets/policyholder_check.css");
|
// use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
||||||
|
|
||||||
fn get_theme() -> ThemeValue {
|
// //#[cfg(feature = "light-theme")]
|
||||||
//ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
// static WIDGET_EXT: &'static str = include_str!("../../resources/stylesheets/policyholder_check.css");
|
||||||
ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
|
||||||
.extension_css(WIDGET_EXT)
|
// fn get_theme() -> ThemeValue {
|
||||||
.build()
|
// //ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
||||||
}
|
// ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
||||||
|
// .extension_css(WIDGET_EXT)
|
||||||
|
// .build()
|
||||||
|
// }
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
enum Action {
|
enum Action {
|
||||||
@@ -84,8 +85,8 @@ impl State for MainViewState {
|
|||||||
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
|
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.text(text)
|
.text(text)
|
||||||
.element("text-block")
|
//.element("text-block")
|
||||||
.class("h1")
|
.style("header")
|
||||||
.build(ctx)
|
.build(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +125,7 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Grid::new()
|
Grid::new()
|
||||||
.element("policyholder_check")
|
//.element("policyholder_check")
|
||||||
.margin((4.0, 24.0, 24.0, 4.0))
|
.margin((4.0, 24.0, 24.0, 4.0))
|
||||||
.min_width(180.0)
|
.min_width(180.0)
|
||||||
.min_height(80.0)
|
.min_height(80.0)
|
||||||
@@ -165,7 +166,7 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
TextBlock::new()
|
TextBlock::new()
|
||||||
.element("text-block")
|
//.element("text-block")
|
||||||
.id("result")
|
.id("result")
|
||||||
.min_width(80.0)
|
.min_width(80.0)
|
||||||
.max_width(180.0)
|
.max_width(180.0)
|
||||||
@@ -179,7 +180,7 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Grid::new()
|
Grid::new()
|
||||||
.element("logo_customer")
|
//.element("logo_customer")
|
||||||
.margin((9.0, 16.0, 16.0, 9.0))
|
.margin((9.0, 16.0, 16.0, 9.0))
|
||||||
.attach(Grid::column(0))
|
.attach(Grid::column(0))
|
||||||
.attach(Grid::row(1))
|
.attach(Grid::row(1))
|
||||||
@@ -193,7 +194,7 @@ impl Template for MainView {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Grid::new()
|
Grid::new()
|
||||||
.element("logo_vendor")
|
//.element("logo_vendor")
|
||||||
.margin((9.0, 16.0, 16.0, 9.0))
|
.margin((9.0, 16.0, 16.0, 9.0))
|
||||||
.attach(Grid::column(2))
|
.attach(Grid::column(2))
|
||||||
.attach(Grid::row(1))
|
.attach(Grid::row(1))
|
||||||
@@ -222,7 +223,7 @@ fn main() {
|
|||||||
.min_width(460.0)
|
.min_width(460.0)
|
||||||
.min_height(180.0)
|
.min_height(180.0)
|
||||||
.resizeable(true)
|
.resizeable(true)
|
||||||
.theme(get_theme())
|
//.theme(get_theme())
|
||||||
.child(MainView::new().build(ctx))
|
.child(MainView::new().build(ctx))
|
||||||
.build(ctx)
|
.build(ctx)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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;
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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)
|
|
||||||
}
|
|
||||||
@@ -1,355 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
88
advotracker/src/data/constants.rs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Styles (RON based theme system)
|
||||||
|
pub static STYLE_BOTTOM_BAR: &str = "bottom_bar";
|
||||||
|
pub static STYLE_HEADER_BAR: &str = "header_bar";
|
||||||
|
pub static STYLE_SEPERATOR: &str = "seperator";
|
||||||
|
//pub static STYLE_ITEM_BUTTON: &str = "item_button";
|
||||||
|
pub static STYLE_MENU: &str = "menu";
|
||||||
|
pub static STYLE_BUTTON_MENU: &str = "button_menu";
|
||||||
|
pub static STYLE_STACK_MENU: &str = "stack_menu";
|
||||||
|
|
||||||
|
// Widget IDs (DCES: Entity[id] => [Component1, .. , Component<n>] -> data or state)
|
||||||
|
pub static ID_CONFIGURATION_FORM: &str = "configuration_form";
|
||||||
|
pub static ID_CONFIGURATION_HEADER: &str = "configuration_header";
|
||||||
|
pub static ID_CONFIGURATION_LABEL_CONFIG_FILE: &str = "configuration_label_config_file";
|
||||||
|
pub static ID_CONFIGURATION_CONFIG_FILE: &str = "configuration_config_file";
|
||||||
|
pub static ID_CONFIGURATION_LABEL_LANGUAGE_ID: &str = "configuration_label_language_id";
|
||||||
|
pub static ID_CONFIGURATION_LANGUAGE_ID: &str = "configuration_language_id";
|
||||||
|
|
||||||
|
pub static ID_LOCALIZATION_FORM: &str = "localization_form";
|
||||||
|
pub static ID_LOCALIZATION_HEADER: &str = "localization_header";
|
||||||
|
pub static ID_LOCALIZATION_LANGUAGES: &str = "localization_languages";
|
||||||
|
pub static ID_LOCALIZATION_LABEL_LANGUAGE_NAME: &str = "localization_label_language_name";
|
||||||
|
pub static ID_LOCALIZATION_LANGUAGE_NAME: &str = "localization_language_name";
|
||||||
|
|
||||||
|
pub static ID_MENU_POPUP: &str = "menu_popup";
|
||||||
|
pub static ID_MENU_STACK: &str = "menu_stack";
|
||||||
|
pub static ID_MENU_BUTTON: &str = "menu_button";
|
||||||
|
pub static ID_MENU_GRID: &str = "menu_grid";
|
||||||
|
pub static ID_MENU_LABEL_ACCOUNT: &str = "menu_label_account";
|
||||||
|
pub static ID_MENU_LABEL_QUIT: &str = "menu_label_quit";
|
||||||
|
pub static ID_MENU_LABEL_TOGGLE_THEME: &str = "menu_label_toggle_theme";
|
||||||
|
pub static ID_MENU_SHORTCUT_QUIT: &str = "menu_shortcut_quit";
|
||||||
|
pub static ID_MENU_TOGGLE_THEME: &str = "menu_toggle_theme";
|
||||||
|
|
||||||
|
pub static ID_POLICY_CHECK_FORM: &str = "policy_check_form";
|
||||||
|
pub static ID_POLICY_CHECK_FORM_ROW_0: &str = "policy_check_form_row_0";
|
||||||
|
pub static ID_POLICY_CHECK_FORM_ROW_1: &str = "policy_check_form_row_1";
|
||||||
|
pub static ID_POLICY_CHECK_FORM_ROW_2: &str = "policy_check_form_row_2";
|
||||||
|
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_BUTTON_RESULT: &str = "policy_check_button_result";
|
||||||
|
pub static ID_POLICY_CHECK_BUTTON_MENU: &str = "policy_check_button_menu";
|
||||||
|
pub static ID_POLICY_CHECK_DATA_COUNT_BLOCK: &str = "policy_check_data_count_block";
|
||||||
|
pub static ID_POLICY_CHECK_HINT: &str = "policy_check_hint";
|
||||||
|
pub static ID_POLICY_CHECK_LABEL_HINT: &str = "policy_check_label_hint";
|
||||||
|
pub static ID_POLICY_CHECK_LABEL_MENU: &str = "policy_check_label_menu";
|
||||||
|
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_POLICY_NUMBER: &str = "policy_check_policy_number";
|
||||||
|
pub static ID_POLICY_CHECK_POPUP_PROGRESS: &str = "policy_check_popup_progress";
|
||||||
|
pub static ID_POLICY_CHECK_PROGRESS_BAR: &str = "policy_check_progress_bar";
|
||||||
|
pub static ID_POLICY_CHECK_PROGRESS_TIME: &str = "policy_check_progress_time";
|
||||||
|
pub static ID_POLICY_CHECK_PROGRESS_TEXT: &str = "policy_check_progress_text";
|
||||||
|
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: &str = "policy_data_count";
|
||||||
|
pub static ID_POLICY_DATA_LABEL: &str = "policy_data_label";
|
||||||
|
pub static ID_POLICY_DATA_ITEMS_WIDGET: &str = "policy_data_items_widget";
|
||||||
|
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_STACK: &str = "policy_data_stack";
|
||||||
|
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";
|
||||||
|
|
||||||
|
// Component Values (Properties)
|
||||||
|
pub static PROP_ADVOTRACKER: &str = "advotracker";
|
||||||
|
pub static PROP_POLICY_CHECK: &str = "policy_check";
|
||||||
|
pub static PROP_POLICY_PROGRESS_COUNT: &str = "policy_progress_count";
|
||||||
|
|
||||||
|
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";
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
// 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";
|
|
||||||
@@ -5,8 +5,9 @@
|
|||||||
* SPDX-License-Identifier: (0BSD or MIT)
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// structures with implementations
|
|
||||||
pub mod structures;
|
|
||||||
|
|
||||||
/// provides orbtk widgets constants
|
/// provides orbtk widgets constants
|
||||||
pub mod keys;
|
pub mod constants;
|
||||||
|
|
||||||
|
/// structures with implementations
|
||||||
|
pub mod structures;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
/// An enumeration of valid policy codes.
|
/// An enumeration of valid policy codes.
|
||||||
/// right now, only "AS" is used.
|
/// right now, only "AS" is used.
|
||||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||||
pub enum PolicyCode {
|
pub enum PolicyCode {
|
||||||
/// Allianz Sachversicherung
|
/// Allianz Sachversicherung
|
||||||
AS
|
AS
|
||||||
@@ -66,7 +66,7 @@ impl Default for CommunicationType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Status of a given policy data element.
|
/// Status of a given policy data element.
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)]
|
||||||
pub enum Status {
|
pub enum Status {
|
||||||
/// Active -> the policy is active an supported
|
/// Active -> the policy is active an supported
|
||||||
Active,
|
Active,
|
||||||
@@ -95,7 +95,7 @@ pub struct CsvExportRecord {
|
|||||||
/// Versicherungsschein Code
|
/// Versicherungsschein Code
|
||||||
pub policy_code: String,
|
pub policy_code: String,
|
||||||
/// Versicherungsscheinnummer (10-stellig, numerisch)
|
/// Versicherungsscheinnummer (10-stellig, numerisch)
|
||||||
pub policy_number: u32,
|
pub policy_number: u64,
|
||||||
/// Anrufer: "Vorname, Nachname"
|
/// Anrufer: "Vorname, Nachname"
|
||||||
pub policy_holder: String,
|
pub policy_holder: String,
|
||||||
/// Sachverhalt: "Kurzschilderung"
|
/// Sachverhalt: "Kurzschilderung"
|
||||||
@@ -141,7 +141,7 @@ pub struct HarmType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Structure used to verify a policy data element.
|
/// Structure used to verify a policy data element.
|
||||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
#[derive(Default, Debug, Clone, Deserialize, PartialEq, Serialize)]
|
||||||
pub struct PolicyCheck {
|
pub struct PolicyCheck {
|
||||||
/// Versicherungsschein-Prüfnummer
|
/// Versicherungsschein-Prüfnummer
|
||||||
pub policy_check_number: String,
|
pub policy_check_number: String,
|
||||||
@@ -150,13 +150,12 @@ pub struct PolicyCheck {
|
|||||||
/// Referenz zum Versicherungsschein-Typ
|
/// Referenz zum Versicherungsschein-Typ
|
||||||
pub policy_code: PolicyCode,
|
pub policy_code: PolicyCode,
|
||||||
/// Referenz zur Versicherungsschein-Nummer
|
/// Referenz zur Versicherungsschein-Nummer
|
||||||
pub policy_number: usize,
|
pub policy_number: u64,
|
||||||
/// Validitätsergebnis
|
/// Validitätsergebnis
|
||||||
pub policy_number_status: Status
|
pub policy_number_status: Status
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PolicyCheck {
|
impl PolicyCheck {}
|
||||||
}
|
|
||||||
|
|
||||||
// #[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
// #[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||||
// pub struct PolicyCheckList {
|
// pub struct PolicyCheckList {
|
||||||
@@ -314,7 +313,7 @@ pub struct PolicyData {
|
|||||||
pub policy_code: PolicyCode,
|
pub policy_code: PolicyCode,
|
||||||
/// Versicherungsscheinnummer (10stellig, numerisch)
|
/// Versicherungsscheinnummer (10stellig, numerisch)
|
||||||
#[serde(rename = "POLLFNR")]
|
#[serde(rename = "POLLFNR")]
|
||||||
pub policy_number: usize,
|
pub policy_number: u64,
|
||||||
/// Status des Versicherungsscheins
|
/// Status des Versicherungsscheins
|
||||||
pub status: Option<Status>
|
pub status: Option<Status>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,10 @@
|
|||||||
// /// The client specific services
|
// /// The client specific services
|
||||||
// pub mod clients;
|
// pub mod clients;
|
||||||
|
|
||||||
/// provides helper functions to manage orbtk callbacks
|
|
||||||
pub mod callbacks;
|
|
||||||
|
|
||||||
/// provides data definitions
|
/// provides data definitions
|
||||||
pub mod data;
|
pub mod data;
|
||||||
|
|
||||||
/// provides orbtk widget structures
|
/// provides orbtk widgets (handling views and states)
|
||||||
pub mod widgets;
|
pub mod widgets;
|
||||||
|
|
||||||
/// provides services
|
/// provides services
|
||||||
|
|||||||
238
advotracker/src/locales/advotracker.json
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
{
|
||||||
|
"err.lang.not_found": {
|
||||||
|
"de_DE.UTF-8": "Konnte Sprachkode nicht auslesen",
|
||||||
|
"de_DE": "Konnte Sprachkode nicht auslesen",
|
||||||
|
"C": "Couldn't read LANG"
|
||||||
|
},
|
||||||
|
"err.user.not_found": {
|
||||||
|
"fr": "Utilisateur introuvable: $email, $id",
|
||||||
|
"de_DE.UTF-8": "Anwender nicht gefunden: $email, $id",
|
||||||
|
"de_DE": "Anwender nicht gefunden: $email, $id",
|
||||||
|
"C": "User not found: $email, $id"
|
||||||
|
},
|
||||||
|
"main.started": {
|
||||||
|
"de_DE.UTF-8": "Programmlogik starten",
|
||||||
|
"de_DE": "Programmlogik starten",
|
||||||
|
"C": "Program logic started"
|
||||||
|
},
|
||||||
|
"main.finished": {
|
||||||
|
"de_DE.UTF-8": "Programmlogik beendet",
|
||||||
|
"de_DE": "Programmlogik beendet",
|
||||||
|
"C": "Program logic finished"
|
||||||
|
},
|
||||||
|
"parse.arguments": {
|
||||||
|
"de_DE.UTF-8": "Programmargumente prüfen",
|
||||||
|
"de_DE": "Programmargumente prüfen",
|
||||||
|
"C": "Parsing arguments"
|
||||||
|
},
|
||||||
|
"parse.environment": {
|
||||||
|
"de_DE.UTF-8": "Umgebungsvariablen prüfen",
|
||||||
|
"de_DE": "Umgebungsvariablen prüfen",
|
||||||
|
"C": "Parsing environment"
|
||||||
|
},
|
||||||
|
"parse.results": {
|
||||||
|
"de_DE.UTF-8": "Ergebnisse der Konfigurations-Parameterprüfung",
|
||||||
|
"de_DE": "Ergebnisse der Konfigurationsparameterprüfung",
|
||||||
|
"C": "Config parsing results"
|
||||||
|
},
|
||||||
|
"config.name": {
|
||||||
|
"de_DE.UTF-8": "Konfigurationswert für",
|
||||||
|
"de_DE": "Konfigurationswert für",
|
||||||
|
"C": "Config Value for"
|
||||||
|
},
|
||||||
|
"config.name.lang": {
|
||||||
|
"de_DE.UTF-8": "Sprach-Code_DE",
|
||||||
|
"de_DE": "Sprach-Code_DE",
|
||||||
|
"C": "Language code_DE"
|
||||||
|
},
|
||||||
|
"config.name.verbositylevel": {
|
||||||
|
"de_DE.UTF-8": "Ausgabe-Ebene",
|
||||||
|
"de_DE": "Ausgabe-Ebene",
|
||||||
|
"C": "verbosity level"
|
||||||
|
},
|
||||||
|
"config.name.environment": {
|
||||||
|
"de_DE.UTF-8": "Umgebungsvariablen",
|
||||||
|
"de_DE": "Umgebungsvariablen",
|
||||||
|
"C": "environment"
|
||||||
|
},
|
||||||
|
"config.name.configfile": {
|
||||||
|
"de_DE.UTF-8": "Konfigurations-Datei",
|
||||||
|
"de_DE": "Konfigurations-Datei",
|
||||||
|
"C": "config file"
|
||||||
|
},
|
||||||
|
"config.name.dbdriver": {
|
||||||
|
"de_DE.UTF-8": "Datenbank-Treiber",
|
||||||
|
"de_DE": "Datenbank-Treiber",
|
||||||
|
"C": "database driver"
|
||||||
|
},
|
||||||
|
"config.name.redis": {
|
||||||
|
"de_DE.UTF-8": "Redis Datenbank",
|
||||||
|
"de_DE": "Redis Datenbank",
|
||||||
|
"C": "Redis database"
|
||||||
|
},
|
||||||
|
"csv.export.started": {
|
||||||
|
"de_DE.UTF-8": "Export in eine CSV Datei starten",
|
||||||
|
"de_DE": "Export in eine CSV Datei starten",
|
||||||
|
"C": "Export to csv file started"
|
||||||
|
},
|
||||||
|
"csv.export.finished": {
|
||||||
|
"de_DE.UTF-8": "Export in eine CSV Datei beendet",
|
||||||
|
"de_DE": "Export in eine CSV Datei beendet",
|
||||||
|
"C": "Export to csv file finished"
|
||||||
|
},
|
||||||
|
"csv.import.started": {
|
||||||
|
"de_DE.UTF-8": "Import aus einer CSV Datei",
|
||||||
|
"de_DE": "Import aus einer CSV Datei",
|
||||||
|
"C": "Import from a csv file"
|
||||||
|
},
|
||||||
|
"csv.import.finished": {
|
||||||
|
"de_DE.UTF-8": "Import aus einer CSV Datei beendet",
|
||||||
|
"de_DE": "Import aus einer CSV Datei beendet",
|
||||||
|
"C": "Import from a csv file finished"
|
||||||
|
},
|
||||||
|
"redis.connection.error": {
|
||||||
|
"de_DE.UTF-8": "Es konnte keine Redis Verbindung aufgebaut werden",
|
||||||
|
"de_DE": "Es konnte keine Redis Verbindung aufgebaut werden",
|
||||||
|
"C": "Could not establish a redis connection"
|
||||||
|
},
|
||||||
|
"policy.hashmap.success": {
|
||||||
|
"de_DE.UTF-8": "Hashmap wurde erfolgreich erstellt",
|
||||||
|
"de_DE": "Hashmap wurde erfolgreich erstellt",
|
||||||
|
"C": "Hashmap creation was successfull"
|
||||||
|
},
|
||||||
|
"policy.hashmap.failed": {
|
||||||
|
"de_DE.UTF-8": "Hashmap konnte nicht erstellt werden",
|
||||||
|
"de_DE": "Hashmap konnte nicht erstellt werden",
|
||||||
|
"C": "Hashmap creation failed"
|
||||||
|
},
|
||||||
|
"policy.menu.label": {
|
||||||
|
"de_DE.UTF-8": "Menü",
|
||||||
|
"de_DE": "Menü",
|
||||||
|
"C": "Menu"
|
||||||
|
},
|
||||||
|
"policy.menu.label_account": {
|
||||||
|
"de_DE.UTF-8": "Aktueller Benutzer",
|
||||||
|
"de_DE": "Aktueller Benutzer",
|
||||||
|
"C": "Active user"
|
||||||
|
},
|
||||||
|
"policy.menu.label_quit": {
|
||||||
|
"de_DE.UTF-8": "Beenden",
|
||||||
|
"de_DE": "Beenden",
|
||||||
|
"C": "Quit"
|
||||||
|
},
|
||||||
|
"policy.menu.label_toggle_theme": {
|
||||||
|
"de_DE.UTF-8": "Thema wechseln",
|
||||||
|
"de_DE": "Thema wechseln",
|
||||||
|
"C": "Toggle theme"
|
||||||
|
},
|
||||||
|
"policy.string.header": {
|
||||||
|
"de_DE.UTF-8": "Validierung Versicherungsnummer",
|
||||||
|
"de_DE": "Validierung Versicherungsnummer",
|
||||||
|
"C": "Policy number validation"
|
||||||
|
},
|
||||||
|
"policy.string.label_policy_data": {
|
||||||
|
"de_DE.UTF-8": "Importierte Daten",
|
||||||
|
"de_DE": "Importierte Daten",
|
||||||
|
"C": "imported data"
|
||||||
|
},
|
||||||
|
"policy.string.label_policy_list": {
|
||||||
|
"de_DE.UTF-8": "Versicherungsnummern-Liste",
|
||||||
|
"de_DE": "Versicherungsnummern-Liste",
|
||||||
|
"C": "policy list"
|
||||||
|
},
|
||||||
|
"policy.string.label_policy_number": {
|
||||||
|
"de_DE.UTF-8": "Versicherungsnummer",
|
||||||
|
"de_DE": "Versicherungsnummer",
|
||||||
|
"C": "policy number"
|
||||||
|
},
|
||||||
|
"policy.string.label_result": {
|
||||||
|
"de_DE.UTF-8": "Prüfungsergebnis",
|
||||||
|
"de_DE": "Prüfungsergebnis",
|
||||||
|
"C": "check result"
|
||||||
|
},
|
||||||
|
"policy.string.data_count": {
|
||||||
|
"de_DE.UTF-8": "Anzahl Prüflistenelemente",
|
||||||
|
"de_DE": "Anzahl Prüflistenelemente",
|
||||||
|
"C": "Number of checklist elements"
|
||||||
|
},
|
||||||
|
"policy.string.import_data": {
|
||||||
|
"de_DE.UTF-8": "Importieren der Prüflisten-Elemente",
|
||||||
|
"de_DE": "Importieren der Prüflisten-Elemente",
|
||||||
|
"C": "Import checklist elements"
|
||||||
|
},
|
||||||
|
"policy.string.progress_time": {
|
||||||
|
"de_DE.UTF-8": "Bearbeitungszeit",
|
||||||
|
"de_DE": "Bearbeitungszeit",
|
||||||
|
"C": "processing time"
|
||||||
|
},
|
||||||
|
"policy.string.progress_text": {
|
||||||
|
"de_DE.UTF-8": "Importiere Daten",
|
||||||
|
"de_DE": "Importiere Daten",
|
||||||
|
"C": "Importing data"
|
||||||
|
},
|
||||||
|
"policy.validation.button_failed": {
|
||||||
|
"de_DE.UTF-8": "ungültig",
|
||||||
|
"de_DE": "ungültig",
|
||||||
|
"C": "invalid"
|
||||||
|
},
|
||||||
|
"policy.validation.button_success": {
|
||||||
|
"de_DE.UTF-8": "gültig",
|
||||||
|
"de_DE": "gültig",
|
||||||
|
"C": "valid"
|
||||||
|
},
|
||||||
|
"policy.validation.failed": {
|
||||||
|
"de_DE.UTF-8": "Die Versicherungsscheinnummber ist ungültig",
|
||||||
|
"de_DE": "Die Versicherungsscheinnummber ist ungültig",
|
||||||
|
"C": "The given policy number is invalid"
|
||||||
|
},
|
||||||
|
"policy.validation.new": {
|
||||||
|
"de_DE.UTF-8": "Neue Prüfung",
|
||||||
|
"de_DE": "Neue Prüfung",
|
||||||
|
"C": "New validation"
|
||||||
|
},
|
||||||
|
"policy.validation.success": {
|
||||||
|
"de_DE.UTF-8": "Die Versicherungsscheinnummber ist gültig",
|
||||||
|
"de_DE": "Die Versicherungsscheinnummber ist gültig",
|
||||||
|
"C": "The given policy number is valid"
|
||||||
|
},
|
||||||
|
"policy.validation.started": {
|
||||||
|
"de_DE.UTF-8": "Die Prüfung der Versicherungsscheinnummber wurde gestartet",
|
||||||
|
"de_DE": "Die Prüfung der Versicherungsscheinnummber wurde gestartet",
|
||||||
|
"C": "Validation of the policy number started"
|
||||||
|
},
|
||||||
|
"policy.validation.finished": {
|
||||||
|
"de_DE.UTF-8": "Die Prüfung der Versicherungsscheinnummber wurde beendet",
|
||||||
|
"de_DE": "Die Prüfung der Versicherungsscheinnummber wurde beendet",
|
||||||
|
"C": "Validation of the policy number finished"
|
||||||
|
},
|
||||||
|
"policy.validation.invalid_input": {
|
||||||
|
"de_DE.UTF-8": "Nur Nummer sind zulässig",
|
||||||
|
"de_DE": "Nur Nummer sind zulässig",
|
||||||
|
"C": "Only numbers are valid"
|
||||||
|
},
|
||||||
|
"policy.validation.not_found": {
|
||||||
|
"de_DE.UTF-8": "Nummer ist nicht aktiviert",
|
||||||
|
"de_DE": "Nummer ist nicht aktiviert",
|
||||||
|
"C": "number isn't marked active"
|
||||||
|
},
|
||||||
|
"policy.validation.to_long": {
|
||||||
|
"de_DE.UTF-8": "Die Nummer ist zu lang",
|
||||||
|
"de_DE": "Die Nummer ist zu lang",
|
||||||
|
"C": "Policy number is to long"
|
||||||
|
},
|
||||||
|
"policy.validation.to_short": {
|
||||||
|
"de_DE.UTF-8": "Die Nummer ist zu kurz",
|
||||||
|
"de_DE": "Die Nummer ist zu kurz",
|
||||||
|
"C": "Policy number is to short"
|
||||||
|
},
|
||||||
|
"state.started": {
|
||||||
|
"de_DE.UTF-8": "gestartet",
|
||||||
|
"de_DE": "gestartet",
|
||||||
|
"C": "started"
|
||||||
|
},
|
||||||
|
"state.finished": {
|
||||||
|
"de_DE.UTF-8": "beendet",
|
||||||
|
"de_DE": "beended",
|
||||||
|
"C": "finished"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,61 +5,127 @@
|
|||||||
* SPDX-License-Identifier: (0BSD or MIT)
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// suppress creation of a new console window on window
|
||||||
|
#![windows_subsystem = "windows"]
|
||||||
|
|
||||||
//#[macro_use]
|
//#[macro_use]
|
||||||
//extern crate lazy_static;
|
//extern crate lazy_static;
|
||||||
|
|
||||||
//use chrono::{Local, DateTime};
|
//use chrono::{Local, DateTime};
|
||||||
//use serde::{Deserialize, Serialize};
|
use dotenv::dotenv;
|
||||||
|
use locales::t;
|
||||||
|
use cfg_if::cfg_if;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::env;
|
use std::env;
|
||||||
//use std::process;
|
//use std::process;
|
||||||
//use std::{error::Error, process};
|
use tracing::{info, trace, Level};
|
||||||
//use std::collections::HashMap;
|
|
||||||
use tracing::{debug, trace, Level};
|
|
||||||
|
|
||||||
use orbtk::prelude::*;
|
use orbtk::{
|
||||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
prelude::*,
|
||||||
//use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
theme_default::{THEME_DEFAULT, THEME_DEFAULT_COLORS_DARK, THEME_DEFAULT_FONTS},
|
||||||
|
theming::config::ThemeConfig,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
use orbtk::theme_fluent::{THEME_FLUENT, THEME_FLUENT_COLORS_DARK, THEME_FLUENT_FONTS};
|
||||||
|
|
||||||
// The Main view
|
// The Main view
|
||||||
use advotracker::widgets::main_view;
|
use advotracker::widgets::main_view;
|
||||||
|
|
||||||
mod parse_args;
|
mod parse_args;
|
||||||
|
|
||||||
/// respect environment variables set in .env files
|
/// define valid environment variables provided via .env files
|
||||||
/// located in the current call directory
|
/// located in the current call directory
|
||||||
/// this is primarily used in testing scenarios (eg. debugging)
|
/// this is primarily used in testing scenarios (eg. debugging)
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
struct Environment {
|
struct Environment {
|
||||||
|
lang: String,
|
||||||
test_lang: String,
|
test_lang: String,
|
||||||
log: String,
|
rust_log: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
//#[cfg(feature = "light-theme")]
|
// Style extension
|
||||||
static STYLESHEET: &'static str = include_str!("../resources/stylesheets/advotracker.css");
|
static DEFAULT_DARK_EXT: &str = include_str!("../assets/advotracker/default_dark.ron");
|
||||||
//static STYLESHEET: &'static str = include_str!("../resources/stylesheets/policyholder-check.css");
|
cfg_if! {
|
||||||
|
if #[cfg(windows)] {
|
||||||
|
static FLUENT_DARK_EXT: &str = include_str!("../assets/advotracker/fluent_dark.ron");
|
||||||
|
static FLUENT_LIGHT_EXT: &str = include_str!("../assets/advotracker/fluent_light.ron");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn get_theme() -> ThemeValue {
|
// German localization file.
|
||||||
//ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
static ADVOTRACKER_DE_DE: &str = include_str!("../assets/advotracker/advotracker_de_DE.ron");
|
||||||
ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
|
||||||
.extension_css(STYLESHEET)
|
/// Get the active language environment.
|
||||||
.build()
|
fn get_lang() -> String {
|
||||||
|
// get system environment
|
||||||
|
let mut lang = env::var("LANG").unwrap_or("C".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) => { info!(target: "advotracker", "{}", e) }
|
||||||
|
}
|
||||||
|
trace!(target: "advotracker", lang = ?lang);
|
||||||
|
lang
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg_if! {
|
||||||
|
if #[cfg(windows)] {
|
||||||
|
/// Extend and register theme assets.
|
||||||
|
fn theme() -> Theme {
|
||||||
|
register_default_fonts(Theme::from_config(
|
||||||
|
ThemeConfig::from(DEFAULT_DARK_EXT)
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT))
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT_COLORS_DARK))
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT_FONTS)),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
fn theme_fluent() -> Theme {
|
||||||
|
register_fluent_fonts(Theme::from_config(
|
||||||
|
ThemeConfig::from(FLUENT_DARK_EXT)
|
||||||
|
.extend(ThemeConfig::from(THEME_FLUENT))
|
||||||
|
.extend(ThemeConfig::from(THEME_FLUENT_COLORS_DARK))
|
||||||
|
.extend(ThemeConfig::from(THEME_FLUENT_FONTS)),
|
||||||
|
))
|
||||||
|
// register_fluent_fonts(Theme::from_config(
|
||||||
|
// ThemeConfig::from(FLUENT_LIGHT_EXT)
|
||||||
|
// .extend(ThemeConfig::from(THEME_FLUENT))
|
||||||
|
// .extend(ThemeConfig::from(THEME_FLUENT_COLORS_DARK))
|
||||||
|
// .extend(ThemeConfig::from(THEME_FLUENT_FONTS)),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/// Extend and register theme assets.
|
||||||
|
fn theme() -> Theme {
|
||||||
|
register_default_fonts(Theme::from_config(
|
||||||
|
ThemeConfig::from(DEFAULT_DARK_EXT)
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT))
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT_COLORS_DARK))
|
||||||
|
.extend(ThemeConfig::from(THEME_DEFAULT_FONTS)),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
use dotenv::dotenv;
|
|
||||||
use parse_args::parse_args;
|
use parse_args::parse_args;
|
||||||
//use std::process;
|
|
||||||
//use std::sync::Arc;
|
|
||||||
use tracing_subscriber::fmt;
|
use tracing_subscriber::fmt;
|
||||||
use viperus::Viperus;
|
use viperus::Viperus;
|
||||||
|
|
||||||
//use advotracker::callbacks::policy_check::is_valid;
|
let machine_kind = if cfg!(unix) {
|
||||||
//use advotracker::data::structures::{PolicyCode, PolicyDataList, PolicyList};
|
"unix"
|
||||||
// WIP: can't push pointer by value to widget, call import in widget callback for now
|
} else if cfg!(windows) {
|
||||||
//use advotracker::services::imports::allianzdirectcall::*;
|
"windows"
|
||||||
|
} else {
|
||||||
|
"unknown/unsupported"
|
||||||
|
};
|
||||||
|
|
||||||
//static DEFAULT_FILTER: &str = concat!(module_path!(), "=", "trace");
|
// respect dotenv environment (e.g for testing)
|
||||||
|
// -> overwrites the preset default values
|
||||||
|
let rust_log = dotenv::var("RUST_LOG").unwrap_or_else(|_| String::from("None"));
|
||||||
|
|
||||||
// initialize the tracing subsystem
|
// initialize the tracing subsystem
|
||||||
// a drop in replacement for classical logging
|
// a drop in replacement for classical logging
|
||||||
@@ -67,77 +133,74 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let span = tracing::span!(Level::TRACE, "advotracker");
|
let span = tracing::span!(Level::TRACE, "advotracker");
|
||||||
let _enter = span.enter();
|
let _enter = span.enter();
|
||||||
let subscriber = fmt::Subscriber::builder()
|
let subscriber = fmt::Subscriber::builder()
|
||||||
//.with_env_filter("trace")
|
.with_env_filter(&rust_log)
|
||||||
.with_max_level(tracing::Level::INFO)
|
//.with_max_level(tracing::Level::DEBUG)
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
tracing::subscriber::with_default(subscriber, || {
|
tracing::subscriber::with_default(subscriber, || {
|
||||||
// get system environment
|
// get system environment
|
||||||
let mut lang = env::var("LANG").unwrap_or("en".to_string());
|
let lang = get_lang();
|
||||||
trace!(target: "csv-test", message = "main", state = "started");
|
|
||||||
trace!(target: "csv-test", environment = "system", lang = ?lang);
|
|
||||||
|
|
||||||
// testing environment: read from .env file
|
let mut state = t!("state.started", lang);
|
||||||
dotenv().ok();
|
let mut res = t!("parse.environment", lang);
|
||||||
match envy::from_env::<Environment>() {
|
trace!(target: "advotracker", message = ?res, state = ?state);
|
||||||
Ok(environment) => {
|
trace!(target: "advotracker", environment = "system", lang = ?lang);
|
||||||
if environment.test_lang != lang { lang = environment.test_lang; }
|
trace!(target: "advotracker", machine = ?&machine_kind);
|
||||||
},
|
|
||||||
Err(e) => { debug!(target: "advotracker", "{}", e); }
|
// how to handle unimplemented lang resources??
|
||||||
}
|
res = t!("parse.environment", lang);
|
||||||
// how to handle unumplemented lang resources??
|
trace!(target: "advotracker", environment = "envy", lang = ?lang);
|
||||||
trace!(target: "csv-test", environment = "envy");
|
state = t!("state.finished", lang);
|
||||||
|
trace!(target: "advotracker", message = ?res, state = ?state);
|
||||||
|
|
||||||
// initialize viperus structure
|
// initialize viperus structure
|
||||||
let mut viperus = Viperus::new();
|
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
|
// parse commandline arguments
|
||||||
trace!(target: "csv-test", process = "parse.arguments", state = "started");
|
res = t!("parse.arguments", lang);
|
||||||
|
state = t!("state.started", lang);
|
||||||
|
trace!(target: "advotracker", process = ?res, state = ?state);
|
||||||
|
|
||||||
let _ = parse_args(&mut viperus);
|
let _ = parse_args(&mut viperus);
|
||||||
|
state = t!("state.finished", lang);
|
||||||
trace!(target: "csv-test", process = "parse_argument", state = "finished");
|
trace!(target: "advotracker", process = ?res, state = ?state);
|
||||||
//trace!(target: "Viperus", "Count of Config parameters: {:?}", VIPERUS_COUNT);
|
|
||||||
|
|
||||||
// main tasks
|
// main tasks
|
||||||
trace!(target: "csv-test", process = "main", state = "started");
|
res = t!("main.started", lang);
|
||||||
|
state = t!("state.started", lang);
|
||||||
|
trace!(target: "advotracker", process = ?res, state = ?state);
|
||||||
|
|
||||||
// moved to callback: checkview_state.rs
|
// use this only if you want to run it as web application.
|
||||||
|
orbtk::initialize();
|
||||||
|
|
||||||
Application::from_name("rzerres.advotracker")
|
// if no dictionary is set for the default language e.g. english the content of the text property will drawn.
|
||||||
.window(move |ctx| {
|
let localization = RonLocalization::create()
|
||||||
|
.language("en_US")
|
||||||
|
.dictionary("de_DE", ADVOTRACKER_DE_DE)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Application::from_name("nwx.advotracker")
|
||||||
|
.localization(localization)
|
||||||
|
.theme(theme())
|
||||||
|
.window(|ctx| {
|
||||||
Window::new()
|
Window::new()
|
||||||
//.title("OrbTk - Policyholder checker")
|
.title("AdvoTracker - DirectCall")
|
||||||
.title("AdvoTracker - Versicherungsnummern")
|
|
||||||
.position((500.0, 100.0))
|
.position((500.0, 100.0))
|
||||||
.size(580.0, 320.0)
|
.size(580.0, 320.0)
|
||||||
.min_width(460.0)
|
//.min_width(460.0)
|
||||||
.min_height(180.0)
|
//.min_height(180.0)
|
||||||
.resizeable(true)
|
.resizeable(true)
|
||||||
.theme(get_theme())
|
|
||||||
.child(main_view::MainView::new().build(ctx))
|
.child(main_view::MainView::new().build(ctx))
|
||||||
.build(ctx)
|
.build(ctx)
|
||||||
})
|
})
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
trace!(target: "csv-test", process = "main", state = "finished");
|
state = t!("state.finished", lang);
|
||||||
|
res = t!("main.finished", lang);
|
||||||
|
trace!(target: "advotracker", process = ?res, state = ?state);
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ use viperus::Viperus;
|
|||||||
pub fn parse_args(viperus: &mut Viperus) -> Result<(), Box<dyn std::error::Error>> {
|
pub fn parse_args(viperus: &mut Viperus) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
if cfg!(feature = "global") {
|
if cfg!(feature = "global") {
|
||||||
trace!(target: "Viperus", "Viperus feature 'global' enabled.");
|
trace!(target: "Viperus", "Viperus feature 'global' enabled.");
|
||||||
//println!("Lasy static: 'VIPERUS' is accessible globaly");
|
println!("Lasy static: 'VIPERUS' is accessible globaly");
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg!(feature = "fmt-clap") {
|
if cfg!(feature = "fmt-clap") {
|
||||||
trace!(target: "Viperus", "Viperus feature 'fmt-clap' enabled.");
|
trace!(target: "Viperus", "Viperus feature 'fmt-clap' enabled.");
|
||||||
//println!("Using feature fmt-clap");
|
println!("Using feature fmt-clap");
|
||||||
}
|
}
|
||||||
|
|
||||||
// preset default key/value pairs (lowest priority)
|
// preset default key/value pairs (lowest priority)
|
||||||
@@ -142,13 +142,6 @@ SMR Unerledigt: 089 92529 60222")
|
|||||||
env_prefix.push_str("_");
|
env_prefix.push_str("_");
|
||||||
viperus.set_env_prefix(&env_prefix);
|
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
|
// enable caching and automatic update of environment values
|
||||||
viperus.cache(true);
|
viperus.cache(true);
|
||||||
viperus.automatic_env(true);
|
viperus.automatic_env(true);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//use chrono::{Local, DateTime};
|
//use chrono::{Local, DateTime};
|
||||||
|
use locales::t;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
//use std::collections::HashMap;
|
//use std::collections::HashMap;
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
@@ -21,7 +22,9 @@ pub fn export(p: &mut String, lang: &String) -> Result<(), Box<dyn Error>> {
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
//use std::ffi::OsStr;
|
//use std::ffi::OsStr;
|
||||||
|
|
||||||
trace!(target: "advotrackerd", process = "csv-export", state = "started");
|
let mut res = t!("csv.export.started", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
|
trace!(target: "csv-export", process = ?res, state = ?state);
|
||||||
|
|
||||||
// Note: slash syntax also works on Windows!
|
// Note: slash syntax also works on Windows!
|
||||||
let path = Path::new(p);
|
let path = Path::new(p);
|
||||||
@@ -30,7 +33,9 @@ pub fn export(p: &mut String, lang: &String) -> Result<(), Box<dyn Error>> {
|
|||||||
let file = File::open(path)?;
|
let file = File::open(path)?;
|
||||||
|
|
||||||
trace!(target: "csv.export", extension = ?path.extension(), file = ?file);
|
trace!(target: "csv.export", extension = ?path.extension(), file = ?file);
|
||||||
trace!(target: "advotrackerd", process = "csv-export", state = "finished");
|
state = t!("state.finished", lang);
|
||||||
|
res = t!("csv.export.finished", lang);
|
||||||
|
trace!(target: "csv-export", process = ?res, state = ?state);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use chrono::{Local, DateTime};
|
use chrono::{Local, DateTime};
|
||||||
|
use locales::t;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::time::{Duration, SystemTime};
|
||||||
use tracing::trace;
|
use tracing::trace;
|
||||||
|
|
||||||
//use crate::db::redis;
|
//use crate::db::redis;
|
||||||
@@ -19,21 +21,26 @@ use crate::data::structures::{PolicyCode, PolicyDataList, PolicyData};
|
|||||||
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
/// https://docs.rs/csv/1.1.3/csv/cookbook/index.html
|
||||||
/// https://blog.burntsushi.net/csv/
|
/// https://blog.burntsushi.net/csv/
|
||||||
pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
||||||
policy_numbers: &mut HashMap<usize, PolicyCode>, lang: &String)
|
policy_numbers: &mut HashMap<u64, PolicyCode>,
|
||||||
-> Result<usize, Box<dyn Error>> {
|
policy_data_count: &mut u64,
|
||||||
|
lang: &String)
|
||||||
|
-> Result<(u64, Duration), Box<dyn Error>> {
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
||||||
let dt_start: DateTime<Local> = Local::now();
|
let mut res = t!("csv.import.started", lang);
|
||||||
|
let mut state = t!("state.started", lang);
|
||||||
|
let time_start = SystemTime::now();
|
||||||
|
let datetime: DateTime<Local> = time_start.into();
|
||||||
|
|
||||||
trace!(target: "advotrackerd", process = "import", state = "started", date_start = ?dt_start.to_string());
|
trace!(target: "csv-import", process = ?res, state = ?state, date_start = ?datetime.to_string());
|
||||||
|
|
||||||
// Note: slash syntax also workd on Windows!
|
// Note: slash syntax also works on Windows!
|
||||||
let path = Path::new(p);
|
let path = Path::new(p);
|
||||||
|
|
||||||
// must be a readable file
|
// must be a readable file
|
||||||
trace!(target: "advotrackerd", path = ?path);
|
trace!(target: "csv-import", path = ?path);
|
||||||
assert_eq!(path.is_file(), true);
|
assert_eq!(path.is_file(), true);
|
||||||
|
|
||||||
// only accept files with '.txt' extensions
|
// only accept files with '.txt' extensions
|
||||||
@@ -42,7 +49,7 @@ pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
|
|
||||||
// open the file
|
// open the file
|
||||||
let file = File::open(path)?;
|
let file = File::open(path)?;
|
||||||
trace!(target: "advotrackerd", extension = ?extension, file = ?file);
|
trace!(target: "csv-import", extension = ?extension, file = ?file);
|
||||||
|
|
||||||
// Build the CSV reader
|
// Build the CSV reader
|
||||||
let mut csv_reader = csv::ReaderBuilder::new()
|
let mut csv_reader = csv::ReaderBuilder::new()
|
||||||
@@ -54,11 +61,11 @@ pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
{
|
{
|
||||||
// We nest this call in its own scope because of lifetimes.
|
// We nest this call in its own scope because of lifetimes.
|
||||||
let headers = csv_reader.headers()?;
|
let headers = csv_reader.headers()?;
|
||||||
trace!(target: "advotrackerd", header = ?headers);
|
trace!(target: "csv-import", header = ?headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over each record, deserialize und write to our structures
|
// Iterate over each record, deserialize und write to our structures
|
||||||
let mut count = 0;
|
let mut count : u64 = 0;
|
||||||
for result in csv_reader.deserialize() {
|
for result in csv_reader.deserialize() {
|
||||||
// The iterator yields Result<StringRecord, Error>, so we check the
|
// The iterator yields Result<StringRecord, Error>, so we check the
|
||||||
// error here.
|
// error here.
|
||||||
@@ -68,40 +75,59 @@ pub fn import(p: &mut String, data_list: &mut PolicyDataList,
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// WIP: write to redis backend
|
// WIP: write to redis backend
|
||||||
// append the policy_number to the HashMap
|
// for now: append the policy_number to the HashMap
|
||||||
policy_numbers.insert(record.policy_number, record.policy_code);
|
policy_numbers.insert(record.policy_number, record.policy_code);
|
||||||
|
|
||||||
// push record as new vector elements
|
// push record as new vector elements
|
||||||
data_list.push(record);
|
data_list.push(record);
|
||||||
|
|
||||||
count +=1;
|
count +=1;
|
||||||
|
*policy_data_count = count;
|
||||||
};
|
};
|
||||||
|
|
||||||
let dt_end: DateTime<Local> = Local::now();
|
let time_end = SystemTime::now();
|
||||||
let duration = dt_end.signed_duration_since(dt_start);
|
let duration = time_end.duration_since(time_start)
|
||||||
|
.expect("Clock may have gone backwards");
|
||||||
|
trace!(target: "csv-import", record_count = ?count, duration = ?duration);
|
||||||
|
|
||||||
trace!(target: "advotrackerd", record_count = ?count, duration = ?duration);
|
state = t!("state.finished", lang);
|
||||||
|
res = t!("csv.import.finished", lang);
|
||||||
|
let datetime: DateTime<Local> = time_end.into();
|
||||||
|
trace!(target: "csv-import", process = ?res, state = ?state, date_stop = ?datetime.to_string());
|
||||||
|
|
||||||
// Tests
|
Ok((count, duration))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_import() {
|
||||||
// Takes a reference and returns Option<&V>
|
// Takes a reference and returns Option<&V>
|
||||||
let my_policy_numbers : [usize; 2] = [1511111111, 9999999993];
|
let my_policy_numbers : [u64; 2] = [1511111111, 9999999993];
|
||||||
assert_eq!(my_policy_numbers, [1511111111, 9999999993]);
|
assert_eq!(my_policy_numbers, [1511111111, 9999999993]);
|
||||||
|
|
||||||
|
let mut csv_import_path = String::from("data/POLLFNR_TEST.txt");
|
||||||
|
let mut policy_data = PolicyDataList::new("PolicyDataList");
|
||||||
|
let mut policy_numbers : HashMap<u64, PolicyCode> = HashMap::new();
|
||||||
|
let mut policy_data_count: u64 = 0;
|
||||||
|
let lang = "en".to_string();
|
||||||
|
|
||||||
|
match import(&mut csv_import_path, &mut policy_data,
|
||||||
|
&mut policy_numbers, &mut policy_data_count,
|
||||||
|
&lang) {
|
||||||
|
Ok((count, duration)) => {
|
||||||
|
println!("import {:?} records. Duration: {:?}", count, duration);
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
println!("error running CSV-Import: {}", err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
for p in &my_policy_numbers {
|
for p in &my_policy_numbers {
|
||||||
match policy_numbers.get(&p) {
|
match policy_numbers.get(&p) {
|
||||||
Some(policy_code) => {
|
Some(policy_code) => {
|
||||||
//println!("Test: Policy-Number {:?} => Policy-Type {:?}, as expected!",
|
println!("Test: Policy-Number {:?} => Policy-Type {:?}, as expected!",
|
||||||
// p, policy_code);
|
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),
|
||||||
//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)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
/// import from csv format (Standard in)
|
/// Testing: import from csv format (Standard in)
|
||||||
fn import() -> Result<(), Box<dyn Error>> {
|
fn import() -> Result<(), Box<dyn Error>> {
|
||||||
// Build the CSV reader and iterate over each record.
|
// Build the CSV reader and iterate over each record.
|
||||||
let mut csv_reader = csv::Reader::from_reader(io::stdin());
|
let mut csv_reader = csv::Reader::from_reader(io::stdin());
|
||||||
|
|||||||
@@ -8,5 +8,5 @@
|
|||||||
/// advotracker import modules
|
/// advotracker import modules
|
||||||
pub mod imports;
|
pub mod imports;
|
||||||
|
|
||||||
/// advotracker import modules
|
/// advotracker export modules
|
||||||
pub mod exports;
|
pub mod exports;
|
||||||
|
|||||||
73
advotracker/src/widgets/configuration/configuration_state.rs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::widgets::configuration::configuration_view::ConfigurationView;
|
||||||
|
|
||||||
|
/// Valid `actions` that are handled as state changes in the `Configuration` widget.
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub enum ConfigurationAction {
|
||||||
|
SaveConfiguration,
|
||||||
|
LoadConfiguration,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Define valid configuration data.
|
||||||
|
/// This structure is serialized and saved inside the OS dependent settings file.
|
||||||
|
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
||||||
|
struct ConfigurationData(
|
||||||
|
pub String,
|
||||||
|
pub String
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Valid `structures` that are handled inside the state of the `Configuration` widget.
|
||||||
|
#[derive(Debug, Default, AsAny)]
|
||||||
|
pub struct ConfigurationState {}
|
||||||
|
|
||||||
|
impl State for ConfigurationState {
|
||||||
|
fn messages(
|
||||||
|
&mut self,
|
||||||
|
mut messages: MessageReader,
|
||||||
|
registry: &mut Registry,
|
||||||
|
ctx: &mut Context<'_>,
|
||||||
|
) {
|
||||||
|
for message in messages.read::<ConfigurationAction>() {
|
||||||
|
match message {
|
||||||
|
ConfigurationAction::LoadConfiguration => registry
|
||||||
|
.get::<Settings>("settings")
|
||||||
|
.load_async::<ConfigurationData>("configuration_data".to_string(), ctx.entity()),
|
||||||
|
ConfigurationAction::SaveConfiguration => {
|
||||||
|
let configuration_file: String = ConfigurationView::configuration_file_clone(&ctx.widget());
|
||||||
|
let language_id: String = ConfigurationView::language_id_clone(&ctx.widget());
|
||||||
|
registry.get::<Settings>("settings").save_async(
|
||||||
|
"configuration_data".to_string(),
|
||||||
|
ConfigurationData(
|
||||||
|
configuration_file,
|
||||||
|
language_id
|
||||||
|
),
|
||||||
|
ctx.entity(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// save result
|
||||||
|
for message in messages.read::<SettingsResult<()>>() {
|
||||||
|
println!("Result {:?}", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// load result
|
||||||
|
for message in messages.read::<SettingsResult<ConfigurationData>>() {
|
||||||
|
if let Ok(data) = message {
|
||||||
|
ConfigurationView::configuration_file_set(&mut ctx.widget(), data.0);
|
||||||
|
ConfigurationView::language_id_set(&mut ctx.widget(), data.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
139
advotracker/src/widgets/configuration/configuration_view.rs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/*
|
||||||
|
* 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::constants::*,
|
||||||
|
widgets::configuration::configuration_state::{ConfigurationAction, ConfigurationState},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Macro that initializes the widget structures/variables for our view
|
||||||
|
widget!(
|
||||||
|
ConfigurationView<ConfigurationState> {
|
||||||
|
configuration_file: String,
|
||||||
|
language_id: String
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The template implementation of the configuration view
|
||||||
|
/// All GUI elements are styled using the "style" attribute referencing to a ron based css
|
||||||
|
impl Template for ConfigurationView {
|
||||||
|
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||||
|
self.child(
|
||||||
|
Grid::new()
|
||||||
|
.id(ID_CONFIGURATION_FORM)
|
||||||
|
.style(configuration_form)
|
||||||
|
.columns(
|
||||||
|
Columns::create()
|
||||||
|
.push(120)
|
||||||
|
.push(12)
|
||||||
|
.push("auto")
|
||||||
|
)
|
||||||
|
.rows(Rows::create()
|
||||||
|
.push("auto")
|
||||||
|
.push(4)
|
||||||
|
.push("auto")
|
||||||
|
.push(4)
|
||||||
|
.push("auto")
|
||||||
|
.push(12)
|
||||||
|
.push("auto"),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_CONFIGURATION_HEADER)
|
||||||
|
.h_align("start")
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.attach(Grid::column_span(3))
|
||||||
|
.text("Configuration settings")
|
||||||
|
.style("header")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_CONFIGURATION_LABEL_CONFIG_FILE)
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.v_align("center")
|
||||||
|
.h_align("end")
|
||||||
|
.text("Configuration file")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBox::new()
|
||||||
|
.id(ID_CONFIGURATION_CONFIG_FILE)
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.text(("configuration_file", id))
|
||||||
|
.water_mark("Filename...")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_CONFIGURATION_LABEL_LANGUAGE_ID)
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(4))
|
||||||
|
.v_align("center")
|
||||||
|
.h_align("end")
|
||||||
|
.text("Language Id")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBox::new()
|
||||||
|
.id(ID_CONFIGURATION_LANGUAGE_ID)
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(4))
|
||||||
|
.text(("language_id", id))
|
||||||
|
.water_mark("Locale Identifier...")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Grid::new()
|
||||||
|
.h_align("center")
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(6))
|
||||||
|
.attach(Grid::column_span(3))
|
||||||
|
.columns(
|
||||||
|
Columns::create()
|
||||||
|
.push("auto")
|
||||||
|
.push(8)
|
||||||
|
.push("auto")
|
||||||
|
)
|
||||||
|
.rows(Rows::create()
|
||||||
|
.push("auto")
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
.style("button_single_content")
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.text("load")
|
||||||
|
.on_click(move |ctx, _| {
|
||||||
|
ctx.send_message(ConfigurationAction::LoadConfiguration, id);
|
||||||
|
true
|
||||||
|
})
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
.text("save")
|
||||||
|
.style("button_single_content")
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.on_click(move |ctx, _| {
|
||||||
|
ctx.send_message(ConfigurationAction::SaveConfiguration, id);
|
||||||
|
true
|
||||||
|
})
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
12
advotracker/src/widgets/configuration/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)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// The configuration state
|
||||||
|
pub mod configuration_state;
|
||||||
|
|
||||||
|
/// The configuration view
|
||||||
|
pub mod configuration_view;
|
||||||
81
advotracker/src/widgets/global_state.rs
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
use dotenv::dotenv;
|
||||||
|
use serde::Deserialize;
|
||||||
|
use std::env;
|
||||||
|
use tracing::{info, trace};
|
||||||
|
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
data::constants::*,
|
||||||
|
data::structures::PolicyList
|
||||||
|
};
|
||||||
|
|
||||||
|
/// define valid environment variables provided via .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,
|
||||||
|
rust_log: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Provides generic methods to handle states of datatypes.
|
||||||
|
pub trait GlobalState {
|
||||||
|
/// Get the active language environment.
|
||||||
|
fn get_lang() -> String {
|
||||||
|
// get system environment
|
||||||
|
let mut lang = env::var("LANG").unwrap_or("C".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) => { info!(target: "advotracker", "{}", e) }
|
||||||
|
}
|
||||||
|
trace!(target: "advotracker", lang = ?lang);
|
||||||
|
lang
|
||||||
|
}
|
||||||
|
|
||||||
|
// /// 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);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/// 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #[cfg(test)]
|
||||||
|
// mod tests {
|
||||||
|
// #[test]
|
||||||
|
// assert_eq!(2 + 2, 4);
|
||||||
|
// }
|
||||||
40
advotracker/src/widgets/localization/localization_state.rs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
|
||||||
|
use crate::widgets::localization::localization_view::LocalizationView;
|
||||||
|
|
||||||
|
#[derive(AsAny, Debug, Default)]
|
||||||
|
pub struct LocalizationState {
|
||||||
|
change_language: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl LocalizationState {
|
||||||
|
pub fn change_language(&mut self) {
|
||||||
|
self.change_language = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl State for LocalizationState {
|
||||||
|
fn update(&mut self, _registry: &mut Registry, ctx: &mut Context<'_>) {
|
||||||
|
if !self.change_language {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let index = *LocalizationView::selected_index_ref(&ctx.widget()) as usize;
|
||||||
|
let selected_language = LocalizationView::languages_ref(&ctx.widget())[index].clone();
|
||||||
|
|
||||||
|
match selected_language.as_str() {
|
||||||
|
"English" => ctx.set_language("en_US"),
|
||||||
|
"German" => ctx.set_language("de_DE"),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.change_language = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
97
advotracker/src/widgets/localization/localization_view.rs
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* 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::constants::*,
|
||||||
|
widgets::localization::localization_state::LocalizationState,
|
||||||
|
};
|
||||||
|
|
||||||
|
type List = Vec<String>;
|
||||||
|
|
||||||
|
// Macro that initializes the widget structures/variables for our view
|
||||||
|
widget!(LocalizationView<LocalizationState> {
|
||||||
|
languages: List,
|
||||||
|
selected_index: i32 }
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The template implementation of the localization view
|
||||||
|
/// All GUI elements are styled using the "style" attribute referencing to a ron based css
|
||||||
|
impl Template for LocalizationView {
|
||||||
|
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||||
|
let languages = vec!["English".to_string(), "German".to_string()];
|
||||||
|
let count = languages.len();
|
||||||
|
|
||||||
|
self.languages(languages)
|
||||||
|
.selected_index(1)
|
||||||
|
.child(
|
||||||
|
Grid::new()
|
||||||
|
.id(ID_LOCALIZATION_FORM)
|
||||||
|
.margin(4)
|
||||||
|
.columns(
|
||||||
|
Columns::create()
|
||||||
|
.push(120)
|
||||||
|
.push(12)
|
||||||
|
.push(150)
|
||||||
|
)
|
||||||
|
.rows(Rows::create()
|
||||||
|
.push("auto")
|
||||||
|
.push(4)
|
||||||
|
.push("auto")
|
||||||
|
.push(4)
|
||||||
|
.push("auto")
|
||||||
|
.push(12)
|
||||||
|
.push("auto"),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_LOCALIZATION_HEADER)
|
||||||
|
.h_align("start")
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.attach(Grid::column_span(3))
|
||||||
|
.text("Localization dialog")
|
||||||
|
.style("header")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_LOCALIZATION_LABEL_LANGUAGE_NAME)
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.v_align("center")
|
||||||
|
.h_align("end")
|
||||||
|
.text("Language ID")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
ComboBox::new()
|
||||||
|
.id(ID_LOCALIZATION_LANGUAGES)
|
||||||
|
.count(count)
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.items_builder(move |bc, index| {
|
||||||
|
let text = bc.get_widget(id)
|
||||||
|
.get::<Vec<String>>("languages")[index]
|
||||||
|
.clone();
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_LOCALIZATION_LANGUAGE_NAME)
|
||||||
|
.v_align("center")
|
||||||
|
.text(text)
|
||||||
|
.build(bc)
|
||||||
|
})
|
||||||
|
.on_changed("selected_index", move |states, _| {
|
||||||
|
states.get_mut::<LocalizationState>(id).change_language();
|
||||||
|
})
|
||||||
|
.selected_index(id)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
12
advotracker/src/widgets/localization/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)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// The localization state
|
||||||
|
pub mod localization_state;
|
||||||
|
|
||||||
|
/// The localizatin view
|
||||||
|
pub mod localization_view;
|
||||||
@@ -7,23 +7,29 @@
|
|||||||
|
|
||||||
use orbtk::prelude::*;
|
use orbtk::prelude::*;
|
||||||
|
|
||||||
use crate::data::structures::PolicyCheck;
|
use crate::{
|
||||||
use crate::widgets::policycheck_view::PolicyCheckView;
|
data::structures::PolicyCheck,
|
||||||
|
widgets::policycheck::policycheck_view::PolicycheckView,
|
||||||
|
widgets::localization::localization_view::LocalizationView,
|
||||||
|
widgets::configuration::configuration_view::ConfigurationView,
|
||||||
|
widgets::menu::menu_view::MenuView,
|
||||||
|
};
|
||||||
|
|
||||||
|
// [START] views
|
||||||
|
|
||||||
widget!(MainView {
|
widget!(MainView {
|
||||||
// policy_list: PolicyList,
|
// policy_list: PolicyList,
|
||||||
// policy_data_list: PolicyDataList,
|
// policy_data_list: PolicyDataList,
|
||||||
// policylist_view: u32,
|
// policylist_view: u32,
|
||||||
// policydata_view: u32,
|
// policydata_view: u32,
|
||||||
//policycheck_view: u32
|
|
||||||
policycheck_view: PolicyCheck
|
policycheck_view: PolicyCheck
|
||||||
});
|
});
|
||||||
|
|
||||||
impl Template for MainView {
|
impl Template for MainView {
|
||||||
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
fn template(self, _id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||||
let policycheck_view = PolicyCheckView::new()
|
let policycheck_view = PolicycheckView::new()
|
||||||
//.policy_number_count(0)
|
//.policy_number_count(0)
|
||||||
//.policylist_view(id)
|
//.policylist_view(id)
|
||||||
.build(ctx);
|
.build(ctx);
|
||||||
|
|
||||||
// let policylist_view = PolicyListView::new()
|
// let policylist_view = PolicyListView::new()
|
||||||
@@ -47,6 +53,14 @@ impl Template for MainView {
|
|||||||
// .policylist_view(policylist_view.0)
|
// .policylist_view(policylist_view.0)
|
||||||
// .child(policydata_view)
|
// .child(policydata_view)
|
||||||
// .child(policylist_view)
|
// .child(policylist_view)
|
||||||
.child(policycheck_view)
|
.child(
|
||||||
|
TabWidget::new()
|
||||||
|
.tab("Policynumber check", policycheck_view)
|
||||||
|
.tab("Localization", LocalizationView::new().build(ctx))
|
||||||
|
.tab("Configuration", ConfigurationView::new().build(ctx))
|
||||||
|
.tab("Menu", MenuView::new().build(ctx))
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
//.child(policycheck_view)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
300
advotracker/src/widgets/menu/menu_state.rs
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
use cfg_if::cfg_if;
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
use orbtk::shell::event::Key;
|
||||||
|
|
||||||
|
use std::process;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
data::constants::*,
|
||||||
|
widgets::menu::menu_view::MenuView,
|
||||||
|
//widgets::policycheck::policycheck_view::PolicycheckView,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Valid `actions` that are handled as state changes in the `Menu` widget.
|
||||||
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
pub enum MenuAction {
|
||||||
|
CreateMenu,
|
||||||
|
CreateMenuToggleTheme(Entity),
|
||||||
|
RemoveMenu,
|
||||||
|
RemoveMenuToggleTheme(Entity),
|
||||||
|
SetTheme
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Valid `structures` that are handled inside the state of the `Menu` widget.
|
||||||
|
#[derive(AsAny, Default)]
|
||||||
|
pub struct MenuState {
|
||||||
|
action: Option<MenuAction>,
|
||||||
|
menu: Entity,
|
||||||
|
menu_toggle_theme: Entity
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Method definitions, that react on any given state change inside the `Menu` widget.
|
||||||
|
impl MenuState {
|
||||||
|
/// Set a menu holding all valid menu elements
|
||||||
|
/// The elements are ordered compontents inside a stack
|
||||||
|
pub fn create_menu(&mut self, ctx: &mut Context<'_>) {
|
||||||
|
// create a stack as a child of the given component
|
||||||
|
let stack = ctx
|
||||||
|
.entity_of_child(ID_MENU_BUTTON)
|
||||||
|
.expect("PolicycheckState: Can't find entity of resource 'ID_MENU_BUTTON'.");
|
||||||
|
//.entity_of_child(<PolicycheckView>ID_MENU_BUTTON)
|
||||||
|
//.expect("PolicycheckState: Can't find entity of resource 'ID_POLICY_CHECK_POPUP_MENU'.");
|
||||||
|
let current_entity = ctx.entity();
|
||||||
|
let build_context = &mut ctx.build_context();
|
||||||
|
|
||||||
|
// create a new popup menu overlay
|
||||||
|
self.menu = create_menu_popup(current_entity, build_context);
|
||||||
|
|
||||||
|
// create a menu_popup widget as a child of entity "ID_POLICY_CHECK_BUTTON_MENU"
|
||||||
|
build_context.append_child(stack, self.menu);
|
||||||
|
|
||||||
|
println!("Popup Menu created: {:?}", self.menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set a toggle_theme menu
|
||||||
|
/// Select the active theme from a `ComboBox` offering a list of valid `themes``
|
||||||
|
fn create_menu_toggle_theme(&mut self, ctx: &mut Context<'_>) {
|
||||||
|
let stack = ctx
|
||||||
|
.entity_of_child(ID_MENU_LABEL_TOGGLE_THEME)
|
||||||
|
.expect("MenuState: Can't find entity of resource 'ID_MENU_LABEL_TOGGLE_THEME'.");
|
||||||
|
let current_entity = ctx.entity();
|
||||||
|
let build_context = &mut ctx.build_context();
|
||||||
|
|
||||||
|
// create a new menu overlay
|
||||||
|
self.menu_toggle_theme = create_menu_toggle_theme_popup(current_entity, build_context);
|
||||||
|
|
||||||
|
// create a menu_popup widget as a child of entity "ID_POPUP_MENU"
|
||||||
|
build_context.append_child(stack, self.menu_toggle_theme);
|
||||||
|
|
||||||
|
println!("Popup Menu Toggle Theme created: {:?}", self.menu_toggle_theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Remove the menu popup box
|
||||||
|
fn remove_menu(&mut self, ctx: &mut Context<'_>) {
|
||||||
|
ctx.remove_child(ctx.entity());
|
||||||
|
println!("Popup {:?} removed !", ctx.entity());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Remove the menu popup box
|
||||||
|
fn remove_menu_toggle_theme(&mut self, id: Entity, ctx: &mut Context<'_>) {
|
||||||
|
ctx.remove_child(self.menu_toggle_theme);
|
||||||
|
println!("Popup {:?} removed !", id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets a new action.
|
||||||
|
pub fn set_action(&mut self, action: MenuAction) {
|
||||||
|
self.action = action.into();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Supported methods handled inside the `MenuState`
|
||||||
|
impl State for MenuState {
|
||||||
|
/// Initialize the state of widgets inside `MenuState`
|
||||||
|
fn init(&mut self, _: &mut Registry, _ctx: &mut Context<'_>) {
|
||||||
|
// Initialize required entities
|
||||||
|
// let menu_button = ctx
|
||||||
|
// .entity_of_child(ID_MENU_STACK)
|
||||||
|
// .expect("MenuState.init: Can't find resource entity 'PolicycheckView::ID_POLICY_CHECK_BUTTON_MENU'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Handle messages for the `MenuState`
|
||||||
|
fn messages(
|
||||||
|
&mut self,
|
||||||
|
mut messages: MessageReader,
|
||||||
|
_registry: &mut Registry,
|
||||||
|
ctx: &mut Context<'_>,
|
||||||
|
) {
|
||||||
|
for message in messages.read::<MenuAction>() {
|
||||||
|
match message {
|
||||||
|
MenuAction::SetTheme => {
|
||||||
|
let theme_index = *MenuView::selected_index_ref(&ctx.widget());
|
||||||
|
|
||||||
|
cfg_if! {
|
||||||
|
if #[cfg(windows)] {
|
||||||
|
match theme_index {
|
||||||
|
0 => ctx.switch_theme(theme_default_dark()),
|
||||||
|
1 => ctx.switch_theme(theme_default_light()),
|
||||||
|
2 => ctx.switch_theme(theme_redox()),
|
||||||
|
3 => ctx.switch_theme(theme_fluent_dark()),
|
||||||
|
4 => ctx.switch_theme(theme_fluent_light()),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
match theme_index {
|
||||||
|
0 => ctx.switch_theme(theme_default_dark()),
|
||||||
|
1 => ctx.switch_theme(theme_default_light()),
|
||||||
|
2 => ctx.switch_theme(theme_redox()),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Update the state of widgets inside the `Menu` view.
|
||||||
|
fn update(&mut self, _registry: &mut Registry, ctx: &mut Context<'_>) {
|
||||||
|
if let Some(action) = self.action {
|
||||||
|
match action {
|
||||||
|
MenuAction::CreateMenu => {
|
||||||
|
println!("MenuAction::CreateMenu(_entity)");
|
||||||
|
self.create_menu(ctx);
|
||||||
|
}
|
||||||
|
MenuAction::CreateMenuToggleTheme(_entity) => {
|
||||||
|
self.create_menu_toggle_theme(ctx);
|
||||||
|
}
|
||||||
|
MenuAction::RemoveMenu => {
|
||||||
|
self.remove_menu(ctx);
|
||||||
|
}
|
||||||
|
MenuAction::RemoveMenuToggleTheme(entity) => {
|
||||||
|
self.remove_menu_toggle_theme(entity, ctx);
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a new popup presenting the menu components
|
||||||
|
pub fn create_menu_popup(id: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||||
|
Popup::new()
|
||||||
|
.id(ID_MENU_POPUP)
|
||||||
|
.style("container_menu")
|
||||||
|
.target(id)
|
||||||
|
.open(true)
|
||||||
|
.width(280)
|
||||||
|
.height(140)
|
||||||
|
.on_key_down(move | ctx, key_event | {
|
||||||
|
match key_event.key {
|
||||||
|
Key::Q(..) => {
|
||||||
|
//if is_ctrl_home_down(ctx)
|
||||||
|
println!("KeyHandler: got Ctrl+Q");
|
||||||
|
process::exit(0);
|
||||||
|
//}
|
||||||
|
},
|
||||||
|
Key::Escape => {
|
||||||
|
println!("KeyHandler: got Escape");
|
||||||
|
ctx.get_mut::<MenuState>(id)
|
||||||
|
.set_action(MenuAction::RemoveMenu);
|
||||||
|
},
|
||||||
|
_ => {
|
||||||
|
println!("KeyHandler: got {:?}", key_event.key);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
true
|
||||||
|
})
|
||||||
|
.child(
|
||||||
|
Grid::new()
|
||||||
|
.id(ID_MENU_GRID)
|
||||||
|
.columns(
|
||||||
|
Columns::create()
|
||||||
|
.push("80") // Menu Button
|
||||||
|
.push("1") // Seperator
|
||||||
|
.push("*") // Keyboard Shortcut
|
||||||
|
.build(),
|
||||||
|
)
|
||||||
|
.rows(
|
||||||
|
Rows::create()
|
||||||
|
.push("auto")
|
||||||
|
.push("auto")
|
||||||
|
.push("auto")
|
||||||
|
.build(),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
.id(ID_MENU_LABEL_ACCOUNT)
|
||||||
|
.style("button_menu")
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::column_span(2))
|
||||||
|
.icon(material_icons_font::MD_PERSON)
|
||||||
|
.text("Account")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
.id(ID_MENU_LABEL_TOGGLE_THEME)
|
||||||
|
.style("button_menu")
|
||||||
|
.attach(Grid::row(1))
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::column_span(2))
|
||||||
|
.icon(material_icons_font::MD_EDIT)
|
||||||
|
.text("Toggle theme")
|
||||||
|
// .on_click(move |ctx, _| {
|
||||||
|
// ctx.get_mut::<MenuState>(id)
|
||||||
|
// .set_action(MenuAction::SetTheme(id));
|
||||||
|
// true
|
||||||
|
// })
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
.id(ID_MENU_LABEL_QUIT)
|
||||||
|
.style("button_menu")
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.attach(Grid::column_span(2))
|
||||||
|
.icon(material_icons_font::MD_SETTINGS_POWER)
|
||||||
|
.text("Quit")
|
||||||
|
.on_mouse_down(move |_states, _| {
|
||||||
|
process::exit(0);
|
||||||
|
})
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.id(ID_MENU_SHORTCUT_QUIT)
|
||||||
|
.style("button_menu")
|
||||||
|
.attach(Grid::row(2))
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.margin((0, 0, 16, 0))
|
||||||
|
.h_align("end")
|
||||||
|
.v_align("center")
|
||||||
|
.text("CTRL+Q")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a new popup submenu to toogle the active theme
|
||||||
|
pub fn create_menu_toggle_theme_popup(id: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||||
|
//let themes_count = themes.len();
|
||||||
|
//ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), new_width);
|
||||||
|
|
||||||
|
Popup::new()
|
||||||
|
.id(ID_MENU_TOGGLE_THEME)
|
||||||
|
.style("container_menu")
|
||||||
|
.target(id)
|
||||||
|
.open(true)
|
||||||
|
.width(280)
|
||||||
|
.height(140)
|
||||||
|
.child(
|
||||||
|
ComboBox::new()
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.attach(Grid::row(6))
|
||||||
|
//.count(themes_count)
|
||||||
|
.items_builder(move |build_ctx, index| {
|
||||||
|
let theme_name =
|
||||||
|
MenuView::themes_ref(&build_ctx.get_widget(id))[index].clone();
|
||||||
|
TextBlock::new().v_align("center").text(theme_name).build(build_ctx)
|
||||||
|
})
|
||||||
|
.on_changed("selected_index", move |ctx, _| {
|
||||||
|
ctx.send_message(MenuAction::SetTheme, id);
|
||||||
|
println!("changed theme.");
|
||||||
|
})
|
||||||
|
.selected_index(id)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx)
|
||||||
|
}
|
||||||
82
advotracker/src/widgets/menu/menu_view.rs
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* advotracker - Hotline tackingtool for Advocats
|
||||||
|
*
|
||||||
|
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||||
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
|
*/
|
||||||
|
|
||||||
|
use cfg_if::cfg_if;
|
||||||
|
use orbtk::prelude::*;
|
||||||
|
|
||||||
|
use crate::data::constants::*;
|
||||||
|
use crate::widgets::menu::menu_state::{MenuAction, MenuState};
|
||||||
|
|
||||||
|
type List = Vec<String>;
|
||||||
|
|
||||||
|
// Macro that initializes the widget structures/variables for the menu view
|
||||||
|
widget!(
|
||||||
|
MenuView<MenuState> {
|
||||||
|
//menu_stack: Entity,
|
||||||
|
//button_menu: Entity,
|
||||||
|
selected_index: i32,
|
||||||
|
themes: List
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/// The template implementation of the menu view
|
||||||
|
/// All GUI elements are styled using the "style" attribute referencing to a ron based css
|
||||||
|
impl Template for MenuView {
|
||||||
|
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||||
|
cfg_if! {
|
||||||
|
if #[cfg(windows)] {
|
||||||
|
// define the list of supported themes
|
||||||
|
let themes = vec![
|
||||||
|
"default_dark".to_string(),
|
||||||
|
"default_light".to_string(),
|
||||||
|
"redox".to_string(),
|
||||||
|
"fluent_dark".to_string(),
|
||||||
|
"fluent_light".to_string()
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// define the list of supported themes
|
||||||
|
let themes = vec![
|
||||||
|
"default_dark".to_string(),
|
||||||
|
"default_light".to_string(),
|
||||||
|
"redox".to_string(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//self.themes(themes).child(MenuState::create_menu(ID_MENU_POPUP, ctx))
|
||||||
|
self.themes(themes).child(
|
||||||
|
Stack::new()
|
||||||
|
.id(ID_MENU_STACK)
|
||||||
|
.child(
|
||||||
|
TextBlock::new()
|
||||||
|
.style("header")
|
||||||
|
.attach(Grid::row(0))
|
||||||
|
.attach(Grid::column(0))
|
||||||
|
.style("small_text")
|
||||||
|
.text("Select theme")
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new()
|
||||||
|
//.id("button_menu")
|
||||||
|
.id(ID_MENU_BUTTON)
|
||||||
|
.style("button_single_content")
|
||||||
|
.icon(material_icons_font::MD_MENU)
|
||||||
|
.attach(Grid::column(2))
|
||||||
|
.h_align("end")
|
||||||
|
.on_click(move |ctx, _| {
|
||||||
|
println!("WIP: open menu popup from MenuView");
|
||||||
|
ctx.get_mut::<MenuState>(id)
|
||||||
|
.set_action(MenuAction::CreateMenu);
|
||||||
|
true
|
||||||
|
})
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
.build(ctx),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
12
advotracker/src/widgets/menu/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)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// The menu view
|
||||||
|
pub mod menu_view;
|
||||||
|
|
||||||
|
/// The menu state
|
||||||
|
pub mod menu_state;
|
||||||
@@ -5,11 +5,26 @@
|
|||||||
* SPDX-License-Identifier: (0BSD or MIT)
|
* SPDX-License-Identifier: (0BSD or MIT)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// The starting point (Main View)
|
/// Configuration widget.
|
||||||
|
pub mod configuration;
|
||||||
|
|
||||||
|
/// Global helper functions.
|
||||||
|
pub mod global_state;
|
||||||
|
|
||||||
|
/// Localization widget.
|
||||||
|
pub mod localization;
|
||||||
|
|
||||||
|
/// The starting point (Main View).
|
||||||
pub mod main_view;
|
pub mod main_view;
|
||||||
|
|
||||||
/// The policy check wigdet
|
/// Menu widget.
|
||||||
pub mod policycheck_view;
|
pub mod menu;
|
||||||
|
|
||||||
// /// The policy lists widget
|
/// Policycheck wigdet.
|
||||||
// pub mod policylist_view;
|
pub mod policycheck;
|
||||||
|
|
||||||
|
// /// Policydata widget.
|
||||||
|
// pub mod policydata;
|
||||||
|
|
||||||
|
// /// Policylists widget.
|
||||||
|
// pub mod policylist;
|
||||||
|
|||||||