Round dollar amount to nearest dollar [#30073593]

pull/1/head
eric 2012-05-25 18:34:16 -04:00
parent 5146e9616e
commit d784715407
5 changed files with 13 additions and 13 deletions

View File

@ -22,13 +22,13 @@
{% else %}{% if status == 'SUCCESSFUL' %} {% else %}{% if status == 'SUCCESSFUL' %}
<b>UNGLUED!</b> <b>UNGLUED!</b>
<p><b>On:</b> {{ deadline|date:"M d, Y" }}</p> <p><b>On:</b> {{ deadline|date:"M d, Y" }}</p>
<p><b>Raised:</b> {{ work.last_campaign.current_total|intcomma }}</p> <p><b>Raised:</b> {{ work.last_campaign.current_total|floatformat:0|intcomma }}</p>
</div> </div>
{% if first_ebook %}<a href="{{ work.ebooks.0.url }}"><div class="read_itbutton"><span>Read it Now</span></div></a>{% else %}<div class="read_itbutton"><span>Coming Soon</span></div>{% endif %} {% if first_ebook %}<a href="{{ work.ebooks.0.url }}"><div class="read_itbutton"><span>Read it Now</span></div></a>{% else %}<div class="read_itbutton"><span>Coming Soon</span></div>{% endif %}
{% else %}{% if status == 'ACTIVE' %} {% else %}{% if status == 'ACTIVE' %}
<b>UNGLUE IT!</b> <b>UNGLUE IT!</b>
<p><b>${{ work.last_campaign.current_total|intcomma }}</b> raised</p><p><b>${{ work.last_campaign.target|intcomma }}</b> needed</p> <p><b>${{ work.last_campaign.current_total|floatformat:0|intcomma }}</b> raised</p><p><b>${{ work.last_campaign.target|floatformat:0|intcomma }}</b> needed</p>
<p>by {{ deadline|date:"M d, Y" }}</p> <p>by {{ deadline|date:"M d, Y" }}</p>
</div> </div>
<a href="/pledge/{{work.id}}"><div class="read_itbutton pledge"><span>Support</span></div></a> <a href="/pledge/{{work.id}}"><div class="read_itbutton pledge"><span>Support</span></div></a>
@ -151,7 +151,7 @@
<div class="listview panelfront side1 booklist-status"> <div class="listview panelfront side1 booklist-status">
{% if not is_preview %} {% if not is_preview %}
{% ifequal status "ACTIVE" %} {% ifequal status "ACTIVE" %}
<span class="booklist-status-text" style="width: 190px"><b>${{ work.last_campaign.current_total|intcomma }}</b>/<b>${{ work.last_campaign.target|intcomma }}</b></span> <span class="booklist-status-text" style="width: 190px"><b>${{ work.last_campaign.current_total|floatformat:0|intcomma }}</b>/<b>${{ work.last_campaign.target|floatformat:0|intcomma }}</b></span>
{% else %}{% if status == "INITIALIZED" %} {% else %}{% if status == "INITIALIZED" %}
<span class="booklist-status-label">Status:&nbsp;</span><span class="booklist-status-text">Coming soon!</span> <span class="booklist-status-label">Status:&nbsp;</span><span class="booklist-status-text">Coming soon!</span>
{% else %} {% else %}

View File

@ -25,7 +25,7 @@
<h2>Campaign: {{campaign.name}}</h2> <h2>Campaign: {{campaign.name}}</h2>
<!-- url for work: --> <!-- url for work: -->
<p>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work}}</a></p> <p>Work: <a href="{% url work work_id=campaign.work.id %}">{{campaign.work}}</a></p>
<p>Target: {{campaign.target|intcomma}}</p> <p>Target: {{campaign.target|floatformat:0|intcomma}}</p>
<p>Deadline: {{campaign.deadline}}</p> <p>Deadline: {{campaign.deadline}}</p>
<p>Status: {{campaign.status}}</p> <p>Status: {{campaign.status}}</p>
<p>ISBN: {{campaign.work.first_isbn_13}} </p> <p>ISBN: {{campaign.work.first_isbn_13}} </p>
@ -33,7 +33,7 @@
<p>Embed a widget:</p> <p>Embed a widget:</p>
<textarea rows="2" cols="80">&lt;iframe src="{{base_url}}/api/widget/{{campaign.work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;</iframe></textarea> <textarea rows="2" cols="80">&lt;iframe src="{{base_url}}/api/widget/{{campaign.work.first_isbn_13}}/" width="152" height="325" frameborder="0"&gt;</iframe></textarea>
<p>PayPal receiver: {{campaign.paypal_receiver}}</p> <p>PayPal receiver: {{campaign.paypal_receiver}}</p>
<p>Current total (pledged/authorized): {{campaign.current_total|intcomma}}</p> <p>Current total (pledged/authorized): {{campaign.current_total|floatformat:0|intcomma}}</p>
<form method="POST" action="{% url campaign_by_id pk=campaign.id %}" onsubmit="test()"> <form method="POST" action="{% url campaign_by_id pk=campaign.id %}" onsubmit="test()">
{% csrf_token %} {% csrf_token %}
{{form.as_p}} {{form.as_p}}

