2012-08-08 20:15:51 +00:00
|
|
|
{# vim: ft=htmljinja
|
|
|
|
#}
|
|
|
|
<p>
|
2012-08-16 13:52:41 +00:00
|
|
|
<strong>Szerző:</strong> {{ book.author }}<br />
|
|
|
|
<strong>Cím:</strong> {{ book.title }}<br />
|
|
|
|
<strong>Kiadás éve:</strong> {{ book.year }}<br />
|
2012-08-08 20:15:51 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
2012-08-16 13:52:41 +00:00
|
|
|
Nekem van <strong>{{ book.usersCopies(app.user)|length }}</strong>, ebből kölcsön van adva <strong>X</strong>.<br />
|
|
|
|
A teljes közösségnek összesen <strong>{{ book.copies|length }}</strong> példánya van.<br />
|
|
|
|
Kölcsönkérhető <strong>{{ book.copiesBorrowable|length }}</strong> példány, ebből <strong>{{ book.copiesBorrowedByUser(app.user)|length }}</strong> nálam van.<br />
|
2012-08-08 20:15:51 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{% if book.usersCopies(app.user)|length == 0 %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb add-copy-button" id="add-copy-button-{{ book.id }}">[Nekem is van egy]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% else %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb delete-copy-button" id="delete-copy-button-{{ book.id }}">[Nincs már]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{# TODO
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb">[Eladtam valakinek a körben]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
#}
|
|
|
|
{% if book.usersCopiesBorrowable(app.user)|length == 0 %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb mine-is-borrowable-button" id="mine-is-borrowable-button-{{ book.id }}">[Az enyém is kölcsönkérhető]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% else %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb mine-is-not-borrowable-button" id="mine-is-not-borrowable-button-{{ book.id }}">[Nem szeretném kölcsönadni]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if book.usersCopies(app.user)|length > 0 %}
|
|
|
|
{% if book.usersCopiesBuyable(app.user)|length == 0 %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb mine-is-for-sale-button" id="mine-is-for-sale-button-{{ book.id }}">[Az enyém eladó]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% else %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb mine-is-not-for-sale-button" id="mine-is-not-for-sale-button-{{ book.id }}">[Nem szeretném eladni]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if book.copiesBorrowedByUser(app.user)|length == 0 and book.usersCopies(app.user)|length == 0 and not book.userWouldBorrow(app.user) %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb want-to-borrow-button" id="want-to-borrow-button-{{ book.id }}">[Kérek egyet kölcsön]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if book.usersCopies(app.user)|length == 0 and not book.userWouldBuy(app.user) %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<span class="gomb want-to-buy-button" id="want-to-buy-button-{{ book.id }}">[Vennék egyet]</span>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
{% if book.wouldBuy|length > 0 %}
|
|
|
|
<p>
|
2012-08-16 13:52:41 +00:00
|
|
|
Ők szeretnének egyet kölcsönkérni:<br />
|
|
|
|
<ul>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% for user in book.wouldBorrow %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<li>{{ user|userdataspan }}</li>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endfor %}
|
2012-08-16 13:52:41 +00:00
|
|
|
</ul>
|
2012-08-08 20:15:51 +00:00
|
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
{% if book.wouldBuy|length > 0 %}
|
|
|
|
<p>
|
2012-08-16 13:52:41 +00:00
|
|
|
Ők szeretnének venni egyet:<br />
|
|
|
|
<ul>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% for user in book.wouldBuy %}
|
2012-08-16 13:52:41 +00:00
|
|
|
<li>{{ user|userdataspan }}</li>
|
2012-08-08 20:15:51 +00:00
|
|
|
{% endfor %}
|
2012-08-16 13:52:41 +00:00
|
|
|
</ul>
|
2012-08-08 20:15:51 +00:00
|
|
|
</p>
|
|
|
|
{% endif %}
|