show.ejs 1.72 KB

<!DOCTYPE html>
<html>
  <head>
    <%- include('../partials/head') %>
  </head>
  <body>
    <%- include('../partials/nav') %>

    <div class="container mb-3">

      <nav aria-label="breadcrumb">
        <ol class="breadcrumb p-1 pl-2 pr-2">
          <li class="breadcrumb-item"><a href="/">Home</a></li>
          <li class="breadcrumb-item"><a href="/api/book">Book</a></li>
          <li class="breadcrumb-item active" aria-current="page"><%= page.title %></li>
        </ol>
      </nav>

      <div class="card">
        <h5 class="card-header p-2"><%= page.title %></h5>
        <div class="row"> <!-- 1 -->

          <div class="col-md-7 col-lg-8 col-xl-9 order-sm-2 order-md-1"> <!-- 1 -->
            <div class="post-body p-2"><%= page.contents %></div>
          </div>

          <div class="col-md-5 col-lg-4 col-xl-3 order-sm-1 order-md-2"> <!-- 1 -->
            <div class="post-info card m-2 p-2"> 
              <div><span>Created</span> : <span data-date-time="<%= page.createDate %>"></span></div> <!-- 2 -->
              <% if(page.updateDate) { %>
                <div><span>Updated</span> : <span data-date-time="<%= page.updateDate %>"></span></div> <!-- 2 -->
              <% } %>
            </div>
          </div>

        </div>
      </div>

      <div class="mt-3">
        <a class="btn btn-primary" href="/api/page">Back</a>
        <a class="btn btn-primary" href="/api/page/<%= page._id %>/edit">Edit</a>
        <form action="/api/page/<%= page._id %>?_method=delete" method="post" class="d-inline">
          <a class="btn btn-primary" href="javascript:void(0)" onclick="confirm('Do you want to delete this?')?this.parentElement.submit():null;">Delete</a>
        </form>
      </div>

    </div>
  </body>
</html>