diff --git a/src/profiles/templates/profile_base.html b/src/profiles/templates/profile_base.html index 149d5f7f..3d01a025 100644 --- a/src/profiles/templates/profile_base.html +++ b/src/profiles/templates/profile_base.html @@ -61,8 +61,9 @@ {% if user.creditnotes.exists %} -
  • - + {% url 'shop:creditnote_list' as creditnote_list_url %} +
  • + Credit Notes
  • diff --git a/src/profiles/templates/shop/creditnote_list.html b/src/profiles/templates/shop/creditnote_list.html new file mode 100644 index 00000000..b7cacfc3 --- /dev/null +++ b/src/profiles/templates/shop/creditnote_list.html @@ -0,0 +1,43 @@ +{% extends 'profile_base.html' %} +{% load bootstrap3 %} +{% load shop_tags %} +{% load bornhack %} + +{% block profile_content %} +
    +
    +

    Credit Notes

    +
    +
    + + + + + + + + + + + + {% for creditnote in creditnotes %} + + + + + + + + {% endfor %} + +
    Credit Note IDTextAmountPaid?PDF
    {{ creditnote.id }}{{ creditnote.text }}{{ creditnote.amount|currency }}{{ creditnote.paid|truefalseicon }} + {% if creditnote.pdf %} + {% url 'shop:download_creditnote' pk=creditnote.pk as creditnote_download_url %} + {% bootstrap_button "PDF" icon="save-file" href=creditnote_download_url button_class="btn-primary btn-xs" %} + {% else %} + N/A + {% endif %} +
    +
    +
    +{% endblock %} diff --git a/src/shop/templates/creditnote_list.html b/src/shop/templates/creditnote_list.html deleted file mode 100644 index 5e9ec593..00000000 --- a/src/shop/templates/creditnote_list.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends 'shop_base.html' %} -{% load bootstrap3 %} -{% load shop_tags %} -{% load bornhack %} - -{% block shop_content %} -

    Credit Notes

    - - - - - - - - - - - -{% for creditnote in creditnotes %} - - - - - - - -{% endfor %} - -
    Credit Note IDTextAmountPaid?PDF
    {{ creditnote.id }}{{ creditnote.text }}{{ creditnote.amount|currency }}{{ creditnote.paid|truefalseicon }} - {% if creditnote.pdf %} - {% url 'shop:download_creditnote' pk=creditnote.pk as creditnote_download_url %} - {% bootstrap_button "PDF" icon="save-file" href=creditnote_download_url button_class="btn-primary btn-xs" %} - {% else %} - N/A - {% endif %} -
    -{% endblock %} diff --git a/src/shop/views.py b/src/shop/views.py index b6b1face..7eaa9fba 100644 --- a/src/shop/views.py +++ b/src/shop/views.py @@ -369,7 +369,7 @@ class DownloadInvoiceView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsurePa class CreditNoteListView(LoginRequiredMixin, ListView): model = CreditNote - template_name = "creditnote_list.html" + template_name = "shop/creditnote_list.html" context_object_name = 'creditnotes' def get_queryset(self):