{% block member_content %}
+{% if receipts %}
+ <div class="card member-form-card">
+ <div class="card-body">
+ <ul>
+ {% for receipt in receipts %}
+ <li><a href="{{ receipt.document.url }}">{{ receipt.get_display }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+{% endif %}
+
<form method='post'>
{% csrf_token %}
<div class="card member-form-card">
{% bootstrap_form form layout='horizontal' %}
</div>
<div class="card-body">
- <button class="btn btn-primary" type="submit">Save</button>
+ <button class="btn btn-primary" type="submit">Generate</button>
</div>
</div>
</form>
kwargs['member'] = self.get_object()
return kwargs
- def get_context_data(self):
- ctx = super().get_context_data()
+ def get_context_data(self, *args, **kwargs):
+ ctx = super().get_context_data(*args, **kwargs)
ctx['receipts'] = self.get_object().documents.filter(category=DOCUMENT_CATEGORY)
return ctx