%page args="section_data"/>
<%namespace name='static' file='../../static_content.html'/>
<%!
from django.utils.translation import ugettext as _
from courseware.courses import get_studio_url
from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_user_partition
%>
<%block name="js_extra">
<%static:require_module module_name="js/groups/views/cohorts_dashboard_factory" class_name="CohortsFactory">
<%
cohorted_user_partition = get_cohorted_user_partition(course)
content_groups = cohorted_user_partition.groups if cohorted_user_partition else []
%>
var cohortUserPartitionId = ${cohorted_user_partition.id if cohorted_user_partition else 'null'},
contentGroups = [
% for content_group in content_groups:
{
id: ${content_group.id},
name: "${content_group.name | h}",
user_partition_id: cohortUserPartitionId
},
% endfor
];
CohortsFactory(contentGroups, '${get_studio_url(course, 'group_configurations') | h}');
%static:require_module>
%block>