restructure an if
This commit is contained in:
parent
e98b468b10
commit
c148e839f6
@ -821,14 +821,7 @@ fn edit_or_create_link<F: Fn(&str) -> String>(
|
|||||||
],
|
],
|
||||||
tr![
|
tr![
|
||||||
th![t("qr-code")],
|
th![t("qr-code")],
|
||||||
if let Loadable::Data(Some(qr)) = qr {
|
qr.as_ref().map_or_else(|| td!["Loading..."], render_qr),
|
||||||
td![a![
|
|
||||||
span![C!["qrdownload"], "Download", raw!(&qr.svg),],
|
|
||||||
attrs!(At::Href => qr.url, At::Download => "qr-code.png")
|
|
||||||
]]
|
|
||||||
} else {
|
|
||||||
td!["Loading..."]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
a![
|
a![
|
||||||
@ -842,6 +835,13 @@ fn edit_or_create_link<F: Fn(&str) -> String>(
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn render_qr(qr: &QrGuard) -> Node<Msg> {
|
||||||
|
td![a![
|
||||||
|
span![C!["qrdownload"], "Download", raw!(&qr.svg),],
|
||||||
|
attrs!(At::Href => qr.url, At::Download => "qr-code.png")
|
||||||
|
]]
|
||||||
|
}
|
||||||
|
|
||||||
/// generate a qr-code for a code
|
/// generate a qr-code for a code
|
||||||
fn generate_qr_from_code(code: &str) -> String {
|
fn generate_qr_from_code(code: &str) -> String {
|
||||||
generate_qr_from_link(&format!("https://{}/{}", get_host(), code))
|
generate_qr_from_link(&format!("https://{}/{}", get_host(), code))
|
||||||
|
@ -393,7 +393,7 @@ fn view_user_table_head<F: Fn(&str) -> String>(t: F) -> Node<Msg> {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Display the filterboxes below the headlines
|
/// Display the filter-boxes below the headlines
|
||||||
fn view_user_table_filter_input<F: Fn(&str) -> String>(model: &Model, t: F) -> Node<Msg> {
|
fn view_user_table_filter_input<F: Fn(&str) -> String>(model: &Model, t: F) -> Node<Msg> {
|
||||||
tr![
|
tr![
|
||||||
C!["filters"],
|
C!["filters"],
|
||||||
|
Loading…
Reference in New Issue
Block a user