-
+
@@ -12,6 +16,9 @@
% elif state == 'incomplete':
% endif
+ % if hidden:
+
+ % endif
(${state})
diff --git a/common/lib/capa/templates/textinput.html b/common/lib/capa/templates/textinput.html
index 0ba27c6938..7f2f563b81 100644
--- a/common/lib/capa/templates/textinput.html
+++ b/common/lib/capa/templates/textinput.html
@@ -8,11 +8,17 @@
% elif state == 'incomplete':
% endif
+ % if hidden:
+
+ % endif
diff --git a/common/lib/capa/templates/textinput_dynamath.html b/common/lib/capa/templates/textinput_dynamath.html
index 2fc44c9d3e..9009deb682 100644
--- a/common/lib/capa/templates/textinput_dynamath.html
+++ b/common/lib/capa/templates/textinput_dynamath.html
@@ -10,9 +10,16 @@
% elif state == 'incomplete':
+ % endif
+ % if hidden:
+
% endif
-
+
% if state == 'unsubmitted':
From edeb81ce6347d11d7da523dd7dc8bc62175a8af7 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Wed, 4 Jul 2012 15:50:39 -0400
Subject: [PATCH 66/95] change 8.01x default chapter
---
lms/envs/dev_ike.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py
index 642ecf22d7..c70be74352 100644
--- a/lms/envs/dev_ike.py
+++ b/lms/envs/dev_ike.py
@@ -71,7 +71,7 @@ COURSE_SETTINGS = {'6.002x_Fall_2012': {'number' : '6.002x',
'xmlpath': '/8.01x/',
'github_url': 'https://github.com/MITx/8.01x',
'active': True,
- 'default_chapter' : 'MIT_8.011_Spring_2012',
+ 'default_chapter' : 'Mechanics_Online_Spring_2012',
'default_section' : 'Introduction_to_the_course',
},
'edx4edx': {'number' : 'edX.01',
From a5f3d8a9007d208d895c999ed422749754599853 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Wed, 4 Jul 2012 16:06:07 -0400
Subject: [PATCH 67/95] fix handling of tail in inputtypes.math (needed
saxutils.escape)
---
common/lib/capa/inputtypes.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/common/lib/capa/inputtypes.py b/common/lib/capa/inputtypes.py
index 54445af769..d7c0799f75 100644
--- a/common/lib/capa/inputtypes.py
+++ b/common/lib/capa/inputtypes.py
@@ -22,10 +22,14 @@ Each input type takes the xml tree as 'element', the previous answer as 'value',
# status is currently the answer for the problem ID for the input element,
# but it will turn into a dict containing both the answer and any associated message for the problem ID for the input element.
+import logging
import re
import shlex # for splitting quoted strings
from lxml import etree
+import xml.sax.saxutils as saxutils
+
+log = logging.getLogger('mitx.' + __name__)
def get_input_xml_tags():
''' Eventually, this will be for all registered input types '''
@@ -299,8 +303,18 @@ def math(element, value, status, render_template, msg=''):
# isinline = True
# html = render_template("mathstring.html",{'mathstr':mathstr,'isinline':isinline,'tail':element.tail})
- html = '%s%s' % (mathstr,element.tail)
- xhtml = etree.XML(html)
+ html = '%s%s' % (mathstr,saxutils.escape(element.tail))
+ try:
+ xhtml = etree.XML(html)
+ except Exception as err:
+ if False: # TODO needs to be self.system.DEBUG - but can't access system
+ msg = "Error %s
" % str(err).replace('<','<')
+ msg += 'Failed to construct math expression from
%s
' % html.replace('<','<')
+ msg += ""
+ log.error(msg)
+ return etree.XML(msg)
+ else:
+ raise
# xhtml.tail = element.tail # don't forget to include the tail!
return xhtml
From 82c68dd84548e3fa41cf87a8fd59de1b165cb436 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Thu, 5 Jul 2012 10:00:54 -0400
Subject: [PATCH 68/95] Removed table borders and declared inputs as inline
instead of inline-block
---
lms/static/sass/courseware/_problems.scss | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lms/static/sass/courseware/_problems.scss b/lms/static/sass/courseware/_problems.scss
index cbcc2ab4bc..dc66b2e743 100644
--- a/lms/static/sass/courseware/_problems.scss
+++ b/lms/static/sass/courseware/_problems.scss
@@ -205,17 +205,17 @@ section.problem-set {
table {
margin-bottom: lh();
width: 100%;
- border: 1px solid #ddd;
+ // border: 1px solid #ddd;
border-collapse: collapse;
th {
- border-bottom: 2px solid #ccc;
+ // border-bottom: 2px solid #ccc;
font-weight: bold;
text-align: left;
}
td {
- border: 1px solid #ddd;
+ // border: 1px solid #ddd;
}
caption, th, td {
@@ -253,11 +253,12 @@ section.problem-set {
visibility: hidden;
}
- input[type="text"] {
- display: inline-block;
- width: 50%;
+ #{$all-text-inputs} {
+ display: inline;
+ width: auto;
}
+ // this supports a deprecated element and should be removed once the center tag is removed
center {
display: block;
margin: lh() 0;
From 83da714a50fc4285f36e53d0a441bb0be44e14db Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 10:30:04 -0400
Subject: [PATCH 69/95] Add more docstring to import_from_github
---
cms/djangoapps/github_sync/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cms/djangoapps/github_sync/__init__.py b/cms/djangoapps/github_sync/__init__.py
index 178291f7db..d00949e56e 100644
--- a/cms/djangoapps/github_sync/__init__.py
+++ b/cms/djangoapps/github_sync/__init__.py
@@ -13,7 +13,8 @@ def import_from_github(repo_settings):
repo_settings is a dictionary with the following keys:
path: file system path to the local git repo
branch: name of the branch to track on github
- org: name of the
+ org: name of the organization to use in the imported course
+ course: name of the coures to use in the imported course
"""
repo_path = repo_settings['path']
From ab851c0b1ae7e528eecfce811bb6e3ebab1c712a Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 11:54:43 -0400
Subject: [PATCH 70/95] Add tests for the core github_sync functionality
---
cms/djangoapps/github_sync/__init__.py | 31 ++++--
cms/djangoapps/github_sync/exceptions.py | 2 +
cms/djangoapps/github_sync/tests/__init__.py | 96 +++++++++++++++++++
cms/envs/test.py | 14 ++-
.../data/toy/{toy_course.xml => course.xml} | 0
requirements.txt | 1 +
test_root/.gitignore | 2 +
7 files changed, 137 insertions(+), 9 deletions(-)
create mode 100644 cms/djangoapps/github_sync/exceptions.py
create mode 100644 cms/djangoapps/github_sync/tests/__init__.py
rename common/test/data/toy/{toy_course.xml => course.xml} (100%)
create mode 100644 test_root/.gitignore
diff --git a/cms/djangoapps/github_sync/__init__.py b/cms/djangoapps/github_sync/__init__.py
index d00949e56e..c901ad37e7 100644
--- a/cms/djangoapps/github_sync/__init__.py
+++ b/cms/djangoapps/github_sync/__init__.py
@@ -1,10 +1,16 @@
-from git import Repo
-from contentstore import import_from_xml
-from fs.osfs import OSFS
+import logging
import os
-from xmodule.modulestore import Location
-from django.conf import settings
+from django.conf import settings
+from fs.osfs import OSFS
+from git import Repo, PushInfo
+
+from contentstore import import_from_xml
+from xmodule.modulestore import Location
+
+from .exceptions import GithubSyncError
+
+log = logging.getLogger(__name__)
def import_from_github(repo_settings):
"""
@@ -53,4 +59,17 @@ def export_to_github(course, repo_path, commit_message):
origin = git_repo.remotes.origin
if settings.MITX_FEATURES['GITHUB_PUSH']:
- origin.push()
+ push_infos = origin.push()
+ if len(push_infos) > 1:
+ log.error('Unexpectedly pushed multiple heads: {infos}'.format(
+ infos="\n".join(str(info.summary) for info in push_infos)
+ ))
+
+ if push_infos[0].flags & PushInfo.ERROR:
+ log.error('Failed push: flags={p.flags}, local_ref={p.local_ref}, '
+ 'remote_ref_string={p.remote_ref_string}, '
+ 'remote_ref={p.remote_ref}, old_commit={p.old_commit}, '
+ 'summary={p.summary})'.format(p=push_infos[0]))
+ raise GithubSyncError('Failed to push: {info}'.format(
+ info=str(push_infos[0].summary)
+ ))
diff --git a/cms/djangoapps/github_sync/exceptions.py b/cms/djangoapps/github_sync/exceptions.py
new file mode 100644
index 0000000000..9097ffc2a6
--- /dev/null
+++ b/cms/djangoapps/github_sync/exceptions.py
@@ -0,0 +1,2 @@
+class GithubSyncError(Exception):
+ pass
diff --git a/cms/djangoapps/github_sync/tests/__init__.py b/cms/djangoapps/github_sync/tests/__init__.py
new file mode 100644
index 0000000000..825fc68313
--- /dev/null
+++ b/cms/djangoapps/github_sync/tests/__init__.py
@@ -0,0 +1,96 @@
+from django.test import TestCase
+from path import path
+import shutil
+from github_sync import import_from_github, export_to_github, repo_path_from_location
+from git import Repo
+from django.conf import settings
+from xmodule.modulestore.django import modulestore
+from xmodule.modulestore import Location
+from override_settings import override_settings
+from github_sync.exceptions import GithubSyncError
+
+
+class GithubSyncTestCase(TestCase):
+
+ def setUp(self):
+ self.working_dir = path(settings.TEST_ROOT)
+ self.repo_dir = self.working_dir / 'local_repo'
+ self.remote_dir = self.working_dir / 'remote_repo'
+ shutil.copytree('common/test/data/toy', self.remote_dir)
+
+ remote = Repo.init(self.remote_dir)
+ remote.git.add(A=True)
+ remote.git.commit(m='Initial commit')
+ remote.git.config("receive.denyCurrentBranch", "ignore")
+
+ modulestore().collection.drop()
+
+ self.import_revision, self.import_course = import_from_github({
+ 'path': self.repo_dir,
+ 'origin': self.remote_dir,
+ 'branch': 'master',
+ 'org': 'org',
+ 'course': 'course'
+ })
+
+ def tearDown(self):
+ shutil.rmtree(self.repo_dir)
+ shutil.rmtree(self.remote_dir)
+
+ def test_initialize_repo(self):
+ """
+ Test that importing from github will create a repo if the repo doesn't already exist
+ """
+ self.assertEquals(1, len(Repo(self.repo_dir).head.reference.log()))
+
+ def test_import_contents(self):
+ """
+ Test that the import loads the correct course into the modulestore
+ """
+ self.assertEquals('Toy Course', self.import_course.metadata['display_name'])
+ self.assertIn(
+ Location('i4x://org/course/chapter/Overview'),
+ [child.location for child in self.import_course.get_children()])
+ self.assertEquals(1, len(self.import_course.get_children()))
+
+ @override_settings(MITX_FEATURES={'GITHUB_PUSH': False})
+ def test_export_no_pash(self):
+ """
+ Test that with the GITHUB_PUSH feature disabled, no content is pushed to the remote
+ """
+ export_to_github(self.import_course, self.repo_dir, 'Test no-push')
+ self.assertEquals(1, Repo(self.remote_dir).head.commit.count())
+
+ @override_settings(MITX_FEATURES={'GITHUB_PUSH': True})
+ def test_export_push(self):
+ """
+ Test that with GITHUB_PUSH enabled, content is pushed to the remote
+ """
+ self.import_course.metadata['display_name'] = 'Changed display name'
+ export_to_github(self.import_course, self.repo_dir, 'Test push')
+ self.assertEquals(2, Repo(self.remote_dir).head.commit.count())
+
+ @override_settings(MITX_FEATURES={'GITHUB_PUSH': True})
+ def test_export_conflict(self):
+ """
+ Test that if there is a conflict when pushing to the remote repo, nothing is pushed and an exception is raised
+ """
+ self.import_course.metadata['display_name'] = 'Changed display name'
+
+ remote = Repo(self.remote_dir)
+ remote.git.commit(allow_empty=True, m="Testing conflict commit")
+
+ self.assertRaises(GithubSyncError, export_to_github, self.import_course, self.repo_dir, 'Test push')
+ self.assertEquals(2, remote.head.reference.commit.count())
+ self.assertEquals("Testing conflict commit\n", remote.head.reference.commit.message)
+
+
+@override_settings(REPOS={'namea': {'path': 'patha', 'org': 'orga', 'course': 'coursea'},
+ 'nameb': {'path': 'pathb', 'org': 'orgb', 'course': 'courseb'}})
+class RepoPathLookupTestCase(TestCase):
+ def test_successful_lookup(self):
+ self.assertEquals('patha', repo_path_from_location('i4x://orga/coursea/course/foo'))
+ self.assertEquals('pathb', repo_path_from_location('i4x://orgb/courseb/course/foo'))
+
+ def test_failed_lookup(self):
+ self.assertEquals(None, repo_path_from_location('i4x://c/c/course/foo'))
diff --git a/cms/envs/test.py b/cms/envs/test.py
index 032de92953..927e2af987 100644
--- a/cms/envs/test.py
+++ b/cms/envs/test.py
@@ -17,10 +17,18 @@ for app in os.listdir(PROJECT_ROOT / 'djangoapps'):
NOSE_ARGS += ['--cover-package', app]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
+TEST_ROOT = 'test_root'
+
MODULESTORE = {
- 'host': 'localhost',
- 'db': 'mongo_base',
- 'collection': 'key_store',
+ 'default': {
+ 'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore',
+ 'OPTIONS': {
+ 'default_class': 'xmodule.raw_module.RawDescriptor',
+ 'host': 'localhost',
+ 'db': 'test_xmodule',
+ 'collection': 'modulestore',
+ }
+ }
}
DATABASES = {
diff --git a/common/test/data/toy/toy_course.xml b/common/test/data/toy/course.xml
similarity index 100%
rename from common/test/data/toy/toy_course.xml
rename to common/test/data/toy/course.xml
diff --git a/requirements.txt b/requirements.txt
index ddf218af7c..571c530a2f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -29,3 +29,4 @@ django_nose
nosexcover
rednose
GitPython >= 0.3
+django-override-settings
diff --git a/test_root/.gitignore b/test_root/.gitignore
new file mode 100644
index 0000000000..b3e5512f73
--- /dev/null
+++ b/test_root/.gitignore
@@ -0,0 +1,2 @@
+local_repo
+remote_repo
From 386acbe1ff755d6cf11eb696c592dcf4cff55a3b Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 12:15:49 -0400
Subject: [PATCH 71/95] Add tests of the github_sync service hook view
---
.../github_sync/tests/test_views.py | 53 +++++++++++++++++++
requirements.txt | 1 +
2 files changed, 54 insertions(+)
create mode 100644 cms/djangoapps/github_sync/tests/test_views.py
diff --git a/cms/djangoapps/github_sync/tests/test_views.py b/cms/djangoapps/github_sync/tests/test_views.py
new file mode 100644
index 0000000000..9e8095a67b
--- /dev/null
+++ b/cms/djangoapps/github_sync/tests/test_views.py
@@ -0,0 +1,53 @@
+import json
+from django.test.client import Client
+from django.test import TestCase
+from mock import patch, Mock
+from override_settings import override_settings
+from django.conf import settings
+
+
+@override_settings(REPOS={'repo': {'path': 'path', 'branch': 'branch'}})
+class PostReceiveTestCase(TestCase):
+ def setUp(self):
+ self.client = Client()
+
+ @patch('github_sync.views.export_to_github')
+ @patch('github_sync.views.import_from_github')
+ def test_non_branch(self, import_from_github, export_to_github):
+ self.client.post('/github_service_hook', {'payload': json.dumps({
+ 'ref': 'refs/tags/foo'})
+ })
+ self.assertFalse(import_from_github.called)
+ self.assertFalse(export_to_github.called)
+
+ @patch('github_sync.views.export_to_github')
+ @patch('github_sync.views.import_from_github')
+ def test_non_watched_repo(self, import_from_github, export_to_github):
+ self.client.post('/github_service_hook', {'payload': json.dumps({
+ 'ref': 'refs/heads/branch',
+ 'repository': {'name': 'bad_repo'}})
+ })
+ self.assertFalse(import_from_github.called)
+ self.assertFalse(export_to_github.called)
+
+ @patch('github_sync.views.export_to_github')
+ @patch('github_sync.views.import_from_github')
+ def test_non_tracked_branch(self, import_from_github, export_to_github):
+ self.client.post('/github_service_hook', {'payload': json.dumps({
+ 'ref': 'refs/heads/non_branch',
+ 'repository': {'name': 'repo'}})
+ })
+ self.assertFalse(import_from_github.called)
+ self.assertFalse(export_to_github.called)
+
+ @patch('github_sync.views.export_to_github')
+ @patch('github_sync.views.import_from_github', return_value=(Mock(), Mock()))
+ def test_tracked_branch(self, import_from_github, export_to_github):
+ self.client.post('/github_service_hook', {'payload': json.dumps({
+ 'ref': 'refs/heads/branch',
+ 'repository': {'name': 'repo'}})
+ })
+ import_from_github.assert_called_with(settings.REPOS['repo'])
+ mock_revision, mock_course = import_from_github.return_value
+ export_to_github.assert_called_with(mock_course, 'path', "Changes from cms import of revision %s" % mock_revision)
+
diff --git a/requirements.txt b/requirements.txt
index 571c530a2f..d342c46859 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -30,3 +30,4 @@ nosexcover
rednose
GitPython >= 0.3
django-override-settings
+mock>=0.8, <0.9
From e9ee1566d6311de8a29c9aa0659f4f94a325c381 Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 12:48:18 -0400
Subject: [PATCH 72/95] Modularize capa and mitxmako so that xmodule can
properly depend on them
---
common/lib/capa/{ => capa}/__init__.py | 0
common/lib/capa/{ => capa}/calc.py | 0
common/lib/capa/{ => capa}/capa_problem.py | 0
common/lib/capa/{ => capa}/checker.py | 0
common/lib/capa/{ => capa}/correctmap.py | 0
common/lib/capa/{ => capa}/eia.py | 0
common/lib/capa/{ => capa}/inputtypes.py | 0
common/lib/capa/{ => capa}/responsetypes.py | 0
common/lib/capa/{ => capa}/templates/choicegroup.html | 0
common/lib/capa/{ => capa}/templates/imageinput.html | 0
common/lib/capa/{ => capa}/templates/jstextline.html | 0
common/lib/capa/{ => capa}/templates/mathstring.html | 0
common/lib/capa/{ => capa}/templates/schematicinput.html | 0
common/lib/capa/{ => capa}/templates/solutionspan.html | 0
common/lib/capa/{ => capa}/templates/textbox.html | 0
common/lib/capa/{ => capa}/templates/textinput.html | 0
.../lib/capa/{ => capa}/templates/textinput_dynamath.html | 0
common/lib/capa/{ => capa}/util.py | 0
common/lib/capa/setup.py | 8 ++++++++
common/lib/mitxmako/{ => mitxmako}/__init__.py | 0
common/lib/mitxmako/{ => mitxmako}/middleware.py | 0
common/lib/mitxmako/{ => mitxmako}/shortcuts.py | 0
common/lib/mitxmako/{ => mitxmako}/template.py | 0
common/lib/mitxmako/setup.py | 8 ++++++++
common/lib/xmodule/setup.py | 4 ++++
requirements.txt | 2 ++
26 files changed, 22 insertions(+)
rename common/lib/capa/{ => capa}/__init__.py (100%)
rename common/lib/capa/{ => capa}/calc.py (100%)
rename common/lib/capa/{ => capa}/capa_problem.py (100%)
rename common/lib/capa/{ => capa}/checker.py (100%)
rename common/lib/capa/{ => capa}/correctmap.py (100%)
rename common/lib/capa/{ => capa}/eia.py (100%)
rename common/lib/capa/{ => capa}/inputtypes.py (100%)
rename common/lib/capa/{ => capa}/responsetypes.py (100%)
rename common/lib/capa/{ => capa}/templates/choicegroup.html (100%)
rename common/lib/capa/{ => capa}/templates/imageinput.html (100%)
rename common/lib/capa/{ => capa}/templates/jstextline.html (100%)
rename common/lib/capa/{ => capa}/templates/mathstring.html (100%)
rename common/lib/capa/{ => capa}/templates/schematicinput.html (100%)
rename common/lib/capa/{ => capa}/templates/solutionspan.html (100%)
rename common/lib/capa/{ => capa}/templates/textbox.html (100%)
rename common/lib/capa/{ => capa}/templates/textinput.html (100%)
rename common/lib/capa/{ => capa}/templates/textinput_dynamath.html (100%)
rename common/lib/capa/{ => capa}/util.py (100%)
create mode 100644 common/lib/capa/setup.py
rename common/lib/mitxmako/{ => mitxmako}/__init__.py (100%)
rename common/lib/mitxmako/{ => mitxmako}/middleware.py (100%)
rename common/lib/mitxmako/{ => mitxmako}/shortcuts.py (100%)
rename common/lib/mitxmako/{ => mitxmako}/template.py (100%)
create mode 100644 common/lib/mitxmako/setup.py
diff --git a/common/lib/capa/__init__.py b/common/lib/capa/capa/__init__.py
similarity index 100%
rename from common/lib/capa/__init__.py
rename to common/lib/capa/capa/__init__.py
diff --git a/common/lib/capa/calc.py b/common/lib/capa/capa/calc.py
similarity index 100%
rename from common/lib/capa/calc.py
rename to common/lib/capa/capa/calc.py
diff --git a/common/lib/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py
similarity index 100%
rename from common/lib/capa/capa_problem.py
rename to common/lib/capa/capa/capa_problem.py
diff --git a/common/lib/capa/checker.py b/common/lib/capa/capa/checker.py
similarity index 100%
rename from common/lib/capa/checker.py
rename to common/lib/capa/capa/checker.py
diff --git a/common/lib/capa/correctmap.py b/common/lib/capa/capa/correctmap.py
similarity index 100%
rename from common/lib/capa/correctmap.py
rename to common/lib/capa/capa/correctmap.py
diff --git a/common/lib/capa/eia.py b/common/lib/capa/capa/eia.py
similarity index 100%
rename from common/lib/capa/eia.py
rename to common/lib/capa/capa/eia.py
diff --git a/common/lib/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py
similarity index 100%
rename from common/lib/capa/inputtypes.py
rename to common/lib/capa/capa/inputtypes.py
diff --git a/common/lib/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py
similarity index 100%
rename from common/lib/capa/responsetypes.py
rename to common/lib/capa/capa/responsetypes.py
diff --git a/common/lib/capa/templates/choicegroup.html b/common/lib/capa/capa/templates/choicegroup.html
similarity index 100%
rename from common/lib/capa/templates/choicegroup.html
rename to common/lib/capa/capa/templates/choicegroup.html
diff --git a/common/lib/capa/templates/imageinput.html b/common/lib/capa/capa/templates/imageinput.html
similarity index 100%
rename from common/lib/capa/templates/imageinput.html
rename to common/lib/capa/capa/templates/imageinput.html
diff --git a/common/lib/capa/templates/jstextline.html b/common/lib/capa/capa/templates/jstextline.html
similarity index 100%
rename from common/lib/capa/templates/jstextline.html
rename to common/lib/capa/capa/templates/jstextline.html
diff --git a/common/lib/capa/templates/mathstring.html b/common/lib/capa/capa/templates/mathstring.html
similarity index 100%
rename from common/lib/capa/templates/mathstring.html
rename to common/lib/capa/capa/templates/mathstring.html
diff --git a/common/lib/capa/templates/schematicinput.html b/common/lib/capa/capa/templates/schematicinput.html
similarity index 100%
rename from common/lib/capa/templates/schematicinput.html
rename to common/lib/capa/capa/templates/schematicinput.html
diff --git a/common/lib/capa/templates/solutionspan.html b/common/lib/capa/capa/templates/solutionspan.html
similarity index 100%
rename from common/lib/capa/templates/solutionspan.html
rename to common/lib/capa/capa/templates/solutionspan.html
diff --git a/common/lib/capa/templates/textbox.html b/common/lib/capa/capa/templates/textbox.html
similarity index 100%
rename from common/lib/capa/templates/textbox.html
rename to common/lib/capa/capa/templates/textbox.html
diff --git a/common/lib/capa/templates/textinput.html b/common/lib/capa/capa/templates/textinput.html
similarity index 100%
rename from common/lib/capa/templates/textinput.html
rename to common/lib/capa/capa/templates/textinput.html
diff --git a/common/lib/capa/templates/textinput_dynamath.html b/common/lib/capa/capa/templates/textinput_dynamath.html
similarity index 100%
rename from common/lib/capa/templates/textinput_dynamath.html
rename to common/lib/capa/capa/templates/textinput_dynamath.html
diff --git a/common/lib/capa/util.py b/common/lib/capa/capa/util.py
similarity index 100%
rename from common/lib/capa/util.py
rename to common/lib/capa/capa/util.py
diff --git a/common/lib/capa/setup.py b/common/lib/capa/setup.py
new file mode 100644
index 0000000000..cf66229b88
--- /dev/null
+++ b/common/lib/capa/setup.py
@@ -0,0 +1,8 @@
+from setuptools import setup, find_packages
+
+setup(
+ name="capa",
+ version="0.1",
+ packages=find_packages(exclude=["tests"]),
+ install_requires=['distribute'],
+)
diff --git a/common/lib/mitxmako/__init__.py b/common/lib/mitxmako/mitxmako/__init__.py
similarity index 100%
rename from common/lib/mitxmako/__init__.py
rename to common/lib/mitxmako/mitxmako/__init__.py
diff --git a/common/lib/mitxmako/middleware.py b/common/lib/mitxmako/mitxmako/middleware.py
similarity index 100%
rename from common/lib/mitxmako/middleware.py
rename to common/lib/mitxmako/mitxmako/middleware.py
diff --git a/common/lib/mitxmako/shortcuts.py b/common/lib/mitxmako/mitxmako/shortcuts.py
similarity index 100%
rename from common/lib/mitxmako/shortcuts.py
rename to common/lib/mitxmako/mitxmako/shortcuts.py
diff --git a/common/lib/mitxmako/template.py b/common/lib/mitxmako/mitxmako/template.py
similarity index 100%
rename from common/lib/mitxmako/template.py
rename to common/lib/mitxmako/mitxmako/template.py
diff --git a/common/lib/mitxmako/setup.py b/common/lib/mitxmako/setup.py
new file mode 100644
index 0000000000..535d86f90e
--- /dev/null
+++ b/common/lib/mitxmako/setup.py
@@ -0,0 +1,8 @@
+from setuptools import setup, find_packages
+
+setup(
+ name="mitxmako",
+ version="0.1",
+ packages=find_packages(exclude=["tests"]),
+ install_requires=['distribute'],
+)
diff --git a/common/lib/xmodule/setup.py b/common/lib/xmodule/setup.py
index 77b0838ff2..1ce23bca90 100644
--- a/common/lib/xmodule/setup.py
+++ b/common/lib/xmodule/setup.py
@@ -8,6 +8,10 @@ setup(
package_data={
'xmodule': ['js/module/*']
},
+ requires=[
+ 'capa',
+ 'mitxmako'
+ ],
# See http://guide.python-distribute.org/creation.html#entry-points
# for a description of entry_points
diff --git a/requirements.txt b/requirements.txt
index d342c46859..6f63769ee3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -24,6 +24,8 @@ sympy
newrelic
glob2
pymongo
+-e common/lib/capa
+-e common/lib/mitxmako
-e common/lib/xmodule
django_nose
nosexcover
From ce4cea0e3efa116919014f0077fa3c85855dc910 Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 13:07:29 -0400
Subject: [PATCH 73/95] Don't fail if no NOSE_COVER_HTML_DIR is set
---
lms/envs/test.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lms/envs/test.py b/lms/envs/test.py
index 941b855f5c..aed49d43de 100644
--- a/lms/envs/test.py
+++ b/lms/envs/test.py
@@ -20,7 +20,8 @@ INSTALLED_APPS = [
# Nose Test Runner
INSTALLED_APPS += ['django_nose']
-NOSE_ARGS = ['--cover-erase', '--with-xunit', '--with-xcoverage', '--cover-html', '--cover-inclusive', '--cover-html-dir', os.environ['NOSE_COVER_HTML_DIR']]
+NOSE_ARGS = ['--cover-erase', '--with-xunit', '--with-xcoverage', '--cover-html',
+ '--cover-inclusive', '--cover-html-dir', os.environ.get('NOSE_COVER_HTML_DIR', 'cover_html')]
for app in os.listdir(PROJECT_ROOT / 'djangoapps'):
NOSE_ARGS += ['--cover-package', app]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
From dbd82c4bc8a8c56de88adda994297d678f350487 Mon Sep 17 00:00:00 2001
From: Calen Pennington
Date: Thu, 5 Jul 2012 13:07:54 -0400
Subject: [PATCH 74/95] Install numpy before trying to install scipy from
requirements.txt
---
requirements.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/requirements.txt b/requirements.txt
index 6f63769ee3..efc8e48ddd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,6 @@
django<1.4
pip
+numpy
scipy
matplotlib
markdown
From 74e01bb07ac4ef0d39c27d10ee02e9ab0ccaf634 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Fri, 6 Jul 2012 09:49:08 -0400
Subject: [PATCH 75/95] fixed two bugs in inputtypes: textline with quotes
crashed problems, and choice without text caused error
---
common/lib/capa/inputtypes.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/common/lib/capa/inputtypes.py b/common/lib/capa/inputtypes.py
index d7c0799f75..66ac57c52d 100644
--- a/common/lib/capa/inputtypes.py
+++ b/common/lib/capa/inputtypes.py
@@ -166,7 +166,8 @@ def choicegroup(element, value, status, render_template, msg=''):
raise Exception("[courseware.capa.inputtypes.choicegroup] Error only tags should be immediate children of a , found %s instead" % choice.tag)
ctext = ""
ctext += ''.join([etree.tostring(x) for x in choice]) # TODO: what if choice[0] has math tags in it?
- ctext += choice.text # TODO: fix order?
+ if choice.text is not None:
+ ctext += choice.text # TODO: fix order?
choices[choice.get("name")] = ctext
context={'id':eid, 'value':value, 'state':status, 'type':type, 'choices':choices}
html = render_template("choicegroup.html", context)
@@ -187,9 +188,17 @@ def textline(element, value, status, render_template, msg=""):
count = int(eid.split('_')[-2])-1 # HACK
size = element.get('size')
hidden = element.get('hidden','') # if specified, then textline is hidden and id is stored in div of name given by hidden
+ escapedict = {'"': '"'}
+ value = saxutils.escape(value,escapedict) # otherwise, answers with quotes in them crashes the system!
context = {'id':eid, 'value':value, 'state':status, 'count':count, 'size': size, 'msg': msg, 'hidden': hidden}
html = render_template("textinput.html", context)
- return etree.XML(html)
+ try:
+ xhtml = etree.XML(html)
+ except Exception as err:
+ if True: # TODO needs to be self.system.DEBUG - but can't access system
+ log.debug('[inputtypes.textline] failed to parse XML for:\n%s' % html)
+ raise
+ return xhtml
#-----------------------------------------------------------------------------
From 9801ce5d3be49d96a6e995c169899a8f0c365952 Mon Sep 17 00:00:00 2001
From: Prem Sichanugrist
Date: Fri, 6 Jul 2012 14:19:32 -0400
Subject: [PATCH 76/95] Add documentation for running JavaScript test
---
doc/testing.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/doc/testing.md b/doc/testing.md
index fa134ade66..ee54ae74d9 100644
--- a/doc/testing.md
+++ b/doc/testing.md
@@ -8,5 +8,25 @@ Testing is good. Here is some useful info about how we set up tests--
### Frontend code:
-- TODO
+We're using Jasmine to unit-testing the JavaScript files. All the specs are
+written in CoffeeScript for the consistency. To access the test cases, start the
+server in debug mode, navigate to `http://127.0.0.1:[port number]/_jasmine` to
+see the test result.
+All the JavaScript codes must have test coverage. Both CMS and LMS
+has its own test directory in `{cms,lms}/static/coffee/spec` If you haven't
+written a JavaScript test before, you can look at those example files as a
+starting point. Also, these materials might be helpful for you:
+
+CMS Note: For consistency, you're advised to use the same directory structure
+for implementation and test. For example, test for `src/views/module.coffee`
+should be written in `spec/views/module_spec.coffee`.
+
+* http://pivotal.github.com/jasmine
+* http://railscasts.com/episodes/261-testing-javascript-with-jasmine?view=asciicast
+* http://a-developer-life.blogspot.com/2011/05/jasmine-part-1-unit-testing-javascript.html
+
+If you're finishing a feature that contains JavaScript code snippets and do not
+sure how to test, please feel free to open up a pull request and asking people
+for help. (However, the best way to do it would be writing your test first, then
+implement your feature - Test Driven Development.)
From 4356ec5c458120d3c90a30344a7a272fa607b2c8 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Sun, 8 Jul 2012 17:00:08 -0400
Subject: [PATCH 77/95] default course to settings.COURSE_DEFAULT
---
lms/djangoapps/courseware/views.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py
index 425720f67b..a7dc4bdc65 100644
--- a/lms/djangoapps/courseware/views.py
+++ b/lms/djangoapps/courseware/views.py
@@ -145,7 +145,7 @@ def get_course(request, course):
if course == None:
if not settings.ENABLE_MULTICOURSE:
- course = "edx4edx"
+ course = settings.COURSE_DEFAULT
elif 'coursename' in request.session:
# use multicourse_settings, so that settings.COURSE_TITLE is set properly
course = multicourse_settings.get_coursename_from_request(request)
@@ -187,6 +187,7 @@ def index(request, course=None, chapter=None, section=None,
course = clean(get_course(request, course))
if not multicourse_settings.is_valid_course(course):
+ log.debug('Course %s is not valid' % course)
return redirect('/')
# keep track of current course being viewed in django's request.session
From 0daf7b049774169092bb01179fcab840aabbc718 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Sun, 8 Jul 2012 19:03:29 -0400
Subject: [PATCH 78/95] merging of stable-edx4edx into master - bugfixes and
debugging
---
common/lib/xmodule/xmodule/capa_module.py | 2 +-
common/lib/xmodule/xmodule/modulestore/__init__.py | 6 ++++++
common/lib/xmodule/xmodule/modulestore/xml.py | 9 ++++++++-
common/lib/xmodule/xmodule/x_module.py | 2 ++
common/lib/xmodule/xmodule/xml_module.py | 1 +
lms/djangoapps/courseware/views.py | 5 ++++-
lms/envs/common.py | 1 +
lms/envs/dev_ike.py | 7 +++++--
8 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py
index 322dab5d91..b53c29ef86 100644
--- a/common/lib/xmodule/xmodule/capa_module.py
+++ b/common/lib/xmodule/xmodule/capa_module.py
@@ -135,7 +135,7 @@ class CapaModule(XModule):
try:
self.lcp = LoncapaProblem(self.definition['data'], self.location.html_id(), instance_state, seed=seed, system=self.system)
except Exception:
- msg = 'cannot create LoncapaProblem %s' % self.url
+ msg = 'cannot create LoncapaProblem %s' % self.location.url
log.exception(msg)
if self.system.DEBUG:
msg = '%s
' % msg.replace('<', '<')
diff --git a/common/lib/xmodule/xmodule/modulestore/__init__.py b/common/lib/xmodule/xmodule/modulestore/__init__.py
index faee5ce303..b8ab95d85e 100644
--- a/common/lib/xmodule/xmodule/modulestore/__init__.py
+++ b/common/lib/xmodule/xmodule/modulestore/__init__.py
@@ -6,6 +6,9 @@ that are stored in a database an accessible using their Location as an identifie
import re
from collections import namedtuple
from .exceptions import InvalidLocationError
+import logging
+
+log = logging.getLogger('mitx.' + 'modulestore')
URL_RE = re.compile("""
(?P[^:]+)://
@@ -74,11 +77,13 @@ class Location(_LocationBase):
def check_list(list_):
for val in list_:
if val is not None and INVALID_CHARS.search(val) is not None:
+ log.debug('invalid characters val="%s", list_="%s"' % (val,list_))
raise InvalidLocationError(location)
if isinstance(location, basestring):
match = URL_RE.match(location)
if match is None:
+ log.debug('location is instance of %s but no URL match' % basestring)
raise InvalidLocationError(location)
else:
groups = match.groupdict()
@@ -86,6 +91,7 @@ class Location(_LocationBase):
return _LocationBase.__new__(_cls, **groups)
elif isinstance(location, (list, tuple)):
if len(location) not in (5, 6):
+ log.debug('location has wrong length')
raise InvalidLocationError(location)
if len(location) == 5:
diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py
index a5db17054b..9a67ea59f9 100644
--- a/common/lib/xmodule/xmodule/modulestore/xml.py
+++ b/common/lib/xmodule/xmodule/modulestore/xml.py
@@ -12,7 +12,7 @@ from .exceptions import ItemNotFoundError
etree.set_default_parser(etree.XMLParser(dtd_validation=False, load_dtd=False,
remove_comments=True, remove_blank_text=True))
-log = logging.getLogger(__name__)
+log = logging.getLogger('mitx.' + __name__)
class XMLModuleStore(ModuleStore):
@@ -35,9 +35,13 @@ class XMLModuleStore(ModuleStore):
self.default_class = None
else:
module_path, _, class_name = default_class.rpartition('.')
+ log.debug('module_path = %s' % module_path)
class_ = getattr(import_module(module_path), class_name)
self.default_class = class_
+ log.debug('XMLModuleStore: eager=%s, data_dir = %s' % (eager,self.data_dir))
+ log.debug('default_class = %s' % self.default_class)
+
with open(self.data_dir / "course.xml") as course_file:
class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
def __init__(self, modulestore):
@@ -65,9 +69,11 @@ class XMLModuleStore(ModuleStore):
slug = '{slug}_{count}'.format(slug=slug, count=self.unnamed_modules)
self.used_slugs.add(slug)
+ # log.debug('-> slug=%s' % slug)
xml_data.set('slug', slug)
module = XModuleDescriptor.load_from_xml(etree.tostring(xml_data), self, org, course, modulestore.default_class)
+ log.debug('==> importing module location %s' % repr(module.location))
modulestore.modules[module.location] = module
if eager:
@@ -84,6 +90,7 @@ class XMLModuleStore(ModuleStore):
XMLParsingSystem.__init__(self, **system_kwargs)
self.course = ImportSystem(self).process_xml(course_file.read())
+ log.debug('========> Done with course import')
def get_item(self, location):
"""
diff --git a/common/lib/xmodule/xmodule/x_module.py b/common/lib/xmodule/xmodule/x_module.py
index 8bfbb5f91a..e3668b7ff1 100644
--- a/common/lib/xmodule/xmodule/x_module.py
+++ b/common/lib/xmodule/xmodule/x_module.py
@@ -344,6 +344,8 @@ class XModuleDescriptor(Plugin):
etree.fromstring(xml_data).tag,
default_class
)
+ # leave next line in code, commented out - useful for low-level debugging
+ # log.debug('[XModuleDescriptor.load_from_xml] tag=%s, class_=%s' % (etree.fromstring(xml_data).tag,class_))
return class_.from_xml(xml_data, system, org, course)
@classmethod
diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py
index aebb024a59..16016ca23f 100644
--- a/common/lib/xmodule/xmodule/xml_module.py
+++ b/common/lib/xmodule/xmodule/xml_module.py
@@ -125,6 +125,7 @@ class XmlDescriptor(XModuleDescriptor):
definition_xml = copy.deepcopy(xml_object)
else:
filepath = cls._format_filepath(xml_object.tag, filename)
+ log.debug('filepath=%s, resources_fs=%s' % (filepath,system.resources_fs))
with system.resources_fs.open(filepath) as file:
try:
definition_xml = etree.parse(file).getroot()
diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py
index a7dc4bdc65..c6dbf84ff1 100644
--- a/lms/djangoapps/courseware/views.py
+++ b/lms/djangoapps/courseware/views.py
@@ -209,9 +209,12 @@ def index(request, course=None, chapter=None, section=None,
chapter = clean(chapter)
section = clean(section)
+ if settings.ENABLE_MULTICOURSE:
+ settings.MODULESTORE['default']['OPTIONS']['data_dir'] = settings.DATA_DIR + multicourse_settings.get_course_xmlpath(course)
+
context = {
'csrf': csrf(request)['csrf_token'],
- 'accordion': render_accordion(request, course, chapter, section),
+ 'accordion': render_accordion(request, course, chapter, section), # triggers course load!
'COURSE_TITLE': multicourse_settings.get_course_title(course),
'init': '',
'content': ''
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 33800c6afb..3803a8fde4 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -39,6 +39,7 @@ MITX_FEATURES = {
'USE_DJANGO_PIPELINE' : True,
'DISPLAY_HISTOGRAMS_TO_STAFF' : True,
'REROUTE_ACTIVATION_EMAIL' : False, # nonempty string = address for all activation emails
+ 'DEBUG_LEVEL' : 0, # 0 = lowest level, least verbose, 255 = max level, most verbose
}
# Used for A/B testing
diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py
index c70be74352..3e6efed1c1 100644
--- a/lms/envs/dev_ike.py
+++ b/lms/envs/dev_ike.py
@@ -35,20 +35,22 @@ EDX4EDX_ROOT = ENV_ROOT / "data/edx4edx"
DEBUG = True
ENABLE_MULTICOURSE = True # set to False to disable multicourse display (see lib.util.views.mitxhome)
-QUICKEDIT = True
+QUICKEDIT = False
MAKO_TEMPLATES['course'] = [DATA_DIR, EDX4EDX_ROOT ]
#MITX_FEATURES['USE_DJANGO_PIPELINE'] = False
MITX_FEATURES['DISPLAY_HISTOGRAMS_TO_STAFF'] = False
MITX_FEATURES['DISPLAY_EDIT_LINK'] = True
+MITX_FEATURES['DEBUG_LEVEL'] = 10 # 0 = lowest level, least verbose, 255 = max level, most verbose
-COURSE_SETTINGS = {'6.002x_Fall_2012': {'number' : '6.002x',
+COURSE_SETTINGS = {'6002x_Fall_2012': {'number' : '6.002x',
'title' : 'Circuits and Electronics',
'xmlpath': '/6002x-fall-2012/',
'active' : True,
'default_chapter' : 'Week_1',
'default_section' : 'Administrivia_and_Circuit_Elements',
+ 'location': 'i4x://edx/6002xs12/course/6002x Fall 2012',
},
'8.02_Spring_2013': {'number' : '8.02x',
'title' : 'Electricity & Magnetism',
@@ -81,6 +83,7 @@ COURSE_SETTINGS = {'6.002x_Fall_2012': {'number' : '6.002x',
'active' : True,
'default_chapter' : 'Introduction',
'default_section' : 'edx4edx_Course',
+ 'location': 'i4x://edx/6002xs12/course/edx4edx',
},
'7.03x_Fall_2012': {'number' : '7.03x',
'title' : 'Genetics',
From aedcd9a4c459598129d43d9f0c571b59705643f3 Mon Sep 17 00:00:00 2001
From: ichuang
Date: Sun, 8 Jul 2012 22:04:54 -0400
Subject: [PATCH 79/95] change "type" to "category" in xml_module.py
---
common/lib/xmodule/xmodule/xml_module.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py
index 16016ca23f..0b0b1225b1 100644
--- a/common/lib/xmodule/xmodule/xml_module.py
+++ b/common/lib/xmodule/xmodule/xml_module.py
@@ -148,8 +148,8 @@ class XmlDescriptor(XModuleDescriptor):
)
@classmethod
- def _format_filepath(cls, type, name):
- return '{type}/{name}.{ext}'.format(type=type, name=name, ext=cls.filename_extension)
+ def _format_filepath(cls, category, name):
+ return '{category}/{name}.{ext}'.format(category=category, name=name, ext=cls.filename_extension)
def export_to_xml(self, resource_fs):
"""
From 3a664753b4ab748e29bf70265d7ff0ac649cc60e Mon Sep 17 00:00:00 2001
From: ichuang
Date: Sun, 8 Jul 2012 22:05:21 -0400
Subject: [PATCH 80/95] minor changes - test this branch with more courses
(8.01x, 6.00x)
---
lms/djangoapps/courseware/views.py | 2 +-
lms/envs/dev_ike.py | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py
index c6dbf84ff1..ee3162c6d2 100644
--- a/lms/djangoapps/courseware/views.py
+++ b/lms/djangoapps/courseware/views.py
@@ -200,7 +200,7 @@ def index(request, course=None, chapter=None, section=None,
if defchapter and defsection:
# jump there using redirect, so the user gets the right URL in their browser
newurl = '%s/courseware/%s/%s/%s/' % (settings.MITX_ROOT_URL,
- get_course(request, course),
+ get_course(request, course).replace(' ','_'),
defchapter,
defsection)
log.debug('redirecting to %s' % newurl)
diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py
index 3e6efed1c1..79ae3354ac 100644
--- a/lms/envs/dev_ike.py
+++ b/lms/envs/dev_ike.py
@@ -44,13 +44,13 @@ MITX_FEATURES['DISPLAY_HISTOGRAMS_TO_STAFF'] = False
MITX_FEATURES['DISPLAY_EDIT_LINK'] = True
MITX_FEATURES['DEBUG_LEVEL'] = 10 # 0 = lowest level, least verbose, 255 = max level, most verbose
-COURSE_SETTINGS = {'6002x_Fall_2012': {'number' : '6.002x',
+COURSE_SETTINGS = {'6.002x_Fall_2012': {'number' : '6.002x',
'title' : 'Circuits and Electronics',
'xmlpath': '/6002x-fall-2012/',
'active' : True,
'default_chapter' : 'Week_1',
'default_section' : 'Administrivia_and_Circuit_Elements',
- 'location': 'i4x://edx/6002xs12/course/6002x Fall 2012',
+ 'location': 'i4x://edx/6002xs12/course/6.002x_Fall_2012',
},
'8.02_Spring_2013': {'number' : '8.02x',
'title' : 'Electricity & Magnetism',
@@ -75,6 +75,7 @@ COURSE_SETTINGS = {'6002x_Fall_2012': {'number' : '6.002x',
'active': True,
'default_chapter' : 'Mechanics_Online_Spring_2012',
'default_section' : 'Introduction_to_the_course',
+ 'location': 'i4x://edx/6002xs12/course/8.01_Fall_2012',
},
'edx4edx': {'number' : 'edX.01',
'title' : 'edx4edx: edX Author Course',
@@ -116,6 +117,7 @@ COURSE_SETTINGS = {'6002x_Fall_2012': {'number' : '6.002x',
'active' : True,
'default_chapter' : 'Week_0',
'default_section' : 'Problem_Set_0',
+ 'location': 'i4x://edx/6002xs12/course/6.00x_Fall_2012',
},
'7.00x_Fall_2012': {'number' : '7.00x',
'title' : 'Introduction to Biology',
From 985a5323f4c7258735fa17baafa1c5ae0c9b1529 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Thu, 5 Jul 2012 09:59:53 -0400
Subject: [PATCH 81/95] Added some hovers fo the caledar
---
cms/static/sass/_base.scss | 24 ++++++++++++------------
cms/static/sass/_calendar.scss | 28 ++++++++++++++++++----------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/cms/static/sass/_base.scss b/cms/static/sass/_base.scss
index b5156c0ec0..f9e9e13a1b 100644
--- a/cms/static/sass/_base.scss
+++ b/cms/static/sass/_base.scss
@@ -104,16 +104,16 @@ textarea {
}
}
-.wip {
- outline: 1px solid #f00 !important;
- position: relative;
+// .wip {
+// outline: 1px solid #f00 !important;
+// position: relative;
- &:after {
- content: "WIP";
- font-size: 8px;
- padding: 2px;
- background: #f00;
- color: #fff;
- @include position(absolute, 0px 0px 0 0);
- }
-}
+// &:after {
+// content: "WIP";
+// font-size: 8px;
+// padding: 2px;
+// background: #f00;
+// color: #fff;
+// @include position(absolute, 0px 0px 0 0);
+// }
+// }
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 3dfda9c3d6..423afc5ab4 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -118,23 +118,24 @@ section.cal {
position: relative;
> div {
+ background: $dark-blue;
+ @include box-shadow(0 0 5px darken($light-blue, 60%));
+ @include box-sizing(border-box);
display: none;
+ margin-left: 3%;
+ padding: 10px;
@include position(absolute, 30px 0 0 0);
width: 90%;
- background: rgba(#000, .9);
- padding: 10px;
- @include box-sizing(border-box);
- @include border-radius(3px);
z-index: 99;
&:before {
+ background: $dark-blue;
content: " ";
display: block;
- background: rgba(#000, .8);
- width: 10px;
height: 10px;
@include position(absolute, -5px 0 0 50%);
@include transform(rotate(45deg));
+ width: 10px;
}
ul {
@@ -143,27 +144,34 @@ section.cal {
background: none;
input {
- width: 100%;
@include box-sizing(border-box);
- border-color: #000;
- padding: 6px;
+ width: 100%;
}
select {
- width: 100%;
@include box-sizing(border-box);
+ width: 100%;
option {
font-size: 14px;
}
}
+ div {
+ margin-top: 10px;
+ }
+
a {
+ color: $light-blue;
float: right;
&:first-child {
float: left;
}
+
+ &:hover {
+ color: #fff;
+ }
}
}
}
From 94fccb0017bcc5a5536821e5facce4060b4fe8d2 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Thu, 5 Jul 2012 14:26:40 -0400
Subject: [PATCH 82/95] Added fixes for the sidebar, made better base style for
inputs and brightened colors a bit
---
cms/static/coffee/main.coffee | 50 ++++++++-----------------------
cms/static/sass/_base.scss | 25 ++++++++++++----
cms/static/sass/_calendar.scss | 10 ++-----
cms/static/sass/_section.scss | 15 ++++++----
cms/static/sass/_unit.scss | 2 +-
cms/templates/widgets/header.html | 8 ++---
6 files changed, 48 insertions(+), 62 deletions(-)
diff --git a/cms/static/coffee/main.coffee b/cms/static/coffee/main.coffee
index 8f7d7d7323..bd4992930a 100644
--- a/cms/static/coffee/main.coffee
+++ b/cms/static/coffee/main.coffee
@@ -1,7 +1,13 @@
class @CMS
@setHeight = =>
- windowHeight = $(this).height()
- @contentHeight = windowHeight - 29
+ windowHeight = $(window).height()
+ headerHeight = $('body > header').outerHeight()
+ contentHeight = $('.main-content').height()
+ @sidebarHeight = if windowHeight > contentHeight then windowHeight - headerHeight else contentHeight - headerHeight
+ @minContentHeight = windowHeight - headerHeight
+
+ $('.cal').css('height', @sidebarHeight)
+ $('.main-content').css('min-height', @minContentHeight)
@bind = =>
$('a.module-edit').click ->
@@ -13,8 +19,9 @@ class @CMS
$.get('/edit_item', {id: id}, (data) =>
$('#module-html').empty().append(data)
CMS.bind()
- $('body.content .cal').css('height', @contentHeight)
+ CMS.setHeight()
$('body').addClass('content')
+ $('body.content .cal ol > li').css('height','auto')
$('section.edit-pane').show()
new Unit('unit-wrapper', id)
)
@@ -31,6 +38,7 @@ $ ->
heighest = if $(this).height() > heighest then $(this).height() else heighest
$('.cal ol > li').css('height',heighest + 'px')
+ $('body.content .cal ol > li').css('height','auto')
$('.add-new-section').click -> return false
@@ -43,40 +51,6 @@ $ ->
$(this).parent().parent().hide()
return false
- # $('html').keypress ->
- # $('.wip').css('visibility', 'visible')
-
- setHeight = ->
- windowHeight = $(this).height()
- contentHeight = windowHeight - 29
-
- $('section.main-content > section').css('min-height', contentHeight)
- $('body.content .cal').css('height', contentHeight)
-
- $('.edit-week').click ->
- $('body').addClass('content')
- $('body.content .cal').css('height', contentHeight)
- $('section.edit-pane').show()
- return false
-
- $('a.week-edit').click ->
- $('body').addClass('content')
- $('body.content .cal').css('height', contentHeight)
- $('section.edit-pane').show()
- return false
-
- $('a.sequence-edit').click ->
- $('body').addClass('content')
- $('body.content .cal').css('height', contentHeight)
- $('section.edit-pane').show()
- return false
-
- $('a.module-edit').click ->
- $('body.content .cal').css('height', contentHeight)
-
- $(document).ready(setHeight)
- $(window).bind('resize', setHeight)
-
$('.video-new a').click ->
$('section.edit-pane').show()
return false
@@ -84,7 +58,7 @@ $ ->
$('.problem-new a').click ->
$('section.edit-pane').show()
return false
-
+
CMS.setHeight()
CMS.bind()
diff --git a/cms/static/sass/_base.scss b/cms/static/sass/_base.scss
index f9e9e13a1b..e9403dcffc 100644
--- a/cms/static/sass/_base.scss
+++ b/cms/static/sass/_base.scss
@@ -32,11 +32,11 @@ input {
button, input[type="submit"], .button {
background-color: $orange;
- color: #fff;
- -webkit-font-smoothing: antialiased;
- padding: 8px 10px;
border: 0;
+ color: #fff;
font-weight: bold;
+ padding: 8px 10px;
+ -webkit-font-smoothing: antialiased;
&:hover {
background-color: shade($orange, 10%);
@@ -45,9 +45,22 @@ button, input[type="submit"], .button {
#{$all-text-inputs}, textarea {
border: 1px solid $dark-blue;
- font: $body-font-size $body-font-family;
- padding: 4px 6px;
@include box-shadow(inset 0 3px 6px $light-blue);
+ color: lighten($dark-blue, 30%);
+ font: $body-font-size $body-font-family;
+ outline: none;
+ padding: 4px 6px;
+
+ &:hover {
+ background: lighten($yellow, 13%);
+ color: $dark-blue;
+ }
+
+ &:focus {
+ @include box-shadow(inset 0 3px 6px $light-blue, 0 0 3px lighten($bright-blue, 10%));
+ color: $dark-blue;
+ background: lighten($yellow, 13%);
+ }
}
textarea {
@@ -56,7 +69,6 @@ textarea {
line-height: lh();
padding: 15px;
width: 100%;
-
}
// Extends
@@ -99,6 +111,7 @@ textarea {
&:hover {
background: lighten($yellow, 10%);
}
+
button {
padding: 4px 10px;
}
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 423afc5ab4..90fd767c68 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -1,7 +1,7 @@
section.cal {
@include box-sizing(border-box);
- padding: 25px;
@include clearfix;
+ padding: 25px;
> header {
@include clearfix;
@@ -62,8 +62,8 @@ section.cal {
@include box-sizing(border-box);
float: left;
width: flex-grid(3) + ((flex-gutter() * 3) / 4);
- background-color: lighten($light-blue, 2%);
-
+ background-color: $light-blue;
+ overflow-y: hidden;
header {
border-bottom: 1px solid lighten($dark-blue, 40%);
@@ -90,10 +90,6 @@ section.cal {
color: #888;
border-bottom: 0;
font-size: 12px;
-
- &:hover {
- background: #fff;
- }
}
}
}
diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss
index f0ac33ba53..dbd4f232b1 100644
--- a/cms/static/sass/_section.scss
+++ b/cms/static/sass/_section.scss
@@ -85,6 +85,8 @@ section#unit-wrapper {
}
&:hover {
+ background-color: lighten($yellow, 10%);
+
a.draggable {
opacity: 1;
}
@@ -136,12 +138,16 @@ section#unit-wrapper {
li {
border-bottom: 1px solid darken($light-blue, 8%);
- background: lighten($light-blue, 2%);
+ background: $light-blue;
&:last-child {
border-bottom: 0;
}
+ a {
+ color: $dark-blue;
+ }
+
ul {
list-style: none;
@@ -153,6 +159,8 @@ section#unit-wrapper {
}
&:hover {
+ background-color: lighten($yellow, 10%);
+
a.draggable {
opacity: 1;
}
@@ -172,13 +180,8 @@ section#unit-wrapper {
float: right;
opacity: .3;
}
-
- a {
- color: #000;
- }
}
}
-
}
}
}
diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss
index a21a4bf7a2..b3a6debb57 100644
--- a/cms/static/sass/_unit.scss
+++ b/cms/static/sass/_unit.scss
@@ -41,7 +41,7 @@ section#unit-wrapper {
&.save-update {
@extend .button;
- margin: -6px -25px -6px 0;
+ margin: -6px -21px -6px 0;
}
}
}
diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html
index 4577ac64d8..bad314560b 100644
--- a/cms/templates/widgets/header.html
+++ b/cms/templates/widgets/header.html
@@ -3,16 +3,16 @@
From f1623ec6057b4f53d8d0e1fe7604ffdfdee10792 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Thu, 5 Jul 2012 15:53:52 -0400
Subject: [PATCH 83/95] Added more tweeks to the calendar and unit pages
---
cms/static/sass/_calendar.scss | 28 ++++++++++++++---
cms/static/sass/_unit.scss | 45 +++++++++++++++++++---------
cms/templates/widgets/html-edit.html | 2 +-
3 files changed, 56 insertions(+), 19 deletions(-)
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 90fd767c68..f4d97a64ff 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -269,14 +269,34 @@ section.cal {
opacity: .4;
@include transition();
- > header ul {
- display: none;
- }
-
&:hover {
opacity: 1;
}
+ > header {
+ @include transition;
+ overflow: hidden;
+ height: 55px;
+
+ ul {
+ display: block;
+
+ li {
+ border-left: 0;
+ margin-left: 0;
+ margin-bottom: 4px;
+
+ ul {
+ display: inline;
+ }
+ }
+ }
+
+ &:hover {
+ height: 167px;
+ }
+ }
+
ol {
li {
@include box-sizing(border-box);
diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss
index b3a6debb57..0dada82323 100644
--- a/cms/static/sass/_unit.scss
+++ b/cms/static/sass/_unit.scss
@@ -51,41 +51,61 @@ section#unit-wrapper {
padding: 20px;
section.meta {
+ background: $light-blue;
+ border-bottom: 1px solid lighten($dark-blue, 40%);
+ padding: 10px 20px;
+ margin: -20px -20px 10px;
+ opacity: .7;
+ @include transition;
+
+ &:hover {
+ opacity: 1;
+ padding: 20px;
+ margin: -20px -20px 10px;
+ }
+
section {
&.status-settings {
float: left;
margin-bottom: 10px;
color: $dark-blue;
+ @include clearfix;
ul {
list-style: none;
- border: 1px solid lighten($dark-blue, 40%);
- @include inline-block();
+ border: 1px solid darken($light-blue, 15%);
+ @include clearfix();
+ float: left;
li {
- @include inline-block();
- border-right: 1px solid lighten($dark-blue, 40%);
- padding: 6px;
+ border-right: 1px solid darken($light-blue, 15%);
+ float: left;
&:last-child {
border-right: 0;
}
- &.current {
- background: #eee;
- }
-
a {
color: $dark-blue;
+ padding: 6px;
+ display: block;
+
+ &.current {
+ background: darken($light-blue, 5%);
+ }
+
+ &:hover {
+ background-color: lighten($yellow, 13%);
+ }
}
}
}
a.settings {
- @include inline-block();
+ float: left;
margin: 0 20px;
padding: 6px;
- border: 1px solid lighten($dark-blue, 40%);
+ border: 1px solid darken($light-blue, 15%);
color: $dark-blue;
}
@@ -110,10 +130,7 @@ section#unit-wrapper {
}
&.tags {
- background: $light-blue;
color: lighten($dark-blue, 6%);
- padding: 10px;
- margin: 0 0 20px;
@include clearfix();
clear: both;
diff --git a/cms/templates/widgets/html-edit.html b/cms/templates/widgets/html-edit.html
index f0f63ea905..47a6a55cba 100644
--- a/cms/templates/widgets/html-edit.html
+++ b/cms/templates/widgets/html-edit.html
@@ -36,7 +36,7 @@
${data}
-
+
From 4b43e3474f3b02118f216f64203d64b0ea449435 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Thu, 5 Jul 2012 17:40:31 -0400
Subject: [PATCH 84/95] More tweeks for visual style for the filter bar and
settings
---
cms/static/sass/_calendar.scss | 8 ++++
cms/static/sass/_layout.scss | 1 +
cms/static/sass/_section.scss | 9 ++++-
cms/templates/widgets/module-dropdown.html | 46 +++++++++++-----------
4 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index f4d97a64ff..5af7bb5f6f 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -77,10 +77,18 @@ section.cal {
text-transform: uppercase;
border-bottom: 1px solid lighten($dark-blue, 60%);
padding: 6px;
+ color: $bright-blue;
a {
color: $bright-blue;
display: block;
+ padding: 6px;
+ margin: -6px;
+
+ &:hover {
+ color: darken($bright-blue, 10%);
+ background: lighten($yellow, 10%);
+ }
}
}
diff --git a/cms/static/sass/_layout.scss b/cms/static/sass/_layout.scss
index eb30d55f5c..9ea1060ca4 100644
--- a/cms/static/sass/_layout.scss
+++ b/cms/static/sass/_layout.scss
@@ -5,6 +5,7 @@ body {
> section {
display: table;
+ table-layout: fixed;
width: 100%;
}
diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss
index dbd4f232b1..e12387e488 100644
--- a/cms/static/sass/_section.scss
+++ b/cms/static/sass/_section.scss
@@ -1,12 +1,17 @@
section#unit-wrapper {
section.filters {
@include clearfix;
- margin-bottom: 10px;
- opacity: .4;
+ background: $light-blue;
+ border-bottom: 1px solid lighten($dark-blue, 40%);
+ padding: 5px 20px;
+ margin: -20px -20px 10px;
+ opacity: .7;
@include transition;
&:hover {
opacity: 1;
+ padding: 10px 20px;
+ margin: -20px -20px 10px;
}
ul {
diff --git a/cms/templates/widgets/module-dropdown.html b/cms/templates/widgets/module-dropdown.html
index 6edb142e40..d5115d90c8 100644
--- a/cms/templates/widgets/module-dropdown.html
+++ b/cms/templates/widgets/module-dropdown.html
@@ -2,27 +2,27 @@
+ Add new module
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 7aad8f04bbdb230f333b7d11c366b310c6eedf36 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Fri, 6 Jul 2012 10:49:40 -0400
Subject: [PATCH 85/95] Added better styles for draggable
---
cms/static/sass/_calendar.scss | 33 +++++++++++++++++++++++++++++++--
cms/static/sass/_unit.scss | 4 ++++
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 5af7bb5f6f..602b5604b1 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -108,14 +108,43 @@ section.cal {
li {
border-bottom: 1px solid darken($light-blue, 8%);
- padding: 6px;
+ position: relative;
&:hover {
- background: lighten($yellow, 10%);
+ background-color: lighten($yellow, 14%);
+
+ a.draggable {
+ background-color: lighten($yellow, 14%);
+ }
+ }
+
+ &.editable {
+ padding: 3px 6px;
}
a {
color: lighten($dark-blue, 10%);
+ display: block;
+ padding: 6px 35px 6px 6px;
+
+ &:hover {
+ background-color: lighten($yellow, 10%);
+ }
+
+ &.draggable {
+ background-color: $light-blue;
+ float: none;
+ height: 100%;
+ padding: 0;
+ @include position(absolute, 0px 0px 0 0);
+ width: 30px;
+ z-index: 99;
+
+ &:hover {
+ cursor: move;
+ background-color: lighten($yellow, 10%);
+ }
+ }
}
&.create-module {
diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss
index 0dada82323..8aa48f5fde 100644
--- a/cms/static/sass/_unit.scss
+++ b/cms/static/sass/_unit.scss
@@ -107,6 +107,10 @@ section#unit-wrapper {
padding: 6px;
border: 1px solid darken($light-blue, 15%);
color: $dark-blue;
+
+ &:hover {
+ background-color: lighten($yellow, 13%);
+ }
}
select {
From cb2a6f9d029043e94e388128bc34f130a70ffc15 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Fri, 6 Jul 2012 11:39:17 -0400
Subject: [PATCH 86/95] Played with the layout a bit and some other small
changes
---
cms/static/sass/_calendar.scss | 24 +++++++++++++++++++++---
cms/static/sass/_layout.scss | 3 ++-
cms/static/sass/_unit.scss | 1 -
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 602b5604b1..59c37e6687 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -65,6 +65,12 @@ section.cal {
background-color: $light-blue;
overflow-y: hidden;
+ &:hover {
+ li.create-module {
+ opacity: 1;
+ }
+ }
+
header {
border-bottom: 1px solid lighten($dark-blue, 40%);
@include box-shadow(0 2px 2px $light-blue);
@@ -106,6 +112,7 @@ section.cal {
list-style: none;
margin-bottom: 1px;
+
li {
border-bottom: 1px solid darken($light-blue, 8%);
position: relative;
@@ -149,6 +156,9 @@ section.cal {
&.create-module {
position: relative;
+ opacity: 0;
+ @include transition(all 3s ease-in-out);
+ background: darken($light-blue, 2%);
> div {
background: $dark-blue;
@@ -299,21 +309,29 @@ section.cal {
body.content
section.cal {
- width: flex-grid(3) + flex-gutter();
+ width: flex-grid(3);
float: left;
overflow: scroll;
@include box-sizing(border-box);
opacity: .4;
@include transition();
+ background: darken($light-blue, 2%);
&:hover {
opacity: 1;
+ width: flex-grid(4) + flex-gutter();
+ background-color: transparent;
+
+ + section.main-content {
+ width: flex-grid(8);
+ opacity: .6;
+ }
}
> header {
@include transition;
overflow: hidden;
- height: 55px;
+ height: 30px;
ul {
display: block;
@@ -330,7 +348,7 @@ section.cal {
}
&:hover {
- height: 167px;
+ height: 10%;
}
}
diff --git a/cms/static/sass/_layout.scss b/cms/static/sass/_layout.scss
index 9ea1060ca4..af59ddf6d4 100644
--- a/cms/static/sass/_layout.scss
+++ b/cms/static/sass/_layout.scss
@@ -73,9 +73,10 @@ body {
section.main-content {
border-left: 2px solid $dark-blue;
@include box-sizing(border-box);
- width: flex-grid(9);
+ width: flex-grid(9) + flex-gutter();
float: left;
@include box-shadow( -2px 0 0 darken($light-blue, 3%));
+ @include transition();
}
}
}
diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss
index 8aa48f5fde..d39f7c713e 100644
--- a/cms/static/sass/_unit.scss
+++ b/cms/static/sass/_unit.scss
@@ -21,7 +21,6 @@ section#unit-wrapper {
margin-left: 10px;
color: #999;
font-size: 12px;
- font-style: italic;
}
}
From 0cb4781e4351f0ef757023c703bf56d4096b65db Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Fri, 6 Jul 2012 15:01:59 -0400
Subject: [PATCH 87/95] Rearranged the filter and sort bar and made it
consistant
---
cms/static/sass/_calendar.scss | 39 +++++-----
cms/static/sass/_section.scss | 58 ++++++++++-----
cms/templates/widgets/navigation.html | 92 ++++++++++++------------
cms/templates/widgets/sequence-edit.html | 27 ++++---
4 files changed, 124 insertions(+), 92 deletions(-)
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 59c37e6687..08101ad1b9 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -18,21 +18,32 @@ section.cal {
text-transform: uppercase;
letter-spacing: 1px;
font-size: 14px;
- padding: 6px;
+ padding: 6px 6px 6px 0;
font-size: 12px;
}
ul {
@include inline-block;
+ float: right;
li {
@include inline-block;
- margin-left: 6px;
- border-left: 1px solid #ddd;
+ margin-right: 6px;
+ border-right: 1px solid #ddd;
padding: 0 6px;
+ &:last-child {
+ border-right: 0;
+ margin-right: 0;
+ padding-right: 0;
+ }
+
a {
@include inline-block();
+ font-size: 12px;
+ @include inline-block;
+ margin: 0 6px;
+ font-style: italic;
}
ul {
@@ -63,7 +74,6 @@ section.cal {
float: left;
width: flex-grid(3) + ((flex-gutter() * 3) / 4);
background-color: $light-blue;
- overflow-y: hidden;
&:hover {
li.create-module {
@@ -116,6 +126,7 @@ section.cal {
li {
border-bottom: 1px solid darken($light-blue, 8%);
position: relative;
+ overflow-y: hidden;
&:hover {
background-color: lighten($yellow, 14%);
@@ -232,7 +243,7 @@ section.cal {
}
section.new-section {
- margin-top: 10px;
+ margin: 10px 0 40px;
@include inline-block();
position: relative;
@@ -319,11 +330,11 @@ section.cal {
&:hover {
opacity: 1;
- width: flex-grid(4) + flex-gutter();
+ width: flex-grid(5) + flex-gutter();
background-color: transparent;
+ section.main-content {
- width: flex-grid(8);
+ width: flex-grid(7);
opacity: .6;
}
}
@@ -331,25 +342,21 @@ section.cal {
> header {
@include transition;
overflow: hidden;
- height: 30px;
+
+ > a {
+ display: none;
+ }
ul {
+ float: none;
display: block;
li {
- border-left: 0;
- margin-left: 0;
- margin-bottom: 4px;
-
ul {
display: inline;
}
}
}
-
- &:hover {
- height: 10%;
- }
}
ol {
diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss
index e12387e488..a0507679b4 100644
--- a/cms/static/sass/_section.scss
+++ b/cms/static/sass/_section.scss
@@ -1,29 +1,45 @@
section#unit-wrapper {
section.filters {
@include clearfix;
- background: $light-blue;
- border-bottom: 1px solid lighten($dark-blue, 40%);
- padding: 5px 20px;
- margin: -20px -20px 10px;
- opacity: .7;
+ opacity: .4;
+ margin-bottom: 10px;
@include transition;
&:hover {
opacity: 1;
- padding: 10px 20px;
- margin: -20px -20px 10px;
+ }
+
+ h2 {
+ @include inline-block();
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ font-size: 14px;
+ padding: 6px 6px 6px 0;
+ font-size: 12px;
}
ul {
@include clearfix();
list-style: none;
- padding: 6px;
li {
- @include inline-block();
+ @include inline-block;
+ margin-right: 6px;
+ border-right: 1px solid #ddd;
+ padding-right: 6px;
- &.advanced {
+ &.search {
float: right;
+ border: 0;
+ }
+
+ a {
+ &.more {
+ font-size: 12px;
+ @include inline-block;
+ margin: 0 6px;
+ font-style: italic;
+ }
}
}
}
@@ -44,11 +60,12 @@ section#unit-wrapper {
@include clearfix;
h2 {
- text-transform: uppercase;
- letter-spacing: 1px;
- font-size: 12px;
- float: left;
color: $bright-blue;
+ float: left;
+ font-size: 12px;
+ letter-spacing: 1px;
+ line-height: 19px;
+ text-transform: uppercase;
}
}
@@ -149,6 +166,14 @@ section#unit-wrapper {
border-bottom: 0;
}
+ &.new-module a {
+ background-color: darken($light-blue, 2%);
+
+ &:hover {
+ background-color: lighten($yellow, 10%);
+ }
+ }
+
a {
color: $dark-blue;
}
@@ -158,9 +183,10 @@ section#unit-wrapper {
li {
padding: 6px;
+ border-collapse: collapse;
&:last-child {
- border-bottom: 0;
+ border-bottom: 1px solid darken($light-blue, 8%);
}
&:hover {
@@ -171,6 +197,7 @@ section#unit-wrapper {
}
}
+
&.empty {
padding: 12px;
@@ -182,7 +209,6 @@ section#unit-wrapper {
}
a.draggable {
- float: right;
opacity: .3;
}
}
diff --git a/cms/templates/widgets/navigation.html b/cms/templates/widgets/navigation.html
index ea158d305a..587aba6982 100644
--- a/cms/templates/widgets/navigation.html
+++ b/cms/templates/widgets/navigation.html
@@ -1,35 +1,34 @@
@@ -83,6 +82,7 @@
Video 3
handle
+ <%include file="module-dropdown.html"/>
@@ -90,30 +90,30 @@
diff --git a/cms/templates/widgets/sequence-edit.html b/cms/templates/widgets/sequence-edit.html
index 319e137638..86a1a03aa0 100644
--- a/cms/templates/widgets/sequence-edit.html
+++ b/cms/templates/widgets/sequence-edit.html
@@ -2,30 +2,29 @@
From c8da98743695c66263a0513688b52444d7737bc4 Mon Sep 17 00:00:00 2001
From: Kyle Fiedler
Date: Fri, 6 Jul 2012 17:12:35 -0400
Subject: [PATCH 88/95] Added new icons for all of the content
---
cms/static/img/content-types/chapter.png | Bin 0 -> 135 bytes
cms/static/img/content-types/html.png | Bin 0 -> 352 bytes
cms/static/img/content-types/lab.png | Bin 0 -> 207 bytes
cms/static/img/content-types/problem.png | Bin 0 -> 235 bytes
cms/static/img/content-types/problemset.png | Bin 0 -> 222 bytes
cms/static/img/content-types/sequential.png | Bin 0 -> 122 bytes
cms/static/img/content-types/vertical.png | Bin 0 -> 144 bytes
cms/static/img/content-types/video.png | Bin 0 -> 129 bytes
.../img/content-types/videosequence.png | Bin 0 -> 176 bytes
cms/static/sass/_calendar.scss | 15 +-
cms/static/sass/_content-types.scss | 55 ++
cms/static/sass/_layout.scss | 3 +-
cms/static/sass/_normalize.scss | 504 ++++++++++++++++++
cms/static/sass/_reset.scss | 229 --------
cms/static/sass/_section.scss | 16 +-
cms/static/sass/_unit.scss | 20 +-
cms/static/sass/base-style.scss | 4 +-
cms/templates/unit.html | 2 +-
cms/templates/widgets/navigation.html | 1 +
cms/templates/widgets/sequence-edit.html | 2 +-
20 files changed, 610 insertions(+), 241 deletions(-)
create mode 100644 cms/static/img/content-types/chapter.png
create mode 100644 cms/static/img/content-types/html.png
create mode 100644 cms/static/img/content-types/lab.png
create mode 100644 cms/static/img/content-types/problem.png
create mode 100644 cms/static/img/content-types/problemset.png
create mode 100644 cms/static/img/content-types/sequential.png
create mode 100644 cms/static/img/content-types/vertical.png
create mode 100644 cms/static/img/content-types/video.png
create mode 100644 cms/static/img/content-types/videosequence.png
create mode 100644 cms/static/sass/_content-types.scss
create mode 100644 cms/static/sass/_normalize.scss
delete mode 100644 cms/static/sass/_reset.scss
diff --git a/cms/static/img/content-types/chapter.png b/cms/static/img/content-types/chapter.png
new file mode 100644
index 0000000000000000000000000000000000000000..2903f668d02fd81fafc8f70143c3899176e0835e
GIT binary patch
literal 135
zcmeAS@N?(olHy`uVBq!ia0vp@KrFz)1|-ie{%Q%N{5)M8Ln>~)J-dc^
literal 0
HcmV?d00001
diff --git a/cms/static/img/content-types/html.png b/cms/static/img/content-types/html.png
new file mode 100644
index 0000000000000000000000000000000000000000..566d0a232e780cc39a72413c5e747cbfc6ef6c0b
GIT binary patch
literal 352
zcmV-m0iXVfP)^7{>8uSeRrnNy&m0OS@;IBx!0SvD5epvP6nTLfObyu##C)Oj$8j7D#*p@-|IE
zBa@f$KXpyrojQwI{1(@B?)%iK6BUk&))q?GRu1xuH}s&==;A7#vDWBfH#TvLPr1fA
zxUT`vqVCCsFNId~o&sWApwBEOHTxKu
zn}>Bci8Au&M`R3X_RNJ9g##pzGYh_b%`UpojFYRG8>ZA8nkmHSr6AXBf9|!p6j7JdoSibFe!VcYcYFkiaSyFPyk=W2K?)zr|e>
z_fqlH#ItX41_@+dJVNcnHHJ1G;0}qnqOb7|k}&^-O;keSX+1lWko_s-O_daw@jU6nz=iR
zZ!u@i-_*!rxlRQrTa+Nm1YJma=;MXN;;h0N_K49=2N4oHaQR^i!5AwvFhgF{3k8V9
zNbSwdT*Y4D0ika^Q1>U)vBSm{7x7g8(Sq5(x#I8>UD1K~#yJepL;!KdHvb)0Ji_XC
l93#o-XyPfN4B;I;$Qw*qQ{cg5E(rht002ovPDHLkV1o5;V>ti-
literal 0
HcmV?d00001
diff --git a/cms/static/img/content-types/problemset.png b/cms/static/img/content-types/problemset.png
new file mode 100644
index 0000000000000000000000000000000000000000..85576db2ac0273d138a9276fc5354ecc6cae0d05
GIT binary patch
literal 222
zcmV<403rX0P)6YMG*H@OBuFle)wgspz@F!Zzt~NWl-R7xmm9$
z>|H3R=IEnf=F!doS5?9Z=w5P3V8{
z*SfqYf8%1gL&iHq{4dO67d&!we#2pP!w(8AD}EP>|D37#!u5}JQ(82(*I1)78&qol`;+09EWTT>t<8
literal 0
HcmV?d00001
diff --git a/cms/static/img/content-types/video.png b/cms/static/img/content-types/video.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c9f0176bcd469d73eefe1c097dc5d11a0e24eea
GIT binary patch
literal 129
zcmeAS@N?(olHy`uVBq!ia0vp^d_XL~!3HGNrubO_DGyH<$B>F!ZzmgaF(`1j{y(@Y
zGdzP|D*KII>_M(6W}5BOr0#`3Jk9QSWQwoPN@lAi4bsO&txjt*zt!W?S2OFazbf5%
d?}O|@=BBQ|FHZ9-b^^_0@O1TaS?83{1OUxWDLDWD
literal 0
HcmV?d00001
diff --git a/cms/static/img/content-types/videosequence.png b/cms/static/img/content-types/videosequence.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a6c85843b6dfedc5cacdc00f8632c6880dae125
GIT binary patch
literal 176
zcmeAS@N?(olHy`uVBq!ia0vp^B0wy}!3HFwFZ>e#Qstg5jv*Ddu1+@OYA_IB`MlxJ
z75y9RI$OW!+Z{A!KNPuUwVs5B;gS>2jB-4*F6$(w3EYp-{?^#aXXAV`JWq7z^F~Ld
zJttqbnF}~Cj84;-seD*hU{`K}#6drv!tK9H*LOZ_$iHmO@}liUv-kQlZ2yuvc0cW@
bd&e-t_0akgnvZ4yoxtGf>gTe~DWM4fp8Q1Y
literal 0
HcmV?d00001
diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss
index 08101ad1b9..d110a4cadf 100644
--- a/cms/static/sass/_calendar.scss
+++ b/cms/static/sass/_calendar.scss
@@ -20,11 +20,13 @@ section.cal {
font-size: 14px;
padding: 6px 6px 6px 0;
font-size: 12px;
+ margin: 0;
}
ul {
@include inline-block;
float: right;
+ margin: 0;
li {
@include inline-block;
@@ -48,6 +50,7 @@ section.cal {
ul {
@include inline-block();
+ margin: 0;
li {
@include inline-block();
@@ -66,6 +69,8 @@ section.cal {
border-top: 1px solid lighten($dark-blue, 40%);
width: 100%;
@include box-sizing(border-box);
+ margin: 0;
+ padding: 0;
> li {
border-right: 1px solid lighten($dark-blue, 40%);
@@ -94,6 +99,7 @@ section.cal {
border-bottom: 1px solid lighten($dark-blue, 60%);
padding: 6px;
color: $bright-blue;
+ margin: 0;
a {
color: $bright-blue;
@@ -109,6 +115,9 @@ section.cal {
}
ul {
+ margin: 0;
+ padding: 0;
+
li {
background: #fff;
color: #888;
@@ -120,8 +129,8 @@ section.cal {
ul {
list-style: none;
- margin-bottom: 1px;
-
+ margin: 0 0 1px 0;
+ padding: 0;
li {
border-bottom: 1px solid darken($light-blue, 8%);
@@ -133,6 +142,7 @@ section.cal {
a.draggable {
background-color: lighten($yellow, 14%);
+ opacity: 1;
}
}
@@ -157,6 +167,7 @@ section.cal {
@include position(absolute, 0px 0px 0 0);
width: 30px;
z-index: 99;
+ opacity: .3;
&:hover {
cursor: move;
diff --git a/cms/static/sass/_content-types.scss b/cms/static/sass/_content-types.scss
new file mode 100644
index 0000000000..6df113df78
--- /dev/null
+++ b/cms/static/sass/_content-types.scss
@@ -0,0 +1,55 @@
+.content-type {
+ padding-left: 34px;
+ background-position: 8px center;
+ background-repeat: no-repeat;
+}
+
+.videosequence a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/videosequence.png');
+}
+
+.video a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/video.png');
+}
+
+.problemset a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/problemset.png');
+}
+
+.problem a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/problem.png');
+}
+
+.lab a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/lab.png');
+}
+
+.tab a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/lab.png');
+}
+
+.html a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/html.png');
+}
+
+.vertical a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/vertical.png');
+}
+
+.sequential a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/sequential.png');
+}
+
+.chapter a:first-child {
+ @extend .content-type;
+ background-image: url('/static/img/content-types/chapter.png');
+}
diff --git a/cms/static/sass/_layout.scss b/cms/static/sass/_layout.scss
index af59ddf6d4..f4c9f63ea6 100644
--- a/cms/static/sass/_layout.scss
+++ b/cms/static/sass/_layout.scss
@@ -26,7 +26,7 @@ body {
font-size: 14px;
text-transform: uppercase;
float: left;
- margin-right: 15px;
+ margin: 0 15px 0 0;
a {
color: #fff;
@@ -47,6 +47,7 @@ body {
ul {
float: left;
+ margin: 0;
&.user-nav {
float: right;
diff --git a/cms/static/sass/_normalize.scss b/cms/static/sass/_normalize.scss
new file mode 100644
index 0000000000..4474dee25a
--- /dev/null
+++ b/cms/static/sass/_normalize.scss
@@ -0,0 +1,504 @@
+/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
+
+/* =============================================================================
+ HTML5 display definitions
+ ========================================================================== */
+
+/*
+ * Corrects block display not defined in IE6/7/8/9 & FF3
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/*
+ * Corrects inline-block display not defined in IE6/7/8/9 & FF3
+ */
+
+audio,
+canvas,
+video {
+ display: inline-block;
+ *display: inline;
+ *zoom: 1;
+}
+
+/*
+ * Prevents modern browsers from displaying 'audio' without controls
+ * Remove excess height in iOS5 devices
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/*
+ * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
+ * Known issue: no IE6 support
+ */
+
+[hidden] {
+ display: none;
+}
+
+
+/* =============================================================================
+ Base
+ ========================================================================== */
+
+/*
+ * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
+ * http://clagnut.com/blog/348/#c790
+ * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
+ * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
+ */
+
+html {
+ font-size: 100%; /* 1 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+ -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/*
+ * Addresses font-family inconsistency between 'textarea' and other form elements.
+ */
+
+html,
+button,
+input,
+select,
+textarea {
+ font-family: sans-serif;
+}
+
+/*
+ * Addresses margins handled incorrectly in IE6/7
+ */
+
+body {
+ margin: 0;
+}
+
+
+/* =============================================================================
+ Links
+ ========================================================================== */
+
+/*
+ * Addresses outline displayed oddly in Chrome
+ */
+
+a:focus {
+ outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers
+ * people.opera.com/patrickl/experiments/keyboard/test
+ */
+
+a:hover,
+a:active {
+ outline: 0;
+}
+
+
+/* =============================================================================
+ Typography
+ ========================================================================== */
+
+/*
+ * Addresses font sizes and margins set differently in IE6/7
+ * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+h2 {
+ font-size: 1.5em;
+ margin: 0.83em 0;
+}
+
+h3 {
+ font-size: 1.17em;
+ margin: 1em 0;
+}
+
+h4 {
+ font-size: 1em;
+ margin: 1.33em 0;
+}
+
+h5 {
+ font-size: 0.83em;
+ margin: 1.67em 0;
+}
+
+h6 {
+ font-size: 0.75em;
+ margin: 2.33em 0;
+}
+
+/*
+ * Addresses styling not present in IE7/8/9, S5, Chrome
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to 'bolder' in FF3+, S4/5, Chrome
+*/
+
+b,
+strong {
+ font-weight: bold;
+}
+
+blockquote {
+ margin: 1em 40px;
+}
+
+/*
+ * Addresses styling not present in S5, Chrome
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE6/7/8/9
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/*
+ * Addresses margins set differently in IE6/7
+ */
+
+p,
+pre {
+ margin: 1em 0;
+}
+
+/*
+ * Corrects font family set oddly in IE6, S4/5, Chrome
+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59
+ */
+
+pre,
+code,
+kbd,
+samp {
+ font-family: monospace, serif;
+ _font-family: 'courier new', monospace;
+ font-size: 1em;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers
+ */
+
+pre {
+ white-space: pre;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+
+/*
+ * 1. Addresses CSS quotes not supported in IE6/7
+ * 2. Addresses quote property not supported in S4
+ */
+
+/* 1 */
+
+q {
+ quotes: none;
+}
+
+/* 2 */
+
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+
+small {
+ font-size: 75%;
+}
+
+/*
+ * Prevents sub and sup affecting line-height in all browsers
+ * gist.github.com/413930
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+
+/* =============================================================================
+ Lists
+ ========================================================================== */
+
+/*
+ * Addresses margins set differently in IE6/7
+ */
+
+dl,
+menu,
+ol,
+ul {
+ margin: 1em 0;
+}
+
+dd {
+ margin: 0 0 0 40px;
+}
+
+/*
+ * Addresses paddings set differently in IE6/7
+ */
+
+menu,
+ol,
+ul {
+ padding: 0 0 0 40px;
+}
+
+/*
+ * Corrects list images handled incorrectly in IE7
+ */
+
+nav ul,
+nav ol {
+ list-style: none;
+ list-style-image: none;
+}
+
+
+/* =============================================================================
+ Embedded content
+ ========================================================================== */
+
+/*
+ * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
+ * 2. Improves image quality when scaled in IE7
+ * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
+ */
+
+img {
+ border: 0; /* 1 */
+ -ms-interpolation-mode: bicubic; /* 2 */
+}
+
+/*
+ * Corrects overflow displayed oddly in IE9
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+
+/* =============================================================================
+ Figures
+ ========================================================================== */
+
+/*
+ * Addresses margin not present in IE6/7/8/9, S5, O11
+ */
+
+figure {
+ margin: 0;
+}
+
+
+/* =============================================================================
+ Forms
+ ========================================================================== */
+
+/*
+ * Corrects margin displayed oddly in IE6/7
+ */
+
+form {
+ margin: 0;
+}
+
+/*
+ * Define consistent border, margin, and padding
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE6/7/8/9
+ * 2. Corrects text not wrapping in FF3
+ * 3. Corrects alignment displayed oddly in IE6/7
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0;
+ white-space: normal; /* 2 */
+ *margin-left: -7px; /* 3 */
+}
+
+/*
+ * 1. Corrects font size not being inherited in all browsers
+ * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
+ * 3. Improves appearance and consistency in all browsers
+ */
+
+button,
+input,
+select,
+textarea {
+ font-size: 100%; /* 1 */
+ margin: 0; /* 2 */
+ vertical-align: baseline; /* 3 */
+ *vertical-align: middle; /* 3 */
+}
+
+/*
+ * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
+ */
+
+button,
+input {
+ line-height: normal; /* 1 */
+}
+
+/*
+ * 1. Improves usability and consistency of cursor style between image-type 'input' and others
+ * 2. Corrects inability to style clickable 'input' types in iOS
+ * 3. Removes inner spacing in IE7 without affecting normal text inputs
+ * Known issue: inner spacing remains in IE6
+ */
+
+button,
+input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+ cursor: pointer; /* 1 */
+ -webkit-appearance: button; /* 2 */
+ *overflow: visible; /* 3 */
+}
+
+/*
+ * Re-set default cursor for disabled elements
+ */
+
+button[disabled],
+input[disabled] {
+ cursor: default;
+}
+
+/*
+ * 1. Addresses box sizing set to content-box in IE8/9
+ * 2. Removes excess padding in IE8/9
+ * 3. Removes excess padding in IE7
+ Known issue: excess padding remains in IE6
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+ *height: 13px; /* 3 */
+ *width: 13px; /* 3 */
+}
+
+/*
+ * 1. Addresses appearance set to searchfield in S5, Chrome
+ * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding and search cancel button in S5, Chrome on OS X
+ */
+
+input[type="search"]::-webkit-search-decoration,
+input[type="search"]::-webkit-search-cancel-button {
+ -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in FF3+
+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE6/7/8/9
+ * 2. Improves readability and alignment in all browsers
+ */
+
+textarea {
+ overflow: auto; /* 1 */
+ vertical-align: top; /* 2 */
+}
+
+
+/* =============================================================================
+ Tables
+ ========================================================================== */
+
+/*
+ * Remove most spacing between table cells
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
diff --git a/cms/static/sass/_reset.scss b/cms/static/sass/_reset.scss
deleted file mode 100644
index bfe619c1b0..0000000000
--- a/cms/static/sass/_reset.scss
+++ /dev/null
@@ -1,229 +0,0 @@
-html, body, div, span, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-abbr, address, cite, code,
-del, dfn, em, img, ins, kbd, q, samp,
-small, strong, sub, sup, var,
-b, i,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section, summary,
-time, mark, audio, video {
- margin:0;
- padding:0;
- border:0;
- outline:0;
- vertical-align:baseline;
- background:transparent;
-}
-
-html,body {
- font-size: 100%;
-}
-
-// Corrects block display not defined in IE8/9 & FF3
-article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
- display: block;
-}
-
-// Corrects inline-block display not defined in IE8/9 & FF3
-audio, canvas, video {
- display: inline-block;
-}
-
-// Prevents modern browsers from displaying 'audio' without controls
-audio:not([controls]) {
- display: none;
-}
-
-// Addresses styling for 'hidden' attribute not present in IE8/9, FF3, S4
-[hidden] {
- display: none;
-}
-
-// Prevents iOS text size adjust after orientation change, without disabling user zoom
-// www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
-html {
- font-size: 100%;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-// Addresses font-family inconsistency between 'textarea' and other form elements.
-html, button, input, select, textarea {
- font-family: sans-serif;
-}
-
-a {
- // Addresses outline displayed oddly in Chrome
- &:focus {
- outline: thin dotted;
- // Webkit
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
- }
-
- // Improves readability when focused and also mouse hovered in all browsers
- // people.opera.com/patrickl/experiments/keyboard/test
- &:hover, &:active {
- outline: 0;
- }
-}
-
-// Addresses styling not present in IE8/9, S5, Chrome
-abbr[title] {
- border-bottom: 1px dotted;
-}
-
-// Addresses style set to 'bolder' in FF3+, S4/5, Chrome
-b, strong {
- font-weight: bold;
-}
-
-blockquote {
- margin: 1em 40px;
-}
-
-// Addresses styling not present in S5, Chrome
-dfn {
- font-style: italic;
-}
-
-// Addresses styling not present in IE8/9
-mark {
- background: #ff0;
- color: #000;
-}
-
-// Corrects font family set oddly in S4/5, Chrome
-// en.wikipedia.org/wiki/User:Davidgothberg/Test59
-pre, code, kbd, samp {
- font-family: monospace, serif;
- _font-family: 'courier new', monospace;
- font-size: 1em;
-}
-
-// Improves readability of pre-formatted text in all browsers
-pre {
- white-space: pre;
- white-space: pre-wrap;
- word-wrap: break-word;
-}
-
-// Addresses quote property not supported in S4
-blockquote, q {
- quotes: none;
- &:before, &:after {
- content: '';
- content: none;
- }
-}
-
-small {
- font-size: 75%;
-}
-
-sub, sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-nav {
- ul, ol {
- list-style: none;
- list-style-image: none;
- }
-}
-
-// Removes border when inside 'a' element in IE8/9, FF3
-img {
- border: 0;
- height: auto;
- max-width: 100%;
- -ms-interpolation-mode: bicubic;
-}
-
-// Corrects overflow displayed oddly in IE9
-svg:not(:root) {
- overflow: hidden;
-}
-
-// Define consistent border, margin, and padding
-fieldset {
- border: 1px solid #c0c0c0;
- margin: 0 2px;
- padding: 0.35em 0.625em 0.75em;
-}
-
-legend {
- border: 0; // Corrects color not being inherited in IE8/9
- padding: 0;
- white-space: normal; // Corrects text not wrapping in FF3
-}
-
-button, input, select, textarea {
- font-size: 100%; // Corrects font size not being inherited in all browsers
- margin: 0; // Addresses margins set differently in FF3+, S5, Chrome
- vertical-align: baseline; // Improves appearance and consistency in all browsers
-}
-
-// Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
-button, input {
- line-height: normal;
-}
-
-button, input[type="button"], input[type="reset"], input[type="submit"] {
- cursor: pointer; // Improves usability and consistency of cursor style between image-type 'input' and others
- -webkit-appearance: button; // Corrects inability to style clickable 'input' types in iOS
-}
-
-// Re-set default cursor for disabled elements
-button[disabled], input[disabled] {
- cursor: default;
-}
-
-input[type="checkbox"], input[type="radio"] {
- box-sizing: border-box; // Addresses box sizing set to content-box in IE8/9
- padding: 0; //Removes excess padding in IE8/9
-}
-
-input[type="search"] {
- -webkit-appearance: textfield; // Addresses appearance set to searchfield in S5, Chrome
- -moz-box-sizing: content-box;
- -webkit-box-sizing: content-box; // Addresses box-sizing set to border-box in S5, Chrome (-moz to future-proof)
- box-sizing: content-box;
-}
-
-// Removes inner padding and search cancel button in S5, Chrome on OS X
-input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button {
- -webkit-appearance: none;
-}
-
-// Removes inner padding and border in FF3+
-// www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
-button::-moz-focus-inner, input::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-
-textarea {
- overflow: auto; // Removes default vertical scrollbar in IE8/9
- vertical-align: top; // Improves readability and alignment in all browsers
-}
-
-// Remove most spacing between table cells
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss
index a0507679b4..ca16a4093e 100644
--- a/cms/static/sass/_section.scss
+++ b/cms/static/sass/_section.scss
@@ -16,11 +16,14 @@ section#unit-wrapper {
font-size: 14px;
padding: 6px 6px 6px 0;
font-size: 12px;
+ margin: 0;
}
ul {
@include clearfix();
list-style: none;
+ margin: 0;
+ padding: 0;
li {
@include inline-block;
@@ -66,6 +69,7 @@ section#unit-wrapper {
letter-spacing: 1px;
line-height: 19px;
text-transform: uppercase;
+ margin: 0;
}
}
@@ -88,6 +92,8 @@ section#unit-wrapper {
ol {
list-style: none;
+ margin: 0;
+ padding: 0;
li {
border-bottom: 1px solid lighten($dark-blue, 60%);
@@ -98,6 +104,8 @@ section#unit-wrapper {
ol {
list-style: none;
+ margin: 0;
+ padding: 0;
li {
padding: 6px;
@@ -128,13 +136,15 @@ section#unit-wrapper {
h3 {
font-size: 14px;
+ margin: 0;
}
}
-
ol {
border-left: 4px solid #999;
border-bottom: 0;
+ margin: 0;
+ padding: 0;
li {
&:last-child {
@@ -157,6 +167,8 @@ section#unit-wrapper {
ol {
list-style: none;
+ margin: 0;
+ padding: 0;
li {
border-bottom: 1px solid darken($light-blue, 8%);
@@ -180,6 +192,8 @@ section#unit-wrapper {
ul {
list-style: none;
+ margin: 0;
+ padding: 0;
li {
padding: 6px;
diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss
index d39f7c713e..d8613be3c2 100644
--- a/cms/static/sass/_unit.scss
+++ b/cms/static/sass/_unit.scss
@@ -14,13 +14,19 @@ section#unit-wrapper {
letter-spacing: 1px;
@include inline-block();
color: $bright-blue;
+ margin: 0;
}
p {
@include inline-block();
- margin-left: 10px;
- color: #999;
- font-size: 12px;
+ margin: 0;
+
+ a {
+ text-indent: -9999px;
+ @include inline-block();
+ width: 1px;
+ height: 100%;
+ }
}
}
@@ -71,10 +77,12 @@ section#unit-wrapper {
@include clearfix;
ul {
- list-style: none;
border: 1px solid darken($light-blue, 15%);
@include clearfix();
float: left;
+ list-style: none;
+ margin: 0;
+ padding: 0;
li {
border-right: 1px solid darken($light-blue, 15%);
@@ -144,10 +152,12 @@ section#unit-wrapper {
h2 {
font-size: 14px;
@include inline-block();
+ margin: 0;
}
p {
@include inline-block();
+ margin: 0;
}
}
}
@@ -212,6 +222,8 @@ section#unit-wrapper {
ul {
list-style: none;
+ margin: 0;
+ padding: 0;
li {
margin-bottom: 20px;
diff --git a/cms/static/sass/base-style.scss b/cms/static/sass/base-style.scss
index 3a6c6e0cea..c85b87f453 100644
--- a/cms/static/sass/base-style.scss
+++ b/cms/static/sass/base-style.scss
@@ -1,6 +1,6 @@
@import 'bourbon/bourbon';
-@import 'reset';
+@import 'normalize';
-@import 'base', 'layout';
+@import 'base', 'layout', 'content-types';
@import 'calendar';
@import 'section', 'unit';
diff --git a/cms/templates/unit.html b/cms/templates/unit.html
index 34e21ca049..cd921d2be2 100644
--- a/cms/templates/unit.html
+++ b/cms/templates/unit.html
@@ -2,7 +2,7 @@