Source

django-pim / pcbank / templates / pcbank / cheque_detail.html

Diff from to

pcbank/templates/pcbank/cheque_detail.html

 {% extends "pcbank/base.html" %}
 {% load pcbank_extras %}
+{% load url from future %}
 
 {% block body %}
-{% if not object.transaction %}<form action="{% url assign-transaction object.number %}" method="post">{% csrf_token %}{% endif %}
+{% if not object.transaction %}<form action="{% url 'assign-transaction' object.number %}" method="post">{% csrf_token %}{% endif %}
 <table class="table table-condensed">
 <tr><td><b>Cheque #</b></td><td>{{object.number}}</td></tr>
 <tr><td><b>Amount</b></td><td>${{object.amount|floatformat:2}}</td></tr>
 </table>
 {% if not object.transaction %}<input type="submit" value="Assign Transaction" class="btn btn-primary" /></form>{% endif %}
 <p>{{object.memo|linebreaksbr}}</p>
-{% if object.image %}<img src="{{object.image.url}}"/>{% endif %}
+{% if object.image %}<img src="{{object.image.url}}"/>{% else %}
+<form action="{% url 'upload-cheque' object.number %}" method="post" enctype="multipart/form-data">{% csrf_token %}{{form.as_p}}<input class="btn btn-primary" type="submit" value="Upload Cheque"/></form>
+{% endif %}
 {% endblock %}