messages.html (2164B)
1 {% include 'header.html' %} 2 3 <title>Your messages | Diaspora Diaries</title> 4 5 {% include 'nav.html' %} 6 7 <main role="main" class="container cover"> 8 9 {% if them %} 10 <h1 class="cover-heading">Messages with {{ them['name'] }}</h1> 11 {% else %} 12 <h1 class="cover-heading">Messages</h1> 13 {% endif %} 14 <hr> 15 16 {% if not single %} 17 <div class="table-responsive"> 18 <table class="table table-striped table-hover"> 19 <thead> 20 <tr> 21 <th scope="col">With</th> 22 <th scope="col">Latest</th> 23 <th scope="col">Status</th> 24 <th scope="col">At</th> 25 </tr> 26 </thead> 27 <tbody> 28 {% for i in messages %} 29 <tr> 30 <td><a href="/profile?id={{ i[1] }}">{{ i[0] }}</a></td> 31 <td><a href="/messages?from={{ i[1] }}">{{ i[2]['message'] }}</a></td> 32 {% if i[2]['unread'] == 1 %} 33 <td><span class="fa fa-envelope" style="font-size: 1.5em;" title="Unread"></span></td> 34 {% else %} 35 <td><span class="fa fa-envelope-open" style="font-size: 1.5em;" title="Read"></span></td> 36 {% endif %} 37 <td>{{ parsetime(i[2]['time']) }}</td> 38 </tr> 39 {% endfor %} 40 </tbody> 41 </table> 42 </div> 43 {% else %} 44 45 <form action="/sendmsg" method="POST" id="msgform"> 46 <div class="form-group"> 47 <hr> 48 <p class="lead">Reply:</p> 49 <input type="hidden" name="Id" value="{{ them['id'] }}"> 50 <input type="hidden" name="Us" value="{{ current_user.id }}"> 51 <textarea name="Message" class="form-control" form="msgform" required></textarea><br> 52 <button form="msgform" type="submit" class="btn btn-outline-success">Send</button> 53 </p> 54 </form> 55 56 {% if not messages %} 57 <p class="lead">No messages.</p> 58 {% endif %} 59 60 {% for i in messages %} 61 <hr> 62 <blockquote class="blockquote"> 63 <p>{{ i['message'] }}</p> 64 <footer class="blockquote-footer">{{ i['from'] }} - {{ parsetime(i['time']) }}</footer> 65 </blockquote> 66 {% endfor %} 67 68 <hr> 69 <a href="/messages">< back</a> 70 {% endif %} 71 72 </main> 73 74 {% include 'footer.html' %}