Skip to content
Snippets Groups Projects
Commit 48484ef9 authored by David Ormsbee's avatar David Ormsbee
Browse files

move suggested price listing to common include template

parent 0d678273
Branches
Tags
No related merge requests found
......@@ -21,11 +21,16 @@ class ChooseModeView(View):
@method_decorator(login_required)
def get(self, request):
course_id = request.GET.get("course_id")
modes = CourseMode.modes_for_course_dict(course_id)
context = {
"course_id": course_id,
"modes": CourseMode.modes_for_course_dict(course_id),
"course_name": course_from_id(course_id).display_name
"modes": modes,
"course_name": course_from_id(course_id).display_name,
}
if "verified" in modes:
context["suggested_prices"] = modes["verified"].suggested_prices.split(",")
context["currency"] = modes["verified"].currency.upper()
return render_to_response("course_modes/choose.html", context)
......
......@@ -54,28 +54,7 @@
<span class="ribbon"></span>
<p>Sign up as a verified student and work toward a Certificate of Achievement.</p>
<dl>
<dt>
Select your contribution for this course:
</dt>
<dd>
<ul class="pay-options">
% for price in modes["verified"].suggested_prices.split(","):
<li>
<input type="radio" name="contribution" value="${price|h}"><label for="contribution-${price|h}">$${price} ${modes["verified"].currency.upper()}</label>
</li>
% endfor
<li class="other1">
<input type="radio" id="contribution-other" name="contribution" value=""/>
<label for=" contribution-other"><span class="sr">Other</span></label>
</li>
<li class="other2">
<label for="contribution-other-amt"><span class="sr">Other Amount</span> </label>$<input type="text" size="5" name="contribution-other-amt" id="contribution-other-amt" />
</li>
</ul>
</dd>
</dl>
<%include file="_contribution.html" args="suggested_prices=suggested_prices, currency=currency"/>
<p class="tip expand">
<a href="">Why do I have to pay? What if I don't meet all the requirements?</a>
......
......@@ -41,12 +41,16 @@ class VerifyView(View):
progress_state = "start"
course_id = request.GET['course_id']
verify_mode = CourseMode.mode_for_course(course_id, "verified")
context = {
"progress_state" : progress_state,
"user_full_name" : request.user.profile.name,
"course_id" : course_id,
"course_name" : course_from_id(course_id).display_name,
"purchase_endpoint" : get_purchase_endpoint(),
"suggested_prices" : [int(price) for price in verify_mode.suggested_prices.split(",")],
"currency" : verify_mode.currency.upper(),
"chosen_price" : request.session.get("donation_for_course", verify_mode.min_price)
}
return render_to_response('verify_student/photo_verification.html', context)
......
......@@ -331,30 +331,8 @@
<div class="wrapper-down">
<h3>Check Your Contribution</h3>
<dl>
<dt>
Select your contribution for this course:
</dt>
<dd>
<ul class="pay-options">
<li>
<input type="radio" id="contribution-25" name="contribution"> <label for="contribution-25">$25 USD</label>
</li>
<li>
<input type="radio" id="contribution-50" name="contribution"> <label for="contribution-50">$50 USD</label>
</li>
<li>
<input type="radio" id="contribution-100" name="contribution"> <label for="contribution-100">$100 USD</label>
</li>
<li class="other1">
<input type="radio" id="contribution-other" name="contribution"> <label for="contribution-other"><span class="sr">Other</span></label>
</li>
<li class="other2">
<label for="contribution-other-amt"><span class="sr">Other Amount</span> $</label> <input type="text" size="5" name="contribution-other-amt" id="contribution-other-amt">
</li>
</ul>
</dd>
</dl>
<%include file="/course_modes/_contribution.html" args="suggested_prices=suggested_prices, currency=currency, chosen_price=chosen_price"/>
</div>
<hr />
......
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