2012-05-13 19:32:32 +00:00
{% load humanize %}
2012-03-09 13:56:59 +00:00
{% with work.first_ebook as first_ebook %}
{% with work.last_campaign.supporters as supporters %}
{% with work.cover_image_thumbnail as thumbnail %}
{% with work.author as author %}
2012-05-31 17:33:16 +00:00
{% with work.title as title %}
2012-05-29 23:57:38 +00:00
{% with work.last_campaign as last_campaign %}
2012-05-17 16:06:29 +00:00
{% with work.last_campaign.status as status %}
2012-05-24 16:35:58 +00:00
{% with work.last_campaign.deadline as deadline %}
2012-05-31 17:25:19 +00:00
{% with work.id as workid %}
2013-01-03 01:26:20 +00:00
{% with request.user.wishlist.works.all as wishlist %}
2012-12-31 18:58:42 +00:00
< div class = "thewholebook listview tabs {% if first_ebook or status == 'SUCCESSFUL' %}tabs-1{% else %}{% if status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}{% endif %}" >
2011-12-01 02:05:19 +00:00
< div class = "listview book-list" >
< div class = "listview panelback side2" >
2012-05-31 17:29:41 +00:00
{% comment %} hover state of panel {% endcomment %}
< div class = "greenpanel2" >
2013-03-11 20:09:40 +00:00
{% if last_campaign %}
{% comment %}top section: campaign info + optional action button. Varies by campaign status.{% endcomment %}
{% if status == 'SUCCESSFUL' %}
< div class = "greenpanel_top" >
{% comment %}bibliographic data{% endcomment %}
< div class = "white_text" >
< p > < a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > {{ title }}< / a > < / p >
< p > {{ author }}< / p >
< / div >
{% comment %}link to work page{% endcomment %}
< div class = "moreinfo" >
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target = "_top" > More Info< / a >
< / div >
< div class = "unglued_white" >
< b > UNGLUED!< / b >
< p > < b > On:< / b > {{ deadline|date:"M d, Y" }}< / p >
< p > < b > Raised:< / b > {{ work.last_campaign.current_total|floatformat:0|intcomma }}< / p >
< / div >
2013-03-11 19:38:04 +00:00
< / div >
2013-03-11 20:09:40 +00:00
< div class = "add_button" >
{% include "book_panel_addbutton.html" %}
< / div >
< div class = "white_text bottom_button" >
{% if first_ebook %}
< a href = "{% url download workid %}" class = "hijax" > < span class = "read_itbutton button_text" > < span > Read it Now< / span > < / span > < / a >
{% else %}
2013-03-20 19:24:53 +00:00
< a href = "{% url work workid %}" > < span class = "read_itbutton button_text" > < span > Coming Soon< / span > < / span > < / a >
2013-03-11 20:09:40 +00:00
{% endif %}
2013-03-11 19:38:04 +00:00
< / div >
2013-03-11 20:09:40 +00:00
{% else %}{% if status == 'ACTIVE' %}
< div class = "greenpanel_top" >
{% comment %}bibliographic data{% endcomment %}
< div class = "white_text" >
< p > < a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > {{ title }}< / a > < / p >
< p > {{ author }}< / p >
< / div >
{% comment %}link to work page{% endcomment %}
< div class = "moreinfo" >
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target = "_top" > More Info< / a >
< / div >
< div class = "unglued_white" >
< b > UNGLUE IT!< / b >
2013-08-14 03:47:55 +00:00
{% ifequal work.last_campaign.type 1 %}
< 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|naturalday:"M d, Y" }}< / p >
{% else %}
< p > < b > ${{ work.last_campaign.left|floatformat:0|intcomma }}< / b > needed< / p >
< p > now ungluing on < / p >
< p > {{ work.last_campaign.cc_date|naturalday:"M d, Y" }}< / p >
{% endifequal %}
2013-03-11 20:09:40 +00:00
< / div >
2013-03-11 19:38:04 +00:00
< / div >
2013-03-11 20:09:40 +00:00
{% if request.user.id in supporters %}
2013-03-20 19:24:53 +00:00
< div class = "white_text bottom_button" >
{% include "book_panel_addbutton.html" %}
< / div >
2013-03-11 20:09:40 +00:00
{% else %}
2013-03-20 19:24:53 +00:00
< div class = "add_button" >
{% include "book_panel_addbutton.html" %}
< / div >
< div class = "white_text bottom_button" >
2013-08-14 03:47:55 +00:00
{% ifequal work.last_campaign.type 1 %}
2013-03-20 19:24:53 +00:00
< a href = "{% url pledge work_id=workid %}" > < span class = "read_itbutton pledge button_text" > < span > Pledge< / span > < / span > < / a >
2013-08-14 03:47:55 +00:00
{% else %}
< a href = "{% url purchase work_id=workid %}" > < span class = "read_itbutton pledge button_text" > < span > Purchase< / span > < / span > < / a >
{% endifequal %}
2013-03-20 19:24:53 +00:00
< / div >
{% endif %}
2013-03-11 19:38:04 +00:00
{% else %}
2013-03-11 20:09:40 +00:00
< div class = "greenpanel_top" >
{% comment %}bibliographic data{% endcomment %}
< div class = "white_text" >
< p > < a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > {{ title }}< / a > < / p >
< p > {{ author }}< / p >
< / div >
{% comment %}link to work page{% endcomment %}
< div class = "moreinfo" >
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target = "_top" > More Info< / a >
< / div >
< div class = "unglued_white" >
{% if status == 'INITIALIZED' %}
< p > Campaign coming soon!< / p >
{% else %}{% if status == 'SUSPENDED' %}
< p > This campaign has been suspended.< / p > < br / > < p > See the < a href = "{{faqurl}}" > FAQ< / a > for details.< / p >
{% else %}{% if status == 'WITHDRAWN' %}
< p > This campaign has been withdrawn.< / p > < br / > < p > See the < a href = "{{faqurl}}" > FAQ< / a > for details.< / p >
{% else %}{% if status == 'UNSUCCESSFUL' %}
< p > {{ deadline }}< / p >
< p > Watch for a new campaign.< / p >
{% endif %}{% endif %}{% endif %}{% endif %}
< / div >
< / div >
< div class = "white_text bottom_button" >
{% include "book_panel_addbutton.html" %}
< / div >
{% endif %}{% endif %}
2013-03-11 19:38:04 +00:00
{% else %}
< div class = "greenpanel_top" >
{% comment %}bibliographic data{% endcomment %}
< div class = "white_text" >
< p > < a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > {{ title }}< / a > < / p >
< p > {{ author }}< / p >
< / div >
{% comment %}link to work page{% endcomment %}
< div class = "moreinfo" >
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target = "_top" > More Info< / a >
< / div >
< div class = "unglued_white" >
{% if first_ebook %}
< b > AVAILABLE!< / b >
< div class = "add_button" >
{% include "book_panel_addbutton.html" %}
< / div >
{% else %}
< p > No campaign yet.< / p > < br / > < p > But if lots of ungluers wishlist this book, maybe there will be!< / p >
{% endif %}
< / div >
< / div >
< div class = "white_text bottom_button" >
{% if first_ebook %}
2013-03-20 19:24:53 +00:00
< a href = "{% url download workid %}" class = "hijax" > < span class = "read_itbutton button_text" > < span > Read it Now< / span > < / span > < / a >
2013-03-11 19:38:04 +00:00
{% else %}
{% include "book_panel_addbutton.html" %}
{% endif %}
< / div >
2013-03-11 20:09:40 +00:00
{% endif %}
2013-03-11 19:38:04 +00:00
2012-05-31 17:29:41 +00:00
< / div >
2011-12-01 02:05:19 +00:00
< / div >
< div class = "listview panelfront side1 book-thumb" >
2012-05-31 17:25:19 +00:00
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" target = "_top" > < img src = "{% if thumbnail %}{{ thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt = "Book cover" title = "book cover" / > < / a >
2011-11-22 01:21:06 +00:00
< / div >
2011-12-01 02:05:19 +00:00
< div class = "listview panelfront side1 book-name" >
2011-11-22 01:21:06 +00:00
< div class = "title" >
2012-05-31 17:33:16 +00:00
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > {{ title }}< / a >
2011-11-22 01:21:06 +00:00
< / div >
2012-03-09 13:56:59 +00:00
< div class = "listview author {{ author }}" > {{ author }}< / div >
2011-11-22 01:21:06 +00:00
< / div >
2012-05-31 17:25:19 +00:00
{% comment %}same logic as above{% endcomment %}
{% if request.user.is_anonymous %}
2013-01-05 00:21:34 +00:00
< div class = "listview panelfront side1 create-account" >
< span title = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}" > Login to Add< / span >
< / div >
2012-05-31 17:25:19 +00:00
{% else %}{% if request.user.id in supporters %}
2013-01-05 00:21:34 +00:00
< div class = "listview panelfront side1 on-wishlist" >
< span > Pledged!< / span >
< / div >
2012-05-31 17:25:19 +00:00
{% else %}{% ifequal supporter request.user %}
2013-01-05 00:21:34 +00:00
{% comment %} used only on your own supporter page. {% endcomment %}
2013-01-03 21:33:07 +00:00
{% ifequal status "ACTIVE" %}
< div class = "listview panelfront side1 pledge" >
2013-08-14 03:47:55 +00:00
{% ifequal work.last_campaign.type 1 %}
2013-01-03 21:33:07 +00:00
< span class = "booklist_pledge" > < a href = "{% url pledge work_id=workid %}" class = "fakeinput" > Pledge< / a > < / span >
2013-08-14 03:47:55 +00:00
{% else %}
< span class = "booklist_pledge" > < a href = "{% url purchase work_id=workid %}" class = "fakeinput" > Purchase< / a > < / span >
{% endifequal %}
2013-01-03 21:33:07 +00:00
< / div >
{% else %}
< div class = "listview panelfront side1 remove-wishlist" >
2013-08-18 22:10:25 +00:00
< span id = "l{{ workid }}" > Un-list< / span >
2013-01-03 21:33:07 +00:00
< / div >
{% endifequal %}
2013-01-05 00:21:34 +00:00
{% else %}{% ifequal status "ACTIVE" %}
2013-01-09 16:38:33 +00:00
< div class = "listview panelfront side1 add-wishlist" >
2013-08-14 03:47:55 +00:00
{% ifequal work.last_campaign.type 1 %}
2013-01-09 16:38:33 +00:00
< span class = "booklist_pledge" > < a href = "{% url pledge work_id=workid %}" class = "fakeinput" > Pledge< / a > < / span >
2013-08-14 03:47:55 +00:00
{% else %}
< span class = "booklist_pledge" > < a href = "{% url purchase work_id=workid %}" class = "fakeinput" > Purchase< / a > < / span >
{% endifequal %}
2013-01-09 16:38:33 +00:00
< / div >
2012-06-01 14:22:39 +00:00
{% else %}{% if work in wishlist %}
2013-01-05 00:21:34 +00:00
< div class = "listview panelfront side1 on-wishlist" >
2013-08-18 22:10:25 +00:00
< span > On My List!< / span >
2013-01-05 00:21:34 +00:00
< / div >
2011-11-22 01:21:06 +00:00
{% else %}
2013-01-05 00:21:34 +00:00
< div class = "listview panelfront side1 add-wishlist" >
2012-11-20 14:56:04 +00:00
{% if on_search_page %}
2013-08-18 22:10:25 +00:00
< span class = "gb_id" id = "l{{ googlebooks_id }}" > Add to My List< / span >
2012-11-20 14:56:04 +00:00
{% else %}
2013-08-18 22:10:25 +00:00
< span class = "work_id" id = "l{{ workid }}" > Add to My List< / span >
2012-11-20 14:56:04 +00:00
{% endif %}
2013-01-05 00:21:34 +00:00
< / div >
{% endif %}{% endifequal %}{% endifequal %}{% endif %}{% endif %}
2012-05-31 17:25:19 +00:00
2011-12-01 02:05:19 +00:00
< div class = "listview panelfront side1 booklist-status" >
2012-05-31 17:25:19 +00:00
{% ifequal status "ACTIVE" %}
2013-08-14 03:47:55 +00:00
{% ifequal work.last_campaign.type 1 %}
< span class = "booklist-status-text" > < b > ${{ work.last_campaign.current_total|floatformat:0|intcomma }}< / b > /< b > ${{ work.last_campaign.target|floatformat:0|intcomma }}< / b > < / span >
{% else %}
< span class = "booklist-status-text" > < b > ${{ work.last_campaign.left|floatformat:0|intcomma }}< / b > to go< / span >
{% endifequal %}
2012-05-31 17:25:19 +00:00
{% else %}{% ifequal status "INITIALIZED" %}
< span class = "booklist-status-label" > Status: < / span > < span class = "booklist-status-text" > Coming soon!< / span >
2012-12-31 19:57:01 +00:00
{% else %}{% ifequal status "SUCCESSFUL" %}
{% if not first_ebook %}
2013-01-02 21:10:32 +00:00
< span class = "booklist-status-text" > Ebook coming soon< / span >
2012-12-31 19:57:01 +00:00
{% else %}
< span class = "booklist-status-label" > < / span >
{% endif %}
{% endifequal %}{% endifequal %}{% endifequal %}
2011-11-22 01:21:06 +00:00
< / div >
2011-12-01 02:05:19 +00:00
< div class = "listview panelfront side1 icons" >
2012-05-31 17:25:19 +00:00
{% comment %}
For status icons, we should display...
If there is an ebook: options to get it
If no ebook but there is an active or successful campaign: progress toward goal
Otherwise: number of wishes
{% endcomment %}
2012-05-29 23:57:38 +00:00
{% if first_ebook %}
2012-12-31 19:57:01 +00:00
< a href = "{% url download workid %}" class = "hijax" > < div class = "read_itbutton" > < span > Read it Now< / span > < / div > < / a >
2012-05-31 17:25:19 +00:00
{% else %}{% if status == 'ACTIVE' or status == 'SUCCESSFUL' %}
< div class = "booklist-status-img" >
< img src = "/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" title = "book list status" alt = "book list status" / >
< / div >
< div class = "booklist-status-label panel" > {{ work.percent_of_goal }}%< / div >
2012-01-16 17:10:38 +00:00
{% else %}
2012-07-05 14:05:04 +00:00
{% if work.num_wishes %}
2013-08-18 22:10:25 +00:00
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}?tab=3" class = "nobold" > < span class = "rounded" > < span class = "grey" > < span class = "panelnope" > Listed by < / span > {{ work.num_wishes }}< / span > < / span > < / a >
2012-07-05 14:05:04 +00:00
{% else %}
2013-08-18 22:10:25 +00:00
< a href = "{% if workid %}{% url work workid %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}?tab=3" class = "nobold" > < span class = "rounded" > < span class = "grey" > < span class = "panelnope" > Listed by < / span > 0< / span > < / span > < / a >
2012-07-05 14:05:04 +00:00
{% endif %}
2012-05-31 17:25:19 +00:00
{% endif %}{% endif %}
2012-01-16 17:10:38 +00:00
2011-11-22 01:21:06 +00:00
< / div >
2011-12-01 02:05:19 +00:00
< div class = "listview panelfront side1 ebooks" >
2011-11-22 01:21:06 +00:00
< / div >
2011-09-12 03:44:21 +00:00
< / div >
2012-03-09 13:56:59 +00:00
< / div >
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
2012-05-17 16:06:29 +00:00
{% endwith %}
2012-05-24 16:35:58 +00:00
{% endwith %}
2012-05-29 23:57:38 +00:00
{% endwith %}
2012-05-31 17:33:16 +00:00
{% endwith %}
2013-01-03 01:26:20 +00:00
{% endwith %}
2012-05-31 17:25:19 +00:00
{% endwith %}