diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json
index dc728ee..b5893c6 100644
--- a/.vscode/ftp-kr.sync.cache.json
+++ b/.vscode/ftp-kr.sync.cache.json
@@ -333,6 +333,12 @@
}
}
},
+ ".gitignore": {
+ "type": "-",
+ "size": 14,
+ "lmtime": 1773532569285,
+ "modified": false
+ },
".htaccess": {
"type": "-",
"size": 1055,
@@ -503,8 +509,8 @@
"cron": {
"main-view.php": {
"type": "-",
- "size": 2995,
- "lmtime": 0,
+ "size": 3332,
+ "lmtime": 1773602150426,
"modified": false
}
},
@@ -643,9 +649,9 @@
"site": {
"layout-cron.php": {
"type": "-",
- "size": 6400,
- "lmtime": 1770653884637,
- "modified": true
+ "size": 3723,
+ "lmtime": 1773602132022,
+ "modified": false
},
"layout-logged.php": {
"type": "-",
@@ -839,12 +845,6 @@
"size": 230708,
"lmtime": 1771920013460,
"modified": false
- },
- ".gitignore": {
- "type": "-",
- "size": 14,
- "lmtime": 1773532569285,
- "modified": false
}
}
},
diff --git a/templates/tasks/task_popup.php b/templates/tasks/task_popup.php
index 5fef117..a153d46 100644
--- a/templates/tasks/task_popup.php
+++ b/templates/tasks/task_popup.php
@@ -26,6 +26,7 @@
$checklist_count = is_array( $this -> task['actions'] ) ? count( $this -> task['actions'] ) : 0;
$comments_count = is_array( $this -> task['comments'] ) ? count( $this -> task['comments'] ) : 0;
$attachments_count = is_array( $this -> task_attachments ) ? count( $this -> task_attachments ) : 0;
+ $image_extensions = [ 'jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'svg' ];
$popup_wiki_data = \factory\Tasks::task_wiki_entries_for_user( (int)$this -> task['id'], (int)$this -> user['id'] );
$task_wiki_entries = isset( $popup_wiki_data['entries'] ) && is_array( $popup_wiki_data['entries'] ) ? $popup_wiki_data['entries'] : [];
$wiki_visible_count = isset( $popup_wiki_data['visible_count'] ) ? (int)$popup_wiki_data['visible_count'] : 0;
@@ -167,11 +168,24 @@
if ( is_array( $this -> task_attachments ) and count( $this -> task_attachments ) ):?>
foreach ( $this -> task_attachments as $attachment ):?>
+ $attachment_ext = strtolower( pathinfo( (string)$attachment['title_effective'], PATHINFO_EXTENSION ) );?>
+ $is_image_attachment = in_array( $attachment_ext, $image_extensions, true );?>
-
-
- = htmlspecialchars( $attachment['title_effective'] );?>
-
+ if ( $is_image_attachment ):?>
+
+ = htmlspecialchars( $attachment['title_effective'] );?>
+
+ else:?>
+
+ = htmlspecialchars( $attachment['title_effective'] );?>
+
+ endif;?>
(= $attachment['size_human'];?>)
+ if ( $is_image_attachment ):?>
+
+
+
+ endif;?>
@@ -494,6 +508,22 @@
cursor: zoom-in;
transition: opacity .2s ease;
}
+ .task_popup .task_details .attachments_list li .attachment-download {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 24px;
+ height: 24px;
+ margin-left: 4px;
+ border-radius: 4px;
+ color: #1f3d72;
+ text-decoration: none;
+ transition: background .2s ease, color .2s ease;
+ }
+ .task_popup .task_details .attachments_list li .attachment-download:hover {
+ background: #eef3fb;
+ color: #16305b;
+ }
.task_popup .task_details .description img:hover {
opacity: .85;
}
@@ -522,6 +552,21 @@
box-shadow: 0 0 40px rgba(0,0,0,.5);
object-fit: contain;
}
+ .task-img-lightbox .lightbox-content {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 10px;
+ max-width: 90vw;
+ max-height: 90vh;
+ }
+ .task-img-lightbox .lightbox-title {
+ color: #fff;
+ font-size: 13px;
+ text-align: center;
+ word-break: break-word;
+ }
.task-img-lightbox .lightbox-close {
position: absolute;
top: 16px;
@@ -908,6 +953,30 @@
});
});
+ popup.on( 'click', '.attachment-preview-link', function( e ) {
+ e.preventDefault();
+ e.stopPropagation();
+ var src = $( this ).attr( 'data-image-src' );
+ if ( !src ) return;
+
+ var $overlay = $( '' +
+ '
×' +
+ '

' +
+ '
' );
+
+ $( 'body' ).append( $overlay );
+
+ $overlay.on( 'click', function() {
+ $overlay.remove();
+ });
+
+ $( document ).one( 'keydown.taskLightbox', function( ev ) {
+ if ( ev.key === 'Escape' ) {
+ $overlay.remove();
+ }
+ });
+ });
+
popup.on( 'click', '.js-save-task-users', function( e ) {
e.preventDefault();
var btn = $( this );