<script type="text/template" id="thread-template">
    <article class="discussion-article" data-id="${'<%- id %>'}">
        <div class="local"><a href="javascript:void(0)" class="dogear action-follow"></a></div>
        <div class="discussion-post local">
            <header>
                <a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}</span></a>
                <h1>${'<%- title %>'}</h1>
                <p class="posted-details">
                    <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by
                    <a href="${'<%- user_url %>'}">${'<%- username %>'}</a>
                    <span class="post-status-closed top-post-status" style="display: none">
                      &bull; This thread is closed.
                    </span>
                </p>
            </header>

            <div class="post-body">
                ${'<%- body %>'}
            </div>
            ${'<% if (obj.courseware_location) { %>'}
            <div class="post-context">
                (this post is about <a href="../../jump_to/${'<%- courseware_location %>'}">${'<%- courseware_title %>'}</a>)
            </div>
            ${'<% } %>'}

            <ul class="moderator-actions">
                <li style="display: none"><a class="action-edit" href="javascript:void(0)"><span class="edit-icon"></span> Edit</a></li>
                <li style="display: none"><a class="action-delete" href="javascript:void(0)"><span class="delete-icon"></span> Delete</a></li>
                <li style="display: none"><a class="action-openclose" href="javascript:void(0)"><span class="edit-icon"></span> Close</a></li>
            </ul>
        </div>
        <ol class="responses">
            <li class="loading"><div class="loading-animation"></div></li>
        </ol>
        <div class="local post-status-closed bottom-post-status" style="display: none">
          This thread is closed.
        </div>
        <form class="local discussion-reply-new" data-id="${'<%- id %>'}">
            <h4>Post a response:</h4>
            <ul class="discussion-errors"></ul>
            <div class="reply-body" data-id="${'<%- id %>'}"></div>
            <div class="reply-post-control">
                <a class="discussion-submit-post control-button" href="#">Submit</a>
            </div>
        </form>
    </article>
</script>

<script type="text/template" id="thread-response-template">
    <header class="response-local">
        <a href="javascript:void(0)" class="vote-btn" data-tooltip="vote"><span class="plus-icon"></span><span class="votes-count-number">${"<%- votes['up_count'] %>"}</span></a>
        <a href="javascript:void(0)" class="endorse-btn${'<% if (endorsed) { %> is-endorsed<% } %>'} action-endorse" style="cursor: default" data-tooltip="endorse"><span class="check-icon" style="pointer-events: none; "></span></a>
        <a href="${'<%- user_url %>'}" class="posted-by">${"<%- username %>"}</a>
        <p class="posted-details" title="${'<%- created_at %>'}">${'<%- created_at %>'}</p>
    </header>
    <div class="response-local"><div class="response-body">${"<%- body %>"}</div></div>
    <ul class="moderator-actions response-local">
        <li style="display: none"><a class="action-edit" href="javascript:void(0)"><span class="edit-icon"></span> Edit</a></li>
        <li style="display: none"><a class="action-delete" href="javascript:void(0)"><span class="delete-icon"></span> Delete</a></li>
        <li style="display: none"><a class="action-openclose" href="javascript:void(0)"><span class="edit-icon"></span> Close</a></li>
    </ul>
    <ol class="comments">
        <li class="response-local">
            <form class="comment-form">
                <input type="text" placeholder="Comment&hellip;" class="comment-form-input">
            </form>
        </li>
    </ol>
</script>

<script type="text/template" id="response-comment-template">
  <p><span class="response-body">${'<%- body %>'}</span><span class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by <a href="${'<%- user_url %>'}">${'<%- username %>'}</a></span></p>
</script>

<script type="text/template" id="thread-list-item-template">
    <a href="${'<%- id %>'}" data-id="${'<%- id %>'}"><span class="title">${"<%- title %>"}</span> <span class="comments-count">${"<%- comments_count %>"}</span><span class="votes-count">+${"<%- votes['up_count'] %>"}</span></a>
</script>
