From 3bc1eb5f839db03ebb353831146d1b1d9fc35644 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 29 Jan 2025 11:15:46 +0100 Subject: [PATCH] rebuild details template --- device/templates/details.html | 137 +-------------------------- device/templates/tabs/documents.html | 49 ---------- 2 files changed, 4 insertions(+), 182 deletions(-) delete mode 100644 device/templates/tabs/documents.html diff --git a/device/templates/details.html b/device/templates/details.html index 47a65e0..dd64d6f 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -2,108 +2,6 @@ {% load i18n %} {% block content %} - -
- -
- - - -
-
-
{% trans "Latest Notes" %}
- -
-
- {% for note in device_notes|slice:":4" %} -
-
-
- - {{ note.date|timesince }} {% trans "ago" %} - - - {% if user == note.user or user.is_admin %} - {% trans "Editable" %} -
-
- {% else %} -
-
- {% endif %} -

- {{ note.description }} -

-
- {{ note.user.get_full_name|default:note.user.username }} -
-
- - {% if user == note.user or user.is_admin %} -
- - -
- {% csrf_token %} - - - - -
- - - -
-
- {% csrf_token %} -
-
-

{% trans 'Are you sure you want to delete this note?' %}

- - {% trans 'Confirm delete' %} - -
-
-
- {% endif %} - -
-
- {% empty %} -

{% trans "No notes available." %}

- {% endfor %} -
- -
@@ -202,8 +97,6 @@ {% include 'tabs/user_properties.html' %} - {% include 'tabs/documents.html' %} - {% include 'tabs/lots.html' %} {% include 'tabs/components.html' %} @@ -256,27 +149,5 @@ } } }) - - //Enable save button on note if changes are made to it - function toggleSaveLink(blockquoteElem) { - const saveLink = document.getElementById("saveLink" + blockquoteElem.dataset.noteId); - - saveLink.classList.remove("disabled", "text-muted", "border-light"); - saveLink.classList.add("text-success", "border-success"); - saveLink.style.pointerEvents = "auto"; - - } - //updates note-update-form with new value from blockquote - function submitUpdatedNote(noteId) { - const noteParagraph = document.querySelector('p[data-note-id="' + noteId + '"]'); - const newText = noteParagraph.innerText.trim(); - const descriptionField = document.getElementById('descriptionInput' + noteId); - descriptionField.value = newText; - document.getElementById('updateNoteForm' + noteId).submit(); - } - //simpler are u sure? confirmation message - function submitDeleteForm(noteId) { - document.getElementById('confirmDelete' + noteId).closest('form').submit(); - } {% endblock %} diff --git a/device/templates/tabs/documents.html b/device/templates/tabs/documents.html deleted file mode 100644 index 1679b62..0000000 --- a/device/templates/tabs/documents.html +++ /dev/null @@ -1,49 +0,0 @@ - -{% load i18n %} -
- - -
{% trans 'Documents' %} -
- - - - - - - - - - - - {% for a in object.get_user_documents %} - - - - - - - - {% endfor %} - -
- {% trans 'Key' %} - - {% trans 'Value' %} - - {% trans 'Created on' %} - - -
{{ a.key }} - {{ a.value }} - {{ a.created }} - - -
-