about summary refs log blame commit diff
path: root/templates/thread.html
blob: 5245adf99e850fc0f1b8935f88aac718e3c48d8f (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                
        

                                                                                          
                                                                            

                                                                                                                                                                                                                    

                                                       
                                               

         




                                                                             
                                                                            

             
 
                           
                                                 
                                                
                                     
              
 
                                



                                                                                                                                    

                
                                                                          
 
                                                                               





                                                                             
                                                                                                  

                                                                                 
                  


                     
 
                                                                       



                                                                                  
                                                                                                                     

                                                                            

                    
                 
              
            
          

         
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="Content-Security-Policy" content="script-src 'self';">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <!-- Custom CSS additions -->
    <style>img { max-width:100%; height:auto; }</style>
    <title>Converse: {{ title | safe }}</title>
  </head>
  <body>
    <header>
      <nav class="navbar navbar-light bg-light justify-content-between mb-3">
        <a class="navbar-brand" href="/">
          <h2>Converse</h2>
        </a>
        <a class="btn btn-outline-secondary my-2" href="/">Back to index</a>
      </nav>
    </header>

    <div class="container">
      <div class="list-group d-flex flex-column">
        <div class="list-group-item d-flex row">
          <h3>{{ title | safe }}</h3>
        </div>

        {% for post in posts -%}
        <div id="post-{{ post.id}}" class="list-group-item d-flex row">
          <div class="d-flex flex-column border-right col-2">
            <img class="mx-auto" src="https://www.gravatar.com/avatar/{{ post.author_gravatar }}?d=monsterid" style="width: 80px;"/>
            <span class="mx-auto text-center"><strong>{{ post.author_name }}</strong></span>
          </div>

          <div class="align-self-stretch col">{{ post.body | safe }}</div>

          <div class="d-inline-flex flex-column align-items-end ml-auto col-1">
            <a href="/thread/{{ id }}#post-{{ post.id }}" class="ml-auto">
              <small class="text-muted float-right">{{ post.posted }}</small>
            </a>

            <div class="d-inline-flex flex-row mt-auto ml-auto">
              {%- if post.editable %}
              <a href="/post/{{ post.id }}/edit" class="badge badge-light border m-1 p-1">Edit</a>
              {% endif -%}
              <a href="#quote" class="badge badge-light border m-1 p-1">Quote</a>
            </div>
          </div>
        </div>
        {%- endfor %}

        <div class="list-group-item flex-column align-items-start row">
          <form id="reply-form" action="/thread/reply" method="post">
            <input type="hidden" id="thread_id" name="thread_id" value="{{ id }}">
            <label for="body">You can use <strong>Markdown</strong>!</label>
            <div class="input-group">
              <textarea class="form-control" id="post" name="post" aria-label="thread response" rows="10"></textarea>
              <div class="input-group-append">
                <button class="btn btn-primary" type="submit">Post!</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </body>
</html>