<div class="discussion-post">
    <header class="wrapper-post-header">
        <div class="post-header-content">
            <h1 class="post-title"><%- title %></h1>
            <p class="posted-details">
            <%
            var timeAgoHtml = interpolate(
                '<span class="timeago" title="%(created_at)s">%(created_at)s</span>',
                {created_at: created_at},
                true
            );
            %>
            <%=
            interpolate(
                // Translators: post_type describes the kind of post this is (e.g. "question" or "discussion");
                // time_ago is how much time has passed since the post was created (e.g. "4 hours ago")
                _.escape(gettext('%(post_type)s posted %(time_ago)s by %(author)s')),
                {post_type: thread_type, time_ago: timeAgoHtml, author: author_display},
                true
            )
            %>
            </p>
            <div class="post-labels">
                <span class="post-label-pinned"><i class="icon fa fa-thumb-tack"></i><%- gettext("Pinned") %></span>
                <span class="post-label-reported"><i class="icon fa fa-flag"></i><%- gettext("Reported") %></span>
                <span class="post-label-closed"><i class="icon fa fa-lock"></i><%- gettext("Closed") %></span>
            </div>
        </div>
        <% if (!readOnly) { %>
            <div class="post-header-actions post-extended-content">
                <%=
                _.template(
                    $('#forum-actions').html(),
                    {
                        contentId: cid,
                        contentType: 'post',
                        primaryActions: ['vote', 'follow'],
                        secondaryActions: ['pin', 'edit', 'delete', 'report', 'close'],
                        readOnly: readOnly
                    }
                )
                %>
            </div>
        <% } %>
    </header>

    <div class="post-body"><%- body %></div>
    <div class="post-context">
        <% if (mode == "tab" && obj.courseware_url) { %>
            <%
            var courseware_title_linked = interpolate(
                '<a href="%(courseware_url)s">%(courseware_title)s</a>',
                {courseware_url: courseware_url, courseware_title: _.escape(courseware_title)},
                true
            );
            %>
            <%=
            interpolate(
                _.escape(gettext('Related to: %(courseware_title_linked)s')),
                {courseware_title_linked: courseware_title_linked},
                true
            )
            %>
        <% } %>
        <div class="group-visibility-label">
            <% if (obj.group_name) { %>
                <%-
                interpolate(
                    gettext('This post is visible only to %(group_name)s.'),
                    {group_name: obj.group_name},
                    true
                )
                %>
            <% } else { %>
                <%- gettext('This post is visible to everyone.') %>
            <% } %>
        </div>
    </div>
</div>
