Commit 596de8ab by cahrens

Hook up "View Live" buttons and get "New Static Tab" working again.

parent 9eb02a8a
......@@ -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,
......
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
......
......@@ -9,7 +9,8 @@
el: $('.main-wrapper'),
model: new CMS.Models.Module({
id: '${context_course.location}'
})
}),
mast: $('.wrapper-mast')
});
</script>
</%block>
......@@ -36,7 +37,7 @@
<div class="wrapper-content wrapper">
<section class="content">
<div class="introduction has-links">
<p class="copy">Static Pages are additional pages that supplment your Courseware. Other course authors have used them to share a syllabus, calendar, handouts, and more.</p>
<p class="copy">Static Pages are additional pages that supplement your Courseware. Other course authors have used them to share a syllabus, calendar, handouts, and more.</p>
<nav class="nav-introduction-supplementary">
<ul>
<li class="nav-item">
......
......@@ -67,12 +67,12 @@
<article class="my-classes">
% if user.is_active:
<ul class="class-list">
%for course, url in courses:
%for course, url, lms_link in courses:
<li>
<a class="class-link" href="${url}" class="class-name">
<span class="class-name">${course}</span>
</a>
<a href="#" rel="external" class="button view-button view-live-button"><i class="ss-icon ss-symbolicons-block icon icon-view">&#xE010;</i>View Live</a>
<a href="${lms_link}" rel="external" class="button view-button view-live-button"><i class="ss-icon ss-symbolicons-block icon icon-view">&#xE010;</i>View Live</a>
</li>
%endfor
</ul>
......
......@@ -137,7 +137,7 @@
<a href="#" class="button new-button new-courseware-section-button"><i class="ss-icon ss-symbolicons-standard icon icon-create">&#x002B;</i> New Section</a>
</li>
<li class="nav-item">
<a href="#" rel="external" class="button view-button view-live-button"><i class="ss-icon ss-symbolicons-block icon icon-view">&#xE010;</i>View Live</a>
<a href="${lms_link}" rel="external" class="button view-button view-live-button"><i class="ss-icon ss-symbolicons-block icon icon-view">&#xE010;</i>View Live</a>
</li>
</ul>
</nav>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment