working on download page

pull/1/head
Andromeda Yelton 2012-08-23 13:38:48 -04:00
parent 368a3ca8ec
commit aa3667d260
2 changed files with 13 additions and 1 deletions

View File

@ -134,6 +134,16 @@ $j(document).ready(function(){
{% else %} {% else %}
<div class="btn_support"><form action="{% url pledge work_id %}" method="get"><input type="submit" value="Support" /></form></div> <div class="btn_support"><form action="{% url pledge work_id %}" method="get"><input type="submit" value="Support" /></form></div>
{% endif %} {% endif %}
{% else %}
{% if status == 'SUCCESSFUL' %}
<div class="btn_support">
{% if unglued_ebook %}
<a href="{{ unglued_ebook.url }}">Download</a>
{% else %}
Coming soon!
{% endif %}
</div>
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -415,7 +425,7 @@ $j(document).ready(function(){
{% if premium.limit == 0 or premium.limit > premium.premium_count %} {% if premium.limit == 0 or premium.limit > premium.premium_count %}
<li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}"> <li class="{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}">
<a href="{% url pledge_modify work_id %}?premium_id={{premium.id}}"> <a href="{% url pledge_modify work_id %}?premium_id={{premium.id}}">
<span class="menu-item-price">${{ premium.amount|floatformat:0|intcomma }}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Pledged!</div>{% endif %} <span class="menu-item-price">{% if premium.amount %}${{ premium.amount|floatformat:0|intcomma }}{% else %}Any amount{% endif %}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Pledged!</div>{% endif %}
<span class="menu-item-desc">{{ premium.description }}</span> <span class="menu-item-desc">{{ premium.description }}</span>
{% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %} {% ifnotequal premium.limit 0 %}<br /> Only {{ premium.premium_remaining }} remaining! {% endifnotequal %}
</a></li> </a></li>

View File

@ -166,6 +166,8 @@ def work(request, work_id, action='display'):
countdown = "in %s minutes" % str(time_remaining.seconds/60 + 1) countdown = "in %s minutes" % str(time_remaining.seconds/60 + 1)
else: else:
countdown = "right now" countdown = "right now"
elif work.last_campaign_status() == 'SUCCESSFUL':
unglued_ebook = work.ebooks().filter(unglued=True)
if action == 'preview': if action == 'preview':
work.last_campaign_status = 'ACTIVE' work.last_campaign_status = 'ACTIVE'