aboutsummaryrefslogtreecommitdiff
path: root/templates/notification.tmpl
blob: 395987e456ea7e43a919e0a167b6c21d449d6bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{{with .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}

<form action="/notifications/read?max_id={{.ReadID}}" method="post" target="_self">
	<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
	<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
	<h1>Notifications
		{{- if and (not $.Ctx.AntiDopamineMode) (gt .UnreadCount 0)}}
			({{.UnreadCount }})
		{{end}}
		<a class="page-link" href="/notifications" target="_self" accesskey="R" title="Refresh (R)">refresh</a>
		{{if .ReadID}}
		<input type="submit" value="read" class="btn-link page-link" accesskey="C" title="Clear unread notifications (C)">
		{{end}}
	</h1>
</form>

{{range .Notifications}}
<article class="notification-container {{.Type}} {{if .Pleroma}}{{if not .Pleroma.IsSeen}}unread{{end}}{{end}}">
	{{if eq .Type "follow"}}
	<div class="user-list-item">
		<div class="user-list-profile-img">
			<a class="img-link" href="/user/{{.Account.ID}}">
				<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="@{{.Account.Acct}}" height="48">
			</a>
		</div>
		<div class="user-list-name">
			<bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
			followed you - <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
			<br>
			<a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
		</div>
		<br class="hidden">
	</div>

	{{else if eq .Type "follow_request"}}
	<div class="user-list-item">
		<div class="user-list-profile-img">
			<a class="img-link" href="/user/{{.Account.ID}}">
				<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="@{{.Account.Acct}}" height="48">
			</a>
		</div>
		<div class="user-list-name">
			<bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
			wants to follow you - 
			<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
			<br>
			<a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
			<div class="follow-request-actions">
				<form class="d-inline" action="/accept/{{.Account.ID}}" method="post" target="_self">
					<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
					<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
					<input type="submit" value="accept" class="btn-link">
				</form>
				-
				<form class="d-inline" action="/reject/{{.Account.ID}}" method="post" target="_self">
					<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
					<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
					<input type="submit" value="reject" class="btn-link">
				</form>
			</div>
		</div>
		<br class="hidden">
	</div>

	{{else if eq .Type "mention"}}
	{{template "status" (WithContext .Status $.Ctx)}}

	{{else if eq .Type "reblog"}}
	<div class="retweet-info">
		<a class="img-link" href="/user/{{.Account.ID}}">
			<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="@{{.Account.Acct}}" height="48">
		</a>
		<bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
		<a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
		<span class="notification-text"> retweeted your post - 
			<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
		</span>
	</div>
	{{template "status" (WithContext .Status $.Ctx)}}

	{{else if eq .Type "favourite"}}
	<div class="retweet-info">
		<a class="img-link" href="/user/{{.Account.ID}}">
			<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="@{{.Account.Acct}}" height="48">
		</a>
		<bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
		<a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
		<span class="notification-text"> liked your post - 
			<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
		</span>
	</div>
	{{template "status" (WithContext .Status $.Ctx)}}

	{{else}}
	<div class="retweet-info">
		<a class="img-link" href="/user/{{.Account.ID}}">
			<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="@{{.Account.Acct}}" height="48">
		</a>
		<bdi class="status-dname">{{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}}</bdi>
		<a href="/user/{{.Account.ID}}"><span class="status-uname">@{{.Account.Acct}}</span></a>
		<span class="notification-text"> {{.Type}} - 
			<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> 
		</span>
	</div>
	{{if .Status}}{{template "status" (WithContext .Status $.Ctx)}}{{end}}
	{{end}}
</article>
{{end}}

<nav class="pagination">
	{{if .NextLink}}
		<a href="{{.NextLink}}" target="_self">[next]</a>
	{{end}}
</nav>

{{template "footer.tmpl"}}
{{end}}