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
|
{{define "title"}}Backend — @{{.ActorName}}{{end}}
{{define "content"}}
<h1>@{{.ActorName}}</h1>
{{if .BotOpenURL}}
<p><a href="{{.BotOpenURL}}" target="_blank" rel="noopener">Open @{{.ActorName}} on {{.UserInstance}}</a></p>
{{end}}
<p class="meta">
Logged in as <strong>{{.Handle}}</strong>
{{if .VisibleBots | len | lt 1}} —
switch bot:
{{range $i, $name := .VisibleBots}}{{if $i}}, {{end}}{{if eq $name $.ActorName}}<strong>@{{$name}}</strong>{{else}}<a href="/backend?actor={{$name}}">@{{$name}}</a>{{end}}{{end}}
{{end}}
{{if .AllActorsLink}} — <a href="/backend">all actors</a>{{end}}
— <a href="/login">switch account</a>
</p>
{{if .Curators}}
<p class="curators"><strong>Curators:</strong>
<ul>
{{range .Curators}}
<li><a href="{{.URL}}" target="_blank" rel="noopener">{{.Handle}}</a></li>
{{end}}
</ul>
</p>
{{end}}
<h2>Boost a URL</h2>
<form class="boost-form" method="POST" action="/backend?actor={{.ActorName}}">
<input type="hidden" name="action" value="boost">
<input type="text" name="url" placeholder="https://mastodon.social/@user/123" autofocus>
<button type="submit">Boost →</button>
</form>
<h2>Boosted posts</h2>
<table>
<thead><tr><th>Kind</th><th>URL</th><th>At</th><th></th><th></th></tr></thead>
<tbody>
{{if .Outbox}}
{{range .Outbox}}
<tr>
<td class="kind">{{if eq .Kind "quote"}}❝ quote{{else}}➡ boost{{end}}</td>
<td><a href="{{.Object}}" target="_blank" rel="noopener">{{.Object}}</a>{{if .Snippet}}<br><small class="snippet">{{.Snippet}}</small>{{end}}</td>
<td class="ts">{{.Published}}</td>
<td class="open">{{if .OpenURL}}<a href="{{.OpenURL}}" target="_blank" rel="noopener">Open on instance</a>{{end}}</td>
<td>
<form method="POST" action="/backend?actor={{$.ActorName}}">
<input type="hidden" name="action" value="unboost">
<input type="hidden" name="url" value="{{.Object}}">
<button type="submit">{{if eq .Kind "quote"}}Unquote{{else}}Unboost{{end}}</button>
</form>
</td>
</tr>
{{end}}
{{else}}
<tr><td colspan="5"><em>No boosts yet.</em></td></tr>
{{end}}
</tbody>
</table>
{{if .IsAdmin}}
<h2>Edit actor settings</h2>
<form method="POST" action="/backend?actor={{.ActorName}}">
<input type="hidden" name="action" value="save_meta">
<div class="field">
<label for="display_name">Display name</label>
<input type="text" id="display_name" name="display_name" value="{{.DisplayName}}" placeholder="{{.ActorName}}">
</div>
<div class="field">
<label for="summary">Summary</label>
<input type="text" id="summary" name="summary" value="{{.Summary}}">
</div>
<div class="field">
<label for="allowlist">Curators (one actor URL per line)</label>
<textarea id="allowlist" name="allowlist" rows="6">{{.Allowlist}}</textarea>
</div>
<button type="submit">Save</button>
</form>
<h2>Profile picture</h2>
{{if .AvatarURL}}<img src="{{.AvatarURL}}" alt="avatar" style="width:100px;height:100px;object-fit:cover;border-radius:50%;display:block;margin-bottom:0.5rem">{{end}}
<form method="POST" action="/backend/avatar?actor={{.ActorName}}" enctype="multipart/form-data">
<div class="field">
<label for="avatar">Upload image (JPEG, PNG, GIF, WebP — resized to 400×400)</label>
<input type="file" id="avatar" name="avatar" accept="image/*">
</div>
<button type="submit">Upload</button>
</form>
{{end}}
{{end}}
{{template "base" .}}
|