<!-- Page Heading -->
    <div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Issue Detail</h1>
    <% if (issue.user._id == user.id) { %>
        <a href="/issues/<%= project._id %>/edit/<%= issue._id %>" class="btn btn-primary btn-icon-split">
            <span class="icon text-white-40">
                <i class="fas fa-edit"></i>
            </span>
            <span class="text">
                Edit Issue
            </span>
        </a>
<% } %>
    </div>

    <h4 class="mb-4">Project: <%= project.title %></h4>

    <div class="card mb-4">
    <div class="card-body">
    <h5 class="card-title text-dark"><%= issue.title %> &nbsp;
<% if (issue.status == 'Open') { %>
            <button class="btn btn-sm btn-success btn-icon-split">
        <span class="icon text-white-40">
            <i class="fa fa-fw fa-cog" aria-hidden="true"></i>
        </span>
        <span class="text">
        <%= issue.status %>
        </span>
        </button>
        </td>
    <% } if (issue.status == 'Closed') { %>
            <button class="btn btn-sm btn-danger btn-icon-split">
            <span class="icon text-white-40">
                <i class="fa fa-check-circle" aria-hidden="true"></i>
            </span>
            <span class="text">
                <%= issue.status %>
            </span>
            </button>
            </td>
        <% } %>
    </h5>
    <p class="card-text">
    <% if (issue.type == 'Bug') { %>
                <button class="btn btn-sm btn-danger btn-round"><%= issue.type %></button>
        <% } if (issue.type == 'Feature') { %>
                    <button class="btn btn-sm btn-warning btn-round"><%= issue.type %></button>

            <% } if (issue.type == 'Discussion') { %>
                        <button class="btn btn-sm btn-info btn-round"><%= issue.type %></button>
                <% } %>
    &nbsp;
<% if (issue.priority == 'None') { %>
            <button class="btn btn-sm btn-info btn-round"><%= issue.priority %></button>
    <% } if (issue.priority == 'Low') { %>
                <button class="btn btn-sm btn-success btn-round"><%= issue.priority %></button>
        <% } if (issue.priority == 'Medium') { %>
                    <button class="btn btn-sm btn-warning btn-round"><%= issue.priority %></button>
            <% } if (issue.priority == 'High') { %>
                        <button class="btn btn-sm btn-danger btn-round"><%= issue.priority %></button>
                <% } %>
    <p class="mt-4"><%- issue.description %></p>
    </p>
    <hr/>
    <p class="text-sm"> Created <%= moment(issue.createdAt).fromNow() %> by <a href="/users/<%= issue.user._id %>"><%= issue.user.username %></a>

<% if (issue.createdAt.toString() != issue.updatedAt.toString()) { %>
            <p class="text-sm"> (Edited <%= moment(issue.updatedAt).fromNow() %>) %>
        <% } %>
    </div>
    </div>

    <%- include('comment') %>
