diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 678b2623..7ecf9f4b 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -57,7 +57,8 @@ fn details_response(blog: String, slug: String, conn: DbConn, user: Option "date": &post.creation_date.timestamp(), "previous": query.and_then(|q| q.responding_to.map(|r| Comment::get(&*conn, r).expect("Error retrieving previous comment").to_json(&*conn, &vec![]))), "user_fqn": user.clone().map(|u| u.get_fqn(&*conn)).unwrap_or(String::new()), - "is_author": user.map(|u| post.get_authors(&*conn).into_iter().any(|a| u.id == a.id)).unwrap_or(false) + "is_author": user.clone().map(|u| post.get_authors(&*conn).into_iter().any(|a| u.id == a.id)).unwrap_or(false), + "is_following": user.map(|u| u.is_following(&*conn, post.get_authors(&*conn)[0].id)).unwrap_or(false) })) }) }) diff --git a/static/main.css b/static/main.css index c30b313e..c91cb76f 100644 --- a/static/main.css +++ b/static/main.css @@ -778,5 +778,5 @@ figcaption { } .avatar.padded { - margin-right: 1em; + margin-right: 2rem; } diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index cae86e50..ea8280c9 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -34,6 +34,20 @@

{{ "This article is under the {{ license }} license." | _(license=article.post.license) }}

+ {% if account %}