a mini social media app for small communities
1@include 'partial/header.html'
2
3<h1>
4 @{viewing.get_name()}
5 (@@@viewing.username)
6
7 @if viewing.pronouns != ''
8 (@viewing.pronouns)
9 @end
10
11 @if viewing.muted
12 [muted]
13 @end
14
15 @if viewing.automated
16 [automated]
17 @end
18
19 @if viewing.admin
20 [admin]
21 @end
22</h1>
23
24@if app.logged_in_as(mut ctx, viewing.id)
25<p>this is you!</p>
26@if !user.automated
27@include 'components/new_post.html'
28<hr>
29@end
30@end
31
32@if viewing.bio != ''
33<div>
34 <h2>bio:</h2>
35 <pre id="bio">@viewing.bio</pre>
36</div>
37<hr>
38@end
39
40@if app.logged_in_as(mut ctx, viewing.id)
41<div>
42 <p><a href="/me/saved">saved posts</a></p>
43 <p><a href="/me/saved_for_later">saved for later</a></p>
44</div>
45<hr>
46@end
47
48<div>
49 <h2>recent posts:</h2>
50 @if posts.len > 0
51 @for post in posts
52 @include 'components/post_small.html'
53 @end
54 @else
55 <p>no posts!</p>
56 @end
57</div>
58
59@if ctx.is_logged_in() && user.admin
60<hr>
61
62<div>
63 <h2>admin powers:</h2>
64 <form action="/api/user/set_muted" method="post">
65 <input
66 type="number"
67 name="id"
68 id="id"
69 value="@user.id"
70 required aria-required
71 readonly aria-readonly
72 hidden aria-hidden
73 >
74 @if !user.muted
75 <input
76 type="checkbox"
77 name="muted"
78 id="muted"
79 value="true"
80 checked aria-checked
81 readonly aria-readonly
82 hidden aria-hidden
83 >
84 <input type="submit" value="mute">
85 @else
86 <input
87 type="checkbox"
88 name="muted"
89 id="muted"
90 value="false"
91 checked aria-checked
92 readonly aria-readonly
93 hidden aria-hidden
94 >
95 <input type="submit" value="unmute">
96 @end
97 </form>
98</div>
99@end
100
101@if viewing.bio != ''
102<script src="/static/js/render_body.js"></script>
103<script>
104 render_body('bio')
105</script>
106@end
107
108@include 'partial/footer.html'