Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit dcb30e3

Browse files
authored
Add files via upload
1 parent f27719e commit dcb30e3

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{% extends 'base.html' %}
2+
{% block content %}
3+
<a href="{% url 'companies:adauga' %}" class="btn btn-success">Adauga locatie</a>
4+
<br>
5+
<table class="table">
6+
<thead>
7+
<tr>
8+
<th>Index</th>
9+
<th>Nume</th>
10+
<th>Website</th>
11+
<th>Tip Companie</th>
12+
<th>Stare</th>
13+
<th>Actions</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
{% for item in companies_list %}
18+
<tr>
19+
<td>{{ forloop.counter0|add:page_obj.start_index }}</td>
20+
<td>{{ item.nume }}</td>
21+
<td>{{ item.website }}</td>
22+
<td>{{ item.tip_companie }}</td>
23+
<td>{% if item.active == 1 %}
24+
<span>Activ</span>
25+
{% else %}
26+
<span>Inactiv</span>
27+
{% endif %}
28+
</td>
29+
<td>
30+
<a href="{% url 'companies:modifica' item.id %}" class="btn btn-success">Modifica</a>
31+
{% if item.active == 1 %}
32+
<a href="{% url 'companies:sterge' item.id %}" class="btn btn-danger">Sterge</a>
33+
{% else %}
34+
<a href="{% url 'companies:activeaza' item.id %}" class="btn btn-info">Activeaza</a>
35+
{% endif %}
36+
</td>
37+
</tr>
38+
{% endfor %}
39+
</tbody>
40+
</table>
41+
<div class="d-flex align-items-center">
42+
{% if is_paginated %}
43+
<ul class="pagination">
44+
{% if page_obj.has_previous %}
45+
<li><a class="btn" href="?page={{ page_obj.previous_page_number }}"><<</a></li>
46+
{% else %}
47+
<li class="disabled btn"><span><<</span></li>
48+
{% endif %}
49+
{% for i in paginator.page_range %}
50+
{% if page_obj.number == i %}
51+
<li class="active btn btn-info"><span>{{ i }}<span class="sr-only">(curent)</span></span></li>
52+
{% else %}
53+
<li><a class="btn" href="?page={{ i }}">{{ i }}</a></li>
54+
{% endif %}
55+
{% endfor %}
56+
{% if page_obj.has_next %}
57+
<li><a class="btn" href="?page={{ page_obj.next_page_number }}">>></a></li>
58+
{% else %}
59+
<li class="disabled btn"><span>>></span></li>
60+
{% endif %}
61+
<span class="align-right">Showing {{ page_obj.start_index }} - {{ page_obj.end_index }} of
62+
{{ page_obj.paginator.count }}
63+
</span>
64+
</ul>
65+
{% endif %}
66+
</div>
67+
{% endblock %}

0 commit comments

Comments
 (0)