Added a rough textarea for someone to copy embedding iframe for widget

pull/1/head
Raymond Yee 2011-11-21 18:06:44 -08:00
parent e09cf8186d
commit 78339e3de5
2 changed files with 7 additions and 1 deletions

View File

@ -9,8 +9,11 @@
<p>Status: {{campaign.status}}</p>
<p>ISBN: {{campaign.work.editions.all.0.isbn_10}} | {{campaign.work.editions.all.0.isbn_13}} </p>
<p><a href="{% url widget isbn=campaign.work.editions.all.0.isbn_10 %}">Widget Link</a></p>
<p>Embed a widget:</p>
<textarea rows="2" cols="80">&lt;iframe src="{{base_url}}/api/widget/{{campaign.work.editions.all.0.isbn_13}}/" width="150" height="360" frameborder="0"&gt;</iframe></textarea>
<p>PayPal receiver: {{campaign.paypal_receiver}}</p>
<p>Current total (pledged/authorized): {{campaign.current_total}}</p>
<p>Base URL: {{base_url}}</p>
<form method="POST" action="{% url campaign_by_id pk=campaign.id %}">
{% csrf_token %}
{{form.as_p}}

View File

@ -376,9 +376,12 @@ class CampaignFormView(FormView):
pk = self.kwargs["pk"]
campaign = models.Campaign.objects.get(id=int(pk))
context = super(CampaignFormView, self).get_context_data(**kwargs)
base_url = self.request.build_absolute_uri("/")[:-1]
context.update({
'campaign': campaign
'campaign': campaign,
'base_url':base_url
})
return context
def form_valid(self,form):