diff --git a/api.php b/api.php
index 38b31b6..e2f1ec3 100644
--- a/api.php
+++ b/api.php
@@ -57,6 +57,11 @@ switch ($action) {
case 'attachmentGetAll':
$result = attachmentGetAll($_REQUEST['report_id']);
break;
+ case 'attachmentDelete':
+ $suc = attachmentDelete($_REQUEST['attachment_id']);
+ if ($suc === false) $error = 'Attachment delete failed';
+ $result = array('processed' => $suc);
+ break;
}
header('Content-Type: application/json');
@@ -172,6 +177,13 @@ function help()
'params' => [
'report_id' => 'Report id',
]
+ ],
+ 'attachmentGet' => [
+ 'name' => 'attachmentGet',
+ 'description' => 'Get attachment',
+ 'params' => [
+ 'attachment_id' => 'Attachment id',
+ ]
]
]
];
diff --git a/webapp/src/assets/css/style.css b/webapp/src/assets/css/style.css
index 7a21471..fb5b276 100644
--- a/webapp/src/assets/css/style.css
+++ b/webapp/src/assets/css/style.css
@@ -473,6 +473,7 @@ button:focus-visible,
flex-direction: row;
justify-content: space-between;
background-color: var(--color-bg0);
+ align-items: center;
}
#report .attachments .attachment .attachment-header .created,
#report .attachments .attachment .attachment-header .author {
diff --git a/webapp/src/backend.js b/webapp/src/backend.js
index cbe10f3..8e1c53c 100644
--- a/webapp/src/backend.js
+++ b/webapp/src/backend.js
@@ -97,4 +97,8 @@ export const backend = {
return this.callPromise('attachmentGetAll', {report_id: report_id});
},
+ attachmentDelete(attachment_id) {
+ return this.callPromise('attachmentDelete', {attachment_id: attachment_id});
+ },
+
};
diff --git a/webapp/src/views/Report.vue b/webapp/src/views/Report.vue
index b88e8ce..1a20ad3 100644
--- a/webapp/src/views/Report.vue
+++ b/webapp/src/views/Report.vue
@@ -47,12 +47,12 @@
:key="attachment.attachment_id"
>
{{ attachment.attachment_content }}
+
+
![]()
+
+
+ Neznamy typ prilohy: {{ attachment.attachment_type }}
+
@@ -87,6 +102,32 @@
required
>
+