%if user.is_authenticated() and registered:
%if show_courseware_link:
%endif
${_("You are enrolled in this course")}
%if show_courseware_link:
${_("View Course")}
%endif
%elif in_cart:
${_('This course is in your cart.').format(cart_link=cart_link)}
% elif is_course_full:
${_("Course is full")}
% elif invitation_only and not can_enroll:
${_("Enrollment in this course is by invitation only")}
## Shib courses need the enrollment button to be displayed even when can_enroll is False,
## because AnonymousUsers cause can_enroll for shib courses to be False, but we need them to be able to click
## so that they can register and become a real user that can enroll.
% elif not is_shib_course and not can_enroll:
${_("Enrollment is Closed")}
%elif can_add_course_to_cart:
<%
if user.is_authenticated():
reg_href = "#"
reg_element_id = "add_to_cart_post"
else:
reg_href = reg_then_add_to_cart_link
reg_element_id = "reg_then_add_to_cart"
%>
<% if ecommerce_checkout:
reg_href = ecommerce_checkout_link
reg_element_id = ""
%>
${_("Add {course_name} to Cart ({price} USD)")\
.format(course_name=course.display_number_with_default, price=course_price)}
%else:
<%
if ecommerce_checkout:
reg_href = ecommerce_checkout_link
else:
reg_href="#"
if professional_mode:
href_class = "add-to-cart"
else:
href_class = "register"
%>
${_("Enroll in {course_name}").format(course_name=course.display_number_with_default) | h}
%endif