View File

@ -30,7 +30,7 @@
<div class="jsmodule rounded pledge"> <div class="jsmodule rounded pledge">
<div class="jsmod-content"> <div class="jsmod-content">
${{ work.last_campaign.target|intcomma }} needed by<br /> ${{ work.last_campaign.target|floatformat:0|intcomma }} needed by<br />
{{ work.last_campaign.deadline }} {{ work.last_campaign.deadline }}
</div> </div>
</div> </div>

View File

@ -7,7 +7,7 @@
will contain campaign info. maybe a cover image. (small.) will contain campaign info. maybe a cover image. (small.)
{% comment %} {% comment %}
<p class="pledge_complete">You just pledged ${{transaction.amount|intcomma}} to <a href="{% url work work.id %}">{{work.title}}</a>.</p> <p class="pledge_complete">You just pledged ${{transaction.amount|intcomma}} to <a href="{% url work work.id %}">{{work.title}}</a>.</p>
<p class="pledge_complete">If the campaign reaches its target of ${{campaign.target|intcomma}} by {{campaign.deadline|date:"F d, Y"}}, <p class="pledge_complete">If the campaign reaches its target of ${{campaign.target|floatformat:0|intcomma}} by {{campaign.deadline|date:"F d, Y"}},
your PayPal account will be charged ${{transaction.amount|intcomma}}.</p> your PayPal account will be charged ${{transaction.amount|intcomma}}.</p>
note: campaign (image, title, rights holder, deadline, maybe target) note: campaign (image, title, rights holder, deadline, maybe target)

View File

@ -64,11 +64,11 @@ $j(document).ready(function(){
{% else %}{% if work.last_campaign and not is_preview %} {% else %}{% if work.last_campaign and not is_preview %}
{% if status == 'ACTIVE' %} {% if status == 'ACTIVE' %}
Unglue it! <br /> Unglue it! <br />
${{ work.last_campaign.current_total|intcomma }}/${{ work.last_campaign.target|intcomma }} <br /> ${{ work.last_campaign.current_total|floatformat:0|intcomma }}/${{ work.last_campaign.target|floatformat:0|intcomma }} <br />
Ending {{ countdown }} Ending {{ countdown }}
{% else %} {% else %}
{% if status == 'SUCCESSFUL' %} {% if status == 'SUCCESSFUL' %}
Unglued on {{ work.last_campaign.deadline|date:"M j, Y"}}! <br />${{ work.last_campaign.current_total|intcomma }} raised of ${{ work.last_campaign.target|intcomma }} goal Unglued on {{ work.last_campaign.deadline|date:"M j, Y"}}! <br />${{ work.last_campaign.current_total|floatformat:0|intcomma }} raised of ${{ work.last_campaign.target|floatformat:0|intcomma }} goal
{% else %}{% if status == 'INITIALIZED' %} {% else %}{% if status == 'INITIALIZED' %}
Campaign starting soon Campaign starting soon
{% else %}{% if status == 'SUSPENDED' %} {% else %}{% if status == 'SUSPENDED' %}
@ -184,7 +184,7 @@ $j(document).ready(function(){
{% else %} {% else %}
{{ work.last_campaign.supporters.count }} Ungluers have {{ work.last_campaign.supporters.count }} Ungluers have
{% endif %} {% endif %}
pledged ${{ work.last_campaign.current_total|intcomma }}<br />toward a ${{ work.last_campaign.target|intcomma }} goal pledged ${{ work.last_campaign.current_total|floatformat:0|intcomma }}<br />toward a ${{ work.last_campaign.target|floatformat:0|intcomma }} goal
{% else %} {% else %}
{% if wishers == 1 %} {% if wishers == 1 %}
1 Ungluer has 1 Ungluer has
@ -277,7 +277,7 @@ $j(document).ready(function(){
{{ claim.rights_holder.rights_holder_name }} {{ claim.rights_holder.rights_holder_name }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
, has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) if ungluers can join together to raise ${{ work.last_campaign.target|intcomma }} by {{ work.last_campaign.deadline }}. , has agreed to release <i>{{work.title}}</i> to the world as a Creative Commons licensed ebook (<a href="{{ work.last_campaign.license_url }}">{{ work.last_campaign.license }}</a>) if ungluers can join together to raise ${{ work.last_campaign.target|floatformat:0|intcomma }} by {{ work.last_campaign.deadline }}.
You can help!</p> You can help!</p>
<h4>Campaign details: the fine print</h4> <h4>Campaign details: the fine print</h4>
@ -397,7 +397,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|intcomma }}</span>{% if pledged.0.premium == premium %}<div class="you_pledged">Pledged!</div>{% endif %} <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-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>
@ -408,7 +408,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 work_id %}?premium_id={{premium.id}}"> <a href="{% url pledge work_id %}?premium_id={{premium.id}}">
<span class="menu-item-price">${{ premium.amount|intcomma }}</span> <span class="menu-item-price">${{ premium.amount|floatformat:0|intcomma }}</span>
<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>