* code for task #45435.

This commit is contained in:
王怡栋
2021-12-09 17:14:36 +08:00
parent e3e5325efb
commit 068eeee4e8
2 changed files with 21 additions and 1 deletions
+16 -1
View File
@@ -43,4 +43,19 @@ function deleteItem(obj)
{
if($('#teamForm .table tbody').children().length < 2) return false;
$(obj).closest('tr').remove();
}
}
$(document).on('change', '[id^="levels"]', function()
{
$next = $(this).closest('td').next()
if($(this).val() == '50')
{
$next.prepend('<input type="text" value="" class="form-control disabled" disabled autocomplete="off" />');
$next.find('[id^="expires"]').addClass('hidden');
}
else
{
$next.find('[id^="expires"]').removeClass('hidden');
$next.find('input.disabled').remove();
}
})
@@ -25,7 +25,12 @@
<td><?php echo html::input("names[$i]", $member->name, "class='form-control' readonly");?></td>
<td><?php echo html::select("levels[$i]", array(''=>'') + $this->lang->gitlab->accessLevels, $member->access_level, "class='form-control chosen'");?></td>
<td>
<?php if($member->access_level == '50'):?>
<input type="text" value="" class="form-control disabled" disabled autocomplete="off" />
<?php echo html::input("expires[$i]", $member->expires_at, "class='form-control form-date hidden'");?>
<?php else:?>
<?php echo html::input("expires[$i]", $member->expires_at, "class='form-control form-date'");?>
<?php endif;?>
<?php echo html::hidden("ids[$i]", $member->id);?>
</td>
<td class='c-actions text-center'>