From 596de8ab2cc14581a2e17600da9e89da717670de Mon Sep 17 00:00:00 2001 From: cahrens Date: Tue, 19 Feb 2013 11:34:41 -0500 Subject: [PATCH] Hook up "View Live" buttons and get "New Static Tab" working again. --- cms/djangoapps/contentstore/views.py | 6 +++++- cms/static/coffee/src/views/tabs.coffee | 3 +-- cms/templates/edit-tabs.html | 5 +++-- cms/templates/index.html | 4 ++-- cms/templates/overview.html | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index b3bb134e3d..df0f5c41d2 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -125,7 +125,8 @@ def index(request): reverse('course_index', args=[ course.location.org, course.location.course, - course.location.name])) + course.location.name]), + get_lms_link_for_item(course.location)) for course in courses], 'user': request.user, 'disable_course_creation': settings.MITX_FEATURES.get('DISABLE_COURSE_CREATION', False) and not request.user.is_staff @@ -166,6 +167,8 @@ def course_index(request, org, course, name): if not has_access(request.user, location): raise PermissionDenied() + lms_link = get_lms_link_for_item(location) + upload_asset_callback_url = reverse('upload_asset', kwargs={ 'org': org, 'course': course, @@ -178,6 +181,7 @@ def course_index(request, org, course, name): return render_to_response('overview.html', { 'active_tab': 'courseware', 'context_course': course, + 'lms_link': lms_link, 'sections': sections, 'course_graders': json.dumps(CourseGradingModel.fetch(course.location).graders), 'parent_location': course.location, diff --git a/cms/static/coffee/src/views/tabs.coffee b/cms/static/coffee/src/views/tabs.coffee index 5a826c1794..9fbe4e5789 100644 --- a/cms/static/coffee/src/views/tabs.coffee +++ b/cms/static/coffee/src/views/tabs.coffee @@ -1,6 +1,4 @@ class CMS.Views.TabsEdit extends Backbone.View - events: - 'click .new-tab': 'addNewTab' initialize: => @$('.component').each((idx, element) => @@ -13,6 +11,7 @@ class CMS.Views.TabsEdit extends Backbone.View ) ) + @options.mast.find('.new-tab').on('click', @addNewTab) @$('.components').sortable( handle: '.drag-handle' update: @tabMoved diff --git a/cms/templates/edit-tabs.html b/cms/templates/edit-tabs.html index 7f28c46457..95b14fd5cf 100644 --- a/cms/templates/edit-tabs.html +++ b/cms/templates/edit-tabs.html @@ -9,7 +9,8 @@ el: $('.main-wrapper'), model: new CMS.Models.Module({ id: '${context_course.location}' - }) + }), + mast: $('.wrapper-mast') }); @@ -36,7 +37,7 @@