policycheck: update styling, constants and localization
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -11,16 +11,19 @@ Dictionary (
|
||||
// like a struct, but keys are also values instead of just beenig identifiers
|
||||
words: {
|
||||
// policycheck_view
|
||||
"Policy number validation": "Versicherungsnummern Prüfung",
|
||||
"Validation policy number": "Prüfung Versicherungsnummer",
|
||||
"Policy number": "Versicherungsnummer",
|
||||
"Policy code": "ID der Vers.-Nummer",
|
||||
"Checklist elements: ": "Prüflistenelemente: ",
|
||||
"Check result": "Prüfungsergebnis",
|
||||
"Importing data": "Importiere Datensätze",
|
||||
"Processing time": "Bearbeitungszeit",
|
||||
"Error:": "Fehler:",
|
||||
"Reason": "Grund",
|
||||
"Policy number is to long": "Die Nummer ist zu lang",
|
||||
"Policy number is to short": "Die Nummer ist zu kurz",
|
||||
"The given policy number is invalid": "Die Versicherungsnumber ist ungültig",
|
||||
"The given policy number is valid": "Die Versicherungsnumber ist gültig",
|
||||
"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",
|
||||
|
||||
@@ -1,113 +1,122 @@
|
||||
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",
|
||||
},
|
||||
),
|
||||
"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",
|
||||
},
|
||||
),
|
||||
"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",
|
||||
},
|
||||
),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -219,9 +219,14 @@ impl PolicyCheckState {
|
||||
// Parse policy code: "AS-123456789"
|
||||
// DION VERS POLLFNR
|
||||
// 1 AS 1515735810
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
|
||||
//Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
//Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), Visibility::Collapsed);
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Collapsed);
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Collapsed);
|
||||
Button::background_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("transparent"));
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Collapsed);
|
||||
//Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Collapsed);
|
||||
|
||||
if policy_number_length == 10 {
|
||||
// cast policy_number_sting to <u64>
|
||||
@@ -235,60 +240,92 @@ impl PolicyCheckState {
|
||||
// matching key, get associated value
|
||||
trace!(target: "advotracker", state = "success",
|
||||
policy_number = ?p, policy_code = ?policy_code);
|
||||
|
||||
let string_result = format!("1-{:?}-{}",
|
||||
policy_code, p);
|
||||
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from(string_result));
|
||||
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#008000"));
|
||||
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
|
||||
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000"));
|
||||
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CHECK);
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
|
||||
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Visible);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
|
||||
}
|
||||
_ => {
|
||||
// no matching key
|
||||
let res = t!("policy.validation.failed", self.lang);
|
||||
trace!(target: "advotracker", state = ?res, policy_number = ?p);
|
||||
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("The given policy number is invalid"));
|
||||
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("The given policy number is invalid"));
|
||||
|
||||
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
|
||||
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
trace!(target: "advotracker", state = "error", error_type = "invalid type", error = ?e);
|
||||
|
||||
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Only numbers are valid"));
|
||||
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
|
||||
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Only numbers are valid"));
|
||||
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
|
||||
|
||||
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
|
||||
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
if policy_number_length < 10 {
|
||||
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Policy number is to short"));
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
|
||||
let res = t!("policy.validation.failed", self.lang);
|
||||
trace!(target: "advotracker", state = ?res, reason = "number to short");
|
||||
|
||||
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
|
||||
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Policy number is to short"));
|
||||
|
||||
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
|
||||
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
|
||||
}
|
||||
if policy_number_length > 10 {
|
||||
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Policy number is to long"));
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
|
||||
let res = t!("policy.validation.failed", self.lang);
|
||||
trace!(target: "advotracker", state = ?res, reason = "number to long");
|
||||
|
||||
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
|
||||
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
|
||||
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Policy number is to long"));
|
||||
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
|
||||
|
||||
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
|
||||
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
|
||||
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
|
||||
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
|
||||
}
|
||||
|
||||
trace!(target: "advotracker", parse_entry = "finished");
|
||||
@@ -427,8 +464,11 @@ impl State for PolicyCheckState {
|
||||
.entity_of_child(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);
|
||||
//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);
|
||||
//Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_0), Visibility::Collapsed);
|
||||
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
|
||||
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();
|
||||
|
||||
@@ -16,11 +16,16 @@ pub static STYLE_STACK_MENU: &'static 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";
|
||||
|
||||
@@ -96,7 +96,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
trace!(target: "advotracker", environment = "system", lang = ?lang);
|
||||
trace!(target: "advotracker", machine = ?&machine_kind);
|
||||
|
||||
// how to handle unumplemented lang resources??
|
||||
// how to handle unimplemented lang resources??
|
||||
res = t!("parse.environment", lang);
|
||||
trace!(target: "advotracker", environment = "envy", lang = ?lang);
|
||||
state = t!("state.finished", lang);
|
||||
|
||||
@@ -58,7 +58,7 @@ impl Template for PolicyCheckView {
|
||||
.v_align("end")
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.margin((0, 9, 16, 0))
|
||||
.margin((0, 9, 48, 0))
|
||||
.text("©Networkx GmbH")
|
||||
.build(ctx)
|
||||
)
|
||||
@@ -111,7 +111,7 @@ impl Template for PolicyCheckView {
|
||||
.id(ID_POLICY_CHECK_HEADER)
|
||||
.v_align("center")
|
||||
.h_align("left")
|
||||
.text("Policy number validation")
|
||||
.text("Validation policy number")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
@@ -120,11 +120,14 @@ impl Template for PolicyCheckView {
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_form_row_0 = Stack::new()
|
||||
// 1st row
|
||||
.id(ID_POLICY_CHECK_FORM_ROW_0)
|
||||
.attach(Grid::row(0))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(5))
|
||||
.orientation("horizontal")
|
||||
.v_align("center")
|
||||
//.h_align("center")
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_POLICY_NUMBER)
|
||||
@@ -134,6 +137,8 @@ impl Template for PolicyCheckView {
|
||||
.margin((0, 0, 16, 0))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.width(300)
|
||||
.min_width(300)
|
||||
.text("Policy number")
|
||||
.build(ctx),
|
||||
)
|
||||
@@ -182,12 +187,13 @@ impl Template for PolicyCheckView {
|
||||
|
||||
let policy_check_form_row_1 = Stack::new()
|
||||
// 2nd row
|
||||
.id(ID_POLICY_CHECK_FORM_ROW_1)
|
||||
.attach(Grid::row(1))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(5))
|
||||
.orientation("horizontal")
|
||||
//.visibility(Visibility::Collapsed)
|
||||
.v_align("center")
|
||||
//.h_align("center")
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_RESULT)
|
||||
@@ -197,9 +203,9 @@ impl Template for PolicyCheckView {
|
||||
.margin((0, 0, 16, 0))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.width(250)
|
||||
.min_width(250)
|
||||
.text("Check result")
|
||||
.width(300)
|
||||
.min_width(300)
|
||||
.text("Policy code")
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
@@ -214,35 +220,78 @@ impl Template for PolicyCheckView {
|
||||
)
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_form_row_2 = Stack::new()
|
||||
// 3nd row
|
||||
.id(ID_POLICY_CHECK_FORM_ROW_2)
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::column_span(5))
|
||||
.orientation("horizontal")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_LABEL_HINT)
|
||||
//.style("hint")
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(0))
|
||||
.margin((0, 0, 16, 0))
|
||||
.h_align("end")
|
||||
.v_align("center")
|
||||
.width(300)
|
||||
.min_width(300)
|
||||
.font_size(11.)
|
||||
.text("Error:")
|
||||
.build(ctx),
|
||||
)
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.id(ID_POLICY_CHECK_HINT)
|
||||
//.style("hint")
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(2))
|
||||
.h_align("start")
|
||||
.v_align("center")
|
||||
.font_size(11)
|
||||
.build(ctx)
|
||||
)
|
||||
.build(ctx);
|
||||
|
||||
let policy_check_form = Container::new()
|
||||
.id(ID_POLICY_CHECK_FORM)
|
||||
.min_width(420)
|
||||
.attach(Grid::row(2))
|
||||
.attach(Grid::column(1))
|
||||
.style("container_form")
|
||||
.child(
|
||||
Grid::new()
|
||||
.id(ID_POLICY_CHECK_FORM)
|
||||
.width(450)
|
||||
.min_width(400)
|
||||
.columns(
|
||||
Columns::create()
|
||||
// Labels
|
||||
.push("250")
|
||||
// Label
|
||||
.push("300")
|
||||
// Seperator
|
||||
.push("16")
|
||||
// Values
|
||||
.push("100")
|
||||
.push("auto")
|
||||
// Seperator
|
||||
.push("16")
|
||||
// Result-Button
|
||||
.push("32")
|
||||
.build(),
|
||||
//.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::create()
|
||||
.push("auto")
|
||||
.push("auto")
|
||||
.build(),
|
||||
.push("*")
|
||||
//.build(),
|
||||
)
|
||||
.child(policy_check_form_row_0)
|
||||
.child(policy_check_form_row_1)
|
||||
.child(policy_check_form_row_2)
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx);
|
||||
@@ -284,7 +333,6 @@ impl Template for PolicyCheckView {
|
||||
.margin((0, 4, 0, 0))
|
||||
.enabled(true)
|
||||
.text("Checklist elements: ")
|
||||
//.visibility(Visibility::Collapsed)
|
||||
.build(ctx)
|
||||
)
|
||||
.child(
|
||||
@@ -293,7 +341,6 @@ impl Template for PolicyCheckView {
|
||||
.margin((0, 4, 0, 0))
|
||||
.enabled(true)
|
||||
.text("0")
|
||||
//.visibility(Visibility::Collapsed)
|
||||
.build(ctx)
|
||||
)
|
||||
.build(ctx);
|
||||
@@ -310,7 +357,7 @@ impl Template for PolicyCheckView {
|
||||
.push(50)
|
||||
.push("*")
|
||||
.push(50)
|
||||
.build(),
|
||||
//.build(),
|
||||
)
|
||||
.rows(
|
||||
Rows::create()
|
||||
@@ -319,7 +366,7 @@ impl Template for PolicyCheckView {
|
||||
.push("*")
|
||||
.push("auto")
|
||||
.push("auto")
|
||||
.build(),
|
||||
//.build(),
|
||||
)
|
||||
|
||||
// row 0: Policy Check Header
|
||||
|
||||
Submodule advotrackerd updated: 3331aa284d...409d8d1f1a
Reference in New Issue
Block a user