-
= Html::tag('i', '', ['class' => $item['type'] . ' file_icon']) ?>
= Html::a($item['name'], ['home/index', 'directory' => $relativePath], ['class' => 'file_name']) ?>
|
- = Html::button(Html::tag('i', '', ['class' => 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn']) ?>
+ = Html::button(Html::tag('i', '', ['class' => 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '重命名']) ?>
|
-
= Html::tag('i', '', ['class' => $item['type'] . ' file_icon']) ?>
= Html::a($item['name'], ['home/download', 'relativePath' => $relativePath], ['class' => 'file_name']) ?>
@@ -73,9 +70,13 @@ $this->registerCssFile('@web/css/home_style.css');
|
= Html::button(Html::tag('i', '', ['class' => 'fa-regular fa-circle-down']), [
'value' => Url::to(['home/download', 'relativePath' => $relativePath]),
- 'class' => 'btn btn-outline-primary download-btn'
+ 'class' => 'btn btn-outline-primary download-btn',
+ 'data-bs-toggle' => 'tooltip',
+ 'data-bs-placement' => 'top',
+ 'data-bs-title' => '下载'
]) ?>
- = Html::button(Html::tag('i', '', ['class' => 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn']) ?>
+ = Html::button(Html::tag('i', '', ['class' => 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '重命名']) ?>
+ = Html::button(Html::tag('i','',['class' => 'fa-regular fa-trash-can']),['value' => $relativePath,'class' =>'btn btn-outline-danger delete-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '删除'])?>
|
@@ -100,19 +101,20 @@ echo Html::submitButton('提交', ['class' => 'btn btn-primary']);
ActiveForm::end();
Modal::end();
-$this->registerJs(
- "$(document).on('click', '.rename-btn', function() {
- var relativePath = $(this).attr('value');
- var fileName = $(this).closest('tr').find('td:first').text().trim();
- $('#renameRelativePath').val(relativePath);
- $('#renameform-newname').val(fileName);
- $('#renameModal').modal('show');
- })
- .on('click', '.download-btn', function() {
- window.location.href = $(this).attr('value');
- });",
- View::POS_READY,
- 'button-handlers'
-);
+Modal::begin([
+ 'title' => '