Fix css and template issues

This commit is contained in:
r 2019-12-22 03:43:25 +00:00
parent 2678f33157
commit 4a83c22261
6 changed files with 61 additions and 23 deletions

View file

@ -79,7 +79,7 @@ func (r *renderer) RenderAboutPage(ctx context.Context, writer io.Writer, data *
func EmojiFilter(content string, emojis []mastodon.Emoji) string { func EmojiFilter(content string, emojis []mastodon.Emoji) string {
var replacements []string var replacements []string
for _, e := range emojis { for _, e := range emojis {
replacements = append(replacements, ":"+e.ShortCode+":", "<img class=\"status-emoji\" src=\""+e.URL+"\" alt=\""+e.ShortCode+"\" />") replacements = append(replacements, ":"+e.ShortCode+":", "<img class=\"status-emoji\" src=\""+e.URL+"\" alt=\""+e.ShortCode+"\" title=\""+e.ShortCode+"\" />")
} }
return strings.NewReplacer(replacements...).Replace(content) return strings.NewReplacer(replacements...).Replace(content)
} }
@ -90,7 +90,7 @@ func StatusContentFilter(spoiler string, content string, emojis []mastodon.Emoji
} }
var replacements []string var replacements []string
for _, e := range emojis { for _, e := range emojis {
replacements = append(replacements, ":"+e.ShortCode+":", "<img class=\"status-emoji\" src=\""+e.URL+"\" alt=\""+e.ShortCode+"\" />") replacements = append(replacements, ":"+e.ShortCode+":", "<img class=\"status-emoji\" src=\""+e.URL+"\" alt=\""+e.ShortCode+"\" title=\""+e.ShortCode+"\" />")
} }
for _, m := range mentions { for _, m := range mentions {
replacements = append(replacements, "\""+m.URL+"\"", "\"/user/"+m.ID+"\"") replacements = append(replacements, "\""+m.URL+"\"", "\"/user/"+m.ID+"\"")

View file

@ -21,11 +21,15 @@
margin: 0px; margin: 0px;
} }
.status-profile-img-container {
margin-right: 8px;
}
.status-profile-img { .status-profile-img {
height: 48px; height: 48px;
width: 48px; width: 48px;
margin-right: 8px;
object-fit: contain; object-fit: contain;
vertical-align: top;
} }
.status { .status {
@ -111,6 +115,10 @@
margin: 8px 0; margin: 8px 0;
} }
.post-form>div {
margin-bottom: 4px;
}
.signin-form { .signin-form {
margin: 8px 0; margin: 8px 0;
} }
@ -127,7 +135,7 @@
height: 24px; height: 24px;
width: 24px; width: 24px;
margin-bottom: -8px; margin-bottom: -8px;
margin-right: 0px; vertical-align: baseline;
} }
.retweet-info .status-dname{ .retweet-info .status-dname{
@ -248,7 +256,7 @@
} }
.status-visibility { .status-visibility {
margin: 0 4px; margin-left: 4px;
display: inline-block; display: inline-block;
color: #444444; color: #444444;
} }
@ -257,3 +265,19 @@
font-size: 9pt; font-size: 9pt;
vertical-align: bottom; 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;
}

View file

@ -6,9 +6,11 @@
<div class="notification-container {{if .Pleroma}}{{if not .Pleroma.IsSeen}}unread{{end}}{{end}}"> <div class="notification-container {{if .Pleroma}}{{if not .Pleroma.IsSeen}}unread{{end}}{{end}}">
{{if eq .Type "follow"}} {{if eq .Type "follow"}}
<div class="notification-follow-container"> <div class="notification-follow-container">
<a href="/user/{{.Account.ID}}" > <div class="status-profile-img-container">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <a class="img-link" href="/user/{{.Account.ID}}" >
</a> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</a>
</div>
<div> <div>
<div> <div>
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
@ -26,9 +28,11 @@
{{else if eq .Type "reblog"}} {{else if eq .Type "reblog"}}
<div class="notification-retweet-container"> <div class="notification-retweet-container">
<a href="/user/{{.Account.ID}}" > <div class="status-profile-img-container">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <a class="img-link" href="/user/{{.Account.ID}}" >
</a> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</a>
</div>
<div> <div>
<div> <div>
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
@ -41,9 +45,11 @@
{{else if eq .Type "favourite"}} {{else if eq .Type "favourite"}}
<div class="notification-like-container"> <div class="notification-like-container">
<a href="/user/{{.Account.ID}}" > <div class="status-profile-img-container">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <a class="img-link" href="/user/{{.Account.ID}}" >
</a> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</a>
</div>
<div> <div>
<div> <div>
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>

