Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lms/templates/courseware/course_about.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from courseware.courses import course_image_url, get_course_about_section
from courseware.access import has_access
from django.conf import settings
from edxmako.shortcuts import marketing_link

if settings.FEATURES.get('ENABLE_SHOPPING_CART'):
cart_link = reverse('shoppingcart.views.show_cart')
Expand Down Expand Up @@ -58,18 +59,24 @@

## making the conditional around this entire JS block for sanity
%if settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
<%
perms_error = _('The currently logged-in user account does not have permission to enroll in this course. '
'You may need to {start_logout_tag}log out{end_tag} then try the register button again. '
'Please visit the {start_help_tag}help page{end_tag} for a possible solution.').format(
start_help_tag="<a href='{url}'>".format(url=marketing_link('FAQ')), end_tag='</a>',
start_logout_tag="<a href='{url}'>".format(url=reverse('logout'))
)
%>
$('#class_enroll_form').on('ajax:complete', function(event, xhr) {
if(xhr.status == 200) {
location.href = "${reverse('dashboard')}";
} else if (xhr.status == 403) {
location.href = "${reverse('course-specific-register', args=[course.id])}?course_id=${course.id}&enrollment_action=enroll";
} else if (xhr.status == 400) { //This means the user did not have permission
$('#register_error').html('This course has restricted enrollment. Sorry, you do not have permission to enroll.<br />' +
'You may need to log out and re-login with a university account, such as WebAuth'
).css("display", "block");
$('#register_error').html("${perms_error}").css("display", "block");
} else {
$('#register_error').html(
(xhr.responseText ? xhr.responseText : 'An error occurred. Please try again later.')
(xhr.responseText ? xhr.responseText : "${_("An error occurred. Please try again later.")}")
).css("display", "block");
}
});
Expand Down
2 changes: 1 addition & 1 deletion lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
continue

# These urls are enabled separately
if key == "ROOT" or key == "COURSES" or key == "FAQ":
if key == "ROOT" or key == "COURSES":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See in the original PR comment. Basically, I don’t know why FAQ was ever excluded. But if it’s excluded, then marketing_urls(‘FAQ’) doesn’t work if themes are enabled.
I did a grep for FAQ over the codebase and didn’t spot any potential issues.

On Jan 14, 2014, at 11:06 AM, Sarina Canelake notifications@github.com wrote:

In lms/urls.py:

@@ -128,7 +128,7 @@
continue

 # These urls are enabled separately
  • if key == "ROOT" or key == "COURSES" or key == "FAQ":
  • if key == "ROOT" or key == "COURSES":
    What is the reasoning for this change?


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Er n/m I see you explain in the PR - ignore me :)

continue

# Make the assumptions that the templates are all in the same dir
Expand Down