Improve date time popup

This commit is contained in:
eraden 2020-08-20 23:08:26 +02:00
parent 7e4afa19bc
commit e1dd975f07
5 changed files with 96 additions and 65 deletions

129
Cargo.lock generated
View File

@ -421,13 +421,13 @@ checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a"
[[package]]
name = "async-trait"
version = "0.1.37"
version = "0.1.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caae68055714ff28740f310927e04f2eba76ff580b16fb18ed90073ee71646f7"
checksum = "6e1a4a2f97ce50c9d0282c1468816208588441492b40d813b2e0419c22c05e7f"
dependencies = [
"proc-macro2",
"quote",
"syn",
"proc-macro2",
"quote",
"syn",
]
[[package]]
@ -668,9 +668,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cc"
version = "1.0.58"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
checksum = "66120af515773fb005778dc07c261bd201ec8ce50bd6e7144c927753fe013381"
[[package]]
name = "cfg-if"
@ -1127,14 +1127,14 @@ dependencies = [
[[package]]
name = "flate2"
version = "1.0.16"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e"
checksum = "766d0e77a2c1502169d4a93ff3b8c15a71fd946cd0126309752104e5f3c46d94"
dependencies = [
"cfg-if",
"crc32fast",
"libc",
"miniz_oxide",
"cfg-if",
"crc32fast",
"libc",
"miniz_oxide",
]
[[package]]
@ -1686,26 +1686,27 @@ dependencies = [
"diesel",
"dotenv",
"env_logger",
"futures 0.3.5",
"ipnetwork",
"jirs-data",
"lettre",
"lettre_email",
"libc",
"log",
"num-bigint",
"num-integer",
"num-traits",
"percent-encoding",
"pq-sys",
"pretty_env_logger",
"r2d2",
"rusoto_core",
"rusoto_s3",
"serde",
"serde_json",
"time 0.1.43",
"toml",
"futures 0.3.5",
"ipnetwork",
"jirs-data",
"lettre",
"lettre_email",
"libc",
"log",
"num-bigint",
"num-integer",
"num-traits",
"openssl-sys",
"percent-encoding",
"pq-sys",
"pretty_env_logger",
"r2d2",
"rusoto_core",
"rusoto_s3",
"serde",
"serde_json",
"time 0.1.43",
"toml",
"url",
"uuid 0.8.1",
]
@ -1802,9 +1803,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.74"
version = "0.2.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10"
checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3"
[[package]]
name = "line-wrap"
@ -2105,9 +2106,9 @@ checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
[[package]]
name = "once_cell"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
[[package]]
name = "opaque-debug"
@ -2125,8 +2126,8 @@ dependencies = [
"cfg-if",
"foreign-types",
"lazy_static",
"libc",
"openssl-sys",
"libc",
"openssl-sys",
]
[[package]]
@ -2135,17 +2136,27 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
[[package]]
name = "openssl-src"
version = "111.10.2+1.1.1g"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de"
dependencies = [
"autocfg 1.0.0",
"cc",
"libc",
"pkg-config",
"vcpkg",
"autocfg 1.0.0",
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
[[package]]
@ -2301,9 +2312,9 @@ dependencies = [
[[package]]
name = "ppv-lite86"
version = "0.2.8"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
[[package]]
name = "pq-sys"
@ -3069,19 +3080,19 @@ dependencies = [
[[package]]
name = "syntect"
version = "4.3.0"
version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b57a45fdcf4891bc79f635be5c559210a4cfa464891f969724944c713282eedb"
checksum = "4e3978df05b5850c839a6b352d3c35ce0478944a4be689be826b53cf75363e88"
dependencies = [
"bincode",
"bitflags",
"fancy-regex",
"flate2",
"fnv",
"lazy_static",
"lazycell",
"plist",
"regex-syntax",
"bincode",
"bitflags",
"fancy-regex",
"flate2",
"fnv",
"lazy_static",
"lazycell",
"plist",
"regex-syntax",
"serde",
"serde_derive",
"serde_json",
@ -3200,9 +3211,9 @@ dependencies = [
[[package]]
name = "tinyvec"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed"
checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
[[package]]
name = "tokio"

View File

@ -7,10 +7,26 @@
.dateTimeTooltip {
padding: 15px;
position: absolute;
top: 0;
width: 720px;
min-width: 720px;
max-width: 720px;
top: -50px;
left: 110px;
width: 610px;
min-width: 610px;
max-width: 610px;
}
.dateTimeTooltip:before {
content: '';
display: block;
width: 20px;
height: 20px;
position: absolute;
left: -10px;
top: 56px;
transform: rotate(45deg);
background: white;
z-index: -1;
border-left: 1px solid rgba(9, 30, 66, 0.25);
border-bottom: 1px solid rgba(9, 30, 66, 0.25);
}
.dateTimeTooltip > h2 {

View File

@ -264,12 +264,13 @@ fn render(values: StyledDateTimeInput) -> Node<Msg> {
let input = {
let field_id = values.field_id.clone();
let visible = values.popup_visible;
let on_focus = ev(Ev::Click, move |ev| {
ev.prevent_default();
ev.stop_propagation();
Msg::StyledDateTimeInputChanged(
field_id,
StyledDateTimeChanged::PopupVisibilityChanged(true),
StyledDateTimeChanged::PopupVisibilityChanged(!visible),
)
});
let text = values

View File

@ -60,6 +60,7 @@ env_logger = "0.7"
futures = { version = "*" }
lettre = { version = "*" }
lettre_email = { version = "*" }
openssl-sys = { version = "*", features = ["vendored"] }
[dependencies.diesel]
version = "1.4.4"

View File

@ -408,7 +408,9 @@ impl Handler<InnerMsg> for WsServer {
self.sessions.remove(&user_id);
} else {
let v = self.sessions.entry(user_id).or_insert_with(Vec::new);
v.remove_item(&recipient);
if let Err(e) = v.remove_item(&recipient) {
error2!(e);
}
}
}
InnerMsg::SendToUser(user_id, msg) => {