From a7539819e6c048ada4acc022c5aefc288f818ade Mon Sep 17 00:00:00 2001 From: Marwan Alwali Date: Thu, 23 Jan 2025 19:05:48 +0300 Subject: [PATCH 1/3] update --- inventory/management/.DS_Store | Bin 6148 -> 8196 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/inventory/management/.DS_Store b/inventory/management/.DS_Store index 74afc2e8e02de352b14d36265cb017e3932ce4d1..4829c1eb4fc0de62c462e1c937483a7f1e1fa0c1 100644 GIT binary patch literal 8196 zcmeHMU2GLa6rOKe=7M<9;CPSHeQQ5-P_=S(X`8 zhnU5$a}Da;H7J=pJvK}~gYIWCf1*DUf90PU@pI9v-p%A3+Yg$WEKmCp+Zsu0)g7K27`AKWLx62s@j-7C1J zA7XoiK~ZESt<{`7*}Sf)A=%R0e5xUNvX%EYwzQl&rO1nF*KXdMKIRO&-XlCbv;{?5 z6`L!@&s|evZ7Y%ef@h+jIRsEANv`Yx8|t z zYq_TF9^E%$o59c^MbHiGBes=SlqwwVb&X-`!r~=0n!Z$DRzeBit5{j9l?MtL`*^_) zM#Vk!i489a;U@H}3{S)9Y`coXOG2|mSVxQK7@11{qy{EXiu zMN*|osam>OS|!yBR1)MX@$Jt%4yikV@F8`>r#%Jd^rh;u#6IG-b>eC!iOeeH znO4DBEOUnH*Q+ZM+ALzf7~ZI^OlY%-`C?d?s847TC7c*GCYn^OjM7O7u`P*uRf8-B zx2UbER!)f}hFjFFs>XP(i*Z|`Bcbs$`5T0NgT2Q-BEnuE!hX+wWWTU0MACVvA%d>N zD%7C?Ylx(q(2C92f^FE2F6<=A_M#8{*pESEVG&`6U?YzJ1r%`~?kC!w#zREfC-5Ym z!qYf|7x5Ba#w#Ix-@^NXdgFxLS)!tl_+TnR7JKrpvg&vOCnp6>OE9>;eKO6h7fAF3)hFoagyWzFrtr5*-HbaYpAab2 zkgTpYG&Hl&Q7|zztkqGdwlp%(Q7|($uC3+d5LMQ<4vNpt$<52}o}3^k&)74$K~Q9J zwD_8h4ab-lvvY6=G6PKq0s(Fy;R>>7W8rt^$^0^oAeS&OGBB`!XeNkLz+#)@dFC(! E0EAH@a{vGU From aaf12c950ba1cf1631a00d833944edebd3cbad6e Mon Sep 17 00:00:00 2001 From: Marwan Alwali Date: Sun, 26 Jan 2025 13:33:57 +0300 Subject: [PATCH 2/3] update --- .../__pycache__/settings.cpython-311.pyc | Bin 6859 -> 7358 bytes .../__pycache__/urls.cpython-311.pyc | Bin 2072 -> 2157 bytes car_inventory/urls.py | 1 + inventory/__pycache__/mixins.cpython-311.pyc | Bin 2391 -> 3600 bytes inventory/mixins.py | 24 ++- templates/mail/change_plan_body.txt | 13 ++ templates/mail/change_plan_title.txt | 1 + templates/mail/expired_account_body.txt | 14 ++ templates/mail/expired_account_title.txt | 1 + templates/mail/extend_account_body.txt | 11 ++ templates/mail/extend_account_title.txt | 1 + templates/mail/invoice_created_body.txt | 14 ++ templates/mail/invoice_created_title.txt | 1 + templates/mail/remind_expire_body.txt | 15 ++ templates/mail/remind_expire_title.txt | 1 + templates/plans/account_activation.html | 22 +++ templates/plans/base.html | 15 ++ .../plans/billing_info_create_or_update.html | 23 +++ templates/plans/billing_info_delete.html | 15 ++ templates/plans/create_order.html | 77 ++++++++ templates/plans/current.html | 43 +++++ templates/plans/expiration_messages.html | 31 ++++ templates/plans/extend.html | 60 ++++++ templates/plans/fake_payments.html | 17 ++ templates/plans/invoices/PL_EN.html | 5 + templates/plans/invoices/invoice_base.html | 83 +++++++++ templates/plans/invoices/layout.html | 171 ++++++++++++++++++ templates/plans/order_detail.html | 94 ++++++++++ templates/plans/order_detail_table.html | 40 ++++ templates/plans/order_list.html | 55 ++++++ templates/plans/pagination.html | 22 +++ templates/plans/plan_table.html | 127 +++++++++++++ templates/plans/pricing.html | 7 + templates/plans/upgrade.html | 7 + 34 files changed, 1008 insertions(+), 3 deletions(-) create mode 100644 templates/mail/change_plan_body.txt create mode 100644 templates/mail/change_plan_title.txt create mode 100644 templates/mail/expired_account_body.txt create mode 100644 templates/mail/expired_account_title.txt create mode 100644 templates/mail/extend_account_body.txt create mode 100644 templates/mail/extend_account_title.txt create mode 100644 templates/mail/invoice_created_body.txt create mode 100644 templates/mail/invoice_created_title.txt create mode 100644 templates/mail/remind_expire_body.txt create mode 100644 templates/mail/remind_expire_title.txt create mode 100644 templates/plans/account_activation.html create mode 100644 templates/plans/base.html create mode 100644 templates/plans/billing_info_create_or_update.html create mode 100644 templates/plans/billing_info_delete.html create mode 100644 templates/plans/create_order.html create mode 100644 templates/plans/current.html create mode 100644 templates/plans/expiration_messages.html create mode 100644 templates/plans/extend.html create mode 100644 templates/plans/fake_payments.html create mode 100644 templates/plans/invoices/PL_EN.html create mode 100644 templates/plans/invoices/invoice_base.html create mode 100644 templates/plans/invoices/layout.html create mode 100644 templates/plans/order_detail.html create mode 100644 templates/plans/order_detail_table.html create mode 100644 templates/plans/order_list.html create mode 100644 templates/plans/pagination.html create mode 100644 templates/plans/plan_table.html create mode 100644 templates/plans/pricing.html create mode 100644 templates/plans/upgrade.html diff --git a/car_inventory/__pycache__/settings.cpython-311.pyc b/car_inventory/__pycache__/settings.cpython-311.pyc index 92b03f6f87df37c9c1dca3356da043e29a0d9cc9..599aa15d1e40d00ef894ac23e117f2251983d073 100644 GIT binary patch delta 701 zcmX|9&1(}u6rWAfuf(iPnxs__W2MBRrXNWT777jNR@SDwA=z!4^+S}d zy(A}55US+rr3jWHqOzBs{0Dl;aha2UfQLY#2M^-5Tk~V)@!s$K=HtzqKhP7@?vKQhcaf1Ez>>5I1t`LGxB)j|8A=}qrMw3q4}AEU0^o}?T}W&2 zk;K8r5)XYPF#W`;d4E&XO{+Yx;kiMAss@pUpj=lWs*!=6nu2vQqNA4$geyq5z7JjX zQohcy|EO~qcugg&*-MLFDr4cxdla?U`8#^rGDqu*_DaD^2EyA)EvYN!lyL6GS^P}Z z>WWcSaa=%^ZLHSRt!6x@)^`-#G(*eJ6}+X!bwfkQxD!vM&EdKE)ZJ7%ohHL>@`XzL zuIF40lF_+&2Pp@RCY{M-rdxv~P}TJY(qydE5eZ%d?xuvk2+itF#i_BctyGO>KUq;5 z*wC6JbRjmBT^Tp(PmyN&<}%4y;wfd#$@9laI=S`8AnY%d&YAaWyQr&a*j2W=kcJDUuPF6|$Qo z)OY0^FLFY$Orm`%E3iB#7x+AzD<6WBvu^)coe_1U=`)>!7$5lNFlXOD_xn23_+Dr# z?CF93rcL)aYk&N@x7Zs5;qf+YM-yET{x!B>M{n7&xIK2wj!oKEZuf#i6V5uvbU~yS h2EoXi`|nrY^6&Weh#i^ef{-0s=z^#_w6D&A{{Vjm>MsBQ delta 183 zcmdmIdD@h3IWI340}%Xp+nfGEVIrRdqr*mZ2WD25UWxAJ69?#X;rDk)j<#Toep@yUrrC6f{nWJAGkOqyPsjfEGoOm>!t=bi&p$Oy#6hnXj@mFO2#6k__o03#as VKDcf6m6T`ZzQ7<3L`AcJDgia#GjIR^ diff --git a/car_inventory/__pycache__/urls.cpython-311.pyc b/car_inventory/__pycache__/urls.cpython-311.pyc index 8c3b05d27bf91820c1f9adcb0f578ca65fed71a5..a83a2e89bc3afcb0e173074144eab0e62b142c5f 100644 GIT binary patch delta 186 zcmbOs@K!*5IWI340}#~go|K-+!octt#DM`pDC6^+jq24*JWLF!%qc2Bk|jlTavYNk z+cHiDhSi*tS1{>Ht1V*!vVj-^s(2X~qWDwTgBdi{H-BK-$H-sBR*;jJSFB&f1*SKz zWbt5RG~fJ*^);i;4Hk|Dmkx;u<`c|k*jyCWxFW1^kwx`@vjp=##?7x-oEaJAHtVsyW)%J?$SJ_|g#k!>WZ-0EYT*7LHrbU!0{{>)8B72G diff --git a/car_inventory/urls.py b/car_inventory/urls.py index 7b6399d6..dafe4c8a 100644 --- a/car_inventory/urls.py +++ b/car_inventory/urls.py @@ -24,6 +24,7 @@ urlpatterns += i18n_patterns( path('ledger/', include('django_ledger.urls', namespace='django_ledger')), path("haikalbot/", include("haikalbot.urls")), path('appointment/', include('appointment.urls')), + path('plans/', include('plans.urls')), ) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/inventory/__pycache__/mixins.cpython-311.pyc b/inventory/__pycache__/mixins.cpython-311.pyc index d9fae07d86c39e7f1d23c3ddae6d375a237116d3..ed3ed8af8d8a46bd22a1615f55d2b04dbd36b938 100644 GIT binary patch delta 1703 zcma)6T}&KR6ux(MXZJ4b0@Vcu3v_mAfWa((C6oswZE1ZF#i&VR_Mzj*3^3dMA$NvS z*EP!niEDyJGBuF2Mjo1~X=02%YLlAyY*@0%k~Kc`!B?|}nl$?2IkPOK;sYmhzkBZQ z`I+zB@^hbdHhmciH4qT>jp3x|$a>UxD1DasOLH5i6mKx;~xMEbBG%rkTzzZaj)yoX_x-JZ~CF-IBGmF0XKH zX~|44$o8Uqe~;TO4#^p4skf=ovpMA=h(* ztFD*M`<{PBF@e@2fK^guB-(rTbU8A*8yPJ|#!8W~DrpE@qBSfAy9%#tiN8Bvc{lS_ zA31l47Ot$nS_*b=<%_|go#0Tl_37??xRT6K!~+qbZ-%!2F2HAWlL*8QV0P}Gy8_pm-GnS+G zAQ$%!^YMX@6B38_B=81T5*Umt+oJP;4&?cZcCbE0NCM5dl3;ahJ5bk-_PQtMxlMF$ zP5=}?7mu5Vr2DdF17yyX*KZh{o4Vn$Q&!al!!~UrpHfvhW!Q@uUA8lB%^-Vgb##)V z89X$=k)*TP;3QU=OWl{ESs^-=^-T`J)RfY|Ps5H%W8F5G=J{5b;!OxGxae8REOE?M zMO?PcB=Et~<_-J3N+6~2>naWu@qjOBEoE@`JX+>w04$_0hI>Gk2n@3w|0PQ;bTHpd z@^Hq6O+c8x7&+Cp;lJfCxAg3`^lV=)wkV|*r6BG}U3VHw(m+WXE=yy((%84^L%k@? zl%$zLXs=PK5*m1i{ub`IHB$=rmczrl;o+T;YY#&J_`PxUKpDAK46CKETDY>;94-Wr zY#w++oU7vCG**JkZH_)yLI?DpGm=SFRcI|bq}PR78TfEN0yZlJ@WdHrZErV;_!1mJ zSrB`wf~!Ro!&wBy>1X3UJj-K_&L;ZZm2)_DC-E8hn@y%N n`f}2k;^Qzx)7F~vGm8x{nL=2{;ZK}<{B+@E>O=!0UcB*N7h5rn%Wor2pc{+N1BnKP4_pjNYD=WAD;ix=G`gs0az)YP0|OgpCL@Hr$Rpd~HG}o; zWJA{J;ui$8Kky>tK7+jKr^!0`0H>a^IFP-Pp-2Kq6^VfeHW{field}') + return field + class LocalizedNameMixin: """ diff --git a/templates/mail/change_plan_body.txt b/templates/mail/change_plan_body.txt new file mode 100644 index 00000000..489b5100 --- /dev/null +++ b/templates/mail/change_plan_body.txt @@ -0,0 +1,13 @@ +{% load i18n %}{% autoescape off %} +{% trans "Hi" %} {% firstof user.get_full_name user.username %}, + +{% if userplan.expire != None %} + {% blocktrans with plan_name=plan.name expire=userplan.expire %}Your current plan is {{ plan_name }} and it will expire on {{ expire }}. {% endblocktrans %} +{% else %} + {% blocktrans with plan_name=plan.name %}Your current plan is {{ plan_name }}. {% endblocktrans %} +{% endif %} + +{% trans "Thank you" %} +-- +{% blocktrans %}The Team at {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/mail/change_plan_title.txt b/templates/mail/change_plan_title.txt new file mode 100644 index 00000000..bbec277e --- /dev/null +++ b/templates/mail/change_plan_title.txt @@ -0,0 +1 @@ +{% load i18n %}{% blocktrans with user=user plan=plan.name %}Your account {{ user }} has new plan {{ plan }}{% endblocktrans %} \ No newline at end of file diff --git a/templates/mail/expired_account_body.txt b/templates/mail/expired_account_body.txt new file mode 100644 index 00000000..701ad8f9 --- /dev/null +++ b/templates/mail/expired_account_body.txt @@ -0,0 +1,14 @@ +{% load i18n %}{% autoescape off %} +{% trans "Hi" %} {% firstof user.get_full_name user.username %}, + +{% blocktrans %}Your account has just expired.{% endblocktrans %} + +{% blocktrans with plan_name=userplan.plan.name %}You can restore your current plan {{ plan_name }} here:{% endblocktrans %} +http://{{ site_domain }}{% url 'current_plan' %} +{% blocktrans %}or you can upgrade your plan here:{% endblocktrans %} +http://{{ site_domain }}{% url 'upgrade_plan' %} + +{% trans "Thank you" %} +-- +{% blocktrans %}The Team at {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/mail/expired_account_title.txt b/templates/mail/expired_account_title.txt new file mode 100644 index 00000000..54a3d3a7 --- /dev/null +++ b/templates/mail/expired_account_title.txt @@ -0,0 +1 @@ +{% load i18n %}{% blocktrans %}Your account {{ user }} has just expired{% endblocktrans %} \ No newline at end of file diff --git a/templates/mail/extend_account_body.txt b/templates/mail/extend_account_body.txt new file mode 100644 index 00000000..f7e77e50 --- /dev/null +++ b/templates/mail/extend_account_body.txt @@ -0,0 +1,11 @@ +{% load i18n %}{% autoescape off %} +{% trans "Hi" %} {% firstof user.get_full_name user.username %}, + +{% blocktrans with days=pricing.period plan_name=plan.name expire=userplan.expire %}Your account has just been extended by {{ days }} days. Your current plan is {{ plan_name }} and it will expire on {{ expire }}. {% endblocktrans %} + +{% trans "An invoice will be sent with another e-mail, if billing data was provided." %} + +{% trans "Thank you" %} +-- +{% blocktrans %}The Team at {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/mail/extend_account_title.txt b/templates/mail/extend_account_title.txt new file mode 100644 index 00000000..8a984a5e --- /dev/null +++ b/templates/mail/extend_account_title.txt @@ -0,0 +1 @@ +{% load i18n %}{% blocktrans with user=user days=pricing.period %}Your account {{ user }} has been extended by {{ days }} days{% endblocktrans %} \ No newline at end of file diff --git a/templates/mail/invoice_created_body.txt b/templates/mail/invoice_created_body.txt new file mode 100644 index 00000000..4367230c --- /dev/null +++ b/templates/mail/invoice_created_body.txt @@ -0,0 +1,14 @@ +{% load i18n %}{% autoescape off %} +{% trans "Hi" %} {% firstof user.get_full_name user.username %}, + +{% blocktrans %}We are writing to inform you, that {{ invoice_type }} {{ invoice_number }} has been issued. You can view it and print it at: +http://{{ site_domain }}{{ url }} +{% endblocktrans %} + +{% trans "Details of the order can be see on:" %}: +http://{{ site_domain }}{% url 'order' pk=order %} + +{% trans "Thank you" %} +-- +{% blocktrans %}The Team at {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/mail/invoice_created_title.txt b/templates/mail/invoice_created_title.txt new file mode 100644 index 00000000..3304e800 --- /dev/null +++ b/templates/mail/invoice_created_title.txt @@ -0,0 +1 @@ +{% load i18n %}{% trans 'Order' %} {{ order }} - {% blocktrans with invoice_type=invoice_type invoice_number=invoice_number user=user %}{{ invoice_type }} {{ invoice_number }} has been issued for {{ user }}{% endblocktrans %} \ No newline at end of file diff --git a/templates/mail/remind_expire_body.txt b/templates/mail/remind_expire_body.txt new file mode 100644 index 00000000..e795fcdf --- /dev/null +++ b/templates/mail/remind_expire_body.txt @@ -0,0 +1,15 @@ +{% load i18n %}{% autoescape off %} +{% trans "Hi" %} {% firstof user.get_full_name user.username %}, + +{% blocktrans %}Your account will expire in {{ days }} days.{% endblocktrans %} + +{% blocktrans with plan_name=userplan.plan.name %}You can extend your current plan {{ plan_name }} on page:{% endblocktrans %} +http://{{ site_domain }}{% url 'current_plan' %} + +{% blocktrans %}or you can upgrade your plan here:{% endblocktrans %} +http://{{ site_domain }}{% url 'upgrade_plan' %} + +{% trans "Thank you" %} +-- +{% blocktrans %}The Team at {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/mail/remind_expire_title.txt b/templates/mail/remind_expire_title.txt new file mode 100644 index 00000000..b6863e01 --- /dev/null +++ b/templates/mail/remind_expire_title.txt @@ -0,0 +1 @@ +{% load i18n %}{% blocktrans count days as days %}Your account {{ user }} will expire in {{ days }} day{% plural %}Your account {{ user }} will expire in {{ days }} days{% endblocktrans %} \ No newline at end of file diff --git a/templates/plans/account_activation.html b/templates/plans/account_activation.html new file mode 100644 index 00000000..233f51bf --- /dev/null +++ b/templates/plans/account_activation.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} +{% load i18n %} + + +{% block body %} +

{% if SUCCESSFUL %}{% trans "Activation successful" %}{% else %}{% trans "Activation failed" %}{% endif %}

+ + {% if SUCCESSFUL %} +{# {% include "messages.html" %}#} + {% blocktrans %} + Your panels will be available again soon. + {% endblocktrans %} + {% else %} + {% blocktrans %} + Your account cannot by activated because your account exceeds plan limits. Please adjust usage of limits and then try to activate your account again. + {% endblocktrans %} +{# {% include "messages.html" %}#} + {% endif %} + + + +{% endblock %} \ No newline at end of file diff --git a/templates/plans/base.html b/templates/plans/base.html new file mode 100644 index 00000000..4facf5e1 --- /dev/null +++ b/templates/plans/base.html @@ -0,0 +1,15 @@ + + + + + {% block extra_js %} + {% endblock %} + + +

django-plans

+ {% include "plans/expiration_messages.html" %} + + {% block body %} + {% endblock %} + + diff --git a/templates/plans/billing_info_create_or_update.html b/templates/plans/billing_info_create_or_update.html new file mode 100644 index 00000000..eb32be35 --- /dev/null +++ b/templates/plans/billing_info_create_or_update.html @@ -0,0 +1,23 @@ +{% extends 'base.html' %} +{% load i18n crispy_forms_filters %} + + +{% block body %} +
+
+
+ {% block "form-content" %} + {% trans "Provide billing data" %} + {% csrf_token %} + {{ form|crispy }} + {% if object %} + {{ _("Delete") }} + {% endif %} + + {% endblock %} +
+
+
+{% endblock %} diff --git a/templates/plans/billing_info_delete.html b/templates/plans/billing_info_delete.html new file mode 100644 index 00000000..ffe91ce6 --- /dev/null +++ b/templates/plans/billing_info_delete.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} +{% load i18n %} + +{% block body %} +

Billing data

+ +
+ {% csrf_token %} + {% trans "Are you sure to delete billing info?" %} +

+ +

+{% endblock %} diff --git a/templates/plans/create_order.html b/templates/plans/create_order.html new file mode 100644 index 00000000..636c1273 --- /dev/null +++ b/templates/plans/create_order.html @@ -0,0 +1,77 @@ +{% extends 'base.html' %} +{% load i18n crispy_forms_filters%} + +{% block body %} +

{% trans "Confirm order" %}

+ {% if FREE_ORDER %} + {# Free order is when user downgrades a plan and there is no additional payment it is handle by special a view. #} + {% with object as order %} + {% include "plans/order_detail_table.html" %} + {% endwith %} + +
+ {% blocktrans %}If you downgrade your plan please remember that new lower limits are used immediately after + finishing the order.{% endblocktrans %} +
+ +
+ {% csrf_token %} + +
+ + {% else %} + +
+ {% with object as order %} + {% include "plans/order_detail_table.html" %} + {% endwith %} + +

{% trans "Invoice" %}

+ {% url "billing_info" as billing_info_url %} + {% with billing_info_url|add:"?next="|add:request.get_full_path as billing_info_url %} + {% if billing_info %} +

+ {% blocktrans %} + Invoice for this order will be issued for: + {% endblocktrans %} + +

+ {{ billing_info.name }}
+ {{ billing_info.street }}
+ {{ billing_info.zipcode }} + {{ billing_info.city }}, + {{ billing_info.country }} +

+ {% trans "VAT ID" %} {{ billing_info.tax_number }} +
+

+

+ {% blocktrans %} + If this data is not correct please edit billing data before + making an order. + {% endblocktrans %} +

+ {% else %} + {% block invoice-alert %} +

+ {% blocktrans %} + Invoice will not be issued. If you need an invoice please provide + billing data before making an order. + {% endblocktrans %} +

+ {% endblock %} + {% endif %} + {% endwith %} + +

+ + + + + {{ form|crispy }} + {% csrf_token %} +

+ + {% endif %} + +{% endblock %} diff --git a/templates/plans/current.html b/templates/plans/current.html new file mode 100644 index 00000000..6286dcfb --- /dev/null +++ b/templates/plans/current.html @@ -0,0 +1,43 @@ +{% extends 'base.html' %} +{% load i18n %} + +{% block body %} + + {% block account_details %} +

{% trans "Your account" %}

+ +
+
{% trans "Account" %}:
+
{{ user }}
+
{% trans "State" %}:
+
{% if userplan.active %} {% trans "active" %} {% else %} + {% trans "expired" %} {% endif %}
+
{% trans "Expire" %}:
+
{{ userplan.expire }}
+
{% trans "Plan" %}:
+
{{ userplan.plan }} {% trans "upgrade" %}
+
+ {% endblock %} + + {% block plan_details %} +

{% trans "Plan details" %}

+ + +
+
+ {% include "plans/plan_table.html" %} +
+
+ {% endblock %} + + {% block need_more %} +

{% trans "Need more?" %}

+ + {% url 'upgrade_plan' as upgrade_url %} + {% blocktrans %} + Please see other currently available plans. + {% endblocktrans %} + {% endblock %} + + +{% endblock %} diff --git a/templates/plans/expiration_messages.html b/templates/plans/expiration_messages.html new file mode 100644 index 00000000..c0f0c697 --- /dev/null +++ b/templates/plans/expiration_messages.html @@ -0,0 +1,31 @@ +{% load i18n %} + +{% block expiration_messages %} +{% if ACCOUNT_EXPIRED %} + +
+ {% blocktrans with url=EXTEND_URL %}Your account has expired. + Please extend your account.{% endblocktrans %} +
+{% else %} + + {% if ACCOUNT_NOT_ACTIVE %} +
+ {% blocktrans with url=ACTIVATE_URL %} + Your account is not active. Possibly you are over some limits. + Try to activate your account. + {% endblocktrans %} +
+ {% endif %} + + {% if EXPIRE_IN_DAYS >= 0 and EXPIRE_IN_DAYS <= 14 %} +
+ {% blocktrans with extend_url=EXTEND_URL days_to_expire=EXPIRE_IN_DAYS %} + Your account will expire soon (in {{ days_to_expire }} days). + We recommend to extend your account now. + {% endblocktrans %} +
+ {% endif %} + +{% endif %} +{% endblock %} diff --git a/templates/plans/extend.html b/templates/plans/extend.html new file mode 100644 index 00000000..867d4d38 --- /dev/null +++ b/templates/plans/extend.html @@ -0,0 +1,60 @@ +{% load i18n %} + +{% block seo_title %}user_plan{% endblock %} + +{% block extra_js %} + +{% endblock %} + +{% block body %} +
+ {% csrf_token %} + {{ form.as_p }} +
+ +{% if userplan.plan.available %} +
    +
  • {% trans "Plan" %}: {{ userplan.plan.name }} +
  • {% trans "Quotas" %}: +
      + {% for quota in quotas %} +
    • {{ quota.quota.name }} ({{ quota.quota.description }}) - + + {% if quota.quota.is_boolean %} + + {% if quota.value %} {% trans "yes" %} {% else %} {% trans "no" %} {% endif %} + + {% else %} + {{ quota.value }} {{ quota.quota.unit }} + {% endif %} + {% endfor %} +
    + +
  • {% trans "Pricings" %}: + +
  • +
+{% else %} + + {% url 'upgrade_plan' as upgrade_url %} + {% blocktrans %} + Unfortunately your current plan is not available any more. You need to upgrade your plan. + {% endblocktrans %} + +{% endif %} + +{% endblock %} diff --git a/templates/plans/fake_payments.html b/templates/plans/fake_payments.html new file mode 100644 index 00000000..aa906660 --- /dev/null +++ b/templates/plans/fake_payments.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% load i18n %} + + +{% block body %} + +

FakePayments™

+

Please select desired status after performing payment for an {{ object }}.

+
+ {% csrf_token %} + {{ form.as_p }} + +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/plans/invoices/PL_EN.html b/templates/plans/invoices/PL_EN.html new file mode 100644 index 00000000..9a3003bd --- /dev/null +++ b/templates/plans/invoices/PL_EN.html @@ -0,0 +1,5 @@ +{% extends 'base.html' %} +{% block title %}{{ invoice.full_number }}{% endblock %} +{% block body %} +{% include 'plans/invoices/layout.html' %} +{% endblock %} \ No newline at end of file diff --git a/templates/plans/invoices/invoice_base.html b/templates/plans/invoices/invoice_base.html new file mode 100644 index 00000000..172f2c16 --- /dev/null +++ b/templates/plans/invoices/invoice_base.html @@ -0,0 +1,83 @@ + + + + {% block title %}{% endblock %} + + + + {% block head %}{% endblock %} + + + +{% block body %}{% endblock %} + + \ No newline at end of file diff --git a/templates/plans/invoices/layout.html b/templates/plans/invoices/layout.html new file mode 100644 index 00000000..f17fe96a --- /dev/null +++ b/templates/plans/invoices/layout.html @@ -0,0 +1,171 @@ + {% if logo_url %} + company logo + {% endif %} + +
+

+ {{ invoice.full_number }} +

+

{% if not copy %}ORIGINAL{% else %}COPY{% endif %}

+

{{ invoice.issued|date:"Y-m-d" }}

+ {% if invoice.type != invoice.INVOICE_TYPES.PROFORMA %} +

{{ invoice.selling_date|date:"Y-m-d" }}

+ {% else %} +

 

+ {% endif %} +
+ + + + + + + + + + +
+ +

+ + {{ invoice.shipping_name }}
+ {{ invoice.shipping_street }}
+ {{ invoice.shipping_zipcode }} {{ invoice.shipping_city }}
+ {{ invoice.buyer_country.code }} - {{ invoice.buyer_country.name }} + + +
+ +

+ {{ invoice.issuer_name }}
+ {{ invoice.issuer_street }}
+ {{ invoice.issuer_zipcode }} {{ invoice.issuer_city}}
+ {{ invoice.issuer_country.code }} - {{ invoice.issuer_country.name }}

+ {{ invoice.issuer_tax_number }}
+

+ +

+ {{ invoice.buyer_name }}
+ {{ invoice.buyer_street }}
+ {{ invoice.buyer_zipcode }} {{ invoice.buyer_city }}
+ {{ invoice.buyer_country.code }} - {{ invoice.buyer_country.name }} + + {% if invoice.buyer_tax_number %} +

+ + {{ invoice.buyer_tax_number }} + +

+ {% endif %} +
+
+ + + + + + + + + + + {% if invoice.rebate %} + + + {% endif %} + + + + + + + + + + + + + + + {% if invoice.rebate %} + + {% endif %} + + + + + + + + + + + + + + + +
+ + + + Description + + + + Unit price + + + + + Qty. + + + + Rebate + + + + Subtotal + + VAT + + + VAT Amount + + + + Subtotal with TAX/VAT +
+ 1 + {{ invoice.item_description }}{{ invoice.unit_price_net|floatformat:2 }} {{ invoice.currency }}{{ invoice.quantity }}units{{ invoice.rebate|floatformat:2 }} %{{ invoice.total_net|floatformat:2 }} {{ invoice.currency }}{% if invoice.tax != None %}{{ invoice.tax|floatformat:2 }} %{% else %}n/a{% endif %}{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} {{ invoice.currency }}{% else %}n/a{% endif %}{{ invoice.total|floatformat:2 }} {{ invoice.currency }}
{{ invoice.total_net|floatformat:2 }} {{ invoice.currency }}{% if invoice.tax != None %}{{ invoice.tax|floatformat:2 }} %{% else %}n/a{% endif %}{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} {{ invoice.currency }}{% else %}n/a{% endif %}{{ invoice.total|floatformat:2 }} {{ invoice.currency }}
+
+ + {% if invoice.type != invoice.INVOICE_TYPES.PROFORMA %} +

+ {% endif %} + + + + + {% if invoice.type == invoice.INVOICE_TYPES.PROFORMA %} + + + {% else %} + + {% endif %} + + {{ invoice.payment_date|date:"Y-m-d" }} +

+
+ + {% if invoice.type == invoice.INVOICE_TYPES.PROFORMA %}

This document is not an invoice.

{% endif %} + + {% if invoice.tax == None and invoice.is_UE_customer %} +

+ -Reverse charge. +

+ {% endif %} + + +
diff --git a/templates/plans/order_detail.html b/templates/plans/order_detail.html new file mode 100644 index 00000000..1e7e77f9 --- /dev/null +++ b/templates/plans/order_detail.html @@ -0,0 +1,94 @@ +{% extends "base.html" %} +{% load i18n %} + + +{% block head %} + +{% endblock %} + + +{% block body %} +

{% blocktrans with object.id as order_id and object.get_status_display as order_status %}Order #{{ order_id }} + (status: {{ order_status }}){% endblocktrans %}

+ + {# You should provide displaying django messages in this template #} + + {% with object as order %} + {% include "plans/order_detail_table.html" %} + {% endwith %} + + {% if object.get_all_invoices.count %} +

{% trans "Printable documents" %}

+ + {% endif %} + + + +

{% trans "Payment" %}

+ {% if object.completed %} + +

+ {% blocktrans with object.completed as completed %} + Payment completed on: {{ completed }} + {% endblocktrans %} +

+ {% else %} + + {% if object.is_ready_for_payment %} + {% block payment_method %} + +

+ Here should go bindings to your payment. We recommend using django-getpaid for payment processing. + Use a fake payment below to simulate paying for an order: +

+ + Pay using + FakePayments™ ;) + + {# An example code snippet for accepting payments using django-getpaid #} + + {#
#} + {# {% csrf_token %}#} + {#
    {{ payment_form.as_ul }}
#} + {#

#} + {#

#} + {#
#} + + {% endblock %} + {% else %} + +

+ {% blocktrans %} + This order is expired. It will accept an incoming payment made earlier, but new payment cannot be + initialized. Please make a new order if necessary. + {% endblocktrans %} +

+ + {% endif %} + + {% endif %} + + {% if object.status == object.STATUS.NOT_VALID %} +

+ {% blocktrans %} + This order could not be processed as it is not valid. Please contact with customer service. + {% endblocktrans %} +

+ {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/templates/plans/order_detail_table.html b/templates/plans/order_detail_table.html new file mode 100644 index 00000000..61f64ce0 --- /dev/null +++ b/templates/plans/order_detail_table.html @@ -0,0 +1,40 @@ +{% load i18n %} + +{% block table %} +
+ + + + + + + + + + {% if order.user %} + + + {% endif %} + + + + + + + + + + + + + + +
{% trans "Name" %}{% trans "Net price" %}{% trans "VAT" %}{% trans "VAT total" %}{% trans "Total" %}{% trans "Order completed" %}{% trans "Plan valid from" %}{% trans "Plan valid until" %}
{{ order.name }}{{ order.amount }} {{ order.currency }}{% if order.tax == None %}n/a{% else %}{{ order.tax }} %{% endif %}{% if order.tax_total == None %}n/a{% else %}{{ order.tax_total }} {{ order.currency }}{% endif %}{{ order.total }} {{ order.currency }}{{ order.completed|date|default:"-" }}{{ order.get_plan_extended_from|date|default:"-" }}{{ order.get_plan_extended_until|date|default:"-" }}
+
+{% endblock %} +{% if order.tax == None %} +

{% trans "EU VAT" %}

+
+ {% blocktrans %} VAT is not applied to order. {% endblocktrans %} +
+{% endif %} diff --git a/templates/plans/order_list.html b/templates/plans/order_list.html new file mode 100644 index 00000000..90a81c3b --- /dev/null +++ b/templates/plans/order_list.html @@ -0,0 +1,55 @@ +{% extends 'base.html' %} +{% load i18n %} + + +{% block body %} + {% block order_header %} +

{% trans "List of orders" %}

+ {% endblock %} + + {% if object_list %} + {% block pagination_first %} + {% include "plans/pagination.html" %} + {% endblock %} + + {% block order_table %} +
+ + + + + + + + + + + + + + + {% for order in object_list %} + + + + + + + + + + + {% endfor %} + +
ID{% trans 'Name' %}{% trans 'Created' context 'order created' %}{% trans 'Status' context 'order status' %}{% trans 'Completed' context 'order completed' %}{% trans 'Total' context 'total amount, value' %}{% trans 'Plan valid from' %}{% trans 'Plan valid until' %}
{{ order.pk }}{{ order.name }}{{ order.created|date }}{{ order.get_status_display }}{{ order.completed|date|default:"-" }}{{ order.total }} {{ CURRENCY }}{{ order.plan_extended_from|date|default:"-" }}{{ order.plan_extended_until|date|default:"-" }}
+
+ {% endblock %} + + {% block pagination_second %} + {% include "plans/pagination.html" %} + {% endblock %} + + {% else %} + {% blocktrans %}You do not have any orders so far.{% endblocktrans %} + {% endif %} +{% endblock %} diff --git a/templates/plans/pagination.html b/templates/plans/pagination.html new file mode 100644 index 00000000..0388649a --- /dev/null +++ b/templates/plans/pagination.html @@ -0,0 +1,22 @@ +{% load i18n %} +{% if is_paginated %} +
    + {% if page_obj.has_previous %} +
  • «
  • + {% else %} +
  • «
  • + {% endif %} + + {% for page in page_obj.paginator.page_range %} + +
  • + {{ page }}
  • + {% endfor %} + + {% if page_obj.has_next %} +
  • »
  • + {% else %} +
  • »
  • + {% endif %} +
+{% endif %} diff --git a/templates/plans/plan_table.html b/templates/plans/plan_table.html new file mode 100644 index 00000000..d6603577 --- /dev/null +++ b/templates/plans/plan_table.html @@ -0,0 +1,127 @@ +{% load i18n %} +
+ + + + + {% for plan in plan_list %} + + {% endfor %} + + + + + {% for quota_row in plan_table %} + + + + + {% for plan_quota in quota_row.1 %} + + + {% endfor %} + + + {% endfor %} + + + + + + + + {% if user.is_authenticated %} + + + + {% for plan in plan_list %} + + {% endfor %} + + + {% endif %} + + + + {% for plan in plan_list %} + + {% endfor %} + + + +
+ {% if plan.url %}{% endif %} + {{ plan.name }} + + {% if plan == userplan.plan %} + {% trans "your current plan" %} + {% endif %} + {% if plan.url %}{% endif %} +
+ {% if quota_row.0.url %}{% endif %} + {{ quota_row.0.name }} + {{ quota_row.0.description }} + {% if quota_row.0.url %}{% endif %} + + {% if plan_quota != None %} + {% if quota_row.0.is_boolean %} + {% if plan_quota.value %} + {% else %} - {% endif %} + {% else %} + {% if plan_quota.value == None %}{% trans 'no limit' %}{% else %}{{ plan_quota.value }} {{ quota_row.0.unit }}{% endif %} + {% endif %} + {% endif %} +
{% trans 'Pricing' %}
+ {% if plan != userplan.plan and not userplan.is_expired and not userplan.plan.is_free %} + {% trans "Change" %}{% endif %} +
+ {% if plan.available %} + + + {% else %} + + {% url 'upgrade_plan' as upgrade_url %} + {% blocktrans %} + This plan is not available anymore and cannot be extended.

+ You need to upgrade your account to any of currently available plans. + {% endblocktrans %} + + + {% endif %} +

+
+

+ {% trans "Net prices" %} + +

diff --git a/templates/plans/pricing.html b/templates/plans/pricing.html new file mode 100644 index 00000000..b66a22fc --- /dev/null +++ b/templates/plans/pricing.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} +{% load i18n %} + +{% block body %} +

{% trans "See our great value plans" %}

+ {% include "plans/plan_table.html" %} +{% endblock %} diff --git a/templates/plans/upgrade.html b/templates/plans/upgrade.html new file mode 100644 index 00000000..12c2eb7b --- /dev/null +++ b/templates/plans/upgrade.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} +{% load i18n %} + +{% block body %} +

{% trans "Choose plan" %}

+ {% include "plans/plan_table.html" %} +{% endblock %} From e2528f5ad7724247051f33cac8ffdaf304f65dc1 Mon Sep 17 00:00:00 2001 From: Marwan Alwali Date: Sun, 26 Jan 2025 16:58:49 +0300 Subject: [PATCH 3/3] update --- .../__pycache__/settings.cpython-311.pyc | Bin 7358 -> 7358 bytes templates/plans/current.html | 78 +++--- templates/plans/plan_table.html | 227 ++++++++---------- .../subscriptions/subscription_plan.html | 2 +- 4 files changed, 155 insertions(+), 152 deletions(-) diff --git a/car_inventory/__pycache__/settings.cpython-311.pyc b/car_inventory/__pycache__/settings.cpython-311.pyc index 599aa15d1e40d00ef894ac23e117f2251983d073..81c8ff388d77d30d5b61a1a7e4c1dd8ac2a7ca17 100644 GIT binary patch delta 29 jcmdmIxzCb!IWI340}y{% trans "Your account" %} + +
+
+
+
+
{% trans "Your Account" %}
+
+
+
+
{% trans "Account" %}:
+
{{ user.dealer.get_local_name }}
-
-
{% trans "Account" %}:
-
{{ user }}
-
{% trans "State" %}:
-
{% if userplan.active %} {% trans "active" %} {% else %} - {% trans "expired" %} {% endif %}
-
{% trans "Expire" %}:
-
{{ userplan.expire }}
-
{% trans "Plan" %}:
-
{{ userplan.plan }} {% trans "upgrade" %}
-
- {% endblock %} +
{% trans "State" %}:
+
+ {% if userplan.active %} + {% trans "Active" %} + {% else %} + {% trans "Expired" %} + {% endif %} +
- {% block plan_details %} -

{% trans "Plan details" %}

+
{% trans "Expire" %}:
+
{{ userplan.expire }}
- -
-
- {% include "plans/plan_table.html" %} +
{% trans "Plan" %}:
+
+ {{ userplan.plan }} + {% trans "Upgrade" %} +
+
+
+
- {% endblock %} - {% block need_more %} -

{% trans "Need more?" %}

- - {% url 'upgrade_plan' as upgrade_url %} - {% blocktrans %} - Please see other currently available plans. - {% endblocktrans %} - {% endblock %} + +
+
+
+
+
{% trans "Plan Details" %}
+
+
+
+
+ {% include "plans/plan_table.html" %} +
+
+
+
+
+
-{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/templates/plans/plan_table.html b/templates/plans/plan_table.html index d6603577..c6bdd0e0 100644 --- a/templates/plans/plan_table.html +++ b/templates/plans/plan_table.html @@ -1,127 +1,112 @@ {% load i18n %} -
- - - - - {% for plan in plan_list %} - - {% endfor %} - - - - - {% for quota_row in plan_table %} - - - - - {% for plan_quota in quota_row.1 %} - - + {% endif %} + + + {% for plan in plan_list %} + + {% endfor %} + + +
- {% if plan.url %}{% endif %} - {{ plan.name }} - - {% if plan == userplan.plan %} - {% trans "your current plan" %} - {% endif %} - {% if plan.url %}{% endif %} -
- {% if quota_row.0.url %}{% endif %} - {{ quota_row.0.name }} - {{ quota_row.0.description }} - {% if quota_row.0.url %}{% endif %} - - {% if plan_quota != None %} - {% if quota_row.0.is_boolean %} - {% if plan_quota.value %} + {% else %} - {% endif %} - {% else %} - {% if plan_quota.value == None %}{% trans 'no limit' %}{% else %}{{ plan_quota.value }} {{ quota_row.0.unit }}{% endif %} +
+ + + + + {% for plan in plan_list %} + - {% endfor %} - - - - - - - - {% if user.is_authenticated %} - - - - {% for plan in plan_list %} - - {% endfor %} - - - {% endif %} - - - - {% for plan in plan_list %} - + {% endfor %} + + + + {% for quota_row in plan_table %} + + + {% for plan_quota in quota_row.1 %} + + {% endfor %} + + {% endfor %} + + + + + + + {% if user.is_authenticated %} + + + {% for plan in plan_list %} + - {% endfor %} - - - -
+ {% if plan.url %}{% endif %} + {{ plan.name }} + {% if plan == userplan.plan %} + {% trans "Current Plan" %} {% endif %} - {% endif %} - - {% endfor %} - -
{% trans 'Pricing' %}
- {% if plan != userplan.plan and not userplan.is_expired and not userplan.plan.is_free %} - {% trans "Change" %}{% endif %} -
- {% if plan.available %} -
+ {% if quota_row.0.url %}{% endif %} + {{ quota_row.0.name }} + {{ quota_row.0.description }} + {% if quota_row.0.url %}{% endif %} + + {% if plan_quota != None %} + {% if quota_row.0.is_boolean %} + {% if plan_quota.value %}{% else %}{% endif %} + {% else %} + {% if plan_quota.value == None %}{% trans 'No Limit' %}{% else %}{{ plan_quota.value }} {{ quota_row.0.unit }}{% endif %} {% endif %} {% endif %} - {% endfor %} - {% else %} - {# Allow selecting plans with no pricings #} -
  • - {% trans "Free" %} - ({% trans "no expiry" %}) - 0 {{ CURRENCY }} - {% if plan != userplan.plan or userplan.is_expired %} - - {% if userplan.is_expired %} - {% trans "Select" %} - {% else %} - {% trans "Change" %} - {% endif %} - +
  • {% trans 'Pricing' %}
    + {% if plan != userplan.plan and not userplan.is_expired and not userplan.plan.is_free %} + {% trans "Change" %} {% endif %} - - {% endif %} - - - {% else %} - - {% url 'upgrade_plan' as upgrade_url %} - {% blocktrans %} - This plan is not available anymore and cannot be extended.

    - You need to upgrade your account to any of currently available plans. - {% endblocktrans %} - - - {% endif %} -

    + + {% endfor %} +
    + {% if plan.available %} + + {% else %} + + {% url 'upgrade_plan' as upgrade_url %} + {% blocktrans %} + This plan is not available anymore and cannot be extended.
    + You need to upgrade your account to any of currently available plans. + {% endblocktrans %} +
    + {% endif %} +
    -

    - {% trans "Net prices" %} - -

    +

    * {% trans "Net prices" %}

    \ No newline at end of file diff --git a/templates/subscriptions/subscription_plan.html b/templates/subscriptions/subscription_plan.html index 3f0eefa0..40a965f0 100644 --- a/templates/subscriptions/subscription_plan.html +++ b/templates/subscriptions/subscription_plan.html @@ -4,7 +4,7 @@ {% block content %}
    -

    Pricing

    +

    {{ _('Pricing') }}