all devices
This commit is contained in:
parent
d687c96112
commit
72f242ad88
|
@ -91,7 +91,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link{% if path == 'admin_people_new' %} active2{% endif %}" href="{# url 'idhub:admin_people_new' #}">
|
||||
<a class="nav-link{% if path == 'admin_people_new' %} active2{% endif %}" href="{% url 'dashboard:all_devices' %}">
|
||||
{% trans 'All devices' %}
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -5,5 +5,6 @@ app_name = 'dashboard'
|
|||
|
||||
urlpatterns = [
|
||||
path("", views.UnassignedDevicesView.as_view(), name="unassigned_devices"),
|
||||
path("all/", views.AllDevicesView.as_view(), name="all_devices"),
|
||||
path("<int:pk>/", views.LotDashboardView.as_view(), name="lot"),
|
||||
]
|
||||
|
|
|
@ -22,6 +22,21 @@ class UnassignedDevicesView(InventaryMixin):
|
|||
return context
|
||||
|
||||
|
||||
class AllDevicesView(InventaryMixin):
|
||||
template_name = "unassigned_devices.html"
|
||||
section = "All"
|
||||
title = _("All Devices")
|
||||
breadcrumb = "Devices / All Devices"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
devices = Device.objects.filter(owner=self.request.user)
|
||||
context.update({
|
||||
'devices': devices,
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
class LotDashboardView(InventaryMixin, DetailsMixin):
|
||||
template_name = "unassigned_devices.html"
|
||||
section = "Unassigned"
|
||||
|
|
Loading…
Reference in New Issue