Skip to content

Commit 5de2359

Browse files
authoredNov 30, 2024··
Debounce notify events and replace askama with sailfish (#614)
* debounce notify events * replace askama * delete sass file
1 parent 7aa9060 commit 5de2359

File tree

9 files changed

+142
-312
lines changed

9 files changed

+142
-312
lines changed
 

‎Cargo.lock

+94-59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ members = [
7979
resolver = "2"
8080

8181
[workspace.dependencies]
82-
askama = { version = "0.12.1", default-features = false }
8382
asynk-strim = "0.1.2"
8483
clap = { version = "4.5.21", features = ["derive", "wrap_help"] }
8584
diesel = { version = "2.2.5", default-features = false, features = [
@@ -116,6 +115,10 @@ iso8601-timestamp = "0.3.1"
116115
itertools = { version = "0.13.0", default-features = false }
117116
minijinja = { version = "2.5.0", features = ["loader"] }
118117
moka = { version = "=0.12.7", features = ["sync"] }
118+
sailfish = { version = "0.9.0", default-features = false, features = [
119+
"derive",
120+
"perf-inline",
121+
] }
119122
simdutf8 = { version = "0.1.5", features = ["aarch64_neon"] }
120123
sonic-rs = "=0.3.14"
121124
tokio = "1.41.1"

‎crates/kitsune-email/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version.workspace = true
66
license.workspace = true
77

88
[dependencies]
9-
askama.workspace = true
109
diesel.workspace = true
1110
diesel-async.workspace = true
1211
kitsune-db.workspace = true
@@ -26,6 +25,7 @@ mrml = { version = "4.0.1", default-features = false, features = [
2625
"parse",
2726
"render",
2827
] }
28+
sailfish.workspace = true
2929
speedy-uuid.workspace = true
3030
triomphe.workspace = true
3131
typed-builder = "0.20.0"

‎crates/kitsune-email/src/mails/confirm_account.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::traits::{RenderableEmail, RenderedEmail};
2-
use askama::Template;
32
use kitsune_error::Result;
43
use mrml::{mjml::Mjml, prelude::render::RenderOptions};
4+
use sailfish::Template;
55
use typed_builder::TypedBuilder;
66

77
#[derive(Template, TypedBuilder)]
8-
#[template(escape = "html", path = "verify.mjml")]
8+
#[template(path = "verify.mjml")]
99
pub struct ConfirmAccount<'a> {
1010
domain: &'a str,
1111
username: &'a str,
+14-15
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
<mjml>
22
<mj-head>
3-
<mj-title>Confirm your {{domain}} account</mj-title>
3+
<mj-title>Confirm your <%= self.domain %> account</mj-title>
44
<mj-attributes>
55
<mj-all font-family="monospace" line-height="17px" />
66
</mj-attributes>
77
</mj-head>
88
<mj-body>
99
<mj-section>
1010
<mj-column>
11-
12-
<mj-text align="center" font-size="30px">
13-
Kitsune
14-
</mj-text>
11+
<mj-text align="center" font-size="30px"> Kitsune </mj-text>
1512

1613
<mj-divider></mj-divider>
1714

18-
<mj-text font-size="25px">
19-
Confirm your account
20-
</mj-text>
15+
<mj-text font-size="25px"> Confirm your account </mj-text>
2116

2217
<mj-text>
23-
Congratulations to your new account on {{domain}}!
24-
<p>Click the button below to unlock your account (@{{username}})!</p>
18+
Congratulations to your new account on <%= self.domain %>!
19+
<p>
20+
Click the button below to unlock your account (@<%= self.username
21+
%>)!
22+
</p>
2523
</mj-text>
2624

27-
<mj-button href="{{verify_link}}">
28-
Confirm my account!
29-
</mj-button>
25+
<mj-button href="{{verify_link}}"> Confirm my account! </mj-button>
3026

3127
<mj-text>
3228
You didn't register an account? Feel free to just ignore this email!
3329
</mj-text>
3430

3531
<mj-text align="center" font-size="10px">
36-
{{domain}} powered by <a style="text-decoration:none;" href="https://joinkitsune.org">Kitsune</a>
32+
<%= self.domain %> powered by
33+
<a style="text-decoration: none" href="https://joinkitsune.org"
34+
>Kitsune</a
35+
>
3736
</mj-text>
3837
</mj-column>
3938
</mj-section>
4039
</mj-body>
41-
</mjml>
40+
</mjml>

‎crates/kitsune-language/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ isolang = { version = "2.4.0", features = [
1414
"list_languages",
1515
"serde",
1616
] }
17-
rustc-hash = "2.0.0"
17+
rustc-hash = "2.1.0"
1818
whatlang = "0.16.4"
1919
whichlang = "0.1.0"
2020

0 commit comments

Comments
 (0)
Please sign in to comment.