haikal/templates/crm/opportunity_list.html
Marwan Alwali 8b00f9a40f update
2024-12-31 13:56:15 +03:00

50 lines
1.7 KiB
HTML

{% extends 'base.html' %} <!-- Assuming you have a base template -->
{% block content %}
<h1>Opportunities</h1>
<a href="{% url 'create_opportunity' customer_id=1 %}">Create New Opportunity</a>
<table>
<thead>
<tr>
<th>Deal Name</th>
<th>Customer</th>
<th>Car</th>
<th>Deal Value</th>
<th>Deal Status</th>
<th>Priority</th>
<th>Source</th>
<th>Created By</th>
<th>Created At</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for opportunity in opportunities %}
<tr>
<td>{{ opportunity.deal_name }}</td>
<td>{{ opportunity.customer.get_full_name }}</td>
<td>{{ opportunity.car }}</td>
<td>{{ opportunity.deal_value }}</td>
<td>{{ opportunity.get_deal_status_display }}</td>
<td>{{ opportunity.get_priority_display }}</td>
<td>{{ opportunity.get_source_display }}</td>
<td>{{ opportunity.created_by.name }}</td>
<td>{{ opportunity.created_at }}</td>
<td>
<a href="{% url 'opportunity_detail' pk=opportunity.pk %}">View</a>
<a href="{% url 'update_opportunity' pk=opportunity.pk %}">Edit</a>
<form action="{% url 'delete_opportunity' pk=opportunity.pk %}" method="post" style="display:inline;">
{% csrf_token %}
<button type="submit">Delete</button>
</form>
</td>
</tr>
{% empty %}
<tr>
<td colspan="10">No opportunities found.</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}