a mini social media app for small communities
1@include 'partial/header.html' 2 3@if ctx.is_logged_in() 4 5@if replying 6<h1>reply to @{replying_to_user.get_name()} with...</h1> 7<p>(replying to <a href="/post/${replying_to}">this</a>)</p> 8@else 9<h2>make a post...</h2> 10@end 11 12<div> 13 <form action="/api/post/new_post" method="post"> 14 @if replying 15 <input 16 type="number" 17 name="replying_to" 18 id="replying_to" 19 required aria-required 20 readonly aria-readonly 21 hidden aria-hidden 22 value="@replying_to" 23 > 24 <input 25 type="text" 26 name="title" 27 id="title" 28 value="reply to @{replying_to_user.get_name()}" 29 required aria-required 30 readonly aria-readonly 31 hidden aria-hidden 32 > 33 @else 34 <input 35 type="text" 36 name="title" 37 id="title" 38 minlength="@app.config.post.title_min_len" 39 maxlength="@app.config.post.title_max_len" 40 pattern="@app.config.post.title_pattern" 41 placeholder="title" 42 required aria-required 43 > 44 @end 45 46 <br> 47 <textarea 48 name="body" 49 id="body" 50 minlength="@app.config.post.body_min_len" 51 maxlength="@app.config.post.body_max_len" 52 rows="10" 53 cols="30" 54 placeholder="in reply to @{replying_to_user.get_name()}..." 55 required 56 ></textarea> 57 58 <br> 59 60 <input type="submit" value="post!"> 61 </form> 62</div> 63@else 64<p>uh oh, you need to be logged in to see this page</p> 65@end 66 67@include 'partial/footer.html'