feat: Enhance task popup with user checkbox styling and selection handling

This commit is contained in:
2026-02-17 10:55:57 +01:00
parent 9a33d8d6f4
commit 28fb121c76
2 changed files with 19 additions and 3 deletions

View File

@@ -8,7 +8,10 @@
"Bash(then rm logs.txt)",
"Bash(else echo \"Plik logs.txt nie istnieje\")",
"Bash(fi)",
"Bash(grep:*)"
"Bash(grep:*)",
"WebFetch(domain:storefront.developers.shoper.pl)",
"WebFetch(domain:developers.shoper.pl)",
"WebFetch(domain:pomoc.home.pl)"
]
}
}

View File

@@ -119,7 +119,7 @@
<div class="task-users-checkboxes">
<? if ( is_array( $this -> all_users ) ): foreach ( $this -> all_users as $u ):?>
<label class="task-user-label">
<input type="checkbox" class="task-user-checkbox" value="<?= $u['id'];?>" <? if ( is_array( $this -> task['users'] ) and in_array( $u['id'], $this -> task['users'] ) ):?>checked="checked"<? endif;?>>
<input type="checkbox" class="task-user-checkbox g-checkbox" value="<?= $u['id'];?>" <? if ( is_array( $this -> task['users'] ) and in_array( $u['id'], $this -> task['users'] ) ):?>checked="checked"<? endif;?>>
<?= $u['name'] . ' ' . $u['surname'];?>
</label>
<? endforeach; endif;?>
@@ -421,6 +421,14 @@
} );
}
if ( $.fn.iCheck )
{
popup.find( '.task-user-checkbox' ).iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue'
});
}
var time_worked = popup.find( '.time_worked' );
var time_value = popup.find( '.js-time-worked-value' );
var total_seconds = parseInt( time_worked.attr( 'data-total-seconds' ), 10 ) || 0;
@@ -483,7 +491,7 @@
if ( res.status === 'success' ) {
var names = [];
popup.find( '.task-user-checkbox:checked' ).each( function() {
names.push( $( this ).parent().text().trim() );
names.push( $( this ).closest( '.task-user-label' ).text().trim() );
});
var html = '';
for ( var i = 0; i < names.length; i++ ) {
@@ -491,6 +499,11 @@
html += '<div class="user"><div class="avatar" title="' + names[i] + '">' + initials + '</div>' + names[i] + '</div>';
}
popup.find( '.users.box' ).html( html );
if ( typeof getSelectedTaskFilters === 'function' && typeof reload_tasks === 'function' )
{
var selected_filters = getSelectedTaskFilters();
reload_tasks( selected_filters.projects, selected_filters.users );
}
btn.text( 'Zapisano!' );
} else {
btn.text( 'Błąd' );