View file

@ -10,7 +10,7 @@
</div> </div>
<div> <div>
<label for ="post-visilibity"> Visibility </label> <label for ="post-visilibity"> Visibility </label>
<select id="post-visilibity" type="file" name="visibility"> <select id="post-visilibity" name="visibility">
<option value="public" {{if eq .DefaultVisibility "public"}}selected{{end}}>Public</option> <option value="public" {{if eq .DefaultVisibility "public"}}selected{{end}}>Public</option>
<option value="unlisted" {{if eq .DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option> <option value="unlisted" {{if eq .DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option>
<option value="private" {{if eq .DefaultVisibility "private"}}selected{{end}}>Private</option> <option value="private" {{if eq .DefaultVisibility "private"}}selected{{end}}>Private</option>

View file

@ -1,7 +1,7 @@
<div id="status-{{if .Reblog}}{{.Reblog.ID}}{{else}}{{.ID}}{{end}}" class="status-container-container"> <div id="status-{{if .Reblog}}{{.Reblog.ID}}{{else}}{{.ID}}{{end}}" class="status-container-container">
{{if .Reblog}} {{if .Reblog}}
<div class="retweet-info"> <div class="retweet-info">
<a href="/user/{{.Account.ID}}" > <a class="img-link" href="/user/{{.Account.ID}}">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</a> </a>
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
@ -12,13 +12,13 @@
{{else}} {{else}}
{{block "status" .}} {{block "status" .}}
<div class="status-container"> <div class="status-container">
<div> {{if not .HideAccountInfo}}
{{if not .HideAccountInfo}} <div class="status-profile-img-container">
<a href="/user/{{.Account.ID}}" > <a class="img-link" href="/user/{{.Account.ID}}">
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" /> <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
</a> </a>
{{end}}
</div> </div>
{{end}}
<div class="status"> <div class="status">
{{if not .HideAccountInfo}} {{if not .HideAccountInfo}}
<div class="status-name"> <div class="status-name">
@ -26,7 +26,7 @@
<a href="/user/{{.Account.ID}}" > <a href="/user/{{.Account.ID}}" >
<span class="status-uname"> {{.Account.Acct}} </span> <span class="status-uname"> {{.Account.Acct}} </span>
</a> </a>
<a class="status-visibility" href="{{.URL}}" target="_blank"> <a class="status-visibility">
{{if eq .Visibility "public"}} {{if eq .Visibility "public"}}
<span class="icon dripicons-web" title="Public"></span> <span class="icon dripicons-web" title="Public"></span>
{{else if eq .Visibility "unlisted"}} {{else if eq .Visibility "unlisted"}}
@ -37,6 +37,9 @@
<span class="icon dripicons-mail" title="Direct"></span> <span class="icon dripicons-mail" title="Direct"></span>
{{end}} {{end}}
</a> </a>
<a class="remote-link" href="{{.URL}}" target="_blank" title="source">
<span class="icon dripicons-link"></span>
</a>
</div> </div>
{{end}} {{end}}
<div class="status-reply-container"> <div class="status-reply-container">
@ -56,7 +59,7 @@
<div class="status-media-container"> <div class="status-media-container">
{{range .MediaAttachments}} {{range .MediaAttachments}}
{{if eq .Type "image"}} {{if eq .Type "image"}}
<a href="{{.URL}}" target="_blank"> <a class="img-link" href="{{.URL}}" target="_blank">
<img class="status-image" src="{{.URL}}" alt="status-image" /> <img class="status-image" src="{{.URL}}" alt="status-image" />
</a> </a>
{{else if eq .Type "audio"}} {{else if eq .Type "audio"}}

View file

@ -5,12 +5,17 @@
<div class="user-info-container"> <div class="user-info-container">
<div> <div>
<div class="user-profile-img-container"> <div class="user-profile-img-container">
<img class="user-profile-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" /> <a class="img-link" href="{{.User.AvatarStatic}}" target="_blank">
<img class="user-profile-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" />
</a>
</div> </div>
<div class="user-profile-details-container"> <div class="user-profile-details-container">
<div> <div>
<span class="status-dname"> {{EmojiFilter .User.DisplayName .User.Emojis}} </span> <span class="status-dname"> {{EmojiFilter .User.DisplayName .User.Emojis}} </span>
<span class="status-uname"> {{.User.Acct}} </span> <span class="status-uname"> {{.User.Acct}} </span>
<a class="remote-link" href="{{.User.URL}}" target="_blank" title="remote profile">
<span class="icon dripicons-link"></span>
</a>
</div> </div>
<div> <div>
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span> <span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>