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

                
        

                                                                                          
                                                                            

                                                                                                                                                                                                                    
                                        

         




                                                                             
                                                                            

             
 






                                                     
                                      


                      
 
                                    



                                                                                              

                                                

                                        
                                                                                                          






                                                             



                                    


                         
 


                                                                       
                                                                             
                                                                                          












                                                                                                                   
            
          

         
<!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">
    <title>Converse: {{ title }}</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="row">
        <div class="col-12">
          <div class="list-group">
            <div class="list-group-item flex-column">
              <div class="row">
                <div class="col-12">
                  <h3>{{ title }}</h3>
                </div>
              </div>
            </div>

            {% for post in posts -%}
            <div id="post-{{ post.id}}" class="list-group-item flex-column align-items-start">
              <a href="/thread/{{ id }}#post-{{ post.id }}">
                <small class="text-muted float-right">{{ post.posted }}</small>
              </a>
              <div class="row">
                <div class="col-2 border-right">
                  <div class="row">
                    <div class="col-12">
                      <img src="https://www.gravatar.com/avatar/{{ post.author_gravatar }}?d=monsterid" />
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-12">
                      <strong>{{ post.author_name }}</strong>
                    </div>
                  </div>
                </div>
                <div class="col-10">
                  {{ post.body }}
                </div>
              </div>
            </div>
            {%- endfor %}

            <div class="list-group-item flex-column align-items-start">
              <div class="row">
                <div class="col-12">
                  <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="body" name="body" aria-label="thread response"></textarea>
                      <div class="input-group-append">
                        <button class="btn btn-outline-primary" type="submit">Post!</button>
                      </div>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>