diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 138b7434a8..1ab78c7c90 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -1,7 +1,5 @@ from mitxmako.shortcuts import render_to_response from keystore.django import keystore -from django.contrib.auth.decorators import login_required -from django.http import HttpResponse def index(request): @@ -20,4 +18,5 @@ def edit_item(request): return render_to_response('unit.html', { 'contents': item.get_html(), 'type': item.type, + 'name': item.name, }) diff --git a/cms/static/sass/_problem.scss b/cms/static/sass/_problem.scss index cb418ef497..39df062cde 100644 --- a/cms/static/sass/_problem.scss +++ b/cms/static/sass/_problem.scss @@ -1,6 +1,4 @@ -section.problem-new, -section.problem-edit, -section.html-edit { +section#unit-wrapper { > header { border-bottom: 2px solid #333; @include clearfix(); @@ -17,50 +15,8 @@ section.html-edit { float: right; } } - > section { padding: 20px; - - textarea { - @include box-sizing(border-box); - display: block; - width: 100%; - } - - - div.preview { - background: #eee; - @include box-sizing(border-box); - min-height: 40px; - padding: 10px; - width: 100%; - margin-top: 10px; - - h1 { - font-size: 24px; - margin-bottom: 1em; - } - - h2 { - font-size: 20px; - margin-bottom: 1em; - } - - h3 { - font-size: 18; - margin-bottom: 1em; - } - - ul { - padding-left: 20px; - margin-bottom: 1em; - } - - p { - margin-bottom: 1em; - } - } - a.save-update { @extend .button; @include inline-block(); @@ -69,3 +25,47 @@ section.html-edit { } } +section.problem-new, +section.problem-edit, +section.html-edit { + textarea { + @include box-sizing(border-box); + display: block; + width: 100%; + } + + + div.preview { + background: #eee; + @include box-sizing(border-box); + min-height: 40px; + padding: 10px; + width: 100%; + margin-top: 10px; + + h1 { + font-size: 24px; + margin-bottom: 1em; + } + + h2 { + font-size: 20px; + margin-bottom: 1em; + } + + h3 { + font-size: 18; + margin-bottom: 1em; + } + + ul { + padding-left: 20px; + margin-bottom: 1em; + } + + p { + margin-bottom: 1em; + } + } +} + diff --git a/cms/templates/unit.html b/cms/templates/unit.html index 0ce973bb9e..c9a3d82b5a 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -1,3 +1,19 @@ -
+
+
+

${name}

+

Unit type: ${type}

+ + + + +
+
${contents} -
+ +
+
+ Save & Update + Cancel +
+
+ diff --git a/cms/templates/widgets/html-edit.html b/cms/templates/widgets/html-edit.html index 1cc201d40b..cbd8a7f3df 100644 --- a/cms/templates/widgets/html-edit.html +++ b/cms/templates/widgets/html-edit.html @@ -1,27 +1,4 @@ -<%namespace name='static' file='../static_content.html'/> -
-
-

${module.name}

-

Unit type: HTML

- - - - -
- -
-
-
- -
- -
${module.definition['data']['text']}
-
- - -
+ +
${module.definition['data']['text']}
diff --git a/common/lib/xmodule/js/module/html.coffee b/common/lib/xmodule/js/module/html.coffee index 47c6084837..e2cba2320c 100644 --- a/common/lib/xmodule/js/module/html.coffee +++ b/common/lib/xmodule/js/module/html.coffee @@ -1,5 +1,8 @@ class @HTML - constructor: (id) -> - $('#' + id + " #edit-box").on('input', -> - $('#' + id + ' #edit-preview').empty().append($(this).val()) + constructor: (@id) -> + id = @id + $("##{id} .edit-box").on('input', -> + $("##{id} .preview").empty().append($(this).val()) ) + + save: -> $("##{@id} .edit-box").val()