From 62d389c853e50fa111624c82ea7e17af65513030 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Fri, 8 Feb 2013 11:50:27 -0500 Subject: [PATCH] Added empty metadata attribute instead of using name to determine which template is empty (very awkward b/c it's a template descriptor not an instance one) Changed display conditionals to get the right things to show in the right tabs for problems --- cms/djangoapps/contentstore/views.py | 2 +- cms/templates/base.html | 1 - cms/templates/unit.html | 83 +++++++++---------- .../xmodule/xmodule/templates/html/empty.yaml | 3 +- .../xmodule/templates/problem/empty.yaml | 3 +- .../templates/problem/emptyadvanced.yaml | 13 +++ 6 files changed, 55 insertions(+), 50 deletions(-) create mode 100644 common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 87a2943773..1ae0757393 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -273,7 +273,7 @@ def edit_unit(request, location): template.display_name, template.location.url(), 'markdown' in template.metadata, - template.location.name == 'Empty' + 'empty' in template.metadata )) components = [ diff --git a/cms/templates/base.html b/cms/templates/base.html index 709ef80eb2..84f10fc2d1 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -31,7 +31,6 @@ - <%static:js group='main'/> <%static:js group='module-js'/> diff --git a/cms/templates/unit.html b/cms/templates/unit.html index eaf9294e38..3777c33591 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -64,8 +64,7 @@ % for type, templates in sorted(component_templates.items()):
-
-
+
Cancel
diff --git a/common/lib/xmodule/xmodule/templates/html/empty.yaml b/common/lib/xmodule/xmodule/templates/html/empty.yaml index 1262ed37cf..b6d867d7d6 100644 --- a/common/lib/xmodule/xmodule/templates/html/empty.yaml +++ b/common/lib/xmodule/xmodule/templates/html/empty.yaml @@ -1,6 +1,7 @@ --- metadata: - display_name: Empty + display_name: Blank HTML Page + empty: True data: | diff --git a/common/lib/xmodule/xmodule/templates/problem/empty.yaml b/common/lib/xmodule/xmodule/templates/problem/empty.yaml index 346f49609c..39c9e7671c 100644 --- a/common/lib/xmodule/xmodule/templates/problem/empty.yaml +++ b/common/lib/xmodule/xmodule/templates/problem/empty.yaml @@ -1,10 +1,11 @@ --- metadata: - display_name: Empty + display_name: Blank Common Problem rerandomize: never showanswer: always markdown: "" weight: "" + empty: True attempts: "" data: | diff --git a/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml b/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml new file mode 100644 index 0000000000..bba7b3a8ac --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/emptyadvanced.yaml @@ -0,0 +1,13 @@ +--- +metadata: + display_name: Blank Advanced Problem + rerandomize: never + showanswer: always + weight: "" + attempts: "" + empty: True +data: | + + + +children: []