diff --git a/cms/djangoapps/contentstore/features/checklists.feature b/cms/djangoapps/contentstore/features/checklists.feature deleted file mode 100644 index c2b411adf0..0000000000 --- a/cms/djangoapps/contentstore/features/checklists.feature +++ /dev/null @@ -1,33 +0,0 @@ -@shard_1 -Feature: CMS.Course checklists - - Scenario: A course author sees checklists defined by edX - Given I have opened a new course in Studio - When I select Checklists from the Tools menu - Then I see the four default edX checklists - - Scenario: A course author can mark tasks as complete - Given I have opened Checklists - Then I can check and uncheck tasks in a checklist - And I reload the page - Then the tasks are correctly selected - - # There are issues getting link to be active in browsers other than chrome - @skip_firefox - @skip_internetexplorer - @skip_safari - Scenario: A task can link to a location within Studio - Given I have opened Checklists - When I select a link to the course outline - Then I am brought to the course outline page - And I press the browser back button - Then I am brought back to the course outline in the correct state - - # There are issues getting link to be active in browsers other than chrome - @skip_firefox - @skip_internetexplorer - @skip_safari - Scenario: A task can link to a location outside Studio - Given I have opened Checklists - When I select a link to help page - Then I am brought to the help page in a new window diff --git a/cms/djangoapps/contentstore/features/checklists.py b/cms/djangoapps/contentstore/features/checklists.py deleted file mode 100644 index 4e246a7517..0000000000 --- a/cms/djangoapps/contentstore/features/checklists.py +++ /dev/null @@ -1,125 +0,0 @@ -# pylint: disable=missing-docstring -# pylint: disable=redefined-outer-name - -from lettuce import world, step -from nose.tools import assert_true, assert_equal -from selenium.common.exceptions import StaleElementReferenceException - - -############### ACTIONS #################### -@step('I select Checklists from the Tools menu$') -def i_select_checklists(step): - world.click_tools() - link_css = 'li.nav-course-tools-checklists a' - world.css_click(link_css) - world.wait_for_ajax_complete() - - -@step('I have opened Checklists$') -def i_have_opened_checklists(step): - step.given('I have opened a new course in Studio') - step.given('I select Checklists from the Tools menu') - - -@step('I see the four default edX checklists$') -def i_see_default_checklists(step): - checklists = world.css_find('.checklist-title') - assert_equal(4, len(checklists)) - assert_true(checklists[0].text.endswith('Getting Started With Studio')) - assert_true(checklists[1].text.endswith('Draft a Rough Course Outline')) - assert_true(checklists[2].text.endswith("Explore edX\'s Support Tools")) - assert_true(checklists[3].text.endswith('Draft Your Course About Page')) - - -@step('I can check and uncheck tasks in a checklist$') -def i_can_check_and_uncheck_tasks(step): - # Use the 2nd checklist as a reference - verifyChecklist2Status(0, 7, 0) - toggleTask(1, 0) - verifyChecklist2Status(1, 7, 14) - toggleTask(1, 3) - verifyChecklist2Status(2, 7, 29) - toggleTask(1, 6) - verifyChecklist2Status(3, 7, 43) - toggleTask(1, 3) - verifyChecklist2Status(2, 7, 29) - - -@step('the tasks are correctly selected$') -def tasks_correctly_selected(step): - verifyChecklist2Status(2, 7, 29) - # verify that task 7 is still selected by toggling its checkbox state and making sure that it deselects - world.browser.execute_script("window.scrollBy(0,1000)") - toggleTask(1, 6) - verifyChecklist2Status(1, 7, 14) - - -@step('I select a link to the course outline$') -def i_select_a_link_to_the_course_outline(step): - clickActionLink(1, 0, 'Edit Course Outline') - - -@step('I am brought to the course outline page$') -def i_am_brought_to_course_outline(step): - assert world.is_css_present('body.view-outline') - assert_equal(1, len(world.browser.windows)) - - -@step('I am brought back to the course outline in the correct state$') -def i_am_brought_back_to_course_outline(step): - step.given('I see the four default edX checklists') - # In a previous step, we selected (1, 0) in order to click the 'Edit Course Outline' link. - # Make sure the task is still showing as selected (there was a caching bug with the collection). - verifyChecklist2Status(1, 7, 14) - - -@step('I select a link to help page$') -def i_select_a_link_to_the_help_page(step): - clickActionLink(2, 0, 'Visit Studio Help') - - -@step('I am brought to the help page in a new window$') -def i_am_brought_to_help_page_in_new_window(step): - step.given('I see the four default edX checklists') - windows = world.browser.windows - assert_equal(2, len(windows)) - world.browser.switch_to_window(windows[1]) - assert_equal('http://help.edge.edx.org/', world.browser.url) - - -############### HELPER METHODS #################### -def verifyChecklist2Status(completed, total, percentage): - def verify_count(driver): - try: - statusCount = world.css_find('#course-checklist1 .status-count').first - return statusCount.text == str(completed) - except StaleElementReferenceException: - return False - - world.wait_for(verify_count) - assert_equal(str(total), world.css_find('#course-checklist1 .status-amount').first.text) - # Would like to check the CSS width, but not sure how to do that. - assert_equal(str(percentage), world.css_find('#course-checklist1 .viz-checklist-status-value .int').first.text) - - -def toggleTask(checklist, task): - world.css_click('#course-checklist' + str(checklist) + '-task' + str(task)) - world.wait_for_ajax_complete() - - -# TODO: figure out a way to do this in phantom and firefox -# For now we will mark the scenerios that use this method as skipped -def clickActionLink(checklist, task, actionText): - # text will be empty initially, wait for it to populate - def verify_action_link_text(driver): - actualText = world.css_text('#course-checklist' + str(checklist) + ' a', index=task) - if actualText == actionText: - return True - else: - # toggle checklist item to make sure that the link button is showing - toggleTask(checklist, task) - return False - - world.wait_for(verify_action_link_text) - world.css_click('#course-checklist' + str(checklist) + ' a', index=task) - world.wait_for_ajax_complete() diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 5e1aabb791..828a09f53d 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -1510,7 +1510,6 @@ class ContentStoreTest(ContentStoreTestCase, XssTestMixin): test_get_html('export_handler') test_get_html('course_team_handler') test_get_html('course_info_handler') - test_get_html('checklists_handler') test_get_html('assets_handler') test_get_html('tabs_handler') test_get_html('settings_handler') @@ -1694,7 +1693,6 @@ class ContentStoreTest(ContentStoreTestCase, XssTestMixin): self.assertEqual(course.textbooks, []) self.assertIn('GRADER', course.grading_policy) self.assertIn('GRADE_CUTOFFS', course.grading_policy) - self.assertGreaterEqual(len(course.checklists), 4) # by fetching fetched_course = self.store.get_item(course.location) @@ -1703,8 +1701,6 @@ class ContentStoreTest(ContentStoreTestCase, XssTestMixin): self.assertEqual(course.start, fetched_course.start) self.assertEqual(fetched_course.start, fetched_item.start) self.assertEqual(course.textbooks, fetched_course.textbooks) - # is this test too strict? i.e., it requires the dicts to be == - self.assertEqual(course.checklists, fetched_course.checklists) def test_image_import(self): """Test backwards compatibilty of course image.""" diff --git a/cms/djangoapps/contentstore/views/__init__.py b/cms/djangoapps/contentstore/views/__init__.py index 2ab6283322..ae2b317657 100644 --- a/cms/djangoapps/contentstore/views/__init__.py +++ b/cms/djangoapps/contentstore/views/__init__.py @@ -5,7 +5,6 @@ # Disable warnings about import from wildcard # All files below declare exports with __all__ from .assets import * -from .checklist import * from .component import * from .course import * from .entrance_exam import * diff --git a/cms/djangoapps/contentstore/views/checklist.py b/cms/djangoapps/contentstore/views/checklist.py deleted file mode 100644 index cb315d6b30..0000000000 --- a/cms/djangoapps/contentstore/views/checklist.py +++ /dev/null @@ -1,142 +0,0 @@ -import json -import copy - -from util.json_request import JsonResponse -from django.http import HttpResponseBadRequest -from django.contrib.auth.decorators import login_required -from django.views.decorators.http import require_http_methods -from django.views.decorators.csrf import ensure_csrf_cookie -from edxmako.shortcuts import render_to_response -from django.http import HttpResponseNotFound -from django.core.exceptions import PermissionDenied -from opaque_keys.edx.keys import CourseKey -from xmodule.modulestore.django import modulestore -from contentstore.utils import reverse_course_url - -from student.auth import has_course_author_access -from xmodule.course_module import CourseDescriptor - -from django.utils.translation import ugettext - -__all__ = ['checklists_handler'] - - -@require_http_methods(("GET", "POST", "PUT")) -@login_required -@ensure_csrf_cookie -def checklists_handler(request, course_key_string, checklist_index=None): - """ - The restful handler for checklists. - - GET - html: return html page for all checklists - json: return json representing all checklists. checklist_index is not supported for GET at this time. - POST or PUT - json: updates the checked state for items within a particular checklist. checklist_index is required. - """ - course_key = CourseKey.from_string(course_key_string) - if not has_course_author_access(request.user, course_key): - raise PermissionDenied() - - course_module = modulestore().get_course(course_key) - - json_request = 'application/json' in request.META.get('HTTP_ACCEPT', 'application/json') - if request.method == 'GET': - # If course was created before checklists were introduced, copy them over - # from the template. - if not course_module.checklists: - course_module.checklists = CourseDescriptor.checklists.default - modulestore().update_item(course_module, request.user.id) - - expanded_checklists = expand_all_action_urls(course_module) - if json_request: - return JsonResponse(expanded_checklists) - else: - handler_url = reverse_course_url('checklists_handler', course_key) - return render_to_response('checklists.html', - { - 'handler_url': handler_url, - # context_course is used by analytics - 'context_course': course_module, - 'checklists': expanded_checklists - }) - elif json_request: - # Can now assume POST or PUT because GET handled above. - if checklist_index is not None and 0 <= int(checklist_index) < len(course_module.checklists): - index = int(checklist_index) - persisted_checklist = course_module.checklists[index] - modified_checklist = json.loads(request.body) - # Only thing the user can modify is the "checked" state. - # We don't want to persist what comes back from the client because it will - # include the expanded action URLs (which are non-portable). - for item_index, item in enumerate(modified_checklist.get('items')): - persisted_checklist['items'][item_index]['is_checked'] = item['is_checked'] - # seeming noop which triggers kvs to record that the metadata is - # not default - course_module.checklists = course_module.checklists - course_module.save() - modulestore().update_item(course_module, request.user.id) - expanded_checklist = expand_checklist_action_url(course_module, persisted_checklist) - return JsonResponse(localize_checklist_text(expanded_checklist)) - else: - return HttpResponseBadRequest( - ("Could not save checklist state because the checklist index " - "was out of range or unspecified."), - content_type="text/plain" - ) - else: - return HttpResponseNotFound() - - -def expand_all_action_urls(course_module): - """ - Gets the checklists out of the course module and expands their action urls. - - Returns a copy of the checklists with modified urls, without modifying the persisted version - of the checklists. - """ - expanded_checklists = [] - for checklist in course_module.checklists: - expanded_checklists.append(localize_checklist_text(expand_checklist_action_url(course_module, checklist))) - return expanded_checklists - - -def expand_checklist_action_url(course_module, checklist): - """ - Expands the action URLs for a given checklist and returns the modified version. - - The method does a copy of the input checklist and does not modify the input argument. - """ - expanded_checklist = copy.deepcopy(checklist) - - urlconf_map = { - "ManageUsers": "course_team_handler", - "CourseOutline": "course_handler", - "SettingsDetails": "settings_handler", - "SettingsGrading": "grading_handler", - } - - for item in expanded_checklist.get('items'): - action_url = item.get('action_url') - if action_url in urlconf_map: - item['action_url'] = reverse_course_url(urlconf_map[action_url], course_module.id) - - return expanded_checklist - - -def localize_checklist_text(checklist): - """ - Localize texts for a given checklist and returns the modified version. - - The method does an in-place operation so the input checklist is modified directly. - """ - # Localize checklist name - checklist['short_description'] = ugettext(checklist['short_description']) # pylint: disable=translation-of-non-string - - # Localize checklist items - for item in checklist.get('items'): - item['short_description'] = ugettext(item['short_description']) # pylint: disable=translation-of-non-string - item['long_description'] = ugettext(item['long_description']) # pylint: disable=translation-of-non-string - item['action_text'] = ugettext(item['action_text']) # pylint: disable=translation-of-non-string - - return checklist diff --git a/cms/djangoapps/contentstore/views/tests/test_checklists.py b/cms/djangoapps/contentstore/views/tests/test_checklists.py deleted file mode 100644 index 17ce2e889a..0000000000 --- a/cms/djangoapps/contentstore/views/tests/test_checklists.py +++ /dev/null @@ -1,153 +0,0 @@ -""" Unit tests for checklist methods in views.py. """ -from contentstore.utils import reverse_course_url -from contentstore.views.checklist import expand_checklist_action_url -from xmodule.modulestore.tests.factories import CourseFactory -from xmodule.modulestore.django import modulestore - -import json -from contentstore.tests.utils import CourseTestCase - - -class ChecklistTestCase(CourseTestCase): - """ Test for checklist get and put methods. """ - def setUp(self): - """ Creates the test course. """ - super(ChecklistTestCase, self).setUp() - self.course = CourseFactory.create(org='mitX', number='333', display_name='Checklists Course') - self.checklists_url = self.get_url() - - def get_url(self, checklist_index=None): - url_args = {'checklist_index': checklist_index} if checklist_index else None - return reverse_course_url('checklists_handler', self.course.id, kwargs=url_args) - - def get_persisted_checklists(self): - """ Returns the checklists as persisted in the modulestore. """ - return modulestore().get_item(self.course.location).checklists - - def compare_checklists(self, persisted, request): - """ - Handles url expansion as possible difference and descends into guts - """ - self.assertEqual(persisted['short_description'], request['short_description']) - expanded_checklist = expand_checklist_action_url(self.course, persisted) - for pers, req in zip(expanded_checklist['items'], request['items']): - self.assertEqual(pers['short_description'], req['short_description']) - self.assertEqual(pers['long_description'], req['long_description']) - self.assertEqual(pers['is_checked'], req['is_checked']) - self.assertEqual(pers['action_url'], req['action_url']) - self.assertEqual(pers['action_text'], req['action_text']) - self.assertEqual(pers['action_external'], req['action_external']) - - def test_get_checklists(self): - """ Tests the get checklists method and URL expansion. """ - response = self.client.get(self.checklists_url) - self.assertContains(response, "Getting Started With Studio") - # Verify expansion of action URL happened. - self.assertContains(response, 'course_team/mitX/333/Checklists_Course') - # Verify persisted checklist does NOT have expanded URL. - checklist_0 = self.get_persisted_checklists()[0] - self.assertEqual('ManageUsers', get_action_url(checklist_0, 0)) - payload = response.content - - # Now delete the checklists from the course and verify they get repopulated (for courses - # created before checklists were introduced). - self.course.checklists = None - # Save the changed `checklists` to the underlying KeyValueStore before updating the modulestore - self.course.save() - modulestore().update_item(self.course, self.user.id) - self.assertEqual(self.get_persisted_checklists(), None) - response = self.client.get(self.checklists_url) - self.assertEqual(payload, response.content) - - def test_get_checklists_html(self): - """ Tests getting the HTML template for the checklists page). """ - response = self.client.get(self.checklists_url, HTTP_ACCEPT='text/html') - self.assertContains(response, "Getting Started With Studio") - # The HTML generated will define the handler URL (for use by the Backbone model). - self.assertContains(response, self.checklists_url) - - def test_update_checklists_no_index(self): - """ No checklist index, should return all of them. """ - returned_checklists = json.loads(self.client.get(self.checklists_url).content) - # Verify that persisted checklists do not have expanded action URLs. - # compare_checklists will verify that returned_checklists DO have expanded action URLs. - pers = self.get_persisted_checklists() - self.assertEqual('CourseOutline', get_first_item(pers[1]).get('action_url')) - for pay, resp in zip(pers, returned_checklists): - self.compare_checklists(pay, resp) - - def test_update_checklists_index_ignored_on_get(self): - """ Checklist index ignored on get. """ - update_url = self.get_url(1) - - returned_checklists = json.loads(self.client.get(update_url).content) - for pay, resp in zip(self.get_persisted_checklists(), returned_checklists): - self.compare_checklists(pay, resp) - - def test_update_checklists_post_no_index(self): - """ No checklist index, will error on post. """ - response = self.client.post(self.checklists_url) - self.assertContains(response, 'Could not save checklist', status_code=400) - - def test_update_checklists_index_out_of_range(self): - """ Checklist index out of range, will error on post. """ - update_url = self.get_url(100) - - response = self.client.post(update_url) - self.assertContains(response, 'Could not save checklist', status_code=400) - - def test_update_checklists_index(self): - """ Check that an update of a particular checklist works. """ - update_url = self.get_url(1) - - payload = self.course.checklists[1] - self.assertFalse(get_first_item(payload).get('is_checked')) - self.assertEqual('CourseOutline', get_first_item(payload).get('action_url')) - get_first_item(payload)['is_checked'] = True - - returned_checklist = json.loads(self.client.ajax_post(update_url, payload).content) - self.assertTrue(get_first_item(returned_checklist).get('is_checked')) - persisted_checklist = self.get_persisted_checklists()[1] - # Verify that persisted checklist does not have expanded action URLs. - # compare_checklists will verify that returned_checklist DOES have expanded action URLs. - self.assertEqual('CourseOutline', get_first_item(persisted_checklist).get('action_url')) - self.compare_checklists(persisted_checklist, returned_checklist) - - def test_update_checklists_delete_unsupported(self): - """ Delete operation is not supported. """ - update_url = self.get_url(100) - response = self.client.delete(update_url) - self.assertEqual(response.status_code, 405) - - def test_expand_checklist_action_url(self): - """ - Tests the method to expand checklist action url. - """ - - def test_expansion(checklist, index, stored, expanded): - """ - Tests that the expected expanded value is returned for the item at the given index. - - Also verifies that the original checklist is not modified. - """ - self.assertEqual(get_action_url(checklist, index), stored) - expanded_checklist = expand_checklist_action_url(self.course, checklist) - self.assertEqual(get_action_url(expanded_checklist, index), expanded) - # Verify no side effect in the original list. - self.assertEqual(get_action_url(checklist, index), stored) - - test_expansion(self.course.checklists[0], 0, 'ManageUsers', '/course_team/mitX/333/Checklists_Course') - test_expansion(self.course.checklists[1], 1, 'CourseOutline', '/course/mitX/333/Checklists_Course') - test_expansion(self.course.checklists[2], 0, 'http://help.edge.edx.org/', 'http://help.edge.edx.org/') - - -def get_first_item(checklist): - """ Returns the first item from the checklist. """ - return checklist['items'][0] - - -def get_action_url(checklist, index): - """ - Returns the action_url for the item at the specified index in the given checklist. - """ - return checklist['items'][index]['action_url'] diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index ef8129ecea..e92dfcf756 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -26,7 +26,6 @@ class CourseMetadata(object): 'enrollment_end', 'tabs', 'graceperiod', - 'checklists', 'show_timezone', 'format', 'graded', diff --git a/cms/static/cms/js/build.js b/cms/static/cms/js/build.js index 1b290554b5..f8481e443e 100644 --- a/cms/static/cms/js/build.js +++ b/cms/static/cms/js/build.js @@ -34,7 +34,6 @@ modules: getModulesList([ 'js/factories/asset_index', 'js/factories/base', - 'js/factories/checklists', 'js/factories/container', 'js/factories/course', 'js/factories/course_create_rerun', diff --git a/cms/static/js/collections/checklist.js b/cms/static/js/collections/checklist.js deleted file mode 100644 index 5117a5720c..0000000000 --- a/cms/static/js/collections/checklist.js +++ /dev/null @@ -1,23 +0,0 @@ -define(["backbone", "underscore", "js/models/checklist"], - function(Backbone, _, ChecklistModel) { - var ChecklistCollection = Backbone.Collection.extend({ - model : ChecklistModel, - - parse: function(response) { - _.each(response, - function( element, idx ) { - element.id = idx; - }); - - return response; - }, - - // Disable caching so the browser back button will work (checklists have links to other - // places within Studio). - fetch: function (options) { - options.cache = false; - return Backbone.Collection.prototype.fetch.call(this, options); - } - }); - return ChecklistCollection; -}); diff --git a/cms/static/js/factories/checklists.js b/cms/static/js/factories/checklists.js deleted file mode 100644 index d0cf812683..0000000000 --- a/cms/static/js/factories/checklists.js +++ /dev/null @@ -1,16 +0,0 @@ -define([ - 'jquery', 'js/collections/checklist', 'js/views/checklist' -], function($, ChecklistCollection, ChecklistView) { - 'use strict'; - return function (handlerUrl) { - var checklistCollection = new ChecklistCollection(), - editor; - - checklistCollection.url = handlerUrl; - editor = new ChecklistView({ - el: $('.course-checklists'), - collection: checklistCollection - }); - checklistCollection.fetch({reset: true}); - }; -}); diff --git a/cms/static/js/views/checklist.js b/cms/static/js/views/checklist.js deleted file mode 100644 index cd3e568a36..0000000000 --- a/cms/static/js/views/checklist.js +++ /dev/null @@ -1,93 +0,0 @@ -define(["js/views/baseview", "underscore", "jquery"], function(BaseView, _, $) { - var ChecklistView = BaseView.extend({ - // takes CMS.Models.Checklists as model - - events : { - 'click .course-checklist .checklist-title' : "toggleChecklist", - 'click .course-checklist .task input' : "toggleTask", - 'click a[rel="external"]' : "popup" - }, - - initialize : function() { - var self = this; - this.template = this.loadTemplate('checklist'); - this.collection.fetch({ - reset: true, - complete: function() { - self.render(); - } - }); - }, - - render: function() { - // catch potential outside call before template loaded - if (!this.template) return this; - - this.$el.empty(); - - var self = this; - _.each(this.collection.models, - function(checklist, index) { - self.$el.append(self.renderTemplate(checklist, index)); - }); - - return this; - }, - - renderTemplate: function (checklist, index) { - var checklistItems = checklist.attributes['items']; - var itemsChecked = 0; - _.each(checklistItems, - function(checklist) { - if (checklist['is_checked']) { - itemsChecked +=1; - } - }); - var percentChecked = Math.round((itemsChecked/checklistItems.length)*100); - return this.template({ - checklistIndex : index, - checklistShortDescription : checklist.attributes['short_description'], - items: checklistItems, - itemsChecked: itemsChecked, - percentChecked: percentChecked}); - }, - - toggleChecklist : function(e) { - e.preventDefault(); - $(e.target).closest('.course-checklist').toggleClass('is-collapsed'); - }, - - toggleTask : function (e) { - var self = this; - - var completed = 'is-completed'; - var $checkbox = $(e.target); - var $task = $checkbox.closest('.task'); - $task.toggleClass(completed); - - var checklist_index = $checkbox.data('checklist'); - var task_index = $checkbox.data('task'); - var model = this.collection.at(checklist_index); - model.attributes.items[task_index].is_checked = $task.hasClass(completed); - - model.save({}, - { - success : function() { - var updatedTemplate = self.renderTemplate(model, checklist_index); - self.$el.find('#course-checklist'+checklist_index).first().replaceWith(updatedTemplate); - - analytics.track('Toggled a Checklist Task', { - 'course': course_location_analytics, - 'task': model.attributes.items[task_index].short_description, - 'state': model.attributes.items[task_index].is_checked - }); - } - }); - }, - popup: function(e) { - e.preventDefault(); - window.open($(e.target).attr('href')); - } - }); - return ChecklistView; -}); diff --git a/cms/static/sass/_build.scss b/cms/static/sass/_build.scss index 2253926702..dcf8f2bc81 100644 --- a/cms/static/sass/_build.scss +++ b/cms/static/sass/_build.scss @@ -61,7 +61,6 @@ @import 'views/unit'; @import 'views/container'; @import 'views/users'; -@import 'views/checklists'; @import 'views/textbooks'; @import 'views/export-git'; @import 'views/group-configuration'; diff --git a/cms/static/sass/elements/_header.scss b/cms/static/sass/elements/_header.scss index 168b1881fd..e538dfd920 100644 --- a/cms/static/sass/elements/_header.scss +++ b/cms/static/sass/elements/_header.scss @@ -368,12 +368,10 @@ body.course.view-certificates .nav-course-settings-certificates, // course tools body.course.view-import .nav-course-tools .title, body.course.view-export .nav-course-tools .title, -body.course.view-checklists .nav-course-tools .title, body.course.view-export-git .nav-course-tools .title, body.course.view-import .nav-course-tools-import, body.course.view-export .nav-course-tools-export, -body.course.view-checklists .nav-course-tools-checklists, body.course.view-export-git .nav-course-tools-export-git, // content library settings diff --git a/cms/static/sass/views/_checklists.scss b/cms/static/sass/views/_checklists.scss deleted file mode 100644 index 5472806260..0000000000 --- a/cms/static/sass/views/_checklists.scss +++ /dev/null @@ -1,341 +0,0 @@ -// Studio - Course Settings -// ==================== - -.view-checklists { - - .content-primary, .content-supplementary { - @include box-sizing(border-box); - } - - .content-primary { - @extend .ui-col-wide; - } - - // checklists - general - .course-checklist { - @extend %ui-window; - margin: 0 0 ($baseline*2) 0; - - &:last-child { - margin-bottom: 0; - } - - // visual status - .viz-checklist-status { - @extend %cont-text-hide; - @include size(100%,($baseline/4)); - position: relative; - display: block; - margin: 0; - background: $gray-l4; - - .viz-checklist-status-value { - @include transition(width $tmg-s2 ease-in-out .25s); - position: absolute; - top: 0; - left: 0; - width: 0%; - height: ($baseline/4); - background: $green; - - .int { - @extend %cont-text-sr; - } - } - } - - - // header/title - header { - @include clearfix(); - box-shadow: inset 0 -1px 1px $shadow-l1; - margin-bottom: 0; - border-bottom: 1px solid $gray-l3; - padding: $baseline ($baseline*1.5); - - .checklist-title { - @include transition(color $tmg-f2 ease-in-out 0s); - width: flex-grid(6, 9); - margin: 0; - @include margin-right(flex-gutter()); - @include float(left); - - .ui-toggle-expansion { - @include transition(all $tmg-f2 ease-in-out 0s); - @extend %t-action1; - display: inline-block; - vertical-align: middle; - @include margin-right($baseline/2); - color: $gray-l4; - } - - &.is-selectable { - @extend %ui-fake-link; - - &:hover { - color: $blue; - - .ui-toggle-expansion { - color: $blue; - } - } - } - } - - .checklist-status { - @extend %t-copy-sub1; - width: flex-grid(3, 9); - @include float(right); - margin-top: ($baseline/2); - @include text-align(right); - color: $gray-l2; - - - .fa-check-square-o { - @extend %t-icon4; - display: inline-block; - margin-left: ($baseline/2); - color: $gray-l4; - } - - .status-count { - @extend %t-copy-base; - @extend %t-strong; - margin-left: ($baseline/4); - margin-right: ($baseline/4); - color: $gray-d3; - } - - .status-amount { - @extend %t-copy-base; - @extend %t-strong; - margin-left: ($baseline/4); - color: $gray-d3; - } - } - } - - // checklist actions - .course-checklist-actions { - @include clearfix(); - @include transition(border $tmg-f2 ease-in-out .25s); - box-shadow: inset 0 1px 1px $shadow-l1; - border-top: 1px solid $gray-l2; - padding: $baseline ($baseline*1.5); - background: $gray-l4; - - .action-primary { - @include green-button(); - @include float(left); - - .fa-plus { - @extend %t-icon7; - display: inline-block; - vertical-align: middle; - margin-right: ($baseline/4); - } - } - - .action-secondary { - @include grey-button(); - @extend %t-action3; - @extend %t-regular; - @include float(right); - - .fa-trash-o { - @extend %t-icon7; - display: inline-block; - vertical-align: middle; - margin-right: ($baseline/4); - } - } - } - - // state - collapsed - &.is-collapsed { - - header { - box-shadow: none; - - .checklist-title { - - .ui-toggle-expansion { - @include transform(rotate(-90deg)); - @include transform-origin(50% 50%); - } - } - } - - .list-tasks { - height: 0; - } - } - - // state - completed - &.is-completed { - - .viz-checklist-status { - - .viz-checklist-status-value { - width: 100%; - } - } - - header { - - .checklist-title, .fa-caret-down { - color: $green; - } - - .checklist-status { - - .status-count, .status-amount, .fa-check-square-o { - color: $green; - } - } - } - } - - // state - not available - .is-not-available { - - } - } - - // list of tasks - .list-tasks { - height: auto; - overflow: hidden; - - .task { - @include transition(background $tmg-f2 ease-in-out 0s, border $tmg-f3 ease-in-out 0s); - @include clearfix(); - position: relative; - border-top: 1px solid $white; - border-bottom: 1px solid $gray-l5; - padding: $baseline ($baseline*1.5); - background: $white; - opacity: 1.0; - - - &:last-child { - margin-bottom: 0; - border-bottom: none; - } - - .task-input { - display: inline-block; - vertical-align: text-top; - @include float(left); - margin-top: ($baseline/2); - @include margin-right(flex-gutter()); - } - - .task-details { - @extend %t-strong; - display: inline-block; - vertical-align: text-top; - @include float(left); - width: flex-grid(6,9); - - .task-name { - @include transition(color $tmg-f2 ease-in-out 0s); - @extend %ui-fake-link; - vertical-align: baseline; - margin-bottom: 0; - } - - .task-description { - @extend %t-copy-sub1; - @include transition(color $tmg-f2 ease-in-out 0s); - color: $gray-l2; - } - - .task-support { - @extend %t-copy-sub2; - @include transition(opacity $tmg-f2 ease-in-out 0s); - opacity: 0.0; - pointer-events: none; - } - } - - .task-actions { - @include transition(opacity $tmg-f2 ease-in-out $tmg-f2); - @include clearfix(); - display: inline-block; - vertical-align: middle; - @include float(right); - width: flex-grid(2,9); - margin: ($baseline/2) 0 0 flex-gutter(); - opacity: 0.0; - pointer-events: none; - text-align: right; - - .action-primary { - @extend %btn-primary-blue; - @extend %t-action3; - } - - .action-secondary { - @extend %t-action4; - margin-top: ($baseline/2); - } - } - - // state - hover - &:hover { - background: $blue-l5; - border-bottom-color: $blue-l4; - border-top-color: $blue-l4; - opacity: 1.0; - - .task-details { - - .task-support { - opacity: 1.0; - pointer-events: auto; - } - } - - .task-actions { - opacity: 1.0; - pointer-events: auto; - } - } - - - // state - completed - &.is-completed { - background: $gray-l6; - border-top-color: $gray-l5; - border-bottom-color: $gray-l5; - - .task-name { - color: $gray-l2; - } - - .task-actions { - - .action-primary { - @extend %btn-secondary-blue; - @extend %t-action3; - } - } - - &:hover { - background: $gray-l5; - border-bottom-color: $gray-l4; - border-top-color: $gray-l4; - - .task-details { - opacity:1.0; - } - } - } - } - } - - .content-supplementary { - @extend .ui-col-narrow; - } -} diff --git a/cms/templates/checklists.html b/cms/templates/checklists.html deleted file mode 100644 index db59bd7e2a..0000000000 --- a/cms/templates/checklists.html +++ /dev/null @@ -1,71 +0,0 @@ -<%inherit file="base.html" /> -<%def name="online_help_token()"><% return "checklist" %>%def> -<%! - from django.core.urlresolvers import reverse - from django.utils.translation import ugettext as _ -%> -<%block name="title">${_("Course Checklists")}%block> -<%block name="bodyclass">is-signedin course view-checklists%block> - -<%namespace name='static' file='static_content.html'/> - -<%block name="header_extras"> -% for template_name in ["checklist"]: - -% endfor -%block> - -<%block name="requirejs"> - require(["js/factories/checklists"], function (ChecklistsFactory) { - ChecklistsFactory("${handler_url}"); - }); -%block> - - -<%block name="content"> -