Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add autofocus on file or folder edit (for HumHub 1.17) #228

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
- Fix #216: Fix image space rending on wall entry
- Enh #224: Unifying positions of button on modals for consistency and better UX
- Enh #227: Use PHP CS Fixer
- Fix: Add autofocus on file or folder edit (for HumHub 1.17 - see https://github.com/humhub/humhub/issues/7136)

0.16.6 - March 14, 2024
-------------------------
Expand Down
32 changes: 16 additions & 16 deletions views/edit/modal_edit_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
?>

<?php ModalDialog::begin([
'header' => Yii::t('CfilesModule.base', '<strong>Edit</strong> file'),
'header' => Yii::t('CfilesModule.base', '<strong>Edit</strong> file'),
'animation' => 'fadeIn',
'size' => 'small']) ?>

<?php $form = ActiveForm::begin(); ?>
<?php $form = ActiveForm::begin() ?>

<div class="modal-body">
<?= $form->field($file->baseFile, 'file_name'); ?>
<?= $form->field($file, 'description')->widget(RichTextField::class); ?>
<?= $form->field($file, 'topics')->widget(TopicPicker::class, ['contentContainer' => $file->content->container])->label(false); ?>
<?= $form->field($file, 'visibility')->widget(ContentVisibilitySelect::class, ['readonly' => $file->parentFolder->content->isPrivate()]); ?>
<?= $form->field($file, 'hidden')->widget(ContentHiddenCheckbox::class, []); ?>
<?= $form->field($file, 'download_count')->staticControl(['style' => 'display:inline']); ?>
</div>
<div class="modal-body">
<?= $form->field($file->baseFile, 'file_name')->textInput(['autofocus' => '']) ?>
<?= $form->field($file, 'description')->widget(RichTextField::class) ?>
<?= $form->field($file, 'topics')->widget(TopicPicker::class, ['contentContainer' => $file->content->container])->label(false) ?>
<?= $form->field($file, 'visibility')->widget(ContentVisibilitySelect::class, ['readonly' => $file->parentFolder->content->isPrivate()]) ?>
<?= $form->field($file, 'hidden')->widget(ContentHiddenCheckbox::class, []) ?>
<?= $form->field($file, 'download_count')->staticControl(['style' => 'display:inline']) ?>
</div>

<div class="modal-footer">
<?= ModalButton::cancel() ?>
<?= ModalButton::submitModal($submitUrl) ?>
</div>
<?php ActiveForm::end() ?>
<div class="modal-footer">
<?= ModalButton::cancel() ?>
<?= ModalButton::submitModal($submitUrl) ?>
</div>
<?php ActiveForm::end() ?>

<?php ModalDialog::end() ?>
<?php ModalDialog::end() ?>
36 changes: 18 additions & 18 deletions views/edit/modal_edit_folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
/* @var $folder \humhub\modules\cfiles\models\Folder */
/* @var $submitUrl string */

$header = ($folder->isNewRecord)
? Yii::t('CfilesModule.base', '<strong>Create</strong> folder')
: Yii::t('CfilesModule.base', '<strong>Edit</strong> folder');
$header = ($folder->isNewRecord)
? Yii::t('CfilesModule.base', '<strong>Create</strong> folder')
: Yii::t('CfilesModule.base', '<strong>Edit</strong> folder');

?>

<?php ModalDialog::begin([
'header' => $header,
'header' => $header,
'animation' => 'fadeIn',
'size' => 'small']) ?>

<?php $form = ActiveForm::begin(); ?>
<div class="modal-body">
<br />
<?= $form->field($folder, 'title'); ?>
<?= $form->field($folder, 'description'); ?>
<?= $form->field($folder, 'visibility')->widget(ContentVisibilitySelect::class, ['readonly' => !$folder->isRoot() && $folder->parentFolder->content->isPrivate()]) ?>
<?= $form->field($folder, 'hidden')->widget(ContentHiddenCheckbox::class) ?>
</div>

<div class="modal-footer">
<?= ModalButton::cancel() ?>
<?= ModalButton::submitModal($submitUrl)?>
</div>
<?php ActiveForm::end() ?>
<?php $form = ActiveForm::begin() ?>
<div class="modal-body">
<br/>
<?= $form->field($folder, 'title')->textInput(['autofocus' => '']) ?>
<?= $form->field($folder, 'description') ?>
<?= $form->field($folder, 'visibility')->widget(ContentVisibilitySelect::class, ['readonly' => !$folder->isRoot() && $folder->parentFolder->content->isPrivate()]) ?>
<?= $form->field($folder, 'hidden')->widget(ContentHiddenCheckbox::class) ?>
</div>

<div class="modal-footer">
<?= ModalButton::cancel() ?>
<?= ModalButton::submitModal($submitUrl) ?>
</div>
<?php ActiveForm::end() ?>

<?php ModalDialog::end() ?>
Loading