diff --git a/templates/account/signup-wizard.html b/templates/account/signup-wizard.html index 206bc605..1ca17e0e 100644 --- a/templates/account/signup-wizard.html +++ b/templates/account/signup-wizard.html @@ -41,7 +41,7 @@
{{form1|crispy}} - {{ _("Read Terms of Service and Privacy Policy")}} + {{ _("Read Terms of Service and Privacy Policy")}}
diff --git a/templates/admin_management/auth_logs.html b/templates/admin_management/auth_logs.html index 239b7f81..cd636844 100644 --- a/templates/admin_management/auth_logs.html +++ b/templates/admin_management/auth_logs.html @@ -1,74 +1,74 @@ - -{% extends "base.html" %} -{% load i18n custom_filters %} -{% block title %}{% trans "Accounts" %}{% endblock title %} -{% block accounts %} - - {% trans "Accounts"|capfirst %} - (current) - -{% endblock %} -{% block content %} -
- -
-

{% trans "Audit Log Dashboard" %}

-
- - -
- {% include 'admin_management/nav.html' %} - -
- - - {% if page_obj %} -
- - - - - - - - - - - - {% for event in page_obj.object_list %} - - - - - - - - - - {% endfor %} - -
{{ _("Timestamp") |capfirst }}{{ _("User") |capfirst }}{{ _("Event Type") }}{{ _("username") |capfirst }}{{ _("IP Address") |capfirst }}
{{event.datetime}}{{ event.user.username|default:"N/A" }}{{ event.get_login_type_display}}{{ event.username}}{{ event.remote_ip}}
-
- - -
-
- {% include 'partials/pagination.html' with q='loginEvents' %} -
-
- - {% else %} -

No authentication audit events found.

- {% endif %} - - - -
-
-
- - - - -{% endblock %} - + +{% extends "base.html" %} +{% load i18n custom_filters %} +{% block title %}{% trans "Accounts" %}{% endblock title %} +{% block accounts %} + + {% trans "Accounts"|capfirst %} + (current) + +{% endblock %} +{% block content %} +
+ +
+

{% trans "Audit Log Dashboard" %}

+
+ + +
+ {% include 'admin_management/nav.html' %} + +
+ + + {% if page_obj %} +
+ + + + + + + + + + + + {% for event in page_obj.object_list %} + + + + + + + + + + {% endfor %} + +
{{ _("Timestamp") |capfirst }}{{ _("User") |capfirst }}{{ _("Event Type") }}{{ _("username") |capfirst }}{{ _("IP Address") |capfirst }}
{{event.datetime}}{{ event.user.username|default:"N/A" }}{{ event.get_login_type_display}}{{ event.username}}{{ event.remote_ip}}
+
+ + +
+
+ {% include 'partials/pagination.html' with q='loginEvents' %} +
+
+ + {% else %} +

No authentication audit events found.

+ {% endif %} + + + +
+
+
+ + + + +{% endblock %} + diff --git a/templates/admin_management/management.html b/templates/admin_management/management.html index 688d9473..92e391ca 100644 --- a/templates/admin_management/management.html +++ b/templates/admin_management/management.html @@ -2,28 +2,28 @@ {% load i18n %} {%block title%} {%trans 'Admin Management' %} {%endblock%} {% block content %} -
-
- -
- - + {% endblock content %} \ No newline at end of file diff --git a/templates/admin_management/model_logs.html b/templates/admin_management/model_logs.html index 01ba623b..26c3b7ff 100644 --- a/templates/admin_management/model_logs.html +++ b/templates/admin_management/model_logs.html @@ -1,133 +1,133 @@ - -{% extends "base.html" %} -{% load i18n custom_filters %} -{% block title %}{% trans "Accounts" %}{% endblock title %} -{% block accounts %} - - {% trans "Accounts"|capfirst %} - (current) - -{% endblock %} -{% block content %} -
- -
-

{% trans "Audit Log Dashboard" %}

