|
@@ -18,9 +18,16 @@ pub fn about(configuration: LocalConfiguration, authentication: Authentication)
|
18
|
18
|
context.extend(configuration);
|
19
|
19
|
context.extend(prepare_authentication_context(&authentication));
|
20
|
20
|
context.insert("stylesheet".to_string(), raito_fe::get_stylesheet());
|
21
|
|
- context.insert("content".to_string(), fs::read_to_string("static/raito_fe/html/about.html").unwrap_or_else(|_| String::from("<h2>About this node</h2>
|
|
21
|
+ context.insert(
|
|
22
|
+ "content".to_string(),
|
|
23
|
+ fs::read_to_string("static/raito_fe/html/about.html").unwrap_or_else(|_| {
|
|
24
|
+ String::from(
|
|
25
|
+ "<h2>About this node</h2>
|
22
|
26
|
This is a placeholder text, it can be edited in \"static/raito_fe/html/about.html\"
|
23
|
|
-")));
|
|
27
|
+",
|
|
28
|
+ )
|
|
29
|
+ }),
|
|
30
|
+ );
|
24
|
31
|
return Template::render("raito_fe/about", context);
|
25
|
32
|
}
|
26
|
33
|
|
|
@@ -573,6 +580,14 @@ fn prepare_authentication_context(authentication: &Authentication) -> HashMap<St
|
573
|
580
|
String::from("authenticated_account_display_name"),
|
574
|
581
|
(*account.display_name).to_string(),
|
575
|
582
|
);
|
|
583
|
+ context.insert(
|
|
584
|
+ String::from("authenticated_account_avatar"),
|
|
585
|
+ (*account.avatar).to_string(),
|
|
586
|
+ );
|
|
587
|
+ context.insert(
|
|
588
|
+ String::from("authenticated_account_id"),
|
|
589
|
+ (*account.id).to_string(),
|
|
590
|
+ );
|
576
|
591
|
}
|
577
|
592
|
None => {
|
578
|
593
|
context.insert(String::from("authenticated_account"), false.to_string());
|
|
@@ -580,6 +595,11 @@ fn prepare_authentication_context(authentication: &Authentication) -> HashMap<St
|
580
|
595
|
String::from("authenticated_account_display_name"),
|
581
|
596
|
String::from("Guest"),
|
582
|
597
|
);
|
|
598
|
+ context.insert(
|
|
599
|
+ String::from("authenticated_account_avatar"),
|
|
600
|
+ String::from("/static/assets/default_avatar.png"),
|
|
601
|
+ );
|
|
602
|
+ context.insert(String::from("authenticated_account_id"), String::from(""));
|
583
|
603
|
}
|
584
|
604
|
}
|
585
|
605
|
|
|
@@ -650,6 +670,7 @@ fn prepare_status_context(status: Status) -> HashMap<String, String> {
|
650
|
670
|
Some(reblog_status) => {
|
651
|
671
|
let reblog: Status = serde_json::from_value(reblog_status).unwrap();
|
652
|
672
|
context.insert(String::from("reblog_account_acct"), reblog.account.acct);
|
|
673
|
+ context.insert(String::from("reblog_account_avatar"), reblog.account.avatar);
|
653
|
674
|
context.insert(
|
654
|
675
|
String::from("reblog_account_url"),
|
655
|
676
|
format!("/account/{}", reblog.id),
|
|
@@ -658,6 +679,7 @@ fn prepare_status_context(status: Status) -> HashMap<String, String> {
|
658
|
679
|
}
|
659
|
680
|
None => {
|
660
|
681
|
context.insert(String::from("reblog_account_acct"), String::from(""));
|
|
682
|
+ context.insert(String::from("reblog_account_avatar"), String::from(""));
|
661
|
683
|
context.insert(String::from("reblog_account_url"), String::from(""));
|
662
|
684
|
context.insert(String::from("reblog_content"), String::from(""));
|
663
|
685
|
}
|