haikal/templates/vendors/vendors_list.html
2025-06-25 13:40:13 +03:00

155 lines
9.3 KiB
HTML

{% extends 'base.html' %}
{% load i18n %}
{% load static %}
{% block title %}
{{ _("Vendors") |capfirst }}
{% endblock title %}
{% block vendors %}<a class="nav-link active">{{ _("Vendors") |capfirst }}</a>{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">
{{ _("Vendors") |capfirst }}
</h2>
<a href="{% url 'vendor_create' %}"
class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{{ _("Add Vendor") }}</a>
</div>
{% include "partials/search_box.html" %}
{% if page_obj.object_list %}
<div class="table-responsive px-1 scrollbar mt-3">
<table class= "table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle"
scope="col"
data-sort="name"
style="width:25%">{{ _("Name") |capfirst }}</th>
<th class="sort white-space-nowrap align-middle"
scope="col"
data-sort="email"
style="width:15%">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-success-subtle rounded me-2">
<span class="text-success-dark" data-feather="mail"></span>
</div>
<span>{{ _("email") |capfirst }}</span>
</div>
</th>
<th class="sort white-space-nowrap align-middle"
scope="col"
data-sort="phone"
style="width:15%;
min-width: 180px">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-primary-subtle rounded me-2">
<span class="text-primary-dark" data-feather="phone"></span>
</div>
<span>{{ _("Phone") }}</span>
</div>
</th>
<th class="sort white-space-nowrap align-middle"
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>{{ _("Contact name") |capfirst }}</span>
</div>
</th>
<th class="sort white-space-nowrap align-middle"
scope="col"
data-sort="company"
style="width:15%">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-warning-subtle rounded me-2">
<span class="text-warning-dark" data-feather="grid"></span>
</div>
<span>{{ _("Address") |capfirst }}</span>
</div>
</th>
<th class="sort white-space-nowrap align-middle"
scope="col"
data-sort="date"
style="width:15%">{{ _("Created date") }}</th>
<th class="sort white-space-nowrap align-middle" scope="col"></th>
</tr>
</thead>
<tbody class="list">
{% for vendor in vendors %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap px-1">
<div class="d-flex align-items-center">
{% if vendor.logo %}
<div class="avatar avatar-xl me-3">
<img class="rounded-circle" src="{{ vendor.logo.url }}" alt="" />
{% else %}
<div class="avatar avatar-xl me-3">
<img class="rounded-circle"
src="{% static 'images/icons/picture.svg' %}"
alt="" />
{% endif %}
</div>
<div>
<a class="fs-8 fw-bold" href="{% url 'vendor_detail' vendor.slug %}">{{ vendor.arabic_name }}</a>
<div class="d-flex align-items-center">
<p class="mb-0 text-body-highlight fw-semibold fs-9 me-2">{{ vendor.name }}</p>
<!--<span class="badge badge-phoenix badge-phoenix-primary">{{ vendor.vendor_model.uuid }}</span>-->
</div>
</div>
</div>
</td>
<td class="align-middle product white-space-nowrap">
<a class="text-body-highlight" href="">{{ vendor.email }}</a>
</td>
<td class="align-middle product white-space-nowrap">
<a class="text-body-highlight" href="tel:{{ vendor.phone }}">{{ vendor.phone_number }}</a>
</td>
<td class="align-middle product white-space-nowrap">{{ vendor.contact_person }}</td>
<td class="align-middle product white-space-nowrap">{{ vendor.address }}</td>
<td class="align-middle product white-space-nowrap">{{ vendor.created_at|date }}</td>
<td class="align-middle product white-space-nowrap">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'vendor_update' vendor.slug %}"
class="dropdown-item text-success-dark">{% trans "Edit" %}</a>
<div class="dropdown-divider"></div>
<button class="delete-btn dropdown-item text-danger"
data-url="{% url 'vendor_delete' vendor.slug %}"
data-message="{{ _("Are you sure you want to delete this vendor") }}?"
data-bs-toggle="modal"
data-bs-target="#deleteModal">{{ _("Delete") }}</button>
</div>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
{% endif %}
</div>
{% include 'modal/delete_modal.html' %}
{% endblock %}