Showing/hiding main funding banner
[wolnelektury.git] / apps / funding / templates / funding / tags / funding.html
1 {% load i18n %}
2 {% load time_tags %}
3 {% if offer %}
4 {% spaceless %}
5 <div class="funding {{ add_class }}" data-offer-id="{{offer.id}}" style="">
6     {% if closeable %}<a href="#" class="close">X</a>{% endif %}
7     {% if link and is_current %}
8         <div style="float:left; padding-right: .6em;">
9             <a class="call honking" href="{% url 'funding_current' offer.slug %}">
10                 {% trans "Support!" %}</a>
11             <div style="text-align: center; margin: auto;">
12                 <a href="{% url 'infopage' 'wesprzyj' %}">{% trans "Learn more" %}</a>
13             </div>
14         </div>
15     {% endif %}
16     <div class="description {% if link and is_current %}with-button{% endif %}"
17         style="display: inline-block;">
18     {% if link %}<a href="{% if is_current %}{% url 'funding_current' offer.slug %}{% else %}{{ offer.get_absolute_url }}{% endif %}">{% endif %}
19     {% if is_current %}<strong style="">{% trans "Help free the book!" %}</strong>{% endif %}
20     <span class="funding-title{% if not is_current %}-strong{% endif %}">{{ offer }}</span>
21
22     <div class="progress"
23         style="text-align: center; background-size: {{ percentage|stringformat:'.2f' }}% 1px;"
24     >
25         {% if sum %}
26             <span class="piece" style="float:left">{% trans "missing" %}: {{ missing }} zł</span>
27         {% endif %}
28         {% if not is_win %}
29             <span class="piece" style="float: right">{% trans "collected" %}: {{ sum }} zł</span>
30         {% endif %}
31         {% if is_current %}
32             <span class="piece" style="display:inline-block;margin-right: 0em;">{% trans "until fundraiser end" %}:
33                 <span class="countdown inline" data-until='{{ offer.end|date_to_utc:True|utc_for_js }}'></span>
34             </span>
35         {% endif %}
36
37         <div style="clear: both"></div>
38     </div>
39     {% if link %}</a>{% endif %}
40     </div>
41     <div style="clear: both"></div>
42 </div>
43 {% if closeable %}
44     <div class="funding-handle">{% trans "Help free the book!" %}</div>
45 {% endif %}
46 {% endspaceless %}
47 {% endif %}