diff --git a/inventory/urls.py b/inventory/urls.py index 4d0a7a85..110dc778 100644 --- a/inventory/urls.py +++ b/inventory/urls.py @@ -101,6 +101,7 @@ urlpatterns = [ ), path('update-lead-actions/', views.update_lead_actions, name='update_lead_actions'), path('crm/leads/lead_tracking/', views.lead_tracking, name='lead_tracking'), + path('crm/leads/lead_view/', views.lead_view, name='lead_view'), path("crm/leads/", views.LeadListView.as_view(), name="lead_list"), path( diff --git a/inventory/views.py b/inventory/views.py index a56acefb..16940292 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -4503,6 +4503,8 @@ class UserActivityLogListView(LoginRequiredMixin, ListView): queryset = queryset.filter(user__email=self.request.GET["user"]) return queryset[:100] # will update later with better pagination +def lead_view(request): + return render(request, "crm/leads/lead_view.html") # CRM RELATED VIEWS class LeadListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): @@ -5255,7 +5257,7 @@ class OpportunityDetailView(LoginRequiredMixin, DetailView): context["status_form"] = form context["notes"] = models.Notes.objects.filter( content_type__model="opportunity", object_id=self.object.id - ) + ).order_by("-created") context["activities"] = models.Activity.objects.filter( content_type__model="opportunity", object_id=self.object.id ) diff --git a/templates/crm/leads/lead_list.html b/templates/crm/leads/lead_list.html index 93d880d1..c6429153 100644 --- a/templates/crm/leads/lead_list.html +++ b/templates/crm/leads/lead_list.html @@ -408,11 +408,17 @@ // Show loading indicator Swal.fire({ - title: 'Updating Actions', + toast: true, + icon: 'info', text: 'Please wait...', allowOutsideClick: false, - didOpen: () => { - Swal.showLoading(); + position: "top-end", + showConfirmButton: false, + timer: 2000, + timerProgressBar: false, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; } }); @@ -429,22 +435,34 @@ if (data.success) { // Success notification Swal.fire({ + toast: true, icon: 'success', - title: 'Success!', + position: "top-end", text: data.message || 'Actions updated successfully', - confirmButtonText: 'OK', - timer: 3000, - timerProgressBar: true + showConfirmButton: false, + timer: 2000, + timerProgressBar: false, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } }).then(() => { location.reload(); // Refresh after user clicks OK }); } else { // Error notification Swal.fire({ + toast: true, icon: 'error', - title: 'Error', + position: "top-end", text: data.message || 'Failed to update actions', - confirmButtonText: 'OK' + showConfirmButton: false, + timer: 2000, + timerProgressBar: false, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } }); } }) @@ -452,10 +470,17 @@ Swal.close(); console.error('Error:', error); Swal.fire({ + toast: true, icon: 'error', - title: 'Error', + position: "top-end", text: 'An unexpected error occurred', - confirmButtonText: 'OK' + showConfirmButton: false, + timer: 2000, + timerProgressBar: false, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } }); }); }); diff --git a/templates/crm/leads/lead_view.html b/templates/crm/leads/lead_view.html new file mode 100644 index 00000000..8c4dabbf --- /dev/null +++ b/templates/crm/leads/lead_view.html @@ -0,0 +1,143 @@ +{% extends 'base.html' %} +{% load static i18n %} + +{% block customCSS %} + + {% endblock customCSS %} + + {% block content %} +
+ +
+
مرحبًا ismail mosa
+
+ +
+
+ + +
+ +
+
+
المهام المفتوحة الخاصة بي
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
الموضوعتاريخ الاستحقاقالحالةالأولويةمرتبط بـاسم جهة الاتصال
Register for upcoming CRM Webinars16/02/2025Not StartedLowKing (Sample)Kris Marrier (Sample)
Refer CRM Videos18/02/2025In ProgressNormalMorlong AssociatesMitsue Tollner (Sample)
+
+
+
+ + +
+
+
+ الاجتماعات الخاصة بي + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
العنوانالمرسلإلىاسم جهة الاتصالمرتبط بـ
Demo03:12 16/02/202504:12 16/02/2025Donette Foller (Sample)Printing Dimensions
Webinar03:12 16/02/202504:12 16/02/2025Leota Dilliard (Sample)Commercial Press
+
+
+
+
+ + +
+ +
+
+
العملاء المحتملون لليوم
+
+ No Data +

لم يتم العثور على أي العملاء المحتملون.

+
+
+
+ + +
+
+
تم إقفال صفقات هذا الشهر
+
+ No Data +

لم يتم العثور على أي صفقات.

+
+
+
+
+
+{% endblock content %} \ No newline at end of file diff --git a/templates/crm/opportunities/opportunity_detail.html b/templates/crm/opportunities/opportunity_detail.html index e3690273..e497eb9d 100644 --- a/templates/crm/opportunities/opportunity_detail.html +++ b/templates/crm/opportunities/opportunity_detail.html @@ -299,7 +299,7 @@ - {% for activity in opportunity.lead.get_activities %} + {% for activity in activities %}