64 lines
2.1 KiB
HTML
64 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
{% url privacy as privacyurl %}
|
|
|
|
{% block extra_head %}
|
|
<script src ='https://www.paypalobjects.com/js/external/dg.js' type='text/javascript'></script>
|
|
|
|
{% if embedded %}
|
|
<script>
|
|
//
|
|
// This page is also used as the completion URL for purchases. Close the lightbox
|
|
// whenever we are opened
|
|
//
|
|
dgFlow = top.dgFlow || top.opener.top.dgFlow;
|
|
dgFlow.closeFlow();
|
|
top.close()
|
|
</script>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
|
|
<h2>Campaign: {{campaign.name}}</h2>
|
|
<!-- url for work: -->
|
|
<p>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work}}</a></p>
|
|
<p>Target: {{campaign.target}}</p>
|
|
<p>Deadline: {{campaign.deadline}}</p>
|
|
<p>Status: {{campaign.status}}</p>
|
|
<p>ISBN: {{campaign.work.editions.all.0.isbn_10}} | {{campaign.work.first_isbn_13}} </p>
|
|
<p><a href="{% url widget isbn=campaign.work.first_isbn_13 %}">Widget Link</a></p>
|
|
<p>Embed a widget:</p>
|
|
<textarea rows="2" cols="80"><iframe src="{{base_url}}/api/widget/{{campaign.work.first_isbn_13}}/" width="152" height="325" frameborder="0"></iframe></textarea>
|
|
<p>PayPal receiver: {{campaign.paypal_receiver}}</p>
|
|
<p>Current total (pledged/authorized): {{campaign.current_total}}</p>
|
|
<form method="POST" action="{% url campaign_by_id pk=campaign.id %}" onsubmit="test()">
|
|
{% csrf_token %}
|
|
{{form.as_p}}
|
|
<input type="submit" value="Pledge" id="pledgeBtn"/>
|
|
</form>
|
|
|
|
<!-- All associated transactions -->
|
|
{% if campaign.transactions %}
|
|
<p>Associated transactions:</p>
|
|
<ul>
|
|
{% for transaction in campaign.transactions %}
|
|
<li>id:{{transaction.id}} | type:{{transaction.type}} | {{transaction.status}} | {{transaction.user}} | amount:{{transaction.amount}}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p>No associated transactions</p>
|
|
{% endif %}
|
|
|
|
{% if embedded %}
|
|
<script>
|
|
//
|
|
// This has to be included AFTER the definition of the button
|
|
//
|
|
var dgFlow = new PAYPAL.apps.DGFlow({ trigger: 'pledgeBtn' });
|
|
</script>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|