From 4e43c676b421c8f38485196c04ffb333f4439898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flor=C3=A9al=20Toumikian?= Date: Sun, 12 Apr 2020 21:29:48 +0200 Subject: [PATCH] Fixed: #713: Disply likes and boosts on post cards (#744) This is a basic and simple way to display them. No interaction possible. Alos, this patch is not optimised. as everytime a partial post_card is called, `Post::count_likes()` and `Post::count_reshares()` are called which means quite a few more quesies are sent to database unless diesel uses some cache mechanisem. A way to enhance this this would be to keep a count of likes and reshares are kept in Post model / table. --- assets/themes/default/_global.scss | 23 ++++++++++++++++++- templates/partials/post_card.rs.html | 33 +++++++++++++++++++--------- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/assets/themes/default/_global.scss b/assets/themes/default/_global.scss index d28d23a4..ffa28959 100644 --- a/assets/themes/default/_global.scss +++ b/assets/themes/default/_global.scss @@ -190,7 +190,28 @@ p.error { background: $gray; - text-overflow: ellipsis; + text-overflow: ellipsis; + + footer.authors { + div { + float: left; + margin-right: 0.25em; + } + + .likes { color: $red; } + .reshares { color: $primary; } + + span.likes, span.resahres { + font-family: "Route159",serif; + font-size: 1em; + } + + svg.feather { + width: 0.85em; + height: 0.85em; + } + } + > * { margin: 20px; diff --git a/templates/partials/post_card.rs.html b/templates/partials/post_card.rs.html index d0475e95..99fae87a 100644 --- a/templates/partials/post_card.rs.html +++ b/templates/partials/post_card.rs.html @@ -17,17 +17,30 @@

@article.subtitle