This commit is contained in:
ismail 2025-09-07 17:14:03 +03:00
parent d3a36aab7b
commit 53ea729530
6 changed files with 283 additions and 116 deletions

View File

@ -6778,8 +6778,10 @@ def delete_note(request, dealer_slug, pk):
"""
try:
note = get_object_or_404(models.Notes, pk=pk, created_by=request.user)
print(note)
if isinstance(note.content_object, models.Lead):
if isinstance(note.content_object, models.Customer):
url = "customer_detail"
slug = note.content_object.slug
elif isinstance(note.content_object, models.Lead):
url = "lead_detail"
slug = note.content_object.slug
if hasattr(note.content_object, "opportunity"):

View File

@ -1,162 +1,374 @@
aiofiles==24.1.0
aiohappyeyeballs==2.6.1
aiohttp==3.11.14
aiohttp-retry==2.9.1
aiosignal==1.3.2
alabaster==1.0.0
albucore==0.0.23
albumentations==2.0.5
annotated-types==0.7.0
anyio==4.9.0
arabic-reshaper==3.0.0
arrow==1.3.0
asgiref==3.9.1
astor==0.8.1
astroid==3.3.9
attrs==25.3.0
autobahn==24.4.2
Automat==25.4.16
autopep8==2.3.2
Babel==2.15.0
beautifulsoup4==4.13.4
bidict==0.23.1
binaryornot==0.4.4
bleach==6.2.0
blessed==1.21.0
blinker==1.9.0
Brotli==1.1.0
cattrs==25.1.1
certifi==2025.7.9
cffi==1.17.1
channels==4.2.2
chardet==5.2.0
charset-normalizer==3.4.2
click==8.2.1
colorama==0.4.6
constantly==23.10.4
commonmark==0.9.1
contourpy==1.3.1
cookiecutter==2.6.0
crispy-bootstrap5==2025.6
cryptography==45.0.5
cssbeautifier==1.15.4
daphne==4.2.1
cssselect2==0.8.0
cycler==0.12.1
Cython==3.0.12
datastar-py==0.6.2
decorator==5.2.1
defusedxml==0.7.1
desert==2020.11.18
diff-match-patch==20241021
dill==0.3.9
distlib==0.3.9
distro==1.9.0
dj-rest-auth==7.0.1
dj-shop-cart==7.1.1
Django==5.2.4
django-admin-sortable2==1.0.4
django-allauth==65.10.0
django-angular==2.3.1
django-appconf==1.1.0
django-appointment==3.8.0
django-background-tasks==1.2.8
django-bootstrap5==25.1
django-ckeditor==6.7.3
django-classy-tags==3.0.1
django-cms==3.11.3
django-cors-headers==4.7.0
django-countries==7.6.1
django-crispy-forms==2.4
django-debug-toolbar==5.2.0
django-easy-audit==1.3.7
django-encrypted-model-fields==0.6.5
django-entangled==0.6.2
django-extensions==4.1
django-extra-views==0.14.0
django-filer==3.0.3
django-filter==25.1
django-formtools==2.4
django-fsm==3.0.0
django-fsm-admin==1.2.5
django-haystack==3.3.0
django-imagekit==5.0.0
django-import-export==4.3.8
django-ipware==7.0.1
django-js-asset==3.1.2
django-ledger==0.7.6.1
django-manager-utils==3.1.5
django-model-utils==5.0.0
django-money==3.5.3
django-next-url-mixin==0.4.0
django-nine==0.2.7
django-nonefield==0.4
django-ordered-model==3.7.4
django-oscar==3.2.5
django-pdf-actions==0.1.44
django-phonenumber-field==8.0.0
django-picklefield==3.3
django-plans==2.0.0
django-prometheus==2.4.1
django-polymorphic==3.1.0
django-post-office==3.6.3
django-prometheus==2.3.1
django-q2==1.8.0
django-query-builder==3.2.0
django-rest-auth==0.9.5
django-schema-graph==3.1.0
django-sekizai==3.0.1
django-select2==7.10.0
django-sequences==3.0
django-shop==1.2.4
django-silk==5.3.2
django-sms==0.7.0
django-sslserver==0.22
django-tables2==2.7.5
django-tailwind==4.0.1
django-treebeard==4.7.1
django-view-breadcrumbs==2.5.1
django-viewflow==2.2.12
django-widget-tweaks==1.5.0
djangocms-admin-style==3.3.1
djangocms-cascade==1.3.7
djangocms-text-ckeditor==5.1.7
djangorestframework==3.16.0
djangorestframework_simplejwt==5.5.0
djangoviz==0.1.1
djhtml==3.0.8
djlint==1.36.4
dnspython==2.7.0
docopt==0.6.2
docutils==0.21.2
easy-thumbnails==2.9
ecdsa==0.19.1
EditorConfig==0.17.1
emoji==2.14.1
et_xmlfile==2.0.0
factory-boy==3.2.1
Faker==37.4.0
fastapi==0.115.12
filelock==3.18.0
fire==0.7.0
fleming==0.7.0
fonttools==4.58.5
fpdf==1.7.2
fpdf2==2.8.3
frozenlist==1.5.0
fsspec==2025.3.0
gprof2dot==2024.6.6
graphqlclient==0.2.4
greenlet==3.2.3
gunicorn==23.0.0
h11==0.16.0
h2==4.2.0
hpack==4.1.0
hstspreload==2025.1.1
html5lib==1.1
htmx==0.0.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.28.1
httpx-ws==0.7.2
hyperframe==6.1.0
hyperlink==21.0.0
icalendar==6.3.1
idna==3.10
incremental==24.7.2
iron-core==1.2.1
iron-mq==0.9
ifaddr==0.2.0
imageio==2.37.0
imagesize==1.4.1
imgaug==0.4.0
iso4217==1.12.20240625
isodate==0.7.2
isort==6.0.1
itsdangerous==2.2.0
Jinja2==3.1.6
jiter==0.10.0
joblib==1.4.2
jsbeautifier==1.15.4
json5==0.12.0
jsonfield==3.1.0
jsonpatch==1.33
jsonpointer==3.0.0
jwt==1.4.0
kiwisolver==1.4.8
langchain==0.3.26
langchain-core==0.3.68
langchain-ollama==0.3.4
langchain-text-splitters==0.3.8
langsmith==0.4.4
lazy_loader==0.4
ledger==1.0.1
libretranslatepy==2.1.4
lmdb==1.6.2
lmstudio==1.4.1
luhnchecker==0.0.12
lxml==5.3.1
Markdown==3.8.2
markdown-it-py==3.0.0
markdown2==2.5.3
MarkupSafe==3.0.2
marshmallow==3.26.1
matplotlib==3.10.1
mccabe==0.7.0
mdurl==0.1.2
MouseInfo==0.1.3
mpmath==1.3.0
msgspec==0.19.0
multidict==6.2.0
mypy-extensions==1.0.0
networkx==3.4.2
newrelic==10.7.0
nicegui==2.13.0
nltk==3.9.1
num2words==0.5.14
numpy==2.3.1
nvidia-cublas-cu12==12.4.5.8
nvidia-cuda-cupti-cu12==12.4.127
nvidia-cuda-nvrtc-cu12==12.4.127
nvidia-cuda-runtime-cu12==12.4.127
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.2.1.3
nvidia-curand-cu12==10.3.5.147
nvidia-cusolver-cu12==11.6.1.9
nvidia-cusparse-cu12==12.3.1.170
nvidia-cusparselt-cu12==0.6.2
nvidia-nccl-cu12==2.21.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.4.127
oauthlib==3.2.2
ofxtools==0.9.5
ollama==0.5.1
openai==1.93.3
opencv-contrib-python==4.11.0.86
opencv-python==4.11.0.86
opencv-python-headless==4.11.0.86
openpyxl==3.1.5
opt_einsum==3.4.0
orjson==3.10.18
outcome==1.3.0.post0
packaging==24.2
pandas==2.3.1
pango==0.0.1
passlib==1.7.4
pathspec==0.12.1
pdfkit==1.0.0
phonenumbers==8.13.42
pilkit==3.0
pillow==10.4.0
priority==1.3.0
prometheus_client==0.22.1
pipenv==2024.4.1
platformdirs==4.3.7
prometheus_client==0.21.1
propcache==0.3.0
protobuf==6.30.1
pscript==0.7.7
psycopg-binary==3.2.6
psycopg2-binary==2.9.10
purl==1.6
py-moneyed==3.0
pyasn1==0.6.1
pyasn1_modules==0.4.2
PyAutoGUI==0.9.54
pyclipper==1.3.0.post6
pycodestyle==2.12.1
pycountry==24.6.1
pycparser==2.22
pydantic==2.11.7
pydantic_core==2.33.2
pydotplus==2.0.2
pydyf==0.11.0
PyGetWindow==0.0.9
Pygments==2.19.2
pymongo==4.14.1
pyOpenSSL==25.1.0
PyJWT==2.9.0
pylint==3.3.5
PyMsgBox==1.0.9
pyparsing==3.2.1
pypdf==5.4.0
PyPDF2==3.0.1
pyperclip==1.9.0
pyphen==0.17.2
pypng==0.20220715.0
PyRect==0.2.0
PyScreeze==1.0.1
pyserial==3.5
PySocks==1.7.1
python-bidi==0.6.6
python-dateutil==2.9.0.post0
python-dotenv==1.1.1
python-docx==1.1.2
python-dotenv==1.0.1
python-engineio==4.11.2
python-ipware==3.0.0
python-jose==3.5.0
python-multipart==0.0.20
python-openid==2.2.5
python-slugify==8.0.4
python-socketio==5.12.1
python-stdnum==2.1
python3-saml==1.16.0
python3-xlib==0.15
pytweening==1.2.0
pytz==2025.2
pyvin==0.0.2
PyYAML==6.0.2
pyzbar==0.1.9
qrcode==8.0
RapidFuzz==3.12.2
redis==6.2.0
regex==2024.11.6
reportlab==4.3.1
requests==2.32.4
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==14.0.0
rsa==4.9.1
rubicon-objc==0.5.0
ruff==0.12.2
service-identity==24.2.0
sacremoses==0.1.1
scikit-image==0.25.2
scikit-learn==1.6.1
scipy==1.15.2
selenium==4.29.0
sentencepiece==0.2.0
setuptools==80.9.0
shapely==2.0.7
simple-websocket==1.1.0
simsimd==6.2.1
six==1.17.0
sniffio==1.3.1
snowballstemmer==2.2.0
sorl-thumbnail==12.9.0
sortedcontainers==2.4.0
soupsieve==2.7
SQLAlchemy==2.0.41
sqlparse==0.5.3
stanza==1.10.1
starlette==0.46.1
stringzilla==3.12.3
suds==1.2.0
svglib==1.5.1
swapper==1.3.0
sympy==1.13.1
tablib==3.8.0
tenacity==9.1.2
termcolor==2.5.0
text-unidecode==1.3
threadpoolctl==3.6.0
tifffile==2025.3.13
tinycss2==1.4.0
tinyhtml5==2.0.0
tomli==2.2.1
tomlkit==0.13.2
torch==2.6.0
tqdm==4.67.1
Twisted==25.5.0
txaio==25.6.1
trio==0.29.0
trio-websocket==0.12.2
triton==3.2.0
types-python-dateutil==2.9.0.20250708
typing-inspect==0.9.0
typing-inspection==0.4.1
typing_extensions==4.14.1
tzdata==2025.2
Unidecode==1.3.8
upgrade-requirements==1.7.0
urllib3==2.5.0
uvicorn==0.35.0
uvicorn-worker==0.3.0
uv==0.6.14
uvicorn==0.34.0
uvloop==0.21.0
vbuild==0.8.2
virtualenv==20.30.0
vishap==0.1.5
vpic-api==0.7.4
watchfiles==1.0.4
wcwidth==0.2.13
weasyprint==64.1
webencodings==0.5.1
websocket-client==1.8.0
websockets==15.0.1
Werkzeug==3.1.3
whitenoise==6.9.0
zope.interface==7.2
wikipedia==1.4.0
wsproto==1.2.0
xmlsec==1.3.15
yarl==1.18.3
zopfli==0.2.3.post1
zstandard==0.23.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -265,74 +265,13 @@
</div>
</div>
</div>
<div class="col-sm-auto">
<div class="d-sm-block d-inline-flex d-md-flex flex-xl-column flex-xxl-row align-items-center align-items-xl-start align-items-xxl-center border-start-sm ps-sm-5 border-translucent">
<div class="d-flex bg-success-subtle rounded flex-center me-3 mb-sm-3 mb-md-0 mb-xl-3 mb-xxl-0"
style="width:32px;
height:32px">
<span class="text-success-dark icon-saudi_riyal"
style="width:24px;
height:24px"></span>
</div>
<div>
<p class="fw-bold mb-1">{{ _("Expected Revenue") }}</p>
<h4 class="fw-bolder text-nowrap">{{ opportunity.expected_revenue }}</h4>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="px-xl-4 mb-7">
<div class="row mx-0 mx-sm-3 mx-lg-0 px-lg-0">
<div class="col-sm-12 col-xxl-6 border-bottom border-end-xxl border-translucent py-3">
<table class="w-100 table-stats table-stats">
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td class="py-2">
<div class="d-inline-flex align-items-center">
<div class="d-flex bg-success-subtle rounded-circle flex-center me-3"
style="width:24px;
height:24px">
<span class="text-success-dark"
data-feather="bar-chart-2"
style="width:16px;
height:16px"></span>
</div>
<p class="fw-bold mb-0">{% trans "Probability (%)" %}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0 mb-0 pb-3 pb-sm-0">{{ opportunity.probability }} (%)</p>
</td>
</tr>
<tr>
<td class="py-2">
<div class="d-flex align-items-center">
<div class="d-flex bg-success-subtle rounded flex-center me-3 mb-sm-3 mb-md-0 mb-xl-3 mb-xxl-0"
style="width:32px;
height:32px">
<span class="text-info-dark icon-saudi_riyal"
style="width:24px;
height:24px"></span>
</div>
<p class="fw-bold mb-0">{{ _("Estimated Revenue") }}</p>
</div>
</td>
<td class="py-2 d-none d-sm-block pe-sm-2">:</td>
<td class="py-2">
<p class="ps-6 ps-sm-0 fw-semibold mb-0">
<span class="icon-saudi_riyal"></span>{{ opportunity.expected_revenue }}
</p>
</td>
</tr>
</table>
</div>
<div class="col-sm-12 col-xxl-6 border-bottom border-translucent py-3">
<table class="w-100 table-stats">
<tr>

View File

@ -60,17 +60,6 @@
<span>{{ _("Phone Number") }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent"
scope="col"
data-sort="contact"
style="width:15%">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-info-subtle rounded me-2">
<span class="text-info-dark" data-feather="user"></span>
</div>
<span>{{ _("National ID") |capfirst }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent"
scope="col"
data-sort="company"
@ -124,9 +113,6 @@
<td class="phone align-middle white-space-nowrap fw-semibold ps-4 border-end border-translucent">
<a class="text-body-highlight" href="tel:{{ customer.phone }}">{{ customer.phone_number }}</a>
</td>
<td class="contact align-middle white-space-nowrap ps-4 border-end border-translucent fw-semibold text-body-highlight">
{{ customer.national_id }}
</td>
<td class="company align-middle white-space-nowrap text-body-tertiary text-opacity-85 ps-4 border-end border-translucent fw-semibold text-body-highlight">
{{ customer.address }}
</td>

View File

@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load humanize %}
{% load i18n static crispy_forms_filters custom_filters %}
{% block title %}
{{ _("View Customer") }}
@ -109,23 +110,50 @@
{% endif %}
</div>
<div class="table-responsive">
<table class="table table-hover table-striped mb-0">
<thead class="bg-body-tertiary">
<table class="table fs-9 mb-0">
<thead>
<tr>
<th scope="col" style="width: 60%;">{% trans 'Note' %}</th>
<th scope="col" style="width: 15%;">{% trans 'Date' %}</th>
<th class="align-middle pe-6 text-uppercase text-start"
scope="col"
style="width:40%">{{ _("Note") }}</th>
<th class="align-middle text-start text-uppercase white-space-nowrap"
scope="col"
style="width:40%">{{ _("Created On") }}</th>
<th class="align-middle text-start text-uppercase white-space-nowrap"
scope="col"
style="width:40%">{{ _("Last Updated") }}</th>
<th class="align-middle pe-0 text-end" scope="col" style="width:10%;"></th>
</tr>
</thead>
<tbody>
<tbody id="notesTable">
{% for note in notes %}
<tr class="align-middle">
<td class="text-body-secondary">{{ note.note|default_if_none:""|linebreaksbr }}</td>
<td class="text-body-secondary text-nowrap">{{ note.created|date:"d M Y" }}</td>
</tr>
{% empty %}
<tr>
<td colspan="4" class="text-center text-body-secondary">
<i class="fas fa-info-circle me-2"></i>{% trans 'No notes found for this customer.' %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle text-start fw-bold text-body-tertiary ps-1">{{ note.note }}</td>
<td class="align-middle text-body-tertiary text-start white-space-nowrap">{{ note.created|naturalday|capfirst }}</td>
<td class="align-middle text-body-tertiary text-start white-space-nowrap">{{ note.updated|naturalday|capfirst }}</td>
<td class="align-middle text-end white-space-nowrap pe-0 action py-2">
{% if note.created_by == request.user %}
<a id="updateBtn"
href="#"
onclick="updateNote(this)"
class="btn btn-sm btn-phoenix-primary me-2"
data-pk="{{ note.pk }}"
data-note="{{ note.note|escapejs }}"
data-url="{% url 'update_note' request.dealer.slug note.pk %}"
data-bs-toggle="modal"
data-bs-target="#noteModal"
data-note-title="{{ _("Update") }}">
<i class='fas fa-pen-square text-primary ms-2'></i>
{{ _("Update") }}
</a>
<button class="btn btn-phoenix-danger btn-sm delete-btn"
data-url="{% url 'delete_note_to_lead' request.dealer.slug note.pk %}"
data-message="Are you sure you want to delete this note?"
data-bs-toggle="modal"
data-bs-target="#deleteModal">
<i class="fas fa-trash"></i>
</button>
{% endif %}
</td>
</tr>
{% endfor %}