From 7cfd43a8c491480e288902246bb05b00ba6217eb Mon Sep 17 00:00:00 2001 From: emile Date: Sun, 5 May 2024 22:23:29 +0300 Subject: [PATCH] new --- .../templates/listing_pages/invoices.html | 7 +-- .../templates/listing_pages/items.html | 38 ++++++++---- .../templates/listing_pages/orders.html | 43 +++++++------ osinaweb/db.sqlite3 | Bin 1204224 -> 1204224 bytes .../delete/__pycache__/urls.cpython-310.pyc | Bin 1166 -> 1147 bytes .../delete/__pycache__/views.cpython-310.pyc | Bin 2982 -> 3250 bytes osinaweb/osinacore/delete/urls.py | 19 +++--- osinaweb/osinacore/delete/views.py | 16 ++++- .../delete_templates/delete-ticket-modal.html | 30 +++++++++ .../listing_pages/business-types.html | 12 ++-- .../templates/listing_pages/businesses.html | 19 ++++-- .../templates/listing_pages/customers.html | 19 ++++-- .../listing_pages/daily-reports.html | 10 ++- .../templates/listing_pages/departments.html | 12 ++-- .../templates/listing_pages/notes.html | 6 +- .../listing_pages/project-types.html | 12 ++-- .../templates/listing_pages/references.html | 10 ++- .../listing_pages/staff-positions.html | 12 ++-- .../templates/listing_pages/staffs.html | 19 ++++-- .../templates/listing_pages/tags.html | 12 ++-- .../templates/listing_pages/tickets.html | 58 +++++++++++++++--- osinaweb/osinacore/templates/main.html | 18 ++++-- osinaweb/static/js/pop-modals.js | 1 + 23 files changed, 269 insertions(+), 104 deletions(-) create mode 100644 osinaweb/osinacore/templates/delete_templates/delete-ticket-modal.html diff --git a/osinaweb/billing/templates/listing_pages/invoices.html b/osinaweb/billing/templates/listing_pages/invoices.html index 4b999768..9210e8d8 100644 --- a/osinaweb/billing/templates/listing_pages/invoices.html +++ b/osinaweb/billing/templates/listing_pages/invoices.html @@ -81,10 +81,9 @@
- - - - + + +
diff --git a/osinaweb/billing/templates/listing_pages/items.html b/osinaweb/billing/templates/listing_pages/items.html index a83a288e..a2964842 100644 --- a/osinaweb/billing/templates/listing_pages/items.html +++ b/osinaweb/billing/templates/listing_pages/items.html @@ -75,17 +75,24 @@
-
- +
+ + + +
-
- +
+ + +
-
- +
+ + +
@@ -149,17 +156,24 @@
-
- +
+ + + +
-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/billing/templates/listing_pages/orders.html b/osinaweb/billing/templates/listing_pages/orders.html index 857ba323..268edfbc 100644 --- a/osinaweb/billing/templates/listing_pages/orders.html +++ b/osinaweb/billing/templates/listing_pages/orders.html @@ -70,40 +70,43 @@
- - -
- -
-
- - {% if order.status == 'Pending' and not order.invoice %} - - - - + + + {% endif %} {% if order.invoice %} - - - - + + + {% endif %} + + +
+ + + + +
+
-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index c18ee909c54eb6b6f0f2329594f2cb30d994a324..6d41ae732f60c7a288a247899544e4155e832301 100644 GIT binary patch delta 1524 zcmah}Yitx{6#eG0vuv5&GqWH*3U*L=6bhZ~w%gtPAq8nmEz7cLC6%CMp>zvHy0D}m znouOR;Rj^}VG?L)l@KC{23**wfOKiV2M{b+p;V|PC=nC25|M-=^_wkE|1kL`Ge7P< z_ndR@{pu1$b%~;AsQ%uTi%d@$? zPN&zIGuh>FIXqdh%QfSaAyynQlCN(OqtCE7vPC{u8*7Rx5Gd}*bvf(Xn;Y7j8Tzt% zdowpp6&Q39bZ(VWGIUo5w-c`PbtBCLsg|i^`HPhc7FI5DXQ^4)lhhn~6o<#Fs$QpO zvcs9}@Z_e@QVebr+}5OCZmg#Ca)R#a<&HxzaTb;|)%S7reSEyn#MjYErwC4IQdoFN zQ^JCvXNLt1CTFQYUeT6Cgi)g+4=brIZ;o4;?HjDnPtdPPb;3?fsiTRX)d@bBc+SF< z)<=c9d7uLJG!~on$EEFN4;V_X-;Zo z26Xni_3k#&YItJnCiHx%%Mx?Omj2!g>s%(^`jV+D)>JQZt`4mTRXf7Vm%J5R60Qo? zjH z%U9LBRyHR;l3P%fA1sUn?px>ZD2~Tv#G^J|;%4$^HFJyY4VHc@T5Mjb+QCm4!}-`J zks@&;N(&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<|QQ9j@GR%tifJ_OVsT(GwhgN(BL6SqAfo21<6Lz z8K0T9g*#7xpYZnnz%RJMn;XYD4B;gD(St6$kN5Bfnz0)@@I3rBQwpemn;Dc`E+=7Q z+ssn0SnZhOcQyO@J+mBa?j!R_E#jG6C$Ps)nZu7Jqm5|s*9pGV|AbfX*2}b;+6nC` zO;)37i<-f#n0Y~$DjgbOx9*v0N}_!ywZh304&gAK#YX+2ewrp&9?Le6sIrO-Ppv~* z>y`-{%Jh^AuB99Y2~}fKveJzYaRi5O&_+K88oO^eX?v-sd^z}!rJmH~;O&H0c#end sL+|RHuVEHbxPYVh0PVcsvlzg~Hq%Qh6(06^o}jZM##;85&!Zau0-rivWdHyG diff --git a/osinaweb/osinacore/delete/__pycache__/urls.cpython-310.pyc b/osinaweb/osinacore/delete/__pycache__/urls.cpython-310.pyc index 60400e7512763a90807889d8a21577f4b2c59816..99ef03d1c1bd3cb3dd583c12a6c00d683cb8d5ee 100644 GIT binary patch delta 296 zcmeC<{LP`A&&$ij00ddL%+tOwGcY^`agYHYkmCTv#cL*N&y+}IOc76I&f-mxNMY+` zPUni^OOXs_(3F~ZPKHw|xwN<>KR2~#;y(jUsie~4%)Hd%;>k{o8f+rPC5dTildBn( zI3x;+^0QKtOD1n%RO69?a`N&^QYXJ<)L<1VNi5EutjeTdC{~i0oSj;tZ}5_77Q3-W=ACeLA#pIpi$#H9{0114n3Dg-wCA(J8_|72$7 h1$@E~1L7ejOrFDhO->5vKORONMm|KR2}~H$NpYXEGzB0ZbyPv^X;_wYV4}Va2E+C=bz5T#}fU1`*9* zR1#K(h!zy(XQd{WK*T38s)<9*hl=Orm!v}EjxcHn$U^j#Bo=2w1V1t=2(P9%g#G#E6f7+Ezg;=)1*uO>tYT5w@u(AkLh4>-B& zzoCBt1GAekY%colpv`^nbC=h5*VpuW#vWLfF5#oi_O4!{Q#(sOr^V9=NI-jLL-H+< zL3xnwNz+EFpb1COIvBz+vA>SrWVGb01s8L)MK|7^=2^Zco=FO`ZtY=V9VL?=w>1zgvPyh$IcX5 zK;*2^F(l4Sv;^hcLThL`x6v(VJE!OrI?f$*23_Y2-Gjb!7gkQaGXJ1ol>U2YCKs@X z*ju=mi&Io!PLoHg@~ diff --git a/osinaweb/osinacore/delete/urls.py b/osinaweb/osinacore/delete/urls.py index a3cb02ca..5f9f0e47 100644 --- a/osinaweb/osinacore/delete/urls.py +++ b/osinaweb/osinacore/delete/urls.py @@ -5,14 +5,15 @@ from . import views urlpatterns = [ - path('deletecustomermodal/', views.delete_customer_modal, name='deletecustomermodal'), - path('deletebusinessmodal/', views.delete_business_modal, name='deletebusinessmodal'), - path('deletestaffmodal/', views.delete_staff_modal, name='deletestaffmodal'), - path('deleteprojectmodal/', views.delete_project_modal, name='deleteprojectmodal'), - path('deleteprojectnotemodal//', views.delete_project_note_modal, name='deleteprojectnotemodal'), - path('deletetaskmodal/', views.delete_task_modal, name='deletetaskmodal'), - path('deletepointmodal///', views.delete_point_modal, name='deletepointmodal'), - path('deletetaskpointmodal///', views.delete_task_point_modal, name='deletetaskpointmodal'), - path('deletenotemodal/', views.delete_note_modal, name='deletenotemodal') + path('customer/', views.delete_customer_modal, name='deletecustomermodal'), + path('business/', views.delete_business_modal, name='deletebusinessmodal'), + path('staff/', views.delete_staff_modal, name='deletestaffmodal'), + path('project/', views.delete_project_modal, name='deleteprojectmodal'), + path('projectnote//', views.delete_project_note_modal, name='deleteprojectnotemodal'), + path('task/', views.delete_task_modal, name='deletetaskmodal'), + path('ticket/', views.delete_ticket_modal, name='deleteticketmodal'), + path('point///', views.delete_point_modal, name='deletepointmodal'), + path('taskpoint///', views.delete_task_point_modal, name='deletetaskpointmodal'), + path('note/', views.delete_note_modal, name='deletenotemodal') ] \ No newline at end of file diff --git a/osinaweb/osinacore/delete/views.py b/osinaweb/osinacore/delete/views.py index 78549fd9..debf383c 100644 --- a/osinaweb/osinacore/delete/views.py +++ b/osinaweb/osinacore/delete/views.py @@ -4,7 +4,7 @@ from django.contrib.auth.decorators import login_required from django.urls import reverse from django.http import HttpResponseRedirect from osinacore.decorators import * - +from customercore.models import * @staff_login_required def delete_customer_modal(request, customer_id): @@ -94,6 +94,20 @@ def delete_task_modal(request, task_id): return render(request, "delete_templates/delete-task-modal.html", context) +@staff_login_required +def delete_ticket_modal(request, ticket_id): + ticket = get_object_or_404(Ticket, id=ticket_id) + + if request.method == 'POST': + ticket.delete() + return redirect('tickets') + + context = { + 'ticket': ticket, + } + return render(request, "delete_templates/delete-ticket-modal.html", context) + + @staff_login_required def delete_point_modal(request, point_id, task_id): diff --git a/osinaweb/osinacore/templates/delete_templates/delete-ticket-modal.html b/osinaweb/osinacore/templates/delete_templates/delete-ticket-modal.html new file mode 100644 index 00000000..08cc9203 --- /dev/null +++ b/osinaweb/osinacore/templates/delete_templates/delete-ticket-modal.html @@ -0,0 +1,30 @@ +{%load static%} + + + + + + + + + + + + + + +
+ {% csrf_token %} + +
+

Are you sure you want to delete this ticket?

+ +
+ +
+
+
+ + + \ No newline at end of file diff --git a/osinaweb/osinacore/templates/listing_pages/business-types.html b/osinaweb/osinacore/templates/listing_pages/business-types.html index bf6a5d2e..28804f0d 100644 --- a/osinaweb/osinacore/templates/listing_pages/business-types.html +++ b/osinaweb/osinacore/templates/listing_pages/business-types.html @@ -55,12 +55,14 @@
-
- -
+ + +
-
- +
+ + +
diff --git a/osinaweb/osinacore/templates/listing_pages/businesses.html b/osinaweb/osinacore/templates/listing_pages/businesses.html index 9c1d5fcc..e355f55d 100644 --- a/osinaweb/osinacore/templates/listing_pages/businesses.html +++ b/osinaweb/osinacore/templates/listing_pages/businesses.html @@ -82,18 +82,25 @@
-
- +
+ + + +
-
- +
+ + +
-
- + + +
diff --git a/osinaweb/osinacore/templates/listing_pages/customers.html b/osinaweb/osinacore/templates/listing_pages/customers.html index d3f3a388..c48c58c2 100644 --- a/osinaweb/osinacore/templates/listing_pages/customers.html +++ b/osinaweb/osinacore/templates/listing_pages/customers.html @@ -86,20 +86,27 @@
-
- +
+ + + +
-
- +
+ + +
-
- + + +
diff --git a/osinaweb/osinacore/templates/listing_pages/daily-reports.html b/osinaweb/osinacore/templates/listing_pages/daily-reports.html index f85c2ac4..888ef0b9 100644 --- a/osinaweb/osinacore/templates/listing_pages/daily-reports.html +++ b/osinaweb/osinacore/templates/listing_pages/daily-reports.html @@ -43,11 +43,17 @@
diff --git a/osinaweb/osinacore/templates/listing_pages/departments.html b/osinaweb/osinacore/templates/listing_pages/departments.html index fda1ac24..8966d84d 100644 --- a/osinaweb/osinacore/templates/listing_pages/departments.html +++ b/osinaweb/osinacore/templates/listing_pages/departments.html @@ -55,12 +55,16 @@
-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/osinacore/templates/listing_pages/notes.html b/osinaweb/osinacore/templates/listing_pages/notes.html index ada10650..d97ce6db 100644 --- a/osinaweb/osinacore/templates/listing_pages/notes.html +++ b/osinaweb/osinacore/templates/listing_pages/notes.html @@ -22,9 +22,11 @@ style="background-color: {{note.color}}">

{{ note.date|date:"F j, Y" }}

-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/osinacore/templates/listing_pages/references.html b/osinaweb/osinacore/templates/listing_pages/references.html index e1acd6aa..eeef4343 100644 --- a/osinaweb/osinacore/templates/listing_pages/references.html +++ b/osinaweb/osinacore/templates/listing_pages/references.html @@ -63,12 +63,16 @@
-
- +
+ + +
- + + +
diff --git a/osinaweb/osinacore/templates/listing_pages/staff-positions.html b/osinaweb/osinacore/templates/listing_pages/staff-positions.html index 37cd6bf3..18e78a9e 100644 --- a/osinaweb/osinacore/templates/listing_pages/staff-positions.html +++ b/osinaweb/osinacore/templates/listing_pages/staff-positions.html @@ -62,12 +62,16 @@
-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/osinacore/templates/listing_pages/staffs.html b/osinaweb/osinacore/templates/listing_pages/staffs.html index ef8ffa7a..6ed2882f 100644 --- a/osinaweb/osinacore/templates/listing_pages/staffs.html +++ b/osinaweb/osinacore/templates/listing_pages/staffs.html @@ -71,18 +71,25 @@
-
- +
+ + + +
-
- +
+ + +
-
- + + +
diff --git a/osinaweb/osinacore/templates/listing_pages/tags.html b/osinaweb/osinacore/templates/listing_pages/tags.html index a355ac2c..f419587d 100644 --- a/osinaweb/osinacore/templates/listing_pages/tags.html +++ b/osinaweb/osinacore/templates/listing_pages/tags.html @@ -55,12 +55,16 @@
-
- +
+ + +
-
- +
+ + +
diff --git a/osinaweb/osinacore/templates/listing_pages/tickets.html b/osinaweb/osinacore/templates/listing_pages/tickets.html index c34b4e79..01540122 100644 --- a/osinaweb/osinacore/templates/listing_pages/tickets.html +++ b/osinaweb/osinacore/templates/listing_pages/tickets.html @@ -95,18 +95,47 @@
+ + + + -
- -
+ + + +
-
- -
+ + +
-
- +
+ + +
@@ -206,6 +235,19 @@
+ + + + + diff --git a/osinaweb/osinacore/templates/main.html b/osinaweb/osinacore/templates/main.html index d79f2280..2a1b72db 100644 --- a/osinaweb/osinacore/templates/main.html +++ b/osinaweb/osinacore/templates/main.html @@ -759,7 +759,10 @@
@@ -855,7 +858,9 @@
@@ -925,7 +930,9 @@
@@ -938,7 +945,9 @@
@@ -999,6 +1008,7 @@
+
diff --git a/osinaweb/static/js/pop-modals.js b/osinaweb/static/js/pop-modals.js index 5846e548..476a7ad7 100644 --- a/osinaweb/static/js/pop-modals.js +++ b/osinaweb/static/js/pop-modals.js @@ -77,6 +77,7 @@ document.addEventListener("DOMContentLoaded", function () { addButtonClickListener("deleteNoteButton", "400px", "140px"); addButtonClickListener("deleteProjectNoteButton", "400px", "140px"); addButtonClickListener("deletePointButton", "400px", "140px"); + addButtonClickListener("deleteTicketButton", "400px", "140px");