From 4a83c22261e4e35de7366c9b815ef72d3555e5d9 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 22 Dec 2019 03:43:25 +0000 Subject: Fix css and template issues --- renderer/renderer.go | 4 ++-- static/main.css | 30 +++++++++++++++++++++++++++--- templates/notification.tmpl | 24 +++++++++++++++--------- templates/postform.tmpl | 2 +- templates/status.tmpl | 17 ++++++++++------- templates/user.tmpl | 7 ++++++- 6 files changed, 61 insertions(+), 23 deletions(-) diff --git a/renderer/renderer.go b/renderer/renderer.go index cabf92d..8009d99 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -79,7 +79,7 @@ func (r *renderer) RenderAboutPage(ctx context.Context, writer io.Writer, data * func EmojiFilter(content string, emojis []mastodon.Emoji) string { var replacements []string for _, e := range emojis { - replacements = append(replacements, ":"+e.ShortCode+":", "\""+e.ShortCode+"\"") + replacements = append(replacements, ":"+e.ShortCode+":", "\""+e.ShortCode+"\"") } return strings.NewReplacer(replacements...).Replace(content) } @@ -90,7 +90,7 @@ func StatusContentFilter(spoiler string, content string, emojis []mastodon.Emoji } var replacements []string for _, e := range emojis { - replacements = append(replacements, ":"+e.ShortCode+":", "\""+e.ShortCode+"\"") + replacements = append(replacements, ":"+e.ShortCode+":", "\""+e.ShortCode+"\"") } for _, m := range mentions { replacements = append(replacements, "\""+m.URL+"\"", "\"/user/"+m.ID+"\"") diff --git a/static/main.css b/static/main.css index e37cef4..89bb9cd 100644 --- a/static/main.css +++ b/static/main.css @@ -21,11 +21,15 @@ margin: 0px; } +.status-profile-img-container { + margin-right: 8px; +} + .status-profile-img { height: 48px; width: 48px; - margin-right: 8px; object-fit: contain; + vertical-align: top; } .status { @@ -111,6 +115,10 @@ margin: 8px 0; } +.post-form>div { + margin-bottom: 4px; +} + .signin-form { margin: 8px 0; } @@ -127,7 +135,7 @@ height: 24px; width: 24px; margin-bottom: -8px; - margin-right: 0px; + vertical-align: baseline; } .retweet-info .status-dname{ @@ -248,7 +256,7 @@ } .status-visibility { - margin: 0 4px; + margin-left: 4px; display: inline-block; color: #444444; } @@ -257,3 +265,19 @@ font-size: 9pt; vertical-align: bottom; } + +.remote-link { + margin-left: 4px; + display: inline-block; + color: #444444; + text-decoration: none; +} + +.remote-link span { + font-size: 9pt; + vertical-align: bottom; +} + +.img-link { + display: inline-block; +} diff --git a/templates/notification.tmpl b/templates/notification.tmpl index 271597b..e46ce8a 100644 --- a/templates/notification.tmpl +++ b/templates/notification.tmpl @@ -6,9 +6,11 @@
{{if eq .Type "follow"}}
- - profile-avatar - +
+ + profile-avatar + +
{{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -26,9 +28,11 @@ {{else if eq .Type "reblog"}}
- - profile-avatar - +
+ + profile-avatar + +
{{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -41,9 +45,11 @@ {{else if eq .Type "favourite"}}
- - profile-avatar - +
+ + profile-avatar + +
{{EmojiFilter .Account.DisplayName .Account.Emojis}} diff --git a/templates/postform.tmpl b/templates/postform.tmpl index 137232f..309e139 100644 --- a/templates/postform.tmpl +++ b/templates/postform.tmpl @@ -10,7 +10,7 @@
- diff --git a/templates/status.tmpl b/templates/status.tmpl index a89fc78..7ec7d29 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -1,7 +1,7 @@
{{if .Reblog}}
- + profile-avatar {{EmojiFilter .Account.DisplayName .Account.Emojis}} @@ -12,13 +12,13 @@ {{else}} {{block "status" .}}
-
- {{if not .HideAccountInfo}} - + {{if not .HideAccountInfo}} +
+ profile-avatar - {{end}}
+ {{end}}
{{if not .HideAccountInfo}} {{end}}
@@ -56,7 +59,7 @@
{{range .MediaAttachments}} {{if eq .Type "image"}} - + status-image {{else if eq .Type "audio"}} diff --git a/templates/user.tmpl b/templates/user.tmpl index e1a782a..ccb0e4a 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -5,12 +5,17 @@