diff --git a/src/template_utils.rs b/src/template_utils.rs index 4b0fb844..7e38ba5d 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -45,12 +45,11 @@ impl Size { pub fn avatar(conn: &Connection, user: &User, size: Size, pad: bool, catalog: &Catalog) -> Html { let name = escape(&user.name(conn)).to_string(); Html(format!( - r#"
"#, + aria-label="{title}"> + "#, size = size.as_str(), padded = if pad { "padded" } else { "" }, url = user.avatar_url(conn), diff --git a/static/css/main.css b/static/css/main.css index da72efb5..de2a704b 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -51,6 +51,10 @@ margin: 3em 0px; } + .hidden { + display: none; + } + /* * == Header == */ @@ -155,10 +159,14 @@ header nav a.title p { * == Main == */ - body > main > * { + body > main > *, .h-feed > * { padding: 0 20%; } + body > main > .h-entry, .h-feed { + padding: 0; + } + main h1 { font-family: "Route159"; font-size: 2.5em; diff --git a/templates/blogs/details.rs.html b/templates/blogs/details.rs.html index e5b4c69e..4e31ab15 100644 --- a/templates/blogs/details.rs.html +++ b/templates/blogs/details.rs.html @@ -10,12 +10,21 @@ @:base(ctx, blog.title.as_ref(), {}, { @blog.title }, { -

@blog.title ~@fqn

+ +
+

@blog.title ~@fqn

@blog.summary

@i18n!(ctx.1, "One author in this blog: ", "{0} authors in this blog: ", authors.len()) @for author in authors { - @author.name(ctx.0) + @author.name(ctx.0) }

@@ -40,6 +49,7 @@

@paginate(ctx.1, page, n_pages) + @if is_author {

@i18n!(ctx.1, "Danger zone")

@i18n!(ctx.1, "Be very careful, any action taken here can't be cancelled.")

diff --git a/templates/instance/federated.rs.html b/templates/instance/federated.rs.html index 3491d1e1..e512a1d6 100644 --- a/templates/instance/federated.rs.html +++ b/templates/instance/federated.rs.html @@ -6,7 +6,8 @@ @(ctx: BaseContext, articles: Vec, page: i32, n_pages: i32) @:base(ctx, "All the articles of the Fediverse", {}, {}, { -

@i18n!(ctx.1, "All the articles of the Fediverse")

+
+

@i18n!(ctx.1, "All the articles of the Fediverse")

@if let Some(_) = ctx.2 { @tabs(&[ @@ -29,4 +30,5 @@ }
@paginate(ctx.1, page, n_pages) + }) diff --git a/templates/instance/local.rs.html b/templates/instance/local.rs.html index b7f9333d..366a86e9 100644 --- a/templates/instance/local.rs.html +++ b/templates/instance/local.rs.html @@ -7,7 +7,8 @@ @(ctx: BaseContext, instance: Instance, articles: Vec, page: i32, n_pages: i32) @:base(ctx, i18n!(ctx.1, "Articles from {}"; instance.name.clone()).as_str(), {}, {}, { -

@i18n!(ctx.1, "Articles from {}"; instance.name)

+
+

@i18n!(ctx.1, "Articles from {}"; instance.name)

@if let Some(_) = ctx.2 { @tabs(&[ @@ -30,4 +31,5 @@ }
@paginate(ctx.1, page, n_pages) + }) diff --git a/templates/partials/comment.rs.html b/templates/partials/comment.rs.html index 8d69fcc5..a608eafd 100644 --- a/templates/partials/comment.rs.html +++ b/templates/partials/comment.rs.html @@ -3,15 +3,21 @@ @use plume_models::users::User; @use routes::*; -@(ctx: BaseContext, comm: &Comment, author: User) +@(ctx: BaseContext, comm: &Comment, author: User, in_reply_to: Option<&str>) -
- +
+ @avatar(ctx.0, &author, Size::Small, true, ctx.1) - @author.name(ctx.0) + @author.name(ctx.0) @author.get_fqn(ctx.0) -
+ @if let Some(ref ap_url) = comm.ap_url { + + } + @if let Some(ref in_reply_to) = in_reply_to { + + } +
@if comm.sensitive {
@comm.spoiler_text @@ -23,6 +29,6 @@
@i18n!(ctx.1, "Respond") @for res in comm.get_responses(ctx.0) { - @:comment(ctx, &res, res.get_author(ctx.0)) + @:comment(ctx, &res, res.get_author(ctx.0), comm.ap_url.as_ref().map(|u| &**u)) }
diff --git a/templates/partials/home_feed.rs.html b/templates/partials/home_feed.rs.html index 8c6ce3d8..fa0e8f35 100644 --- a/templates/partials/home_feed.rs.html +++ b/templates/partials/home_feed.rs.html @@ -5,10 +5,12 @@ @(ctx: BaseContext, articles: Vec, link: &str, title: &str) @if articles.len() > 0 { -

@i18n!(ctx.1, title) — @i18n!(ctx.1, "View all")

+
+

@i18n!(ctx.1, title)@i18n!(ctx.1, "View all")

@for article in articles { @:post_card(ctx, article) }
+
} diff --git a/templates/partials/post_card.rs.html b/templates/partials/post_card.rs.html index db52a6e3..25e1f98d 100644 --- a/templates/partials/post_card.rs.html +++ b/templates/partials/post_card.rs.html @@ -4,22 +4,22 @@ @(ctx: BaseContext, article: Post) -
+
@if article.cover_id.is_some() {
} -

@article.title

+

@article.title

-

@article.subtitle

+

@article.subtitle

@Html(i18n!(ctx.1, "By {0}"; format!( - "{}", + "{}", uri!(user::details: name = article.get_authors(ctx.0)[0].get_fqn(ctx.0)), escape(&article.get_authors(ctx.0)[0].name(ctx.0)) ))) @if article.published { - ⋅ @article.creation_date.format("%B %e, %Y") + ⋅ @article.creation_date.format("%B %e, %Y") } ⋅ @article.get_blog(ctx.0).title @if !article.published { diff --git a/templates/posts/details.rs.html b/templates/posts/details.rs.html index f5c3078b..48bc2318 100644 --- a/templates/posts/details.rs.html +++ b/templates/posts/details.rs.html @@ -22,8 +22,9 @@ }, { @blog.title }, { -

@&article.title

-

@&article.subtitle

+
+

@&article.title

+

@&article.subtitle

@if article.cover_id.is_some() {
+ } -
+
@Html(&article.content)
- +
}) diff --git a/templates/users/details.rs.html b/templates/users/details.rs.html index 4ad4a401..707ffc78 100644 --- a/templates/users/details.rs.html +++ b/templates/users/details.rs.html @@ -15,8 +15,9 @@ ]) @if !recents.is_empty() { +

- @i18n!(ctx.1, "Latest articles") + @i18n!(ctx.1, "Latest articles") @icon!("rss")

@@ -24,14 +25,17 @@ @:post_card(ctx, article) }
+
} @if !reshares.is_empty() { -

@i18n!(ctx.1, "Recently boosted")

+
+

@i18n!(ctx.1, "Recently boosted")

@for article in reshares { @:post_card(ctx, article) }
+
} }) diff --git a/templates/users/header.rs.html b/templates/users/header.rs.html index 510af500..5bf8ddb3 100644 --- a/templates/users/header.rs.html +++ b/templates/users/header.rs.html @@ -4,41 +4,45 @@ @(ctx: BaseContext, user: &User, follows: bool, is_remote: bool, instance_url: String) -
-
- @avatar(ctx.0, &user, Size::Medium, false, ctx.1) +
+
+
+ @avatar(ctx.0, &user, Size::Medium, false, ctx.1) -

- @user.name(ctx.0) - @user.get_fqn(ctx.0) -

+

+ @user.name(ctx.0) + @user.get_fqn(ctx.0) +

-

- @if user.is_admin { - @i18n!(ctx.1, "Admin") - } +

+ @if user.is_admin { + @i18n!(ctx.1, "Admin") + } - @if ctx.2.clone().map(|u| u.id == user.id).unwrap_or(false) { - @i18n!(ctx.1, "It is you") - @i18n!(ctx.1, "Edit your profile") - } -

-
+ @if ctx.2.clone().map(|u| u.id == user.id).unwrap_or(false) { + @i18n!(ctx.1, "It is you") + @i18n!(ctx.1, "Edit your profile") + } +

+
- @if is_remote { - @i18n!(ctx.1, "Open on {0}"; instance_url) - } - - @if ctx.2.clone().map(|u| u.id != user.id).unwrap_or(false) { - - @if follows { - + @if is_remote { + @i18n!(ctx.1, "Open on {0}"; instance_url) } else { - + } - - } -
-
- @Html(user.summary.clone()) + + @if ctx.2.clone().map(|u| u.id != user.id).unwrap_or(false) { +
+ @if follows { + + } else { + + } +
+ } +
+
+ @Html(user.summary.clone()) +