Code layout change.
[wolnelektury.git] / src / funding / templates / funding / includes / funding.html
1 {% spaceless %}
2
3 {% load i18n %}
4 {% load time_tags %}
5
6 {% if offer %}
7
8 <div {% if closeable %}id="funding-closeable" {% endif %}class="funding {{ add_class }}" data-offer-id="{{offer.id}}" style="">
9     {% if closeable %}<a href="#" class="close">X</a>{% endif %}
10     {% if link and is_current %}
11         <div class="call-area">
12             <a class="call honking" href="{% url 'funding_current' offer.slug %}">
13                 {% trans "Support!" %}</a>
14             <div class="learn-more">
15                 <a href="{% url 'infopage' 'wesprzyj' %}">{% trans "Learn more" %}</a>
16             </div>
17         </div>
18     {% endif %}
19     <div class="description {% if link and is_current %}with-button{% endif %}">
20     {% if link %}<a href="{% if is_current %}{% url 'funding_current' offer.slug %}{% else %}{{ offer.get_absolute_url }}{% endif %}">{% endif %}
21     {% if show_title %}
22         {% if is_current and show_title_calling %}<strong style="margin-right: .6em;">{% trans "Help free the book!" %}</strong>{% endif %}
23         <span class="funding-title{% if not is_current %}-strong{% endif %}">{{ offer }}</span>
24     {% endif %}
25
26     <div class="progress"
27         style="text-align: center; background-size: {{ percentage|stringformat:'.2f' }}% 1px;"
28     >
29         {% if sum %}
30             <span class="piece progress-collected">{% trans "collected" %}: {{ sum }} zł</span>
31         {% endif %}
32         {% if not is_win %}
33             <span class="piece progress-target"><span class="{% if sum %}progress-extralabel{% endif %}">{% trans "needed" %}: </span>{{ offer.target }} zł</span>
34         {% endif %}
35         {% if is_current %}
36             <span class="piece progress-until"><span class="progress-extralabel">{% trans "until fundraiser end" %}:</span>
37                 <span class="countdown inline" data-until='{{ offer.end|date_to_utc:True|utc_for_js }}'></span>
38             </span>
39         {% else %}
40             <div style="clear: both"></div>
41         {% endif %}
42     </div>
43     {% if link %}</a>{% endif %}
44     </div>
45     <div style="clear: both"></div>
46 </div>
47 {% if closeable %}
48     <div id="funding-handle">{% trans "Help free the book!" %}</div>
49
50 <script type="text/javascript">(function() {
51 var storage = true;
52 try {
53     localStorage.setItem('test', 'test');
54     localStorage.removeItem('test');
55 } catch (exception) {
56     storage = false;
57 }
58 if (storage) {
59     var closeable = document.getElementById('funding-closeable');
60     if (localStorage['hide-offer-id'] !== closeable.getAttribute('data-offer-id')) {
61         closeable.style.display = 'block';
62         document.getElementById('funding-handle').style.display = 'none';
63     }
64 }
65 })();</script>
66
67 {% endif %}
68
69
70 {% endif %}
71
72 {% endspaceless %}