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 && viewing.admin
12 [muted admin, somehow]
13 @else if viewing.muted
14 [muted]
15 @else if viewing.admin
16 [admin]
17 @end
18</h1>
19
20@if app.logged_in_as(mut ctx, viewing.id)
21<p>this is you!</p>
22
23<div>
24 <form action="/api/post/new_post" method="post">
25 <h2>new post:</h2>
26
27 <input
28 type="text"
29 name="title"
30 id="title"
31 minlength="@app.config.post.title_min_len"
32 maxlength="@app.config.post.title_max_len"
33 pattern="@app.config.post.title_pattern"
34 placeholder="title"
35 required aria-required
36 >
37 <br>
38
39 <textarea
40 name="body"
41 id="body"
42 minlength="@app.config.post.body_min_len"
43 maxlength="@app.config.post.body_max_len"
44 rows="10"
45 cols="30"
46 placeholder="body"
47 required aria-required
48 ></textarea>
49 <br>
50
51 <input type="submit" value="post!">
52 </form>
53</div>
54@end
55
56@if viewing.bio != ''
57<div>
58 <h2>bio:</h2>
59 <pre id="bio">@viewing.bio</pre>
60</div>
61@end
62
63<div>
64 <h2>recent posts:</h2>
65 @for post in app.get_posts_from_user(viewing.id, 10)
66 @include 'components/post_small.html'
67 @end
68</div>
69
70@if ctx.is_logged_in() && user.admin
71<div>
72 <h2>admin powers:</h2>
73 <form action="/api/user/set_muted" method="post">
74 <input
75 type="number"
76 name="id"
77 id="id"
78 value="@user.id"
79 required aria-required
80 readonly aria-readonly
81 hidden aria-hidden
82 >
83 @if !user.muted
84 <input
85 type="checkbox"
86 name="muted"
87 id="muted"
88 value="true"
89 checked aria-checked
90 readonly aria-readonly
91 hidden aria-hidden
92 >
93 <input type="submit" value="mute">
94 @else
95 <input
96 type="checkbox"
97 name="muted"
98 id="muted"
99 value="false"
100 checked aria-checked
101 readonly aria-readonly
102 hidden aria-hidden
103 >
104 <input type="submit" value="unmute">
105 @end
106 </form>
107</div>
108@end
109
110@if viewing.bio != ''
111<script src="/static/js/render_body.js"></script>
112<script>
113 render_body('bio')
114</script>
115@end
116
117@include 'partial/footer.html'