mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-30 02:43:00 +00:00
Use <base> element to set target
This commit is contained in:
parent
dd23ac4867
commit
e9f5e0cab5
@ -25,6 +25,7 @@ type CommonData struct {
|
|||||||
CustomCSS string
|
CustomCSS string
|
||||||
CSRFToken string
|
CSRFToken string
|
||||||
AutoRefresh bool
|
AutoRefresh bool
|
||||||
|
Target string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ErrorData struct {
|
type ErrorData struct {
|
||||||
|
@ -189,6 +189,7 @@ func (svc *service) ServeNavPage(ctx context.Context, c *model.Client) (err erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
commonData := svc.getCommonData(ctx, c, "Nav")
|
commonData := svc.getCommonData(ctx, c, "Nav")
|
||||||
|
commonData.Target = "main"
|
||||||
data := &renderer.NavData{
|
data := &renderer.NavData{
|
||||||
User: u,
|
User: u,
|
||||||
CommonData: commonData,
|
CommonData: commonData,
|
||||||
@ -422,6 +423,7 @@ func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client,
|
|||||||
|
|
||||||
commonData := svc.getCommonData(ctx, c, "notifications")
|
commonData := svc.getCommonData(ctx, c, "notifications")
|
||||||
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
|
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
|
||||||
|
commonData.Target = "main"
|
||||||
data := &renderer.NotificationData{
|
data := &renderer.NotificationData{
|
||||||
Notifications: notifications,
|
Notifications: notifications,
|
||||||
UnreadCount: unreadCount,
|
UnreadCount: unreadCount,
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta content='width=device-width, initial-scale=1' name='viewport'>
|
<meta content='width=device-width, initial-scale=1' name='viewport'>
|
||||||
|
{{if .Target}}
|
||||||
|
<base href="" target="{{.Target}}">
|
||||||
|
{{end}}
|
||||||
{{if .CSRFToken}}
|
{{if .CSRFToken}}
|
||||||
<meta name="csrf_token" content="{{.CSRFToken}}">
|
<meta name="csrf_token" content="{{.CSRFToken}}">
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -2,24 +2,24 @@
|
|||||||
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
|
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="user-info-img-container">
|
<div class="user-info-img-container">
|
||||||
<a class="img-link" href="/timeline/home" title="home" target="main">
|
<a class="img-link" href="/timeline/home" title="home">
|
||||||
<img class="user-info-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" />
|
<img class="user-info-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info-details-container">
|
<div class="user-info-details-container">
|
||||||
<div>
|
<div>
|
||||||
<span class="status-dname"> {{EmojiFilter .User.DisplayName .User.Emojis}} </span>
|
<span class="status-dname"> {{EmojiFilter .User.DisplayName .User.Emojis}} </span>
|
||||||
<a class="nav-link" href="/user/{{.User.ID}}" target="main">
|
<a class="nav-link" href="/user/{{.User.ID}}">
|
||||||
<span class="status-uname"> {{.User.Acct}} </span>
|
<span class="status-uname"> {{.User.Acct}} </span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a class="nav-link" href="/timeline/home" target="main">home</a>
|
<a class="nav-link" href="/timeline/home">home</a>
|
||||||
<a class="nav-link" href="/timeline/direct" target="main">direct</a>
|
<a class="nav-link" href="/timeline/direct">direct</a>
|
||||||
<a class="nav-link" href="/timeline/local" target="main">local</a>
|
<a class="nav-link" href="/timeline/local">local</a>
|
||||||
<a class="nav-link" href="/timeline/twkn" target="main">twkn</a>
|
<a class="nav-link" href="/timeline/twkn">twkn</a>
|
||||||
<a class="nav-link" href="/search" target="main">search</a>
|
<a class="nav-link" href="/search">search</a>
|
||||||
<a class="nav-link" href="/about" target="main">about</a>
|
<a class="nav-link" href="/about">about</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a class="nav-link" href="/settings" target="_top">settings</a>
|
<a class="nav-link" href="/settings" target="_top">settings</a>
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
Notifications
|
Notifications
|
||||||
{{if gt .UnreadCount 0}}({{.UnreadCount }}){{end}}
|
{{if gt .UnreadCount 0}}({{.UnreadCount }}){{end}}
|
||||||
</div>
|
</div>
|
||||||
<a class="notification-refresh" href="/notifications">refresh</a>
|
<a class="notification-refresh" href="/notifications" target="_self">refresh</a>
|
||||||
{{if .ReadID}}
|
{{if .ReadID}}
|
||||||
<form action="/notifications/read?max_id={{.ReadID}}" method="post">
|
<form action="/notifications/read?max_id={{.ReadID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="submit" value="read" class="btn-link">
|
<input type="submit" value="read" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
{{if eq .Type "follow"}}
|
{{if eq .Type "follow"}}
|
||||||
<div class="notification-follow-container">
|
<div class="notification-follow-container">
|
||||||
<div class="status-profile-img-container">
|
<div class="status-profile-img-container">
|
||||||
<a class="img-link" href="/user/{{.Account.ID}}" target="main" >
|
<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>
|
||||||
</div>
|
</div>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
{{else if eq .Type "reblog"}}
|
{{else if eq .Type "reblog"}}
|
||||||
<div class="retweet-info">
|
<div class="retweet-info">
|
||||||
<a class="img-link" href="/user/{{.Account.ID}}" target="main">
|
<a class="img-link" href="/user/{{.Account.ID}}">
|
||||||
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
||||||
</a>
|
</a>
|
||||||
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
{{else if eq .Type "favourite"}}
|
{{else if eq .Type "favourite"}}
|
||||||
<div class="retweet-info">
|
<div class="retweet-info">
|
||||||
<a class="img-link" href="/user/{{.Account.ID}}" target="main">
|
<a class="img-link" href="/user/{{.Account.ID}}">
|
||||||
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
||||||
</a>
|
</a>
|
||||||
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{{if .NextLink}}
|
{{if .NextLink}}
|
||||||
<a href="{{.NextLink}}">next</a>
|
<a href="{{.NextLink}}" target="_self">next</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{with .Data}}
|
{{with .Data}}
|
||||||
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data">
|
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
{{if .ReplyContext}}
|
{{if .ReplyContext}}
|
||||||
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
|
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div id="status-{{.ID}}" class="status-container-container">
|
<div id="status-{{.ID}}" class="status-container-container">
|
||||||
{{if .Reblog}}
|
{{if .Reblog}}
|
||||||
<div class="retweet-info">
|
<div class="retweet-info">
|
||||||
<a class="img-link" href="/user/{{.Account.ID}}" target="main">
|
<a class="img-link" href="/user/{{.Account.ID}}">
|
||||||
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
||||||
</a>
|
</a>
|
||||||
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
||||||
@ -14,14 +14,14 @@
|
|||||||
{{with $s := .Data}}
|
{{with $s := .Data}}
|
||||||
<div class="status-container status-{{.ID}}" data-id="{{.ID}}">
|
<div class="status-container status-{{.ID}}" data-id="{{.ID}}">
|
||||||
<div class="status-profile-img-container">
|
<div class="status-profile-img-container">
|
||||||
<a class="img-link" href="/user/{{.Account.ID}}" target="main">
|
<a class="img-link" href="/user/{{.Account.ID}}">
|
||||||
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<div class="status-name">
|
<div class="status-name">
|
||||||
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
<span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>
|
||||||
<a href="/user/{{.Account.ID}}" target="main">
|
<a href="/user/{{.Account.ID}}">
|
||||||
<span class="status-uname"> {{.Account.Acct}} </span>
|
<span class="status-uname"> {{.Account.Acct}} </span>
|
||||||
</a>
|
</a>
|
||||||
<div class="more-container">
|
<div class="more-container">
|
||||||
@ -33,18 +33,18 @@
|
|||||||
source
|
source
|
||||||
</a>
|
</a>
|
||||||
{{if .Muted}}
|
{{if .Muted}}
|
||||||
<form action="/unmuteconv/{{.ID}}" method="post">
|
<form action="/unmuteconv/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="submit" value="unmute" class="btn-link more-link">
|
<input type="submit" value="unmute" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form action="/muteconv/{{.ID}}" method="post">
|
<form action="/muteconv/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="submit" value="mute" class="btn-link more-link">
|
<input type="submit" value="mute" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if eq $.Ctx.UserID .Account.ID}}
|
{{if eq $.Ctx.UserID .Account.ID}}
|
||||||
<form action="/delete/{{.ID}}" method="post">
|
<form action="/delete/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="submit" value="delete" class="btn-link more-link">
|
<input type="submit" value="delete" class="btn-link more-link">
|
||||||
</form>
|
</form>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<div class="status-reply-container">
|
<div class="status-reply-container">
|
||||||
{{if .InReplyToID}}
|
{{if .InReplyToID}}
|
||||||
<div class="status-reply-to">
|
<div class="status-reply-to">
|
||||||
<a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}" target="main">
|
<a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}">
|
||||||
reply to {{.Pleroma.InReplyToAccountAcct}}
|
reply to {{.Pleroma.InReplyToAccountAcct}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -103,7 +103,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{if .Poll}}
|
{{if .Poll}}
|
||||||
<form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST">
|
<form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="hidden" name="status_id" value="{{$s.ID}}">
|
<input type="hidden" name="status_id" value="{{$s.ID}}">
|
||||||
{{range $i, $o := .Poll.Options}}
|
{{range $i, $o := .Poll.Options}}
|
||||||
@ -139,58 +139,58 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
<div class="status-action-container">
|
<div class="status-action-container">
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
<a href="/thread/{{.ID}}?reply=true#status-{{.ID}}" target="main">
|
<a href="/thread/{{.ID}}?reply=true#status-{{.ID}}">
|
||||||
reply
|
reply
|
||||||
</a>
|
</a>
|
||||||
<a class="status-reply-count" href="/thread/{{.ID}}#status-{{.ID}}" target="{{if $.Ctx.ThreadInNewTab}}_blank{{else}}main{{end}}">
|
<a class="status-reply-count" href="/thread/{{.ID}}#status-{{.ID}}" {{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}>
|
||||||
{{if .RepliesCount}} ({{DisplayInteractionCount .RepliesCount}}) {{end}}
|
{{if .RepliesCount}} ({{DisplayInteractionCount .RepliesCount}}) {{end}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
{{if or (eq .Visibility "private") (eq .Visibility "direct")}}
|
{{if or (eq .Visibility "private") (eq .Visibility "direct")}}
|
||||||
<a class="status-retweet" href="" title="this status cannot be retweeted" target="main">
|
<a class="status-retweet" href="" title="this status cannot be retweeted">
|
||||||
retweet
|
retweet
|
||||||
</a>
|
</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if .Reblogged}}
|
{{if .Reblogged}}
|
||||||
<form class="status-retweet" data-action="unretweet" action="/unretweet/{{.ID}}" method="post">
|
<form class="status-retweet" data-action="unretweet" action="/unretweet/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="unretweet" class="btn-link">
|
<input type="submit" value="unretweet" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="status-retweet" data-action="retweet" action="/retweet/{{.ID}}" method="post">
|
<form class="status-retweet" data-action="retweet" action="/retweet/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="retweet" class="btn-link">
|
<input type="submit" value="retweet" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list" target="main">
|
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
|
||||||
{{if .ReblogsCount}} ({{DisplayInteractionCount .ReblogsCount}}) {{end}}
|
{{if .ReblogsCount}} ({{DisplayInteractionCount .ReblogsCount}}) {{end}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
{{if .Favourited}}
|
{{if .Favourited}}
|
||||||
<form class="status-like" data-action="unlike" action="/unlike/{{.ID}}" method="post">
|
<form class="status-like" data-action="unlike" action="/unlike/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="unlike" class="btn-link">
|
<input type="submit" value="unlike" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<form class="status-like" data-action="like" action="/like/{{.ID}}" method="post">
|
<form class="status-like" data-action="like" action="/like/{{.ID}}" method="post" target="_self">
|
||||||
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
|
||||||
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
|
||||||
<input type="submit" value="like" class="btn-link">
|
<input type="submit" value="like" class="btn-link">
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list" target="main">
|
<a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list">
|
||||||
{{if .FavouritesCount}} ({{DisplayInteractionCount .FavouritesCount}}) {{end}}
|
{{if .FavouritesCount}} ({{DisplayInteractionCount .FavouritesCount}}) {{end}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-action">
|
<div class="status-action">
|
||||||
<a class="status-time" href="{{if not .ShowReplies}}/thread/{{.ID}}{{end}}#status-{{.ID}}"
|
<a class="status-time" href="{{if not .ShowReplies}}/thread/{{.ID}}{{end}}#status-{{.ID}}"
|
||||||
target="{{if $.Ctx.ThreadInNewTab}}_blank{{else}}main{{end}}">
|
{{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}>
|
||||||
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">
|
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">
|
||||||
{{TimeSince .CreatedAt}}
|
{{TimeSince .CreatedAt}}
|
||||||
</time>
|
</time>
|
||||||
|
Loading…
Reference in New Issue
Block a user