Add header and make phone view better
This commit is contained in:
parent
2ded7772c3
commit
efc630a09e
2 changed files with 21 additions and 7 deletions
16
src/main.rs
16
src/main.rs
|
@ -130,9 +130,9 @@ markup::define! {
|
|||
link[rel="stylesheet", type="text/css", href="style.css"];
|
||||
}
|
||||
body {
|
||||
@Header { title }
|
||||
@Header { title, actor }
|
||||
main {
|
||||
@for activity in *activities {
|
||||
@for activity in activities.iter().rev() {
|
||||
@Activity { actor, activity }
|
||||
}
|
||||
}
|
||||
|
@ -141,9 +141,11 @@ markup::define! {
|
|||
}
|
||||
}
|
||||
|
||||
Header<'a>(title: &'a str) {
|
||||
Header<'a>(title: &'a str, actor: &'a pleroma::Actor) {
|
||||
header {
|
||||
h1 { @title }
|
||||
p { "This is a static archive of " @actor.username() }
|
||||
p { @markup::raw(&actor.summary) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,3 +202,11 @@ impl pleroma::Activity {
|
|||
published.strftime("%d %b %Y").to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl pleroma::Actor {
|
||||
fn username(&self) -> &str {
|
||||
self.webfinger
|
||||
.strip_prefix("acct:")
|
||||
.unwrap_or(&self.webfinger)
|
||||
}
|
||||
}
|
||||
|
|
12
style.css
12
style.css
|
@ -1,10 +1,7 @@
|
|||
body {
|
||||
background: #fafbfc;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 2rem;
|
||||
margin: 2rem;
|
||||
}
|
||||
|
||||
hr {
|
||||
|
@ -15,6 +12,7 @@ hr {
|
|||
}
|
||||
|
||||
footer {
|
||||
margin-top: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -45,3 +43,9 @@ time {
|
|||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 640px) {
|
||||
body {
|
||||
margin: 1rem;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue