Change content groups message when in a CCX
This commit is contained in:
@@ -486,10 +486,12 @@ def _section_membership(course, access, is_white_label):
|
||||
def _section_cohort_management(course, access):
|
||||
""" Provide data for the corresponding cohort management section """
|
||||
course_key = course.id
|
||||
ccx_enabled = hasattr(course_key, 'ccx')
|
||||
section_data = {
|
||||
'section_key': 'cohort_management',
|
||||
'section_display_name': _('Cohorts'),
|
||||
'access': access,
|
||||
'ccx_is_enabled': ccx_enabled,
|
||||
'course_cohort_settings_url': reverse(
|
||||
'course_cohort_settings',
|
||||
kwargs={'course_key_string': unicode(course_key)}
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
cohort: this.model,
|
||||
isDefaultCohort: this.isDefault(this.model.get('name')),
|
||||
contentGroups: this.contentGroups,
|
||||
studioGroupConfigurationsUrl: this.context.studioGroupConfigurationsUrl
|
||||
studioGroupConfigurationsUrl: this.context.studioGroupConfigurationsUrl,
|
||||
isCcxEnabled: this.context.isCcxEnabled
|
||||
}));
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
discussionTopicsSettingsModel: discussionTopicsSettings,
|
||||
uploadCohortsCsvUrl: cohortManagementElement.data('upload_cohorts_csv_url'),
|
||||
verifiedTrackCohortingUrl: cohortManagementElement.data('verified_track_cohorting_url'),
|
||||
studioGroupConfigurationsUrl: studioGroupConfigurationsUrl
|
||||
studioGroupConfigurationsUrl: studioGroupConfigurationsUrl,
|
||||
isCcxEnabled: cohortManagementElement.data('is_ccx_enabled')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
var cohort_name = cohort.get('name');
|
||||
var cohort_name_value = isNewCohort ? '' : cohort_name;
|
||||
var placeholder_value = isNewCohort ? gettext('Enter the name of the cohort') : '';
|
||||
|
||||
%>
|
||||
<div class="form-field">
|
||||
<div class="cohort-management-settings-form-name field field-text">
|
||||
@@ -126,7 +125,11 @@
|
||||
}
|
||||
)
|
||||
%>
|
||||
<a class="link-to-group-settings" href="<%- studioGroupConfigurationsUrl %>"><%- gettext("Create a content group") %></a>
|
||||
<% if (isCcxEnabled) { %>
|
||||
<%- gettext("Only the parent course staff of a CCX can create content groups.") %>
|
||||
<% } else { %>
|
||||
<a class="link-to-group-settings" href="<%- studioGroupConfigurationsUrl %>"><%- gettext("Create a content group") %></a>
|
||||
<% } %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,7 @@ from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_
|
||||
data-course_cohort_settings_url="${section_data['course_cohort_settings_url']}"
|
||||
data-discussion-topics-url="${section_data['discussion_topics_url']}"
|
||||
data-verified_track_cohorting_url="${section_data['verified_track_cohorting_url']}"
|
||||
data-is_ccx_enabled="${'true' if section_data['ccx_is_enabled'] else 'false'}"
|
||||
>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user