This commit is contained in:
2026-03-17 19:14:37 +01:00
parent 39fc58a962
commit 33504f6013
2 changed files with 83 additions and 14 deletions

View File

@@ -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
}
}
},

View File

@@ -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 @@
<ul class="attachments_list">
<? 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 );?>
<li>
<a href="<?= $attachment['url'];?>" target="_blank" rel="noopener noreferrer" class="attachment-link" download="<?= htmlspecialchars( $attachment['title_effective'] );?>">
<?= htmlspecialchars( $attachment['title_effective'] );?>
</a>
<? if ( $is_image_attachment ):?>
<a href="<?= htmlspecialchars( $attachment['url'] );?>" class="attachment-link attachment-preview-link" data-image-src="<?= htmlspecialchars( $attachment['url'] );?>" data-image-title="<?= htmlspecialchars( $attachment['title_effective'] );?>">
<?= htmlspecialchars( $attachment['title_effective'] );?>
</a>
<? else:?>
<a href="<?= htmlspecialchars( $attachment['url'] );?>" target="_blank" rel="noopener noreferrer" class="attachment-link" download="<?= htmlspecialchars( $attachment['title_effective'] );?>">
<?= htmlspecialchars( $attachment['title_effective'] );?>
</a>
<? endif;?>
<small>(<?= $attachment['size_human'];?>)</small>
<? if ( $is_image_attachment ):?>
<a href="<?= htmlspecialchars( $attachment['url'] );?>" target="_blank" rel="noopener noreferrer" class="attachment-download" download="<?= htmlspecialchars( $attachment['title_effective'] );?>" title="Pobierz">
<i class="fa fa-download"></i>
</a>
<? endif;?>
<a href="#" class="attachment-rename" attachment_id="<?= $attachment['id'];?>" title_current="<?= htmlspecialchars( $attachment['title_effective'] );?>"><i class="fa fa-pencil"></i></a>
<a href="#" class="attachment-delete" attachment_id="<?= $attachment['id'];?>"><i class="fa fa-trash"></i></a>
</li>
@@ -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 = $( '<div class="task-img-lightbox">' +
'<span class="lightbox-close">&times;</span>' +
'<img src="' + src + '">' +
'</div>' );
$( '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 );