## mako

<%! main_css = "style-discussion-main" %>

<%page expression_filter="h"/>
<%inherit file="../main.html" />
<%namespace name='static' file='../static_content.html'/>
<%!
from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs
from openedx.core.djangolib.js_utils import (
    dump_js_escaped_json, js_escaped_string
)
%>

<%block name="bodyclass">discussion-user-profile</%block>
<%block name="pagetitle">${_("Discussion - {course_number}").format(course_number=course.display_number_with_default)}</%block>

<%block name="headextra">
<%include file="_js_head_dependencies.html" />
</%block>

<%block name="js_extra">
<%include file="_js_body_dependencies.html" />

<%static:require_module module_name="discussion/js/discussion_profile_page_factory" class_name="DiscussionProfilePageFactory">
    <%
    profile_page_context = {
        'courseId': unicode(course.id),
        'courseName': course.display_name_with_default,
        'userInfo': user_info,
        'threads': threads,
        'page': page,
        'numPages': num_pages,
    }
    %>
    DiscussionProfilePageFactory(_.extend(
        {
            $el: $('.discussion-user-threads')
        },
        ${profile_page_context | n, dump_js_escaped_json}
    ));
</%static:require_module>
</%block>

<%include file="../courseware/course_navigation.html" args="active_page='discussion'" />

<section class="container">
    <header class="page-header">
        <div class="page-header-main">
            <div class="sr-is-focusable" tabindex="-1"></div>
            <h2 class="hd hd-2 page-title">${_("Discussion")}</h2>
        </div>
    </header>
    <div class="page-content">
        <div class="layout layout-1t2t">
            <aside class="forum-nav layout-col layout-col-a" role="complementary" aria-label="${_("Discussion thread list")}">
                <nav class="user-profile" aria-label="${_('User Profile')}">

                    <article class="sidebar-module discussion-sidebar">
                        <%include file="_user_profile.html" />
                    </article>

                </nav>
            </aside>

            <main id="main" aria-label="Content" tabindex="-1" class="discussion-column layout-col layout-col-b">
                <div class="course-content discussion-user-threads" data-course-id="${course.id}"
                     data-course-name="${course.display_name_with_default}"
                     data-threads="${threads}" data-user-info="${user_info}"
                     data-page="${page}" data-num-pages="${num_pages}">
                </div>
            </main>
        </div>
    </div>
</section>

<%include file="_underscore_templates.html" />
