Commit 15d77fda by Peter Fogg

Hide due/release dates on course outline in Studio.

ECOM-2443
parent dc7f09fc
...@@ -584,6 +584,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', ...@@ -584,6 +584,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
editors.push(VerificationAccessEditor); editors.push(VerificationAccessEditor);
} }
} }
/* globals course */
if (course.get('self_paced')) {
editors = _.without(editors, ReleaseDateEditor, DueDateEditor);
}
return new SettingsXBlockModal($.extend({ return new SettingsXBlockModal($.extend({
editors: editors, editors: editors,
model: xblockInfo model: xblockInfo
......
...@@ -89,6 +89,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo ...@@ -89,6 +89,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo
}, true); }, true);
defaultNewChildName = childInfo.display_name; defaultNewChildName = childInfo.display_name;
} }
/* globals course */
return { return {
xblockInfo: xblockInfo, xblockInfo: xblockInfo,
visibilityClass: XBlockViewUtils.getXBlockVisibilityClass(xblockInfo.get('visibility_state')), visibilityClass: XBlockViewUtils.getXBlockVisibilityClass(xblockInfo.get('visibility_state')),
...@@ -104,7 +105,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo ...@@ -104,7 +105,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo
isCollapsed: isCollapsed, isCollapsed: isCollapsed,
includesChildren: this.shouldRenderChildren(), includesChildren: this.shouldRenderChildren(),
hasExplicitStaffLock: this.model.get('has_explicit_staff_lock'), hasExplicitStaffLock: this.model.get('has_explicit_staff_lock'),
staffOnlyMessage: this.model.get('staff_only_message') staffOnlyMessage: this.model.get('staff_only_message'),
course: course
}; };
}, },
......
...@@ -85,7 +85,8 @@ import json ...@@ -85,7 +85,8 @@ import json
org: "${context_course.location.org | h}", org: "${context_course.location.org | h}",
num: "${context_course.location.course | h}", num: "${context_course.location.course | h}",
display_course_number: "${_(context_course.display_coursenumber)}", display_course_number: "${_(context_course.display_coursenumber)}",
revision: "${context_course.location.revision | h}" revision: "${context_course.location.revision | h}",
self_paced: ${json.dumps(context_course.self_paced)}
}); });
}); });
% endif % endif
......
...@@ -113,18 +113,20 @@ if (xblockInfo.get('graded')) { ...@@ -113,18 +113,20 @@ if (xblockInfo.get('graded')) {
<p> <p>
<span class="sr status-release-label"><%= gettext('Release Status:') %></span> <span class="sr status-release-label"><%= gettext('Release Status:') %></span>
<span class="status-release-value"> <span class="status-release-value">
<% if (xblockInfo.get('released_to_students')) { %> <% if (!course.get('self_paced')) { %>
<i class="icon fa fa-check-square-o"></i> <% if (xblockInfo.get('released_to_students')) { %>
<%= gettext('Released:') %> <i class="icon fa fa-check-square-o"></i>
<% } else if (xblockInfo.get('release_date')) { %> <%= gettext('Released:') %>
<i class="icon fa fa-clock-o"></i> <% } else if (xblockInfo.get('release_date')) { %>
<%= gettext('Scheduled:') %> <i class="icon fa fa-clock-o"></i>
<% } else { %> <%= gettext('Scheduled:') %>
<i class="icon fa fa-clock-o"></i> <% } else { %>
<%= gettext('Unscheduled') %> <i class="icon fa fa-clock-o"></i>
<% } %> <%= gettext('Unscheduled') %>
<% if (xblockInfo.get('release_date')) { %> <% } %>
<%= xblockInfo.get('release_date') %> <% if (xblockInfo.get('release_date')) { %>
<%= xblockInfo.get('release_date') %>
<% } %>
<% } %> <% } %>
</span> </span>
</p> </p>
......
...@@ -1752,3 +1752,53 @@ class DeprecationWarningMessageTest(CourseOutlineTest): ...@@ -1752,3 +1752,53 @@ class DeprecationWarningMessageTest(CourseOutlineTest):
components_present=True, components_present=True,
components_display_name_list=['Open', 'Peer'] components_display_name_list=['Open', 'Peer']
) )
class SelfPacedOutlineTest(CourseOutlineTest):
"""Test the course outline for a self-paced course."""
def populate_course_fixture(self, course_fixture):
course_fixture.add_children(
XBlockFixtureDesc('chapter', SECTION_NAME).add_children(
XBlockFixtureDesc('sequential', SUBSECTION_NAME).add_children(
XBlockFixtureDesc('vertical', UNIT_NAME)
)
),
)
self.course_fixture.add_course_details({'self_paced': True})
def test_release_dates_not_shown(self):
"""
Scenario: Ensure that block release dates are not shown on the
course outline page of a self-paced course.
Given I am the author of a self-paced course
When I go to the course outline
Then I should not see release dates for course content
"""
self.course_outline_page.visit()
section = self.course_outline_page.section(SECTION_NAME)
self.assertEqual(section.release_date, '')
subsection = section.subsection(SUBSECTION_NAME)
self.assertEqual(subsection.release_date, '')
def test_edit_section_and_subsection(self):
"""
Scenario: Ensure that block release/due dates are not shown
in their settings modals.
Given I am the author of a self-paced course
When I go to the course outline
And I click on settings for a section or subsection
Then I should not see release or due date settings
"""
self.course_outline_page.visit()
section = self.course_outline_page.section(SECTION_NAME)
modal = section.edit()
self.assertFalse(modal.has_release_date())
self.assertFalse(modal.has_due_date())
modal.cancel()
subsection = section.subsection(SUBSECTION_NAME)
modal = subsection.edit()
self.assertFalse(modal.has_release_date())
self.assertFalse(modal.has_due_date())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment