diff --git a/osinaweb/billing/edit/__pycache__/urls.cpython-310.pyc b/osinaweb/billing/edit/__pycache__/urls.cpython-310.pyc index 7a71c554..1187cf72 100644 Binary files a/osinaweb/billing/edit/__pycache__/urls.cpython-310.pyc and b/osinaweb/billing/edit/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/billing/edit/__pycache__/views.cpython-310.pyc b/osinaweb/billing/edit/__pycache__/views.cpython-310.pyc index f47e0e31..a7117cc9 100644 Binary files a/osinaweb/billing/edit/__pycache__/views.cpython-310.pyc and b/osinaweb/billing/edit/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/billing/edit/urls.py b/osinaweb/billing/edit/urls.py index 1bb8db0c..6d4e2830 100644 --- a/osinaweb/billing/edit/urls.py +++ b/osinaweb/billing/edit/urls.py @@ -5,5 +5,5 @@ from billing.edit import views urlpatterns = [ path('paymentmethod//', views.edit_payment_method, name='editpaymentmethod'), path('payment/', views.edit_payment_modal, name='edit_payment_modal'), - path('update_order_status/', views.update_order_status, name='update_order_status'), + path('order//status/', views.update_order_status, name='update_order_status'), ] diff --git a/osinaweb/billing/edit/views.py b/osinaweb/billing/edit/views.py index 7c6991d7..1feb2168 100644 --- a/osinaweb/billing/edit/views.py +++ b/osinaweb/billing/edit/views.py @@ -2,6 +2,7 @@ from django.shortcuts import render, get_object_or_404 from osinacore.models import * from billing.models import * from osinacore.decorators import * +from django.http import HttpResponse @@ -37,10 +38,18 @@ def edit_payment_modal(request): @staff_login_required -def update_order_status(request): - +def update_order_status(request, order_id): + order = get_object_or_404(Order, id=order_id) + if request.method == 'POST': + status = OrderStatus( + status = request.POST.get('status'), + order = order, + date = request.POST.get('date'), + ) + status.save() + return HttpResponse('') context = { - + 'order': order } return render(request, 'edit_templates/update-order-status-modal.html', context) \ No newline at end of file diff --git a/osinaweb/billing/templates/details_templates/order-details.html b/osinaweb/billing/templates/details_templates/order-details.html index 86175003..ea5710e0 100644 --- a/osinaweb/billing/templates/details_templates/order-details.html +++ b/osinaweb/billing/templates/details_templates/order-details.html @@ -31,6 +31,11 @@
+ + diff --git a/osinaweb/customercore/templates/user_profile_pages/user-settings.html b/osinaweb/customercore/templates/user_profile_pages/user-settings.html index 5bb372f7..e84f809e 100644 --- a/osinaweb/customercore/templates/user_profile_pages/user-settings.html +++ b/osinaweb/customercore/templates/user_profile_pages/user-settings.html @@ -6,7 +6,7 @@
- +
diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 7ec2aab6..d89a70ca 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index d7a36683..62c3c292 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/edit/__pycache__/urls.cpython-310.pyc b/osinaweb/osinacore/edit/__pycache__/urls.cpython-310.pyc index cb26155a..3e2ef7e9 100644 Binary files a/osinaweb/osinacore/edit/__pycache__/urls.cpython-310.pyc and b/osinaweb/osinacore/edit/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc index 87487f1b..439d4f2f 100644 Binary files a/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/edit/urls.py b/osinaweb/osinacore/edit/urls.py index a622f9cf..5ea68a94 100644 --- a/osinaweb/osinacore/edit/urls.py +++ b/osinaweb/osinacore/edit/urls.py @@ -5,7 +5,7 @@ from . import views urlpatterns = [ path('customer//', views.edit_customer, name='editcustomer'), - path('customerstatus', views.edit_customer_status_modal, name='editcustomerstatusmodal'), + path('customer//status/', views.edit_customer_status_modal, name='editcustomerstatusmodal'), path('business//', views.edit_business, name='editbusiness'), path('staff//', views.edit_staff, name='editstaff'), path('project//', views.edit_project, name='editproject'), diff --git a/osinaweb/osinacore/edit/views.py b/osinaweb/osinacore/edit/views.py index 47fee5f8..dd3b4515 100644 --- a/osinaweb/osinacore/edit/views.py +++ b/osinaweb/osinacore/edit/views.py @@ -1,6 +1,5 @@ from osinacore.models import * from django.shortcuts import render, redirect, get_object_or_404 -from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.urls import reverse from django.http import HttpResponse @@ -44,9 +43,15 @@ def edit_customer(request, customer_id): return render(request, 'edit_templates/edit-customer.html', context) @staff_login_required -def edit_customer_status_modal(request): +def edit_customer_status_modal(request, customer_id): + customer = get_object_or_404(CustomerProfile, id=customer_id) + if request.method == 'POST': + customer.status = request.POST.get('status') + customer.save() + return HttpResponse('') context = { + 'customer': customer, } diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index b501de57..32c26478 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -28,7 +28,7 @@
diff --git a/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html b/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html index 53a4265b..eb570a13 100644 --- a/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html +++ b/osinaweb/osinacore/templates/edit_templates/edit-customer-status-modal.html @@ -14,7 +14,7 @@ - + {% csrf_token %}

Update Customer Status

@@ -26,6 +26,7 @@ +
diff --git a/osinaweb/osinacore/templates/listing_pages/customers.html b/osinaweb/osinacore/templates/listing_pages/customers.html index 8f5062de..57113d3b 100644 --- a/osinaweb/osinacore/templates/listing_pages/customers.html +++ b/osinaweb/osinacore/templates/listing_pages/customers.html @@ -69,8 +69,8 @@

{{customer.user.username}}

- +

{{customer.status}}

diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index f05f59f9..4a9d6ce6 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -100,12 +100,14 @@ def signup(request): token = default_token_generator.make_token(user) current_site = get_current_site(request) + uid = urlsafe_base64_encode(force_bytes(user.pk)) #Encode the user id + token = token + activate_link = f"https://{current_site.domain}/activate/{uid}/{token}/" mail_subject = 'Activate your account' message = render_to_string('email_templates/account_activation_email.html', { 'user': user, - 'domain': current_site.domain, - 'uid': urlsafe_base64_encode(force_bytes(user.pk)), #Encode the user id - 'token': token, + 'activate_link': activate_link, + }) send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email], html_message=message) @@ -874,13 +876,14 @@ def forgot_password(request): current_site = get_current_site(request) uid = urlsafe_base64_encode(force_bytes(user.pk)) - reset_link = f"{current_site}/reset-password/{uid}/{token}/" + reset_link = f"https://{current_site.domain}/reset-password/{uid}/{token}/" mail_subject = 'Reset your password' message = render_to_string('email_templates/forgot_password_email.html', { 'user': user, 'reset_link': reset_link, }) + print(reset_link) send_mail(mail_subject, message, settings.EMAIL_HOST_USER, [user.email], html_message=message) return render(request, 'forgot-password-sent.html') else: diff --git a/osinaweb/static/js/pop-modals.js b/osinaweb/static/js/pop-modals.js index c49b68cd..04c348b8 100644 --- a/osinaweb/static/js/pop-modals.js +++ b/osinaweb/static/js/pop-modals.js @@ -78,7 +78,7 @@ function initializeModalButtons() { addButtonClickListener("editPaymentButton", "500px", "400px"); addButtonClickListener("addPaymentMethodButton", "500px", "400px"); - addButtonClickListener("updateOrderStatusButton", "400px", "160px"); + addButtonClickListener("updateOrderStatusButton", "400px", "240px"); addButtonClickListener("editProjectStatusButton", "400px", "220px"); addButtonClickListener("editCustomerStatusButton", "400px", "160px"); addButtonClickListener("addProjectMemberModal", "400px", "280px");