From c1e037918cefe983cde49c7ff48c67b6094a9ced Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 7 Aug 2013 21:07:51 -0400 Subject: [PATCH] add docstring on StaticContent utility method --- common/lib/xmodule/xmodule/contentstore/content.py | 7 +++++++ common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/contentstore/content.py b/common/lib/xmodule/xmodule/contentstore/content.py index b270d1dbcb..eaf3f48dea 100644 --- a/common/lib/xmodule/xmodule/contentstore/content.py +++ b/common/lib/xmodule/xmodule/contentstore/content.py @@ -60,6 +60,13 @@ class StaticContent(object): @staticmethod def get_static_path_from_location(location): + """ + This utility static method will take a location identifier and create a 'durable' /static/.. URL representation of it. + This link is 'durable' as it can maintain integrity across cloning of courseware across course-ids, e.g. reruns of + courses. + In the LMS/CMS, we have runtime link-rewriting, so at render time, this /static/... format will get translated into + the actual /c4x/... path which the client needs to reference static content + """ if location is not None: return "/static/{name}".format(**location.dict()) else: diff --git a/common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee b/common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee index 337ea55030..11aaf8e526 100644 --- a/common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/html/edit_spec.coffee @@ -98,7 +98,7 @@ describe 'HTMLEditingDescriptor', -> expect(visualEditorStub.isDirty()).toEqual(false) expect(visualEditorStub.getContent()).toEqual('Advanced Editor Text') expect(visualEditorStub.startContent).toEqual('Advanced Editor Text') - it 'When switching to Advanced Editors links are rewritten to c4x format', -> + it 'When switching to visual editor links are rewritten to c4x format', -> loadFixtures 'html-edit-with-links.html' @descriptor = new HTMLEditingDescriptor($('.html-edit')) @descriptor.base_asset_url = '/c4x/foo/bar/asset/'