From bda1d77275b8e2c985becf021094b52466778573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Tue, 26 Mar 2019 21:39:44 +0100 Subject: [PATCH] Forgot about credit notes. --- src/profiles/templates/profile_base.html | 5 ++- .../templates/shop/creditnote_list.html | 43 +++++++++++++++++++ src/shop/templates/creditnote_list.html | 37 ---------------- src/shop/views.py | 2 +- 4 files changed, 47 insertions(+), 40 deletions(-) create mode 100644 src/profiles/templates/shop/creditnote_list.html delete mode 100644 src/shop/templates/creditnote_list.html 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):