Compare commits
33 Commits
master
...
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 |
@@ -25,11 +25,22 @@ Dictionary (
|
||||
"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",
|
||||
// localization
|
||||
"Hello": "Hallo",
|
||||
"User": "Anwender",
|
||||
"Account": "Benutzer",
|
||||
"Toggle theme": "Thema wechseln",
|
||||
"Quit": "Beenden",
|
||||
|
||||
// localization view
|
||||
"Language ID": "Sprache ID",
|
||||
"Localization dialog": "Lokalisierungs-Dialog",
|
||||
"German": "Deutsch",
|
||||
"English": "Englisch"
|
||||
"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
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 6.3 KiB 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 |
@@ -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,122 +0,0 @@
|
||||
Theme (
|
||||
styles: {
|
||||
"button_menu": (
|
||||
base: "menu",
|
||||
properties: {
|
||||
"background": "transparent",
|
||||
//"background": "$GOLDEN_DREAM",
|
||||
//"background": "$LINK_WATER",
|
||||
//"border_brush": "$LINK_WATER",
|
||||
//"border_brush": "$GOLDEN_DREAM",
|
||||
"border_radius": 0,
|
||||
"border_width": 0,
|
||||
//"foreground": "$BRIGHT_GRAY",
|
||||
//"icon_brush": "$BRIGHT_GRAY",
|
||||
"font_size": "$ICON_SIZE_16",
|
||||
"h_align": "left",
|
||||
//"height": 14,
|
||||
"margin": (0, 4, 0, 0),
|
||||
//"padding": (8, 0, 8, 0),
|
||||
},
|
||||
),
|
||||
"container_menu": (
|
||||
properties: {
|
||||
"border_radius": 0,
|
||||
"border_width": 1,
|
||||
"background": "$BRIGHT_GRAY",
|
||||
"border_brush": "$LINK_WATER",
|
||||
//"border_brush": "$GOLDEN_DREAM",
|
||||
"padding": 4,
|
||||
},
|
||||
),
|
||||
"container_progress": (
|
||||
properties: {
|
||||
"border_radius": 3,
|
||||
"border_width": 1,
|
||||
"background": "$BRIGHT_GRAY",
|
||||
"border_brush": "$LINK_WATER",
|
||||
//"border_brush": "$GOLDEN_DREAM",
|
||||
"padding": 14,
|
||||
"h_align": "end"
|
||||
},
|
||||
),
|
||||
"container_form": (
|
||||
base: "container",
|
||||
properties: {
|
||||
"background": "$BRIGHT_GRAY",
|
||||
"border_brush": "$LINK_WATER",
|
||||
"border_radius": 3,
|
||||
"border_width": 1,
|
||||
"padding": 14,
|
||||
"v_align": "top",
|
||||
},
|
||||
),
|
||||
"header_bar": (
|
||||
base: "header",
|
||||
properties: {
|
||||
"foreground": "$LINK_WATER",
|
||||
},
|
||||
),
|
||||
"hint": (
|
||||
base: "body",
|
||||
properties: {
|
||||
"font_size": 11,
|
||||
"font_family": "$MEDIUM_FONT",
|
||||
"width": "250",
|
||||
"min_width": "250"
|
||||
},
|
||||
),
|
||||
"menu": (
|
||||
//base: "base",
|
||||
properties: {
|
||||
"font_size": 16,
|
||||
"font_family": "$MEDIUM_FONT",
|
||||
"background": "$BLACK",
|
||||
"opacity": 1,
|
||||
},
|
||||
states: {
|
||||
"pressed": {
|
||||
"background": "$WHITE",
|
||||
},
|
||||
},
|
||||
),
|
||||
"popup_progress": (
|
||||
base: "popup",
|
||||
properties: {
|
||||
//"h_align": "center",
|
||||
"width": 300,
|
||||
"heigth": 120,
|
||||
},
|
||||
),
|
||||
"stack_menu": (
|
||||
properties: {
|
||||
//"background": "transparent",
|
||||
"spacing": 2,
|
||||
"orientation": "vertical",
|
||||
"h_align": "left",
|
||||
},
|
||||
),
|
||||
"stack_progress": (
|
||||
properties: {
|
||||
//"background": "transparent",
|
||||
"spacing": 8,
|
||||
"margin": (16, 16, 16, 16),
|
||||
},
|
||||
),
|
||||
"textblock": (
|
||||
//base: "base",
|
||||
properties: {
|
||||
"font_size": "$ICON_SIZE_12",
|
||||
},
|
||||
),
|
||||
"textblock_progress": (
|
||||
base: "textblock",
|
||||
properties: {
|
||||
//"background": "transparent",
|
||||
//"font_size": 12,
|
||||
"h_align": "center",
|
||||
"v_align": "center",
|
||||
},
|
||||
),
|
||||
}
|
||||
)
|
||||
@@ -1,100 +0,0 @@
|
||||
Theme (
|
||||
styles: {
|
||||
"button_menu": (
|
||||
base: "menu",
|
||||
properties: {
|
||||
"background": "transparent",
|
||||
"border_radius": 0,
|
||||
"border_width": 0,
|
||||
"font_size": "$ICON_SIZE_16",
|
||||
"h_align": "left",
|
||||
"margin": (0, 4, 0, 0),
|
||||
},
|
||||
),
|
||||
"container_menu": (
|
||||
properties: {
|
||||
"border_radius": 0,
|
||||
"border_width": 1,
|
||||
"background": "$BRIGHT_GRAY",
|
||||
"border_brush": "$LINK_WATER",
|
||||
"padding": 4,
|
||||
},
|
||||
),
|
||||
"container_progress": (
|
||||
properties: {
|
||||
"border_radius": 3,
|
||||
"border_width": 1,
|
||||
"background": "$BRIGHT_GRAY",
|
||||
"border_brush": "$LINK_WATER",
|
||||
"padding": 14,
|
||||
"h_align": "end",
|
||||
},
|
||||
),
|
||||
"container_form": (
|
||||
base: "container",
|
||||
properties: {
|
||||
"background": "$GRAY_NURSE",
|
||||
"border_brush": "$LINK_WATER",
|
||||
"border_radius": 3,
|
||||
"border_width": 1,
|
||||
"padding": 14,
|
||||
"v_align": "top",
|
||||
},
|
||||
),
|
||||
"header_bar": (
|
||||
base: "header",
|
||||
properties: {
|
||||
"background": "$GRAY_NURSE",
|
||||
"foreground": "$BRIGHT_GRAY",
|
||||
},
|
||||
),
|
||||
"menu": (
|
||||
//base: "base",
|
||||
properties: {
|
||||
"font_size": 16,
|
||||
"font_family": "$MEDIUM_FONT",
|
||||
"background": "$GRAY_NURSE",
|
||||
"opacity": 1,
|
||||
"foreground": "$BRIGHT_GRAY",
|
||||
},
|
||||
states: {
|
||||
"pressed": {
|
||||
"background": "$WHITE",
|
||||
},
|
||||
},
|
||||
),
|
||||
"popup_progress": (
|
||||
base: "popup",
|
||||
properties: {
|
||||
"width": 300,
|
||||
"heigth": 120,
|
||||
},
|
||||
),
|
||||
"stack_menu": (
|
||||
properties: {
|
||||
"spacing": 2,
|
||||
"orientation": "vertical",
|
||||
"h_align": "left",
|
||||
},
|
||||
),
|
||||
"stack_progress": (
|
||||
properties: {
|
||||
"spacing": 8,
|
||||
"margin": (16, 16, 16, 16),
|
||||
},
|
||||
),
|
||||
"textblock": (
|
||||
//base: "base",
|
||||
properties: {
|
||||
"font_size": "$ICON_SIZE_12",
|
||||
},
|
||||
),
|
||||
"textblock_progress": (
|
||||
base: "textblock",
|
||||
properties: {
|
||||
"h_align": "center",
|
||||
"v_align": "center",
|
||||
},
|
||||
),
|
||||
}
|
||||
)
|
||||
@@ -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,65 +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 locales::t;
|
||||
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 mut res = t!("policy.validation.started", lang);
|
||||
let mut state = t!("state.started", lang);
|
||||
let dt_start: DateTime<Local> = Local::now();
|
||||
|
||||
trace!(target: "advotracker",
|
||||
process = ?res,
|
||||
state = ?state,
|
||||
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) => {
|
||||
let res = t!("policy.validation.success", lang);
|
||||
info!("{} => {} ({:?})", res, policy_number, policy_code);
|
||||
result = true;
|
||||
trace!(target: "advotracker",
|
||||
policy_number = ?policy_number,
|
||||
validation = ?res,
|
||||
policy_code = ?policy_code);
|
||||
},
|
||||
_ => {
|
||||
let res = t!("policy.validation.failed", lang);
|
||||
info!("{} => {}", res, policy_number);
|
||||
trace!(target: "advotracker",
|
||||
policy_number = ?policy_number,
|
||||
validation = ?res);
|
||||
},
|
||||
}
|
||||
|
||||
let dt_end: DateTime<Local> = Local::now();
|
||||
let duration = dt_end.signed_duration_since(dt_start);
|
||||
|
||||
res = t!("policy.validation.finished", lang);
|
||||
state = t!("state.finished", lang);
|
||||
trace!(target: "advotracker",
|
||||
process = ?res,
|
||||
state = ?state,
|
||||
date_stop = ?dt_end.to_string(),
|
||||
duration = ?duration);
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
@@ -6,66 +6,83 @@
|
||||
*/
|
||||
|
||||
// Styles (RON based theme system)
|
||||
pub static STYLE_BOTTOM_BAR: &'static str = "bottom_bar";
|
||||
pub static STYLE_HEADER_BAR: &'static str = "header_bar";
|
||||
pub static STYLE_SEPERATOR: &'static str = "seperator";
|
||||
//pub static STYLE_ITEM_BUTTON: &'static str = "item_button";
|
||||
pub static STYLE_MENU: &'static str = "menu";
|
||||
pub static STYLE_BUTTON_MENU: &'static str = "button_menu";
|
||||
pub static STYLE_STACK_MENU: &'static str = "stack_menu";
|
||||
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_POLICY_CHECK_FORM: &'static str = "policy_check_form";
|
||||
pub static ID_POLICY_CHECK_FORM_ROW_0: &'static str = "policy_check_form_row_0";
|
||||
pub static ID_POLICY_CHECK_FORM_ROW_1: &'static str = "policy_check_form_row_1";
|
||||
pub static ID_POLICY_CHECK_FORM_ROW_2: &'static str = "policy_check_form_row_2";
|
||||
pub static ID_POLICY_CHECK_HEADER: &'static str = "policy_check_header";
|
||||
pub static ID_POLICY_CHECK_ITEMS_WIDGET: &'static str = "policy_check_items_widget";
|
||||
pub static ID_POLICY_CHECK_BUTTON_RESULT: &'static str = "policy_check_button_result";
|
||||
pub static ID_POLICY_CHECK_BUTTON_MENU: &'static str = "policy_check_button_menu";
|
||||
pub static ID_POLICY_CHECK_DATA_COUNT_BLOCK: &'static str = "policy_check_data_count_block";
|
||||
pub static ID_POLICY_CHECK_HINT: &'static str = "policy_check_hint";
|
||||
pub static ID_POLICY_CHECK_LABEL_HINT: &'static str = "policy_check_label_hint";
|
||||
pub static ID_POLICY_CHECK_LABEL_MENU: &'static str = "policy_check_label_menu";
|
||||
pub static ID_POLICY_CHECK_LABEL_POLICY_NUMBER: &'static str = "policy_check_label_policy_number";
|
||||
pub static ID_POLICY_CHECK_LABEL_RESULT: &'static str = "policy_check_label_result";
|
||||
pub static ID_POLICY_CHECK_MENU: &'static str = "policy_check_menu";
|
||||
pub static ID_POLICY_CHECK_MENU_LABEL_ACCOUNT: &'static str = "policy_check_menu_label_account";
|
||||
pub static ID_POLICY_CHECK_MENU_LABEL_QUIT: &'static str = "policy_check_menu_label_quit";
|
||||
pub static ID_POLICY_CHECK_MENU_SHORTCUT_QUIT: &'static str = "policy_check_menu_shortcut_quit";
|
||||
pub static ID_POLICY_CHECK_MENU_LABEL_TOGGLE_THEME: &'static str = "policy_check_menu_label_toggle_theme";
|
||||
pub static ID_POLICY_CHECK_POLICY_NUMBER: &'static str = "policy_check_policy_number";
|
||||
pub static ID_POLICY_CHECK_POPUP_MENU: &'static str = "policy_check_popup_menu";
|
||||
pub static ID_POLICY_CHECK_POPUP_PROGRESS: &'static str = "policy_check_popup_progress";
|
||||
pub static ID_POLICY_CHECK_PROGRESS_BAR: &'static str = "policy_check_progress_bar";
|
||||
pub static ID_POLICY_CHECK_PROGRESS_TIME: &'static str = "policy_check_progress_time";
|
||||
pub static ID_POLICY_CHECK_PROGRESS_TEXT: &'static str = "policy_check_progress_text";
|
||||
pub static ID_POLICY_CHECK_RESULT: &'static str = "policy_check_result";
|
||||
pub static ID_POLICY_CHECK_WIDGET: &'static str = "policy_check_widget";
|
||||
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_POLICY_DATA_ADD_BUTTON: &'static str = "policy_data_add_button";
|
||||
pub static ID_POLICY_DATA_COUNT: &'static str = "policy_data_count";
|
||||
pub static ID_POLICY_DATA_LABEL: &'static str = "policy_data_label";
|
||||
pub static ID_POLICY_DATA_ITEMS_WIDGET: &'static str = "policy_data_items_widget";
|
||||
pub static ID_POLICY_DATA_DATE_INSERTED: &'static str = "policy_data_date_inserted";
|
||||
pub static ID_POLICY_DATA_DION: &'static str = "policy_data_dion";
|
||||
pub static ID_POLICY_DATA_POLICY_CODE: &'static str = "policy_data_policy_code";
|
||||
pub static ID_POLICY_DATA_POLICY_NUMBER: &'static str = "policy_data_policy_number";
|
||||
pub static ID_POLICY_DATA_STACK: &'static str = "policy_data_stack";
|
||||
pub static ID_POLICY_DATA_STATUS: &'static str = "policy_data_status";
|
||||
pub static ID_POLICY_DATA_LIST_NAME: &'static str = "policy_data_list_name";
|
||||
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_POLICY_LIST_ADD_BUTTON: &'static str = "policy_list_add_button";
|
||||
pub static ID_POLICY_LIST_ITEMS_WIDGET: &'static str = "policy_list_items_widget";
|
||||
pub static ID_POLICY_LIST_TEXT_BOX: &'static str = "policy_list_text_box";
|
||||
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: &'static str = "advotracker";
|
||||
pub static PROP_POLICY_CHECK: &'static str = "policy_check";
|
||||
pub static PROP_POLICY_PROGRESS_COUNT: &'static str = "policy_progress_count";
|
||||
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: &'static str = "policy_data_list";
|
||||
pub static PROP_POLICY_DATA_COUNT: &'static str = "policy_data_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: &'static str = "policy_list";
|
||||
pub static PROP_POLICY_LIST_COUNT: &'static str = "policy_list_count";
|
||||
pub static PROP_POLICY_LIST: &str = "policy_list";
|
||||
pub static PROP_POLICY_LIST_COUNT: &str = "policy_list_count";
|
||||
|
||||
@@ -26,13 +26,10 @@
|
||||
// /// The client specific services
|
||||
// pub mod clients;
|
||||
|
||||
/// provides helper functions to manage orbtk callbacks
|
||||
pub mod callbacks;
|
||||
|
||||
/// provides data definitions
|
||||
pub mod data;
|
||||
|
||||
/// provides orbtk widget structures
|
||||
/// provides orbtk widgets (handling views and states)
|
||||
pub mod widgets;
|
||||
|
||||
/// provides services
|
||||
|
||||
@@ -14,18 +14,23 @@
|
||||
//use chrono::{Local, DateTime};
|
||||
use dotenv::dotenv;
|
||||
use locales::t;
|
||||
use cfg_if::cfg_if;
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
//use std::process;
|
||||
use tracing::{info, trace, Level};
|
||||
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::{
|
||||
prelude::*,
|
||||
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
|
||||
use advotracker::{
|
||||
callbacks::policycheck_state::PolicyCheckState,
|
||||
widgets::main_view,
|
||||
};
|
||||
use advotracker::widgets::main_view;
|
||||
|
||||
mod parse_args;
|
||||
|
||||
@@ -39,8 +44,17 @@ struct Environment {
|
||||
rust_log: String,
|
||||
}
|
||||
|
||||
// Style extension
|
||||
static DEFAULT_DARK_EXT: &str = include_str!("../assets/advotracker/default_dark.ron");
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
// German localization file.
|
||||
static ADVOTRACKER_DE_DE: &str = include_str!("../resources/advotracker/advotracker_de_DE.ron");
|
||||
static ADVOTRACKER_DE_DE: &str = include_str!("../assets/advotracker/advotracker_de_DE.ron");
|
||||
|
||||
/// Get the active language environment.
|
||||
fn get_lang() -> String {
|
||||
@@ -59,6 +73,43 @@ fn get_lang() -> String {
|
||||
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>> {
|
||||
use parse_args::parse_args;
|
||||
use tracing_subscriber::fmt;
|
||||
@@ -129,8 +180,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.build();
|
||||
|
||||
Application::from_name("nwx.advotracker")
|
||||
.theme(PolicyCheckState::theme())
|
||||
.localization(localization)
|
||||
.theme(theme())
|
||||
.window(|ctx| {
|
||||
Window::new()
|
||||
.title("AdvoTracker - DirectCall")
|
||||
|
||||
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;
|
||||
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;
|
||||
@@ -9,11 +9,12 @@ use orbtk::prelude::*;
|
||||
|
||||
use crate::{
|
||||
data::structures::PolicyCheck,
|
||||
widgets::policycheck_view::PolicyCheckView,
|
||||
widgets::policycheck::policycheck_view::PolicycheckView,
|
||||
widgets::localization::localization_view::LocalizationView,
|
||||
widgets::configuration::configuration_view::ConfigurationView,
|
||||
widgets::menu::menu_view::MenuView,
|
||||
};
|
||||
|
||||
type List = Vec<String>;
|
||||
|
||||
// [START] views
|
||||
|
||||
widget!(MainView {
|
||||
@@ -26,7 +27,7 @@ widget!(MainView {
|
||||
|
||||
impl Template for MainView {
|
||||
fn template(self, _id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||
let policycheck_view = PolicyCheckView::new()
|
||||
let policycheck_view = PolicycheckView::new()
|
||||
//.policy_number_count(0)
|
||||
//.policylist_view(id)
|
||||
.build(ctx);
|
||||
@@ -56,79 +57,10 @@ impl Template for MainView {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
widget!(LocalizationView<LocalizationState> { languages: List, selected_index: i32 });
|
||||
|
||||
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(
|
||||
Stack::new()
|
||||
.width(120)
|
||||
.margin(16)
|
||||
.spacing(8)
|
||||
.child(TextBlock::new().text("Hello").build(ctx))
|
||||
.child(TextBlock::new().text("User").build(ctx))
|
||||
.child(TextBlock::new().text("Localization dialog").build(ctx))
|
||||
.child(
|
||||
ComboBox::new()
|
||||
.count(count)
|
||||
.items_builder(move |bc, index| {
|
||||
let text = bc.get_widget(id)
|
||||
.get::<Vec<String>>("languages")[index]
|
||||
.clone();
|
||||
TextBlock::new().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),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// [END] views
|
||||
|
||||
// [START] states
|
||||
|
||||
#[derive(AsAny, Debug, Default)]
|
||||
struct LocalizationState {
|
||||
change_language: bool,
|
||||
}
|
||||
|
||||
impl LocalizationState {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// [END] states
|
||||
|
||||
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)
|
||||
*/
|
||||
|
||||
/// 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;
|
||||
|
||||
/// The policy check wigdet
|
||||
pub mod policycheck_view;
|
||||
/// Menu widget.
|
||||
pub mod menu;
|
||||
|
||||
// /// The policy lists widget
|
||||
// pub mod policylist_view;
|
||||
/// Policycheck wigdet.
|
||||
pub mod policycheck;
|
||||
|
||||
// /// Policydata widget.
|
||||
// pub mod policydata;
|
||||
|
||||
// /// Policylists widget.
|
||||
// pub mod policylist;
|
||||
|
||||
12
advotracker/src/widgets/policycheck/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 policy check state
|
||||
pub mod policycheck_state;
|
||||
|
||||
/// The policy check view
|
||||
pub mod policycheck_view;
|
||||
@@ -1,16 +1,12 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use locales::t;
|
||||
use orbtk::{
|
||||
prelude::*,
|
||||
shell::WindowRequest,
|
||||
theme::{COLORS_RON, FONTS_RON},
|
||||
theming::config::ThemeConfig,
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "light"))]
|
||||
use orbtk::theme::DARK_THEME_RON;
|
||||
|
||||
#[cfg(feature = "light")]
|
||||
use orbtk::theme::LIGHT_THEME_RON;
|
||||
use orbtk::prelude::*;
|
||||
|
||||
use serde::Deserialize;
|
||||
use std::process;
|
||||
@@ -19,75 +15,64 @@ use std::time::{Duration, SystemTime};
|
||||
use tracing::{error, info, trace};
|
||||
|
||||
use crate::{
|
||||
callbacks::global_state::GlobalState,
|
||||
data::structures::{PolicyCode, PolicyDataList, PolicyList},
|
||||
data::constants::*,
|
||||
services::imports::allianzdirectcall::import,
|
||||
data::{
|
||||
structures::{PolicyCode, PolicyDataList, PolicyList},
|
||||
constants::*,
|
||||
},
|
||||
widgets::global_state::GlobalState,
|
||||
//widgets::menu::menu_view::MenuView,
|
||||
//services::imports::allianzdirectcall::import,
|
||||
services::imports::allianzdirectcall,
|
||||
};
|
||||
|
||||
/// Actions that can execute on the task view.
|
||||
/// Valid `actions` that are handled as state changes in the `Policycheck` widget.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Action {
|
||||
pub enum PolicycheckAction {
|
||||
AddProgress(f64),
|
||||
ClearEntry(Entity),
|
||||
ChangeTheme(),
|
||||
InputTextChanged(Entity),
|
||||
ImportData,
|
||||
OpenMenu(Entity),
|
||||
ParseEntry(Entity),
|
||||
AddProgress(f64),
|
||||
ResetProgress,
|
||||
SetMenu(Entity),
|
||||
SetProgress(f64),
|
||||
SetProgressPopup(Entity),
|
||||
RemoveFocus(Entity),
|
||||
RemovePopup(Entity),
|
||||
ResetProgress,
|
||||
SetProgress(f64),
|
||||
SetProgressPopup(Entity),
|
||||
SetToggleTheme(Entity),
|
||||
SetEntry(Entity),
|
||||
SetVisibility(Entity),
|
||||
TextChanged(Entity, usize),
|
||||
ToggleTheme(Entity),
|
||||
TextChanged(Entity, usize)
|
||||
}
|
||||
|
||||
/// define valid environment variables provided via .env files
|
||||
/// located in the current call directory
|
||||
/// this is primarily used in testing scenarios (eg. debugging)
|
||||
/// 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,
|
||||
}
|
||||
|
||||
/// Handles the requests from `PolicyCheckView`.
|
||||
/// Valid `structures` that are handled inside the state of the `Policycheck` widget.
|
||||
#[derive(AsAny, Default)]
|
||||
pub struct PolicyCheckState {
|
||||
action: Option<Action>,
|
||||
pub struct PolicycheckState {
|
||||
action: Option<PolicycheckAction>,
|
||||
duration: Duration,
|
||||
label_result: Entity,
|
||||
lang: String,
|
||||
//last_focused: Option<Entity>,
|
||||
button_menu: Entity,
|
||||
menu: Entity,
|
||||
policy_data_count: u64,
|
||||
policy_numbers: HashMap<u64, PolicyCode>,
|
||||
progress_bar: Entity,
|
||||
progress_count: f64,
|
||||
progress_popup: Entity,
|
||||
theme_name: String
|
||||
progress_popup: Entity
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "light"))]
|
||||
static DARK_EXT: &'static str = include_str!("../../resources/stylesheets/advotracker_dark.ron");
|
||||
|
||||
#[cfg(feature = "light")]
|
||||
static LIGHT_EXT: &'static str = include_str!("../../resources/stylesheets/advotracker_light.ron");
|
||||
|
||||
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();
|
||||
}
|
||||
impl GlobalState for PolicycheckState {}
|
||||
|
||||
/// Method definitions, that react on any given state change inside the `Policycheck` widget.
|
||||
impl PolicycheckState {
|
||||
/// Create a hashmap (key: policy number, value: policy type).
|
||||
pub fn create_hashmap(&mut self, _ctx: &mut Context<'_>) -> Result<(), Box<dyn std::error::Error>> {
|
||||
trace!(target: "advotracker", create_hashmap = "started");
|
||||
@@ -105,7 +90,7 @@ impl PolicyCheckState {
|
||||
// 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");
|
||||
match import(&mut csv_import_path, &mut policy_data,
|
||||
match allianzdirectcall::import(&mut csv_import_path, &mut policy_data,
|
||||
&mut policy_numbers, &mut self.policy_data_count,
|
||||
&self.lang) {
|
||||
Ok((count, duration)) => {
|
||||
@@ -142,11 +127,10 @@ impl PolicyCheckState {
|
||||
|
||||
if self.policy_numbers.len() == 0 {
|
||||
// initialize popup widget
|
||||
let sender = ctx.window_sender();
|
||||
self.set_popup_progress(ctx);
|
||||
self.progress_count += 0.33;
|
||||
self.update_progress_bar(ctx);
|
||||
sender.send(WindowRequest::Redraw).unwrap();
|
||||
//sender.send(WindowRequest::Redraw).unwrap();
|
||||
|
||||
// for _ in 1..4 {
|
||||
// self.progress_count += 0.33;
|
||||
@@ -166,7 +150,7 @@ impl PolicyCheckState {
|
||||
self.progress_count = 1.;
|
||||
self.update_progress_bar(ctx);
|
||||
|
||||
sender.send(WindowRequest::Redraw).unwrap();
|
||||
//sender.send(WindowRequest::Redraw).unwrap();
|
||||
}
|
||||
_ => {
|
||||
let res = t!("policy.hashmap.failed", self.lang);
|
||||
@@ -184,14 +168,6 @@ impl PolicyCheckState {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Open menu.
|
||||
pub fn open_menu(&mut self, _entity: Entity, ctx: &mut Context<'_>) {
|
||||
//let menu_string = ctx.get_widget(entity).get::<String16>("text");
|
||||
//.child(policycheck_menu);
|
||||
//self.set_popup_menu(ctx);
|
||||
self.set_menu(ctx);
|
||||
}
|
||||
|
||||
/// Parse validity of the given policy number.
|
||||
fn parse_entry(&mut self, policy_check_policy_number: Entity,
|
||||
ctx: &mut Context<'_>) {
|
||||
@@ -331,9 +307,8 @@ impl PolicyCheckState {
|
||||
trace!(target: "advotracker", parse_entry = "finished");
|
||||
}
|
||||
|
||||
/// Remove the menu popup box
|
||||
/// Remove the popup box
|
||||
fn remove_popup(&mut self, id: Entity, ctx: &mut Context<'_>) {
|
||||
ctx.remove_child(self.menu);
|
||||
ctx.remove_child(self.progress_popup);
|
||||
println!("Popup {:?} removed !", id);
|
||||
}
|
||||
@@ -351,6 +326,11 @@ impl PolicyCheckState {
|
||||
// ctx.get_widget(self.policy_check_policy_number).update_theme_by_state(true);
|
||||
// }
|
||||
|
||||
/// Sets a new action.
|
||||
pub fn set_action(&mut self, action: PolicycheckAction) {
|
||||
self.action = action.into();
|
||||
}
|
||||
|
||||
/// Change status of given text box to edit mode.
|
||||
fn set_entry(&mut self, text_box: Entity, ctx: &mut Context<'_>) {
|
||||
if ctx.get_widget(text_box).get::<String16>("text").is_empty() {
|
||||
@@ -362,36 +342,29 @@ impl PolicyCheckState {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set a menu
|
||||
fn set_menu(&mut self, ctx: &mut Context<'_>) {
|
||||
let current_entity = ctx.entity;
|
||||
let build_context = &mut ctx.build_context();
|
||||
|
||||
// create a menu overlay
|
||||
self.menu = create_menu(current_entity, build_context);
|
||||
let _menu = build_context.append_child_to_overlay(self.menu)
|
||||
.expect("PolicyCheckState: Can't create overlay as child of entity");
|
||||
}
|
||||
|
||||
/// Set a progress popup that updates the import status in a progress bar
|
||||
fn set_popup_progress(&mut self, ctx: &mut Context<'_>) {
|
||||
//println!("Set up Progress popup: {:?}", text_box);
|
||||
// create a stack as a child of entity "ID_POLICY_CHECK_POLICY_NUMBER"
|
||||
let stack = ctx
|
||||
.entity_of_child(ID_POLICY_CHECK_RESULT)
|
||||
.expect("PolicyCheckState: Can't find entity of resource 'ID_POLICY_CHECK_RESULT'.");
|
||||
let current_entity = ctx.entity;
|
||||
.entity_of_child(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
.expect("PolicycheckState: Can't find entity of resource 'ID_POLICY_CHECK_POLICY_NUMBER'.");
|
||||
let current_entity = ctx.entity();
|
||||
let build_context = &mut ctx.build_context();
|
||||
|
||||
// create the progress_popup widget
|
||||
self.progress_popup = create_popup_progress(current_entity, build_context);
|
||||
println!("New entity `progress_popup` created: {:?}", self.progress_popup);
|
||||
|
||||
// create a progress_popup widget as a child of entity "ID_POLICY_CHECK_POLICY_NUMBER"
|
||||
// append the stack inside the progress_popup
|
||||
build_context.append_child(stack, self.progress_popup);
|
||||
|
||||
// make sure we have a
|
||||
self.progress_bar = ctx
|
||||
.entity_of_child(ID_POLICY_CHECK_PROGRESS_BAR)
|
||||
.expect("PolicyCheckState.init: Can't find entity of resource 'ID_POLICY_CHECK_PROGRESS_BAR'.");
|
||||
.expect("PolicycheckState.init: Can't find entity of resource 'ID_POLICY_CHECK_PROGRESS_BAR'.");
|
||||
println!("New entity `progress_bar` created: {:?}", self.progress_bar);
|
||||
|
||||
println!("PopupProgress created: {:?}", self.progress_popup);
|
||||
println!("function `set_popup_progress()` finished!");
|
||||
}
|
||||
|
||||
/// Change visibility of the result label.
|
||||
@@ -407,29 +380,6 @@ impl PolicyCheckState {
|
||||
//ctx.get_widget(self.label_result).update_theme_by_state(true);
|
||||
}
|
||||
|
||||
|
||||
/// Set and activate the theme attributes.
|
||||
#[cfg(not(feature = "light"))]
|
||||
pub fn theme() -> Theme {
|
||||
Theme::from_config(
|
||||
// sourcing: crates/theme/assets/dark/dark.ron
|
||||
ThemeConfig::from(DARK_THEME_RON)
|
||||
.extend(ThemeConfig::from(DARK_EXT))
|
||||
.extend(ThemeConfig::from(COLORS_RON))
|
||||
.extend(ThemeConfig::from(FONTS_RON)),
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(feature = "light")]
|
||||
pub fn theme() -> Theme {
|
||||
Theme::from_config(
|
||||
ThemeConfig::from(LIGHT_THEME_RON)
|
||||
.extend(ThemeConfig::from(LIGHT_EXT))
|
||||
.extend(ThemeConfig::from(COLORS_RON))
|
||||
.extend(ThemeConfig::from(FONTS_RON)),
|
||||
)
|
||||
}
|
||||
|
||||
/// Update count of elements in the policy data list.
|
||||
fn _update_data_count(&self, ctx: &mut Context<'_>) {
|
||||
let data_list_count = ctx.widget().get::<PolicyDataList>(PROP_POLICY_DATA_LIST).len();
|
||||
@@ -447,22 +397,22 @@ impl PolicyCheckState {
|
||||
}
|
||||
}
|
||||
|
||||
/// upported states for our view
|
||||
impl State for PolicyCheckState {
|
||||
/// Initialize the widget state
|
||||
/// Supported methods handled inside the `PolicycheckState`
|
||||
impl State for PolicycheckState {
|
||||
/// Initialize the state of widgets inside `PolicycheckState`
|
||||
fn init(&mut self, _: &mut Registry, ctx: &mut Context<'_>) {
|
||||
let time_start= SystemTime::now();
|
||||
|
||||
trace!(target: "advotracker", policycheck_state = "init", status = "started");
|
||||
|
||||
// Entities
|
||||
// Initialize required entities
|
||||
self.button_menu = ctx
|
||||
.entity_of_child(ID_POLICY_CHECK_BUTTON_MENU)
|
||||
.expect("PolicyCheckState.init: Can't find resource entity 'ID_POLICY_CHECK_BUTTON_MENU'.");
|
||||
.expect("PolicycheckState.init: Can't find resource entity 'ID_POLICY_CHECK_BUTTON_MENU'.");
|
||||
|
||||
self.label_result = ctx
|
||||
.entity_of_child(ID_POLICY_CHECK_LABEL_RESULT)
|
||||
.expect("PolicyCheckState.init: Can't find resource entity 'ID_POLICY_CHECK_LABEL_RESULT'.");
|
||||
.expect("PolicycheckState.init: Can't find resource entity 'ID_POLICY_CHECK_LABEL_RESULT'.");
|
||||
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
|
||||
@@ -471,7 +421,7 @@ impl State for PolicyCheckState {
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
|
||||
|
||||
// Preset localization with given environment lang
|
||||
self.lang = PolicyCheckState::get_lang();
|
||||
self.lang = PolicycheckState::get_lang();
|
||||
ctx.set_language(&self.lang);
|
||||
|
||||
// // Load the saved data from a file in 'ron' format into our data structure.
|
||||
@@ -492,7 +442,33 @@ impl State for PolicyCheckState {
|
||||
trace!(target: "advotracker", policycheck_state = "init", status = "finished", duration = ?duration);
|
||||
}
|
||||
|
||||
/// Update the widget state.
|
||||
/// Handle messages for `PolicycheckState`.
|
||||
fn messages(
|
||||
&mut self,
|
||||
mut messages: MessageReader,
|
||||
_registry: &mut Registry,
|
||||
ctx: &mut Context<'_>,
|
||||
) {
|
||||
for message in messages.read::<PolicycheckAction>() {
|
||||
match message {
|
||||
PolicycheckAction::AddProgress(increment) => {
|
||||
let old_width = ProgressBar::val_clone(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR));
|
||||
|
||||
let new_width = old_width + increment;
|
||||
// Set the ProgressBar's val property to the calculated percentage
|
||||
// (whereas 0.0 means 0%, and 1.0 means 100%)
|
||||
if new_width <= 1. {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), new_width);
|
||||
} else {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), 1.);
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Update the state of widgets inside the `Policycheck` view.
|
||||
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 {
|
||||
@@ -506,25 +482,13 @@ impl State for PolicyCheckState {
|
||||
|
||||
if let Some(action) = self.action {
|
||||
match action {
|
||||
Action::AddProgress(increment) => {
|
||||
let old_width = ProgressBar::val_clone(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR));
|
||||
|
||||
let new_width = old_width + increment;
|
||||
// Set the ProgressBar's val property to the calculated percentage
|
||||
// (whereas 0.0 means 0 %, and 1.0 means 100 %) to increment the progress
|
||||
if new_width <= 1. {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), new_width);
|
||||
} else {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), 1.);
|
||||
}
|
||||
}
|
||||
Action::ClearEntry(policy_check_policy_number) => {
|
||||
PolicycheckAction::ClearEntry(policy_check_policy_number) => {
|
||||
ctx.get_widget(policy_check_policy_number).set("enabled", false);
|
||||
}
|
||||
Action::InputTextChanged(entity) => {
|
||||
PolicycheckAction::InputTextChanged(entity) => {
|
||||
println!("entry changed: {}", TextBox::text_clone(&ctx.get_widget(entity)));
|
||||
}
|
||||
Action::ImportData => {
|
||||
PolicycheckAction::ImportData => {
|
||||
match self.import_data(ctx) {
|
||||
Ok(()) => {
|
||||
trace!(target: "advotracker", import_data = "success");
|
||||
@@ -535,59 +499,40 @@ impl State for PolicyCheckState {
|
||||
}
|
||||
}
|
||||
}
|
||||
Action::OpenMenu(entity) => {
|
||||
self.open_menu(entity, ctx);
|
||||
}
|
||||
Action::ParseEntry(text_box) => {
|
||||
PolicycheckAction::ParseEntry(text_box) => {
|
||||
self.parse_entry(text_box, ctx);
|
||||
}
|
||||
Action::RemoveFocus(policy_check_policy_number) => {
|
||||
PolicycheckAction::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));
|
||||
//ctx.EventAdapter(FocusEvent::RemoveFocus(policy_check_policy_number));
|
||||
}
|
||||
Action::RemovePopup(entity) => {
|
||||
PolicycheckAction::RemovePopup(entity) => {
|
||||
//println!("WIP: remove popup");
|
||||
self.remove_popup(entity, ctx);
|
||||
}
|
||||
Action::ResetProgress => {
|
||||
PolicycheckAction::ResetProgress => {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), 0.);
|
||||
}
|
||||
Action::SetEntry(policy_check_policy_number) => {
|
||||
PolicycheckAction::SetEntry(policy_check_policy_number) => {
|
||||
//self.last_focused = Some();
|
||||
self.set_entry(policy_check_policy_number, ctx);
|
||||
}
|
||||
Action::SetMenu(_entity) => {
|
||||
self.set_menu(ctx);
|
||||
}
|
||||
Action::SetProgress(value) => {
|
||||
PolicycheckAction::SetProgress(value) => {
|
||||
if value >= 0. || value <= 1. {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), value);
|
||||
} else {
|
||||
ProgressBar::val_set(&mut ctx.child(ID_POLICY_CHECK_PROGRESS_BAR), 0.);
|
||||
} }
|
||||
Action::SetProgressPopup(_entity) => {
|
||||
PolicycheckAction::SetProgressPopup(_entity) => {
|
||||
self.set_popup_progress(ctx);
|
||||
}
|
||||
Action::SetVisibility(_entity) => {
|
||||
PolicycheckAction::SetVisibility(_entity) => {
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
|
||||
}
|
||||
Action::TextChanged(entity, _index) => {
|
||||
PolicycheckAction::TextChanged(entity, _index) => {
|
||||
self.set_entry(entity, ctx);
|
||||
}
|
||||
Action::ToggleTheme(_entity) => {
|
||||
if self.theme_name == "light" {
|
||||
let theme = dark_theme();
|
||||
self.theme_name = "dark".to_string();
|
||||
ctx.switch_theme(theme);
|
||||
}
|
||||
|
||||
if self.theme_name == "dark" {
|
||||
let theme = light_theme();
|
||||
self.theme_name = "light".to_string();
|
||||
ctx.switch_theme(theme);
|
||||
};
|
||||
|
||||
println!{"Switch theme to {:?}", self.theme_name};
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
// Reset action
|
||||
@@ -597,105 +542,21 @@ impl State for PolicyCheckState {
|
||||
// /// Update the view after the layout is rendered.
|
||||
// fn update_post_layout(&mut self, _: &mut Registry, _ctx: &mut Context<'_>) {
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
/// Create a menu popup
|
||||
fn create_menu(menu: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||
Container::new()
|
||||
.style("container_menu")
|
||||
.width(280.0)
|
||||
.height(140.0)
|
||||
.position((100.0, 100.0))
|
||||
.child(
|
||||
Grid::new()
|
||||
.id(ID_POLICY_CHECK_MENU)
|
||||
.columns(
|
||||
Columns::create()
|
||||
// Menu Button
|
||||
.push("80")
|
||||
// Seperator
|
||||
.push("1")
|
||||
// Keyboard Shortcut
|
||||
.push("*")
|
||||
.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::create()
|
||||
.push("auto")
|
||||
.push("auto")
|
||||
.push("auto")
|
||||
.build(),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.id(ID_POLICY_CHECK_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)
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.id(ID_POLICY_CHECK_MENU_LABEL_TOGGLE_THEME)
|
||||
//.style("body")
|
||||
.style("button_menu")
|
||||
.attach(Grid::row(1))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(2))
|
||||
.icon(material_icons_font::MD_EDIT)
|
||||
.on_click(move |states, _| {
|
||||
states.get_mut::<PolicyCheckState>(menu)
|
||||
.action(Action::ToggleTheme(menu));
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.id(ID_POLICY_CHECK_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)
|
||||
.on_mouse_down(move |_states, _| {
|
||||
process::exit(0);
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_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 progress popup with update status of an onging data import
|
||||
fn create_popup_progress(target: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||
fn create_popup_progress(id: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||
Popup::new()
|
||||
.id(ID_POLICY_CHECK_POPUP_PROGRESS)
|
||||
.target(target)
|
||||
.target(id)
|
||||
.open(true)
|
||||
//.style("popup_progress")
|
||||
.style("popup_progress")
|
||||
.width(280)
|
||||
.height(100)
|
||||
.on_mouse_down(move |ctx, _| {
|
||||
println!("on_click -> remove_popup_progress()");
|
||||
ctx.get_mut::<PolicyCheckState>(target)
|
||||
.action(Action::RemovePopup(target));
|
||||
.on_click(move |ctx, _| {
|
||||
println!("create_popup_progress: on_click -> remove_popup(popup_progress)");
|
||||
ctx.get_mut::<PolicycheckState>(id)
|
||||
.set_action(PolicycheckAction::RemovePopup(id));
|
||||
true
|
||||
})
|
||||
.child(
|
||||
@@ -707,14 +568,14 @@ fn create_popup_progress(target: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_PROGRESS_TEXT)
|
||||
//.style("textblock_progress")
|
||||
.font_size(12)
|
||||
.style("textblock_progress")
|
||||
.text("Importing data")
|
||||
.build(ctx)
|
||||
)
|
||||
.child(
|
||||
ProgressBar::new()
|
||||
.id(ID_POLICY_CHECK_PROGRESS_BAR)
|
||||
.style("progress_bar")
|
||||
.val(0)
|
||||
//.width(250)
|
||||
.build(ctx)
|
||||
@@ -722,9 +583,8 @@ fn create_popup_progress(target: Entity, ctx: &mut BuildContext<'_>) -> Entity {
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_PROGRESS_TIME)
|
||||
//.style("textblock_progress")
|
||||
.style("textblock_progress")
|
||||
.h_align("end")
|
||||
.font_size(12)
|
||||
.text("Processing time")
|
||||
.build(ctx)
|
||||
)
|
||||
@@ -6,28 +6,33 @@
|
||||
*/
|
||||
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::shell::event::Key;
|
||||
|
||||
use crate::{
|
||||
data::constants::*,
|
||||
data::structures::PolicyCheck,
|
||||
callbacks::policycheck_state::*,
|
||||
data::{
|
||||
constants::*,
|
||||
structures::PolicyCheck,
|
||||
},
|
||||
//widgets::menu::menu_state::{MenuAction, MenuState},
|
||||
widgets::policycheck::policycheck_state::{PolicycheckAction, PolicycheckState},
|
||||
};
|
||||
|
||||
// Macro that initializes the widget structures/variables for our view
|
||||
// Macro that initializes the widget structures/variables for the policy check view
|
||||
widget!(
|
||||
/// Dialog to enter a policy identifier/number.
|
||||
/// This identifier is checked agains a map of valid policy codes.
|
||||
PolicyCheckView<PolicyCheckState> {
|
||||
// PolicycheckView<PolicycheckState>: KeyDownHandler {
|
||||
PolicycheckView<PolicycheckState> {
|
||||
lang: String,
|
||||
policy_check: PolicyCheck,
|
||||
policy_check_title: String16,
|
||||
policy_check_title: String,
|
||||
policy_data_count: u32
|
||||
}
|
||||
);
|
||||
|
||||
/// The template implementation of the policy check view
|
||||
/// All GUI elements are styled using the "style" attribute referencing to a ron based css
|
||||
impl Template for PolicyCheckView {
|
||||
impl Template for PolicycheckView {
|
||||
//fn template(self, policycheck_view: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
||||
let policy_check_bottom_bar = Container::new()
|
||||
@@ -43,7 +48,7 @@ impl Template for PolicyCheckView {
|
||||
.v_align("center")
|
||||
.child(
|
||||
ImageWidget::new()
|
||||
.image("resources/advotracker/hiedemann_logo.png")
|
||||
.image("assets/advotracker/hiedemann_logo.png")
|
||||
.v_align("center")
|
||||
.build(ctx),
|
||||
)
|
||||
@@ -66,14 +71,6 @@ impl Template for PolicyCheckView {
|
||||
)
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_label_menu = TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_MENU)
|
||||
.style("menu")
|
||||
.text("Help Menu")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_button_menu = Button::new()
|
||||
.id(ID_POLICY_CHECK_BUTTON_MENU)
|
||||
.style("button_single_content")
|
||||
@@ -81,10 +78,10 @@ impl Template for PolicyCheckView {
|
||||
.attach(Grid::column(2))
|
||||
//.min_size(16, 16)
|
||||
.h_align("end")
|
||||
.on_click(move |ctx, _| {
|
||||
//ctx.get_mut::<PolicyCheckState>(policycheck_state)
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::OpenMenu(policy_check_label_menu));
|
||||
.on_click(move |_ctx, _| {
|
||||
println!("WIP: open menu popup from MenuView");
|
||||
// ctx.get_mut::<MenuState>(id)
|
||||
// .set_action(MenuAction::CreateMenu(ID_MENU_STACK));
|
||||
true
|
||||
})
|
||||
.build(ctx);
|
||||
@@ -148,38 +145,40 @@ impl Template for PolicyCheckView {
|
||||
.attach(Grid::column(2))
|
||||
.id(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
.h_align("start")
|
||||
.lost_focus_on_activation(false)
|
||||
.lose_focus_on_activation(false)
|
||||
//WIP: localization for water_mark
|
||||
.water_mark("10-stellig")
|
||||
.on_activate(move |ctx, entity| {
|
||||
// Entity is entered/activated via Mouse/Keyboard
|
||||
//ctx.get_mut::<PolicyCheckState>(policy_check_view)
|
||||
println!("ParseEntry: {:?}", entity);
|
||||
ctx.get_mut::<PolicyCheckState>(id)
|
||||
.action(Action::ParseEntry(entity));
|
||||
//ctx.get_mut::<PolicycheckState>(policy_check_view)
|
||||
ctx.get_mut::<PolicycheckState>(id)
|
||||
.set_action(PolicycheckAction::ParseEntry(entity));
|
||||
})
|
||||
//.on_changed(|_, entity, _, _| println!("Selection changed: {:?}", entity))
|
||||
// .on_changed(move |ctx, entity, _| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::SetProgressBox(entity));
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::AddProgress(0.5));
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::InputTextChanged(entity));
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::SetVisibility(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::SetProgressBox(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::AddProgress(0.5));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::InputTextChanged(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::SetVisibility(entity));
|
||||
// ctx.get_widget(policy_check_label_policy_number).set("visible");
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::SetVisility(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::SetVisility(entity));
|
||||
// })
|
||||
// .on_mouse_down | .on_mouse_move | .on_mouse_up (move |ctx, entity| {
|
||||
// state(id, states).action(Action::AddItem);
|
||||
// state(id, states).set_action(Action::AddItem);
|
||||
// })
|
||||
//.on_key_down(move |ctx, _| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::ImportData);
|
||||
// true
|
||||
//})
|
||||
.on_key_down(move |_, key_event| {
|
||||
if key_event.key == Key::A(true) {
|
||||
println!("A key down");
|
||||
}
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::ImportData);
|
||||
true
|
||||
})
|
||||
.build(ctx),
|
||||
)
|
||||
.child(policy_check_button_result)
|
||||
@@ -216,6 +215,7 @@ impl Template for PolicyCheckView {
|
||||
.attach(Grid::column(2))
|
||||
.h_align("start")
|
||||
.v_align("center")
|
||||
.text("empty")
|
||||
.build(ctx)
|
||||
)
|
||||
.build(ctx);
|
||||
@@ -297,7 +297,8 @@ impl Template for PolicyCheckView {
|
||||
.build(ctx);
|
||||
|
||||
// WIP: this widget type should handle our target natively
|
||||
// but it isn't able to get textinput ... yet
|
||||
// but it isn't able to get textinput, nor handle usize values
|
||||
// ... yet
|
||||
let _policy_check_numeric_box = NumericBox::new()
|
||||
.id(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
.h_align("start")
|
||||
@@ -309,15 +310,17 @@ impl Template for PolicyCheckView {
|
||||
.margin((0, 0, 0, 16))
|
||||
// WIP code @kivimango
|
||||
// .on_activate(move |ctx, entity| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::ParseEntry(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::ParseEntry(entity));
|
||||
// })
|
||||
// .on_changed(move |ctx, entity| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::InputTextChanged(entity));
|
||||
// ctx.get_mut::<PolicycheckState>(id)
|
||||
// .set_action(Action::InputTextChanged(entity));
|
||||
//})
|
||||
.build(ctx);
|
||||
|
||||
// row3: only shown, if we read in `policy numbers` in
|
||||
// a hashmap as values
|
||||
let policy_data_stack = Stack::new()
|
||||
.id(ID_POLICY_DATA_STACK)
|
||||
.attach(Grid::row(3))
|
||||
@@ -346,7 +349,7 @@ impl Template for PolicyCheckView {
|
||||
.build(ctx);
|
||||
|
||||
// Starter page: check policy numbers
|
||||
self.name("PolicyCheckView")
|
||||
self.name("PolicycheckView")
|
||||
// initialize struct (derived default macro)
|
||||
.policy_check(PolicyCheck::default())
|
||||
.child(
|
||||
@@ -387,7 +390,7 @@ impl Template for PolicyCheckView {
|
||||
}
|
||||
}
|
||||
|
||||
// helper to request PolicyCheckState
|
||||
//fn state<'a>(id: Entity, states: &'a mut StatesContext) -> &'a mut PolicyCheckState {
|
||||
// helper to request PolicycheckState
|
||||
//fn state<'a>(id: Entity, states: &'a mut StatesContext) -> &'a mut PolicycheckState {
|
||||
// states.get_mut(id)
|
||||
//}
|
||||
@@ -1,70 +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::constants::*;
|
||||
|
||||
widget!(
|
||||
PolicyCheckMenu {
|
||||
is_active: Bool
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
impl Template for PolicyCheckMenu {
|
||||
fn template(self, _id: Entity, ctx: &mut BuildContext) -> Self {
|
||||
// let policy_check_menu_container = Container::new()
|
||||
// .id(ID_POLICY_CHECK_MENU_CONTAINER)
|
||||
// .class(CLASS_MENU)
|
||||
// .attach(Grid::row(3))
|
||||
// .attach(Grid::column(8))
|
||||
// .margin((0.0, 0.0, 4.0, 0.0))
|
||||
// .enabled(false)
|
||||
// .min_size(120.0, 180.0)
|
||||
// .v_align("center")
|
||||
// .on_click(move |ctx, _| {
|
||||
// ctx.get_mut::<PolicyCheckState>(id)
|
||||
// .action(Action::NewEntry(quit));
|
||||
// true
|
||||
// })
|
||||
// .build(ctx);
|
||||
|
||||
// let policycheck_menu_container = Container::new()
|
||||
// .id(ID_POLICY_CHECK_MENU_CONTAINER)
|
||||
// .background("#dfebf5")
|
||||
// .width(200.0)
|
||||
// .height(200.0)
|
||||
// .child(
|
||||
|
||||
// The menu implemented as an overlay
|
||||
//ctx.append_child_to_overlay(policy_check_menu_button).unwrap();
|
||||
|
||||
self.name("PolicyCheckMenu").child(
|
||||
Stack::new()
|
||||
.id(ID_POLICY_CHECK_MENU)
|
||||
.orientation("vertical")
|
||||
.spacing(8)
|
||||
.h_align("center")
|
||||
.child(
|
||||
Button::new()
|
||||
.icon(material_icons_font::MD_VERIFIED_USER)
|
||||
.text("angemeldeter Benutzer")
|
||||
.margin((0, 8, 0, 0))
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
Button::new()
|
||||
.icon(material_icons_font::MD_EXIT_TO_APP)
|
||||
.text("Quit")
|
||||
.margin((0, 8, 0, 0))
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
)
|
||||
}
|
||||
}
|
||||
12
advotracker/src/widgets/policydata/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 policy check state
|
||||
pub mod policycheck_state;
|
||||
|
||||
/// The policy check view
|
||||
pub mod policycheck_view;
|
||||
12
advotracker/src/widgets/policylist/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 policy check state
|
||||
pub mod policylist_state;
|
||||
|
||||
/// The policy check view
|
||||
pub mod policylist_view;
|
||||