WIP: rework/properties #31
|
@ -15,7 +15,7 @@
|
||||||
<a href="#details" class="nav-link active" data-bs-toggle="tab" data-bs-target="#details">{% trans 'General details' %}</a>
|
<a href="#details" class="nav-link active" data-bs-toggle="tab" data-bs-target="#details">{% trans 'General details' %}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#annotations" class="nav-link" data-bs-toggle="tab" data-bs-target="#annotations">{% trans 'User annotations' %}</a>
|
<a href="#annotations" class="nav-link" data-bs-toggle="tab" data-bs-target="#annotations">{% trans 'User properties' %}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#documents" class="nav-link" data-bs-toggle="tab" data-bs-target="#documents">{% trans 'Documents' %}</a>
|
<a href="#documents" class="nav-link" data-bs-toggle="tab" data-bs-target="#documents">{% trans 'Documents' %}</a>
|
||||||
|
@ -102,13 +102,13 @@
|
||||||
|
|
||||||
<div class="tab-pane fade" id="annotations">
|
<div class="tab-pane fade" id="annotations">
|
||||||
<div class="btn-group mt-1 mb-3">
|
<div class="btn-group mt-1 mb-3">
|
||||||
<a href="{% url 'device:add_annotation' object.pk %}" class="btn btn-primary">
|
<a href="{% url 'device:add_user_property' object.pk %}" class="btn btn-primary">
|
||||||
<i class="bi bi-plus"></i>
|
<i class="bi bi-plus"></i>
|
||||||
{% trans 'Add new annotation' %}
|
{% trans 'New user property' %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5 class="card-title">{% trans 'Annotations' %}</h5>
|
<h5 class="card-title">{% trans 'User properties' %}</h5>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -7,7 +7,7 @@ urlpatterns = [
|
||||||
path("add/", views.NewDeviceView.as_view(), name="add"),
|
path("add/", views.NewDeviceView.as_view(), name="add"),
|
||||||
path("edit/<str:pk>/", views.EditDeviceView.as_view(), name="edit"),
|
path("edit/<str:pk>/", views.EditDeviceView.as_view(), name="edit"),
|
||||||
path("<str:pk>/", views.DetailsView.as_view(), name="details"),
|
path("<str:pk>/", views.DetailsView.as_view(), name="details"),
|
||||||
path("<str:pk>/annotation/add", views.AddAnnotationView.as_view(), name="add_annotation"),
|
path("<str:pk>/user_property/add", views.AddUserPropertyView.as_view(), name="add_user_property"),
|
||||||
path("<str:pk>/document/add", views.AddDocumentView.as_view(), name="add_document"),
|
path("<str:pk>/document/add", views.AddDocumentView.as_view(), name="add_document"),
|
||||||
path("<str:pk>/public/", views.PublicDeviceWebView.as_view(), name="device_web"),
|
path("<str:pk>/public/", views.PublicDeviceWebView.as_view(), name="device_web"),
|
||||||
|
|
||||||
|
|
|
@ -167,10 +167,10 @@ class PublicDeviceWebView(TemplateView):
|
||||||
return JsonResponse(device_data)
|
return JsonResponse(device_data)
|
||||||
|
|
||||||
|
|
||||||
class AddAnnotationView(DashboardView, CreateView):
|
class AddUserPropertyView(DashboardView, CreateView):
|
||||||
template_name = "new_annotation.html"
|
template_name = "new_user_property.html"
|
||||||
title = _("New annotation")
|
title = _("New User Property")
|
||||||
breadcrumb = "Device / New annotation"
|
breadcrumb = "Device / New Property"
|
||||||
success_url = reverse_lazy('dashboard:unassigned_devices')
|
success_url = reverse_lazy('dashboard:unassigned_devices')
|
||||||
model = Annotation
|
model = Annotation
|
||||||
fields = ("key", "value")
|
fields = ("key", "value")
|
||||||
|
|
Loading…
Reference in New Issue