Compare commits
No commits in common. "caa2be3a419beb7417d68fede4b2e830c0ef33d9" and "3350966bb3d4b3f0b9ac94f8c035ab612fd7385c" have entirely different histories.
caa2be3a41
...
3350966bb3
|
@ -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="#user_properties" class="nav-link" data-bs-toggle="tab" data-bs-target="#user_properties">{% trans 'User properties' %}</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>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="user_properties">
|
<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_user_property' 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>
|
||||||
|
|
|
@ -8,7 +8,7 @@ from utils.device import create_property, create_doc, create_index
|
||||||
from utils.forms import MultipleFileField
|
from utils.forms import MultipleFileField
|
||||||
from device.models import Device
|
from device.models import Device
|
||||||
from evidence.parse import Build
|
from evidence.parse import Build
|
||||||
from evidence.models import SystemProperty, Property
|
from evidence.models import SystemProperty
|
||||||
from utils.save_snapshots import move_json, save_in_disk
|
from utils.save_snapshots import move_json, save_in_disk
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,9 +68,9 @@ class UserTagForm(forms.Form):
|
||||||
self.pk = None
|
self.pk = None
|
||||||
self.uuid = kwargs.pop('uuid', None)
|
self.uuid = kwargs.pop('uuid', None)
|
||||||
self.user = kwargs.pop('user')
|
self.user = kwargs.pop('user')
|
||||||
instance = SystemProperty.objects.filter(
|
instance = Annotation.objects.filter(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
type=Property.Type.SYSTEM,
|
type=Annotation.Type.SYSTEM,
|
||||||
key='CUSTOM_ID',
|
key='CUSTOM_ID',
|
||||||
owner=self.user.institution
|
owner=self.user.institution
|
||||||
).first()
|
).first()
|
||||||
|
@ -88,7 +88,7 @@ class UserTagForm(forms.Form):
|
||||||
self.tag = data
|
self.tag = data
|
||||||
self.instance = SystemProperty.objects.filter(
|
self.instance = SystemProperty.objects.filter(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
type=Property.Type.SYSTEM,
|
type=Annotation.Type.SYSTEM,
|
||||||
key='CUSTOM_ID',
|
key='CUSTOM_ID',
|
||||||
owner=self.user.institution
|
owner=self.user.institution
|
||||||
).first()
|
).first()
|
||||||
|
@ -186,9 +186,9 @@ class EraseServerForm(forms.Form):
|
||||||
self.pk = None
|
self.pk = None
|
||||||
self.uuid = kwargs.pop('uuid', None)
|
self.uuid = kwargs.pop('uuid', None)
|
||||||
self.user = kwargs.pop('user')
|
self.user = kwargs.pop('user')
|
||||||
instance = SystemProperty.objects.filter(
|
instance = Annotation.objects.filter(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
type=SystemProperty.Type.ERASE_SERVER,
|
type=Annotation.Type.ERASE_SERVER,
|
||||||
key='ERASE_SERVER',
|
key='ERASE_SERVER',
|
||||||
owner=self.user.institution
|
owner=self.user.institution
|
||||||
).first()
|
).first()
|
||||||
|
@ -201,9 +201,9 @@ class EraseServerForm(forms.Form):
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
self.erase_server = self.cleaned_data.get('erase_server', False)
|
self.erase_server = self.cleaned_data.get('erase_server', False)
|
||||||
self.instance = SystemProperty.objects.filter(
|
self.instance = Annotation.objects.filter(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
type=Property.Type.ERASE_SERVER,
|
type=Annotation.Type.ERASE_SERVER,
|
||||||
key='ERASE_SERVER',
|
key='ERASE_SERVER',
|
||||||
owner=self.user.institution
|
owner=self.user.institution
|
||||||
).first()
|
).first()
|
||||||
|
@ -224,7 +224,7 @@ class EraseServerForm(forms.Form):
|
||||||
|
|
||||||
SystemProperty.objects.create(
|
SystemProperty.objects.create(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
type=Property.Type.ERASE_SERVER,
|
type=Annotation.Type.ERASE_SERVER,
|
||||||
key='ERASE_SERVER',
|
key='ERASE_SERVER',
|
||||||
value=self.erase_server,
|
value=self.erase_server,
|
||||||
owner=self.user.institution,
|
owner=self.user.institution,
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for snap in object.properties %}
|
{% for snap in object.annotations %}
|
||||||
<tbody>
|
<tbody>
|
||||||
{% if snap.type == 0 %}
|
{% if snap.type == 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% if form.tag.value %}
|
{% if form.tag.value %}
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<a class="btn btn-yellow" href="{% url 'evidence:delete_user_property' form.pk %}">{% translate "Delete" %}</a>
|
<a class="btn btn-yellow" href="{% url 'evidence:delete_annotation' form.pk %}">{% translate "Delete" %}</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue