2011-10-11 17:02:17 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% url privacy as privacyurl %}
|
|
|
|
|
2011-11-22 11:14:58 +00:00
|
|
|
{% 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 %}
|
|
|
|
|
2011-10-11 17:02:17 +00:00
|
|
|
{% block content %}
|
2011-11-22 11:14:58 +00:00
|
|
|
|
|
|
|
|
2011-10-11 17:02:17 +00:00
|
|
|
<h2>Campaign: {{campaign.name}}</h2>
|
2011-11-28 23:39:06 +00:00
|
|
|
<!-- url for work: -->
|
|
|
|
<p>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work}}</a></p>
|
2011-10-11 17:02:17 +00:00
|
|
|
<p>Target: {{campaign.target}}</p>
|
|
|
|
<p>Deadline: {{campaign.deadline}}</p>
|
2011-10-13 21:40:07 +00:00
|
|
|
<p>Status: {{campaign.status}}</p>
|
2011-11-22 01:21:06 +00:00
|
|
|
<p>ISBN: {{campaign.work.editions.all.0.isbn_10}} | {{campaign.work.editions.all.0.isbn_13}} </p>
|
2011-12-20 04:26:55 +00:00
|
|
|
<p><a href="{% url widget isbn=campaign.work.editions.all.0.isbn_13 %}">Widget Link</a></p>
|
2011-11-22 02:06:44 +00:00
|
|
|
<p>Embed a widget:</p>
|
2011-11-22 18:59:25 +00:00
|
|
|
<textarea rows="2" cols="80"><iframe src="{{base_url}}/api/widget/{{campaign.work.editions.all.0.isbn_13}}/" width="152" height="325" frameborder="0"></iframe></textarea>
|
2011-10-18 23:27:20 +00:00
|
|
|
<p>PayPal receiver: {{campaign.paypal_receiver}}</p>
|
2011-10-13 21:40:07 +00:00
|
|
|
<p>Current total (pledged/authorized): {{campaign.current_total}}</p>
|
2011-11-22 11:14:58 +00:00
|
|
|
<form method="POST" action="{% url campaign_by_id pk=campaign.id %}" onsubmit="test()">
|
2011-10-11 17:02:17 +00:00
|
|
|
{% csrf_token %}
|
2011-10-12 17:47:48 +00:00
|
|
|
{{form.as_p}}
|
2011-11-22 11:14:58 +00:00
|
|
|
<input type="submit" value="Pledge" id="pledgeBtn"/>
|
2011-10-11 17:02:17 +00:00
|
|
|
</form>
|
2011-11-22 11:14:58 +00:00
|
|
|
|
2011-10-13 17:28:23 +00:00
|
|
|
<!-- All associated transactions -->
|
|
|
|
{% if campaign.transactions %}
|
|
|
|
<p>Associated transactions:</p>
|
|
|
|
<ul>
|
|
|
|
{% for transaction in campaign.transactions %}
|
2011-11-29 00:42:31 +00:00
|
|
|
<li>id:{{transaction.id}} | type:{{transaction.type}} | {{transaction.status}} | {{transaction.user}} | amount:{{transaction.amount}}</li>
|
2011-10-13 17:28:23 +00:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% else %}
|
2011-10-14 02:16:28 +00:00
|
|
|
<p>No associated transactions</p>
|
2011-10-13 17:28:23 +00:00
|
|
|
{% endif %}
|
2011-11-22 11:14:58 +00:00
|
|
|
|
|
|
|
{% if embedded %}
|
|
|
|
<script>
|
|
|
|
//
|
|
|
|
// This has to be included AFTER the definition of the button
|
|
|
|
//
|
|
|
|
var dgFlow = new PAYPAL.apps.DGFlow({ trigger: 'pledgeBtn' });
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
|
2011-10-11 17:02:17 +00:00
|
|
|
{% endblock %}
|