From c253bdee5440a07cf8724157a62b314f61676d38 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 17 Jan 2021 22:29:45 +0900 Subject: [PATCH] Show edit link in post cards --- assets/themes/default/_global.scss | 16 +++++++++++++++- templates/partials/post_card.rs.html | 17 ++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/assets/themes/default/_global.scss b/assets/themes/default/_global.scss index a33739d1..2e2784bb 100644 --- a/assets/themes/default/_global.scss +++ b/assets/themes/default/_global.scss @@ -183,6 +183,8 @@ p.error { display: flex; flex-direction: column; + position: relative; + min-width: 20em; min-height: 20em; margin: 1em; @@ -225,11 +227,14 @@ p.error { } h3 { - margin: 0.75em 20px; + flex-grow: 1; + margin: 0; font-family: $playfair; font-size: 1.75em; font-weight: normal; + line-height: 1.75; a { + display: block; transition: color 0.1s ease-in; color: $text-color; @@ -237,6 +242,15 @@ p.error { } } + .controls { + float: right; + + .button { + margin-top: 0; + margin-bottom: 0; + } + } + main { flex: 1; diff --git a/templates/partials/post_card.rs.html b/templates/partials/post_card.rs.html index 99fae87a..72458e23 100644 --- a/templates/partials/post_card.rs.html +++ b/templates/partials/post_card.rs.html @@ -8,11 +8,18 @@ @if article.cover_id.is_some() {
} -

- - @article.title - -

+
+ @if ctx.2.clone().and_then(|u| article.is_author(ctx.0, u.id).ok()).unwrap_or(false) { + + } +

+ + @article.title + +

+

@article.subtitle