{% include "header.html" %}

<!-- Page Header-->
<header class="masthead" style="background-image: url('{{post.img_url}}')">
  <div class="container position-relative px-4 px-lg-5">
    <div class="row gx-4 gx-lg-5 justify-content-center">
      <div class="col-md-10 col-lg-8 col-xl-7">
        <div class="post-heading">
          <h1>{{ post.title }}</h1>
          <h2 class="subheading">{{ post.subtitle }}</h2>
          <span class="meta"
            >Posted by
            <a href="#">{{ post.author }}</a>
            on {{ post.date }}
          </span>
        </div>
      </div>
    </div>
  </div>
</header>

<!-- Post Content -->
<article>
  <div class="container px-4 px-lg-5">
    <div class="row gx-4 gx-lg-5 justify-content-center">
      <div class="col-md-10 col-lg-8 col-xl-7">
        {{ post.body|safe }}
        <!--TODO: Only show Edit Post button if user id is 1 (admin user) -->
        <div class="d-flex justify-content-end mb-4">
          <a
            class="btn btn-primary float-right"
            href="{{url_for('edit_post', post_id=post.id)}}"
            >Edit Post</a
          >
        </div>

        <!-- Comments Area -->
        <!-- TODO: Add a CKEditor for commenting below -->
        <div class="comment">
          <!-- TODO: Show all the comments on a post -->
          <ul class="commentList">
            <li>
              <div class="commenterImage">
                <img src="../static/assets/img/default-profile.jpg" />
              </div>
              <div class="commentText">
                <p>Some comment</p>
                <span class="date sub-text">comment author name</span>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</article>

{% include "footer.html" %}
