Commit 3d5b571a by Carlos Andrés Rocha

Move courseware related templates to their own folder

Fix moved links
parent 423de186
...@@ -78,7 +78,7 @@ def courses(request): ...@@ -78,7 +78,7 @@ def courses(request):
''' '''
universities = get_courses_by_university(request.user, universities = get_courses_by_university(request.user,
domain=request.META.get('HTTP_HOST')) domain=request.META.get('HTTP_HOST'))
return render_to_response("courses.html", {'universities': universities}) return render_to_response("courseware/courses.html", {'universities': universities})
def render_accordion(request, course, chapter, section): def render_accordion(request, course, chapter, section):
...@@ -97,7 +97,7 @@ def render_accordion(request, course, chapter, section): ...@@ -97,7 +97,7 @@ def render_accordion(request, course, chapter, section):
context = dict([('toc', toc), context = dict([('toc', toc),
('course_id', course.id), ('course_id', course.id),
('csrf', csrf(request)['csrf_token'])] + template_imports.items()) ('csrf', csrf(request)['csrf_token'])] + template_imports.items())
return render_to_string('accordion.html', context) return render_to_string('courseware/accordion.html', context)
def get_current_child(xmodule): def get_current_child(xmodule):
...@@ -407,7 +407,7 @@ def course_about(request, course_id): ...@@ -407,7 +407,7 @@ def course_about(request, course_id):
show_courseware_link = (has_access(request.user, course, 'load') or show_courseware_link = (has_access(request.user, course, 'load') or
settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION')) settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'))
return render_to_response('portal/course_about.html', return render_to_response('courseware/course_about.html',
{'course': course, {'course': course,
'registered': registered, 'registered': registered,
'course_target': course_target, 'course_target': course_target,
...@@ -449,7 +449,7 @@ def render_notifications(request, course, notifications): ...@@ -449,7 +449,7 @@ def render_notifications(request, course, notifications):
'get_discussion_title': partial(get_discussion_title, request=request, course=course), 'get_discussion_title': partial(get_discussion_title, request=request, course=course),
'course': course, 'course': course,
} }
return render_to_string('notifications.html', context) return render_to_string('courseware/notifications.html', context)
@login_required @login_required
def news(request, course_id): def news(request, course_id):
...@@ -462,7 +462,7 @@ def news(request, course_id): ...@@ -462,7 +462,7 @@ def news(request, course_id):
'content': render_notifications(request, course, notifications), 'content': render_notifications(request, course, notifications),
} }
return render_to_response('news.html', context) return render_to_response('courseware/news.html', context)
@login_required @login_required
@cache_control(no_cache=True, no_store=True, must_revalidate=True) @cache_control(no_cache=True, no_store=True, must_revalidate=True)
......
<%inherit file="main.html" /> <%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<%block name="title"><title>Courses</title></%block> <%block name="title"><title>Courses</title></%block>
...@@ -22,17 +22,17 @@ ...@@ -22,17 +22,17 @@
<section class="courses"> <section class="courses">
<section class='university-column'> <section class='university-column'>
%for course in universities['MITx']: %for course in universities['MITx']:
<%include file="course.html" args="course=course" /> <%include file="../course.html" args="course=course" />
%endfor %endfor
</section> </section>
<section class='university-column'> <section class='university-column'>
%for course in universities['HarvardX']: %for course in universities['HarvardX']:
<%include file="course.html" args="course=course" /> <%include file="../course.html" args="course=course" />
%endfor %endfor
</section> </section>
<section class='university-column last'> <section class='university-column last'>
%for course in universities['BerkeleyX']: %for course in universities['BerkeleyX']:
<%include file="course.html" args="course=course" /> <%include file="../course.html" args="course=course" />
%endfor %endfor
</section> </section>
</section> </section>
......
<%inherit file="main.html" /> <%inherit file="main.html" />
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<%block name="bodyclass">courseware news</%block> <%block name="bodyclass">courseware news</%block>
<%block name="title"><title>News – MITx 6.002x</title></%block> <%block name="title"><title>News – MITx 6.002x</title></%block>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<%block name="js_extra"> <%block name="js_extra">
</%block> </%block>
<%include file="/courseware/course_navigation.html" args="active_page='news'" /> <%include file="course_navigation.html" args="active_page='news'" />
<section class="container"> <section class="container">
<div class="course-wrapper"> <div class="course-wrapper">
......
...@@ -5,7 +5,7 @@ def url_for_thread(discussion_id, thread_id): ...@@ -5,7 +5,7 @@ def url_for_thread(discussion_id, thread_id):
return reverse('django_comment_client.forum.views.single_thread', args=[course.id, discussion_id, thread_id]) return reverse('django_comment_client.forum.views.single_thread', args=[course.id, discussion_id, thread_id])
%> %>
<% <%
def url_for_comment(discussion_id, thread_id, comment_id): def url_for_comment(discussion_id, thread_id, comment_id):
return url_for_thread(discussion_id, thread_id) + "#" + comment_id return url_for_thread(discussion_id, thread_id) + "#" + comment_id
%> %>
...@@ -15,7 +15,7 @@ def url_for_discussion(discussion_id): ...@@ -15,7 +15,7 @@ def url_for_discussion(discussion_id):
return reverse('django_comment_client.forum.views.forum_form_discussion', args=[course.id, discussion_id]) return reverse('django_comment_client.forum.views.forum_form_discussion', args=[course.id, discussion_id])
%> %>
<% <%
def discussion_title(discussion_id): def discussion_title(discussion_id):
return get_discussion_title(discussion_id=discussion_id) return get_discussion_title(discussion_id=discussion_id)
%> %>
...@@ -59,18 +59,18 @@ def url_for_user(user_id): #TODO ...@@ -59,18 +59,18 @@ def url_for_user(user_id): #TODO
<%def name="render_notification(notification)"> <%def name="render_notification(notification)">
<div class="notification"> <div class="notification">
% if notification['notification_type'] == 'post_reply': % if notification['notification_type'] == 'post_reply':
${render_user_link(notification)} posted a ${render_comment_link(notification)} ${render_user_link(notification)} posted a ${render_comment_link(notification)}
to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)} to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)}
% elif notification['notification_type'] == 'post_topic': % elif notification['notification_type'] == 'post_topic':
${render_user_link(notification)} posted a new thread ${render_thread_link(notification)} ${render_user_link(notification)} posted a new thread ${render_thread_link(notification)}
in discussion ${render_discussion_link(notification)} in discussion ${render_discussion_link(notification)}
% elif notification['notification_type'] == 'at_user': % elif notification['notification_type'] == 'at_user':
${render_user(info)} mentioned you in ${render_user(info)} mentioned you in
% if notification['info']['content_type'] == 'thread': % if notification['info']['content_type'] == 'thread':
the thread ${render_thread_link(notification)} the thread ${render_thread_link(notification)}
in discussion ${render_discussion_link(notification)} in discussion ${render_discussion_link(notification)}
% else: % else:
${render_comment_link(notification)} ${render_comment_link(notification)}
to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)} to the thread ${render_thread_link(notification)} in discussion ${render_discussion_link(notification)}
% endif % endif
% endif % endif
......
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