From e9f2f769bed326bed5c537bd97527419df02d20d Mon Sep 17 00:00:00 2001
From: fdb-hiroshima <35889323+fdb-hiroshima@users.noreply.github.com>
Date: Sat, 8 Dec 2018 21:52:46 +0100
Subject: [PATCH] Add microformat tags (#341)
Close #229
Adding `
` might have broken the layout in some places. I've tried to fix it, tell me if I missed it somewhere
---
src/template_utils.rs | 7 ++-
static/css/main.css | 10 ++++-
templates/blogs/details.rs.html | 14 +++++-
templates/instance/federated.rs.html | 4 +-
templates/instance/local.rs.html | 4 +-
templates/partials/comment.rs.html | 18 +++++---
templates/partials/home_feed.rs.html | 4 +-
templates/partials/post_card.rs.html | 10 ++---
templates/posts/details.rs.html | 29 +++++++-----
templates/users/details.rs.html | 8 +++-
templates/users/header.rs.html | 66 +++++++++++++++-------------
11 files changed, 108 insertions(+), 66 deletions(-)
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
+
+ @for author in authors {
+
+
@author.name(ctx.0)
+
+
+ }
+
+
+
@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>)
-
@i18n!(ctx.1, "Comments")
@@ -136,7 +140,7 @@ @if !comments.is_empty() {