-
- - -
- {% include 'admin_management/nav.html' %} - -
- - - {% if page_obj %} -
- - - - - - - - - - {# Dedicated column for field name #} - {# Dedicated column for old value #} - {# Dedicated column for new value #} - - - - {% for event in page_obj.object_list %} - {% if event.field_changes %} - {# Loop through each individual field change for this event #} - {% for change in event.field_changes %} - - {# Display common event details using rowspan for the first change #} - {% if forloop.first %} - - - - - - - {% endif %} - - {# Display the specific field change details in their own columns #} - - - - - {% endfor %} - {% else %} - {# Fallback for events with no specific field changes (e.g., CREATE, DELETE) #} - - - - - - - - {# Span the 'Field', 'Old Value', 'New Value' columns #} - - - {% endif %} - {% endfor %} - -
{% trans "Timestamp" %}{% trans "User" %}{% trans "Action" %}{% trans "Model" %}{% trans "Object ID" %}{% trans "Object Representation" %}{% trans "Field" %}{% trans "Old Value" %}{% trans "New Value" %}
- {{ event.datetime|date:"Y-m-d H:i:s" }} - - {{ event.user.username|default:"Anonymous" }} - - {{ event.event_type_display }} - - {{ event.model_name|title }} - - {{ event.object_id }} - - {{ event.object_repr }} - {{ change.field }} - {% if change.old is not None %} -
{{ change.old }}
- {% else %} - (None) - {% endif %} -
- {% if change.new is not None %} -
{{ change.new }}
- {% else %} - (None) - {% endif %} -
{{ event.datetime|date:"Y-m-d H:i:s" }}{{ event.user.username|default:"Anonymous" }}{{ event.event_type_display }}{{ event.model_name|title }}{{ event.object_id }}{{ event.object_repr }} - {% if event.event_type_display == "Create" %} - {% trans "Object created." %} - {% elif event.event_type_display == "Delete" %} - {% trans "Object deleted." %} - {% else %} - {% trans "No specific field changes recorded." %} - {% endif %} -
- -
- -
-
- {% include 'partials/pagination.html' with q='userActions' %} -
-
- -{% else %} -

{% trans "No model change audit events found." %}

-{% endif %} - - -
-
-
- - - - -{% endblock %} - + +{% extends "base.html" %} +{% load i18n custom_filters %} +{% block title %}{% trans "Accounts" %}{% endblock title %} +{% block accounts %} + + {% trans "Accounts"|capfirst %} + (current) + +{% endblock %} +{% block content %} +
+ +
+

{% trans "Audit Log Dashboard" %}

+
+ + +
+ {% include 'admin_management/nav.html' %} + +
+ + + {% if page_obj %} +
+ + + + + + + + + + {# Dedicated column for field name #} + {# Dedicated column for old value #} + {# Dedicated column for new value #} + + + + {% for event in page_obj.object_list %} + {% if event.field_changes %} + {# Loop through each individual field change for this event #} + {% for change in event.field_changes %} + + {# Display common event details using rowspan for the first change #} + {% if forloop.first %} + + + + + + + {% endif %} + + {# Display the specific field change details in their own columns #} + + + + + {% endfor %} + {% else %} + {# Fallback for events with no specific field changes (e.g., CREATE, DELETE) #} + + + + + + + + {# Span the 'Field', 'Old Value', 'New Value' columns #} + + + {% endif %} + {% endfor %} + +
{% trans "Timestamp" %}{% trans "User" %}{% trans "Action" %}{% trans "Model" %}{% trans "Object ID" %}{% trans "Object Representation" %}{% trans "Field" %}{% trans "Old Value" %}{% trans "New Value" %}
+ {{ event.datetime|date:"Y-m-d H:i:s" }} + + {{ event.user.username|default:"Anonymous" }} + + {{ event.event_type_display }} + + {{ event.model_name|title }} + + {{ event.object_id }} + + {{ event.object_repr }} + {{ change.field }} + {% if change.old is not None %} +
{{ change.old }}
+ {% else %} + (None) + {% endif %} +
+ {% if change.new is not None %} +
{{ change.new }}
+ {% else %} + (None) + {% endif %} +
{{ event.datetime|date:"Y-m-d H:i:s" }}{{ event.user.username|default:"Anonymous" }}{{ event.event_type_display }}{{ event.model_name|title }}{{ event.object_id }}{{ event.object_repr }} + {% if event.event_type_display == "Create" %} + {% trans "Object created." %} + {% elif event.event_type_display == "Delete" %} + {% trans "Object deleted." %} + {% else %} + {% trans "No specific field changes recorded." %} + {% endif %} +
+ +
+ +
+
+ {% include 'partials/pagination.html' with q='userActions' %} +
+
+ + {% else %} +

{% trans "No model change audit events found." %}

+ {% endif %} + + +
+
+
+ + + + +{% endblock %} + diff --git a/templates/admin_management/nav.html b/templates/admin_management/nav.html index ac379dea..98f0b892 100644 --- a/templates/admin_management/nav.html +++ b/templates/admin_management/nav.html @@ -1,19 +1,19 @@ -{% load i18n %} - +{% load i18n %} + diff --git a/templates/admin_management/request_logs.html b/templates/admin_management/request_logs.html index b6ce7cea..84d04f6f 100644 --- a/templates/admin_management/request_logs.html +++ b/templates/admin_management/request_logs.html @@ -1,69 +1,69 @@ - -{% extends "base.html" %} -{% load i18n custom_filters %} -{% block title %}{% trans "Accounts" %}{% endblock title %} -{% block accounts %} - - {% trans "Accounts"|capfirst %} - (current) - -{% endblock %} -{% block content %} -
- -
-

{% trans "Audit Log Dashboard" %}

-
- - -
- {% include 'admin_management/nav.html' %} - -
- - {% if page_obj %} -
- - - - - - - - - - - - {% for event in page_obj.object_list %} - - - - - - - - - - {% endfor %} - -
{{ _("Timestamp") |capfirst }}{{ _("User") |capfirst }}{{ _("URL") }}{{ _("Method") |capfirst }}{{ _("IP Address") |capfirst }}
{{event.datetime}}{{ event.user.username|default:"Anonymous" }}{{ event.url }}{{ event.method}}{{ event.remote_ip}}
-
- -
-
- {% include 'partials/pagination.html' with q='userRequests' %} -
-
- {% else %} -

No request audit events found.

- {% endif %} - -
-
-
- - - - -{% endblock %} - + +{% extends "base.html" %} +{% load i18n custom_filters %} +{% block title %}{% trans "Accounts" %}{% endblock title %} +{% block accounts %} + + {% trans "Accounts"|capfirst %} + (current) + +{% endblock %} +{% block content %} +
+ +
+

{% trans "Audit Log Dashboard" %}

+
+ + +
+ {% include 'admin_management/nav.html' %} + +
+ + {% if page_obj %} +
+ + + + + + + + + + + + {% for event in page_obj.object_list %} + + + + + + + + + + {% endfor %} + +
{{ _("Timestamp") |capfirst }}{{ _("User") |capfirst }}{{ _("URL") }}{{ _("Method") |capfirst }}{{ _("IP Address") |capfirst }}
{{event.datetime}}{{ event.user.username|default:"Anonymous" }}{{ event.url }}{{ event.method}}{{ event.remote_ip}}
+
+ +
+
+ {% include 'partials/pagination.html' with q='userRequests' %} +
+
+ {% else %} +

No request audit events found.

+ {% endif %} + +
+
+
+ + + + +{% endblock %} + diff --git a/templates/admin_management/user_management.html b/templates/admin_management/user_management.html index a6f62f7d..c2f47da7 100644 --- a/templates/admin_management/user_management.html +++ b/templates/admin_management/user_management.html @@ -65,13 +65,13 @@
-
+
{% if is_paginated %} - {% include 'partials/pagination.html' %} + {% include 'partials/pagination.html' %} {% endif %} +
-
@@ -129,13 +129,13 @@
-
+
{% if is_paginated %} - {% include 'partials/pagination.html' %} + {% include 'partials/pagination.html' %} {% endif %} +
-
@@ -193,13 +193,13 @@
-
+
{% if is_paginated %} - {% include 'partials/pagination.html' %} + {% include 'partials/pagination.html' %} {% endif %} +
-
@@ -257,13 +257,13 @@
-
+
{% if is_paginated %} - {% include 'partials/pagination.html' %} + {% include 'partials/pagination.html' %} {% endif %} +
-
diff --git a/templates/base.html b/templates/base.html index 053f18b6..d931f418 100644 --- a/templates/base.html +++ b/templates/base.html @@ -40,7 +40,7 @@ - + {% if LANGUAGE_CODE == 'ar' %} @@ -100,9 +100,9 @@ - + - + diff --git a/templates/bill/bill_detail.html b/templates/bill/bill_detail.html index dbd9cd7d..2d913320 100644 --- a/templates/bill/bill_detail.html +++ b/templates/bill/bill_detail.html @@ -7,236 +7,236 @@ {% block title %}Bill Details - {{ block.super }}{% endblock %} {% block customCSS %} - + {% endblock %} {% block content %} -
-
+
+
-
-
-
- {% include 'bill/includes/card_bill.html' with bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %} -
- {% include 'bill/includes/card_vendor.html' with vendor=bill.vendor %} -
- - {% trans 'Bill List' %} - +
+
+
+ {% include 'bill/includes/card_bill.html' with bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %} +
+ {% include 'bill/includes/card_vendor.html' with vendor=bill.vendor %} +
-
-
- {% if bill.is_configured %} -
-
-
-
-
-
- {% trans 'Cash Account' %}: - - {{ bill.cash_account.code }} - -
-

- {% currency_symbol %}{{ bill.get_amount_cash | absolute | currency_format }} -

+
+ {% if bill.is_configured %} +
+
+
+
+
+
+ {% trans 'Cash Account' %}: + + {{ bill.cash_account.code }} + +
+

+ {% currency_symbol %}{{ bill.get_amount_cash | absolute | currency_format }} +

+
+
+ {% if bill.accrue %} +
+
+
+ {% trans 'Prepaid Account' %}: + + {{ bill.prepaid_account.code }} + +
+

+ {% currency_symbol %}{{ bill.get_amount_prepaid | currency_format }} +

+
+
+
+
+
+ {% trans 'Accounts Payable' %}: + + {{ bill.unearned_account.code }} + +
+

+ {% currency_symbol %}{{ bill.get_amount_unearned | currency_format }} +

+
+
+
+
+
+ {% trans 'Accrued' %} {{ bill.get_progress | percentage }} +
+

+ {% currency_symbol %}{{ bill.get_amount_earned | currency_format }} +

+
+
+ {% else %} +
+
+
+ {% trans 'You Still Owe' %} +
+

+ {% currency_symbol %}{{ bill.get_amount_open | currency_format }} +

+
+
+ {% endif %}
- {% if bill.accrue %} -
-
-
- {% trans 'Prepaid Account' %}: - - {{ bill.prepaid_account.code }} - -
-

- {% currency_symbol %}{{ bill.get_amount_prepaid | currency_format }} -

-
-
-
-
-
- {% trans 'Accounts Payable' %}: - - {{ bill.unearned_account.code }} - -
-

- {% currency_symbol %}{{ bill.get_amount_unearned | currency_format }} -

-
-
-
-
-
- {% trans 'Accrued' %} {{ bill.get_progress | percentage }} -
-

- {% currency_symbol %}{{ bill.get_amount_earned | currency_format }} -

-
-
- {% else %} -
-
-
- {% trans 'You Still Owe' %} -
-

- {% currency_symbol %}{{ bill.get_amount_open | currency_format }} -

-
-
- {% endif %}
-
-
- {% endif %} + {% endif %} -
-
-
- -
{% trans 'Bill Items' %}
+
+
+
+ +
{% trans 'Bill Items' %}
+
+
+
+
+ + + + + + + + + + + + + {% for bill_item in itemtxs_qs %} + + + + + + + + + {% endfor %} + + + + + + + + + +
{% trans 'Item' %}{% trans 'Entity Unit' %}{% trans 'Unit Cost' %}{% trans 'Quantity' %}{% trans 'Total' %}{% trans 'PO' %}
+
+
+
{{ bill_item.item_model }}
+
+
+
+ + {% if bill_item.entity_unit %} + {{ bill_item.entity_unit }} + {% endif %} + + + + {% currency_symbol %}{{ bill_item.unit_cost | currency_format }} + + + {{ bill_item.quantity }} + + + {% currency_symbol %}{{ bill_item.total_amount | currency_format }} + + + {% if bill_item.po_model_id %} + + {% trans 'View PO' %} + + {% endif %} +
{% trans 'Total' %} + + {% currency_symbol %}{{ total_amount__sum | currency_format }} + +
+
-
-
- - - - - - - - - - - - - {% for bill_item in itemtxs_qs %} - - - - - - - - - {% endfor %} - - - - - - - - - -
{% trans 'Item' %}{% trans 'Entity Unit' %}{% trans 'Unit Cost' %}{% trans 'Quantity' %}{% trans 'Total' %}{% trans 'PO' %}
-
-
-
{{ bill_item.item_model }}
-
-
-
- - {% if bill_item.entity_unit %} - {{ bill_item.entity_unit }} - {% endif %} - - - - {% currency_symbol %}{{ bill_item.unit_cost | currency_format }} - - - {{ bill_item.quantity }} - - - {% currency_symbol %}{{ bill_item.total_amount | currency_format }} - - - {% if bill_item.po_model_id %} - - {% trans 'View PO' %} - - {% endif %} -
{% trans 'Total' %} - - {% currency_symbol %}{{ total_amount__sum | currency_format }} - -
-
-
-
-
-
-
- -
{% trans 'Bill Transactions' %}
+
+
+
+ +
{% trans 'Bill Transactions' %}
+
+
+
+ {% transactions_table bill %}
-
- {% transactions_table bill %} -
-
-
-
-
- -
{% trans 'Bill Notes' %}
+
+
+
+ +
{% trans 'Bill Notes' %}
+
+
+
+ {% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
-
-
- {% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
-
-{% include "bill/includes/mark_as.html" %} + {% include "bill/includes/mark_as.html" %} {% endblock %} \ No newline at end of file diff --git a/templates/bill/bill_update.html b/templates/bill/bill_update.html index 6ec96e58..36b0d754 100644 --- a/templates/bill/bill_update.html +++ b/templates/bill/bill_update.html @@ -6,52 +6,52 @@ {% load widget_tweaks crispy_forms_filters %} {% block content %} -
-
+
+
-
- {% include 'bill/includes/card_vendor.html' with vendor=bill_model.vendor %} -
+
+ {% include 'bill/includes/card_vendor.html' with vendor=bill_model.vendor %} +
-
-
-
- {% include 'bill/includes/card_bill.html' with bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %} +
+
+
+ {% include 'bill/includes/card_bill.html' with bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %} -
- {% csrf_token %} + + {% csrf_token %} -
- {{ form|crispy }} -
+
+ {{ form|crispy }} +
- + - - {% trans 'Back to Bill Detail' %} - + + {% trans 'Back to Bill Detail' %} + - - {% trans 'Bill List' %} - + + {% trans 'Bill List' %} + -
+ +
-
-
- {% bill_item_formset_table itemtxs_formset %} +
+ {% bill_item_formset_table itemtxs_formset %} +
+ +
- -
-
{% include "bill/includes/mark_as.html" %} {% endblock %} \ No newline at end of file diff --git a/templates/bill/includes/card_bill.html b/templates/bill/includes/card_bill.html index 4c408885..8695cbf3 100644 --- a/templates/bill/includes/card_bill.html +++ b/templates/bill/includes/card_bill.html @@ -201,9 +201,9 @@ -
-
- - - - - - - - - - - {% for opportunity in lead.get_opportunities %} +
+
+
{{ _("Car") }}{{ _("Probability")}}{{ _("Priority")}}
+ + + + + + + + + + {% for opportunity in lead.get_opportunities %} - {% endfor %} - -
{{ _("Car") }}{{ _("Probability")}}{{ _("Priority")}}
{{opportunity.car}} {{opportunity.probability}} {{opportunity.priority|capfirst}} View
+ {% endfor %} + +
@@ -580,109 +580,91 @@ let form = document.querySelector('.add_note_form') form.action = "{% url 'add_note' 'lead' lead.slug %}" } - let Toast = Swal.mixin({ + let Toast = Swal.mixin({ + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } + }); + + // Display Django messages + {% if messages %} + {% for message in messages %} + Toast.fire({ + icon: "{{ message.tags }}", + titleText: "{{ message|safe }}" + }); + {% endfor %} + {% endif %} + + function openActionModal(leadId, currentAction, nextAction, nextActionDate) { + const modal = new bootstrap.Modal(document.getElementById('actionTrackingModal')); + document.getElementById('leadId').value = leadId; + document.getElementById('currentAction').value = currentAction; + document.getElementById('nextAction').value = nextAction; + document.getElementById('nextActionDate').value = nextActionDate; + modal.show(); + } + + document.getElementById('actionTrackingForm').addEventListener('submit', function(e) { + e.preventDefault(); + const formData = new FormData(this); + + // Show loading indicator + Swal.fire({ toast: true, + icon: 'info', + text: 'Please wait...', + allowOutsideClick: false, position: "top-end", showConfirmButton: false, - timer: 3000, - timerProgressBar: true, + timer: 2000, + timerProgressBar: false, didOpen: (toast) => { toast.onmouseenter = Swal.stopTimer; toast.onmouseleave = Swal.resumeTimer; } }); - // Display Django messages - {% if messages %} - {% for message in messages %} - Toast.fire({ - icon: "{{ message.tags }}", - titleText: "{{ message|safe }}" - }); - {% endfor %} - {% endif %} - - function openActionModal(leadId, currentAction, nextAction, nextActionDate) { - const modal = new bootstrap.Modal(document.getElementById('actionTrackingModal')); - document.getElementById('leadId').value = leadId; - document.getElementById('currentAction').value = currentAction; - document.getElementById('nextAction').value = nextAction; - document.getElementById('nextActionDate').value = nextActionDate; - modal.show(); - } - - document.getElementById('actionTrackingForm').addEventListener('submit', function(e) { - e.preventDefault(); - const formData = new FormData(this); - - // Show loading indicator - Swal.fire({ - toast: true, - icon: 'info', - text: 'Please wait...', - allowOutsideClick: false, - position: "top-end", - showConfirmButton: false, - timer: 2000, - timerProgressBar: false, - didOpen: (toast) => { - toast.onmouseenter = Swal.stopTimer; - toast.onmouseleave = Swal.resumeTimer; - } - }); - - fetch("{% url 'update_lead_actions' %}", { - method: 'POST', - body: formData, - headers: { - 'X-CSRFToken': '{{ csrf_token }}' - } - }) - .then(response => response.json()) - .then(data => { - Swal.close(); - if (data.success) { + fetch("{% url 'update_lead_actions' %}", { + method: 'POST', + body: formData, + headers: { + 'X-CSRFToken': '{{ csrf_token }}' + } + }) + .then(response => response.json()) + .then(data => { + Swal.close(); + if (data.success) { // Success notification - Swal.fire({ - toast: true, - icon: 'success', - position: "top-end", - text: data.message || 'Actions updated successfully', - 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 { + Swal.fire({ + toast: true, + icon: 'success', + position: "top-end", + text: data.message || 'Actions updated successfully', + 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', - position: "top-end", - text: data.message || 'Failed to update actions', - showConfirmButton: false, - timer: 2000, - timerProgressBar: false, - didOpen: (toast) => { - toast.onmouseenter = Swal.stopTimer; - toast.onmouseleave = Swal.resumeTimer; - } - }); - } - }) - .catch(error => { - Swal.close(); - console.error('Error:', error); Swal.fire({ toast: true, icon: 'error', position: "top-end", - text: 'An unexpected error occurred', + text: data.message || 'Failed to update actions', showConfirmButton: false, timer: 2000, timerProgressBar: false, @@ -691,16 +673,34 @@ toast.onmouseleave = Swal.resumeTimer; } }); + } + }) + .catch(error => { + Swal.close(); + console.error('Error:', error); + Swal.fire({ + toast: true, + icon: 'error', + position: "top-end", + text: 'An unexpected error occurred', + showConfirmButton: false, + timer: 2000, + timerProgressBar: false, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } }); - }); + }); + }); // Helper function for notifications - function notify(tag, msg) { - Toast.fire({ - icon: tag, - titleText: msg - }); - } + function notify(tag, msg) { + Toast.fire({ + icon: tag, + titleText: msg + }); + } {% endblock customJS %} diff --git a/templates/crm/leads/lead_form.html b/templates/crm/leads/lead_form.html index 91b2ac8a..cd888aa2 100644 --- a/templates/crm/leads/lead_form.html +++ b/templates/crm/leads/lead_form.html @@ -3,9 +3,9 @@ {% block title %} {# Check if an 'object' exists in the context #} {% if object %} - {% trans 'Update Lead'%} + {% trans 'Update Lead'%} {% else %} - {% trans 'Add New Lead'%} + {% trans 'Add New Lead'%} {% endif %} {% endblock %} {% block customcss %} diff --git a/templates/crm/leads/lead_list.html b/templates/crm/leads/lead_list.html index 5f87ca8d..17f10ab7 100644 --- a/templates/crm/leads/lead_list.html +++ b/templates/crm/leads/lead_list.html @@ -6,7 +6,7 @@

{{ _("Leads")|capfirst }}

- {% include "crm/leads/partials/update_action.html" %} + {% include "crm/leads/partials/update_action.html" %}
@@ -102,79 +102,79 @@
- - -
-
{{lead.full_name|capfirst}} -
-

- {% if lead.status == "new" %} - {{_("New")}} - {% elif lead.status == "pending" %} - {{_("Pending")}} - {% elif lead.status == "in_progress" %} - {{_("In Progress")}} - {% elif lead.status == "qualified" %} - {{_("Qualified")}} - {% elif lead.status == "contacted" %} - {{_("Contacted")}} - {% elif lead.status == "canceled" %} - {{_("Canceled")}} - {% endif %} -
-
-
- - - {{ lead.id_car_make.get_local_name }} - {{ lead.id_car_model.get_local_name }} {{ lead.year }} - {{ lead.email }} - {{ lead.phone_number }} - - {% if request.user.staffmember.staff %} -
-
-

- -

-
-
-
- - {% for schedule in lead.get_latest_schedules %} - - - - {% endfor %} - - -
- {% if schedule.scheduled_type == "call" %} - - - {{ schedule.scheduled_at|naturaltime|capfirst }} - {% elif schedule.scheduled_type == "meeting" %} - - - {{ schedule.scheduled_at|naturaltime|capfirst }} - {% elif schedule.scheduled_type == "email" %} - - - {{ schedule.scheduled_at|naturaltime|capfirst }} - {% endif %} - - -
View All ...
+ + +
+
{{lead.full_name|capfirst}} +
+

+ {% if lead.status == "new" %} + {{_("New")}} + {% elif lead.status == "pending" %} + {{_("Pending")}} + {% elif lead.status == "in_progress" %} + {{_("In Progress")}} + {% elif lead.status == "qualified" %} + {{_("Qualified")}} + {% elif lead.status == "contacted" %} + {{_("Contacted")}} + {% elif lead.status == "canceled" %} + {{_("Canceled")}} + {% endif %}
-
-
- {% endif %} - - {{ lead.get_status|upper }} - {{ lead.staff|upper }} + + + {{ lead.id_car_make.get_local_name }} - {{ lead.id_car_model.get_local_name }} {{ lead.year }} + {{ lead.email }} + {{ lead.phone_number }} + + {% if request.user.staffmember.staff %} +
+
+

+ +

+
+
+
+ + {% for schedule in lead.get_latest_schedules %} + + + + {% endfor %} + + +
+ {% if schedule.scheduled_type == "call" %} + + + {{ schedule.scheduled_at|naturaltime|capfirst }} + {% elif schedule.scheduled_type == "meeting" %} + + + {{ schedule.scheduled_at|naturaltime|capfirst }} + {% elif schedule.scheduled_type == "email" %} + + + {{ schedule.scheduled_at|naturaltime|capfirst }} + {% endif %} + + +
View All ...
+
+
+
+
+
+ {% endif %} + + {{ lead.get_status|upper }} + {{ lead.staff|upper }} {% comment %} {% if lead.opportunity.stage == "prospect" %} {{ lead.opportunity.stage|upper }} @@ -188,47 +188,47 @@ {{ lead.opportunity.stage|upper }} {% endif %} {% endcomment %} - - {% if lead.opportunity %} - - Opportunity {{ lead.opportunity.lead}} - - {% endif %} - - - {% if user == lead.staff.user or request.is_dealer %} -
- - -
- {% endif %} - - + + {% if lead.opportunity %} + + Opportunity {{ lead.opportunity.lead}} + + {% endif %} + + + {% if user == lead.staff.user or request.is_dealer %} +
+ + +
+ {% endif %} + + {% endfor %} {% endif %} @@ -237,13 +237,13 @@
-
- {% if is_paginated %} - {% include 'partials/pagination.html' %} - {% endif %} -
+
+ {% if is_paginated %} + {% include 'partials/pagination.html' %} + {% endif %}
+
{% endblock %} diff --git a/templates/crm/leads/lead_tracking.html b/templates/crm/leads/lead_tracking.html index b052b0ef..cfef8140 100644 --- a/templates/crm/leads/lead_tracking.html +++ b/templates/crm/leads/lead_tracking.html @@ -10,19 +10,19 @@ min-height: 500px; } .kanban-header { - position: relative; - font-weight: 600; - padding: 0.5rem 1rem; - margin-bottom: 1rem; - color: #333; - --pointed-edge: {% if LANGUAGE_CODE == 'en' %} right {% else %} left {% endif %}; - clip-path: {% if LANGUAGE_CODE == 'en' %} - polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%) - {% else %} - polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%) - {% endif %}; - box-shadow: 0 1px 2px rgba(0,0,0,0.1); -} + position: relative; + font-weight: 600; + padding: 0.5rem 1rem; + margin-bottom: 1rem; + color: #333; + --pointed-edge: {% if LANGUAGE_CODE == 'en' %} right {% else %} left {% endif %}; + clip-path: {% if LANGUAGE_CODE == 'en' %} + polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%) + {% else %} + polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%) + {% endif %}; + box-shadow: 0 1px 2px rgba(0,0,0,0.1); + } .kanban-header::after { @@ -65,95 +65,95 @@ {% endblock customCSS %} {% block content %}
-
-
-
-

{{ _("Lead Tracking")}}

-
- -
- -
-
-
{{ _("New Leads")}} ({{new|length}})
- {% for lead in new %} - -
- {{lead.full_name|capfirst}}
- {{lead.email}}
- {{lead.phone_number}} -
-
- {% endfor %} +
+
+
+

{{ _("Lead Tracking")}}

-
+ +
+ +
+
+
{{ _("New Leads")}} ({{new|length}})
+ {% for lead in new %} + +
+ {{lead.full_name|capfirst}}
+ {{lead.email}}
+ {{lead.phone_number}} +
+
+ {% endfor %} +
+
-
-
-
{{ _("Follow Ups")}} ({{follow_up|length}})
- {% for lead in follow_up %} - -
- {{lead.full_name|capfirst}}
- {{lead.email}}
- {{lead.phone_number}} -
-
- {% endfor %} -
-
+
+
+
{{ _("Follow Ups")}} ({{follow_up|length}})
+ {% for lead in follow_up %} + +
+ {{lead.full_name|capfirst}}
+ {{lead.email}}
+ {{lead.phone_number}} +
+
+ {% endfor %} +
+
-
-
-
{{ _("Negotiation Ups")}} ({{follow_up|length}})
- {% for lead in negotiation %} - -
- {{lead.full_name|capfirst}}
- {{lead.email}}
- {{lead.phone_number}} -
-
- {% endfor %} -
-
+
+
+
{{ _("Negotiation Ups")}} ({{follow_up|length}})
+ {% for lead in negotiation %} + +
+ {{lead.full_name|capfirst}}
+ {{lead.email}}
+ {{lead.phone_number}} +
+
+ {% endfor %} +
+
-
-
-
{{ _("Won") }} ({{won|length}}) ({{follow_up|length}})
- {% for lead in won %} - -
- {{lead.full_name|capfirst}}
- {{lead.email}}
- {{lead.phone_number}} -
-
- {% endfor %} -
-
+
+
+
{{ _("Won") }} ({{won|length}}) ({{follow_up|length}})
+ {% for lead in won %} + +
+ {{lead.full_name|capfirst}}
+ {{lead.email}}
+ {{lead.phone_number}} +
+
+ {% endfor %} +
+
-
-
-
{{ _("Lost") }} ({{lose|length}})
- {% for lead in lose %} - -
- {{lead.full_name|capfirst}}
- {{lead.email}}
- {{lead.phone_number}} -
-
- {% endfor %} +
+
+
{{ _("Lost") }} ({{lose|length}})
+ {% for lead in lose %} + +
+ {{lead.full_name|capfirst}}
+ {{lead.email}}
+ {{lead.phone_number}} +
+
+ {% endfor %} +
+
+
-
-
-
{% endblock %} \ No newline at end of file diff --git a/templates/crm/leads/partials/update_action.html b/templates/crm/leads/partials/update_action.html index 2d70ce9f..9fc0bd3c 100644 --- a/templates/crm/leads/partials/update_action.html +++ b/templates/crm/leads/partials/update_action.html @@ -1,53 +1,53 @@
{% if opportunity.customer %} -
{{ opportunity.customer|capfirst}}
-
Individual
+
{{ opportunity.customer|capfirst}}
+
Individual
{% else %} -
{{ opportunity.organization|capfirst}}
-
Organization
+
{{ opportunity.organization|capfirst}}
+
Organization
{% endif %} -
-
STAGE : {{ opportunity.get_stage_display }}{{ opportunity.get_status_display }}
-
-
-
-
-
-

{{ opportunity.get_status_display }}

-
{{ opportunity.created|naturaltime|capfirst}}
+
STAGE : {{ opportunity.get_stage_display }}{{ opportunity.get_status_display }}
+
+
+
+
+
+

{{ opportunity.get_status_display }}

+
{{ opportunity.created|naturaltime|capfirst}}
-
-
-

{{ _("Upcoming Events")}}

-
-
-
    - {% for event in opportunity.get_schedules %} -
  • -
    - {{ event.scheduled_type|capfirst }} - {{ event.purpose }} -
    -
    {{ event.scheduled_at|naturaltime|capfirst }}
    -
  • - {% empty %} -
  • {{ _("No upcoming events") }}
  • - {% endfor %} -
+
+
+
+

{{ _("Upcoming Events")}}

+
+
+
    + {% for event in opportunity.get_schedules %} +
  • +
    + {{ event.scheduled_type|capfirst }} + {{ event.purpose }} +
    +
    {{ event.scheduled_at|naturaltime|capfirst }}
    +
  • + {% empty %} +
  • {{ _("No upcoming events") }}
  • + {% endfor %} +
+
+
+
+
+
+
+

{{ _("Related Records")}}

+
+
+
+
+
{{ _("Estimate") }}
+
+ {% if opportunity.estimate %} + {{ _("View Quotation")}} + {% else %} +

{{ _("No Estimate") }}

+ {% endif %} +
+
+
+
{{ _("Invoice") }}
+
+ {% if opportunity.estimate.invoice %} + {{ _("View Invoice")}} + {% else %} +

{{ _("No Invoice") }}

+ {% endif %}
-
-
-

{{ _("Related Records")}}

-
-
-
-
-
{{ _("Estimate") }}
-
+
+
+
+

{{ _("System Information")}}

+
+
+
+
+
{{ _("Created ") }}
+
+ {{ opportunity.created|naturalday|capfirst }} +
+
+
+
{{ _("Last Updated") }}
+
+
+ {{ opportunity.updated }} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+

{{ _("Quotation Amount") }}

+

{% if opportunity.estimate %} - {{ _("View Quotation")}} - {% else %} -

{{ _("No Estimate") }}

+ {{ opportunity.estimate.get_invoiced_amount.invoice_amount_paid__sum }} {% endif %} -

-
-
-
{{ _("Invoice") }}
-
- {% if opportunity.estimate.invoice %} - {{ _("View Invoice")}} - {% else %} -

{{ _("No Invoice") }}

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

{{ _("System Information")}}

-
-
-
-
-
{{ _("Created ") }}
-
- {{ opportunity.created|naturalday|capfirst }} -
-
-
-
{{ _("Last Updated") }}
-
-
- {{ opportunity.updated }} +
+
+
+
+

{{ _("Amount") }}

+

{{opportunity.amount}}

+
+
+
+
+
+
+
+

{{ _("Expected Revenue") }}

+

{{opportunity.expected_revenue}}

-
-
-
-
-
-
-
-
-

{{ _("Quotation Amount") }}

-

- {% if opportunity.estimate %} - {{ opportunity.estimate.get_invoiced_amount.invoice_amount_paid__sum }} - {% endif %} -

+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+

Probability (%)

- - -
-
-
-
-

{{ _("Amount") }}

-

{{opportunity.amount}}

+
: +

{{ opportunity.probability }} (%)

+
+
+
+

{{ _("Estimated Revenue") }}

- - -
-
-
-
-

{{ _("Expected Revenue") }}

-

{{opportunity.expected_revenue}}

+
: +

{{ opportunity.expected_revenue }}

+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+

{{ _("Phone Number") }}

- - - +
:{{ opportunity.customer.phone_number }}
+
+
+

{{ _("Email") }}

+
+
:{{ opportunity.customer.email}}
+
+
+ + + + + + + + + + + + + + + + +
+
+
+

{{ _("Contact Name")}}

+
+
: + {% if opportunity.customer %} +
{{ opportunity.customer.full_name}}
+ {% else %} +
{{ opportunity.organization}}
+ {% endif %} +
+
+
+

{{ _("Assigned To") }}

+
+
: + {% if request.user.email == opportunity.staff.email %} +
You
+ {% else %} +
{{ opportunity.staff.get_local_name}}
+ {% endif %} +
+
+
+ + + + + + + + + + + + + + + + +
+
+
+

{{ _("Create Date")}}

+
+
: +
{{ opportunity.created|naturaltime|capfirst}}
+
+
+
+

{{ _("Expected Closing Date")}}

+
+
: +
{{ opportunity.expected_close_date|date}}
+
-
-
-
- - - - - - - - - - - - - - - - -
-
-
-

Probability (%)

-
-
: -

{{ opportunity.probability }} (%)

-
-
-
-

{{ _("Estimated Revenue") }}

-
-
: -

{{ opportunity.expected_revenue }}

-
-
-
- - - - - - - - - - - - - - - - -
-
-
-

{{ _("Phone Number") }}

-
-
:{{ opportunity.customer.phone_number }}
-
-
-

{{ _("Email") }}

-
-
:{{ opportunity.customer.email}}
-
-
- - - - - - - - - - - - - - - - -
-
-
-

{{ _("Contact Name")}}

-
-
: - {% if opportunity.customer %} -
{{ opportunity.customer.full_name}}
- {% else %} -
{{ opportunity.organization}}
- {% endif %} -
-
-
-

{{ _("Assigned To") }}

-
-
: - {% if request.user.email == opportunity.staff.email %} -
You
- {% else %} -
{{ opportunity.staff.get_local_name}}
- {% endif %} -
-
-
- - - - - - - - - - - - - - - - -
-
-
-

{{ _("Create Date")}}

-
-
: -
{{ opportunity.created|naturaltime|capfirst}}
-
-
-
-

{{ _("Expected Closing Date")}}

-
-
: -
{{ opportunity.expected_close_date|date}}
-
-
-
-
-
+ -
-
-

Activity

-
-
-