-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Folder): Add feature to rename a folder
- Loading branch information
Etienne Gutbub
committed
Jun 12, 2024
1 parent
9c13aa4
commit a3f2c5d
Showing
11 changed files
with
167 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of SyliusMediaManagerPlugin corporate website. | ||
* | ||
* (c) SyliusMediaManagerPlugin <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MonsieurBiz\SyliusMediaManagerPlugin\Exception; | ||
|
||
use Exception; | ||
|
||
final class FolderNotRenamedException extends Exception | ||
{ | ||
private string $folder; | ||
|
||
public function __construct(string $folder) | ||
{ | ||
$this->folder = $folder; | ||
parent::__construct(sprintf('Folder `%s` couldn\'t be renamed', $folder)); | ||
} | ||
|
||
public function getFolder(): string | ||
{ | ||
return $this->folder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Resources/views/Admin/MediaManager/Modal/Content/_renameFolder.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% if path is not empty %} | ||
<div class="ui list"> | ||
<div class="item monsieurbiz-sylius-file-manager__item monsieurbiz-sylius-file-manager__item-rename-folder"> | ||
<i class="edit icon"></i> | ||
<div class="content"> | ||
<div | ||
class="description monsieurbiz-sylius-file-manager__rename-folder-label ui button mini secondary" | ||
style="max-width: 200px;color: white;" | ||
onclick="this.style.display='none';this.parentNode.querySelector('.monsieurbiz-sylius-file-manager__rename-folder').style.display='block';this.parentNode.querySelector('.monsieurbiz-sylius-file-manager__rename-folder input').focus();" | ||
> | ||
{{ 'monsieurbiz_sylius_media_manager.ui.rename_folder' | trans }} | ||
</div> | ||
|
||
{# Form to rename folder #} | ||
<div class="description monsieurbiz-sylius-file-manager__rename-folder ui form mini" style="display: none;"> | ||
<input type="text" name="folder" class="ui field" style="max-width: 200px;height:28px;"/> | ||
<div | ||
class="ui button mini" | ||
onclick="monsieurbizSyliusMediaManagerRenameFolder(this.parentNode.querySelector('input'), '{{ inputName | escape('js') }}', '{{ folder | escape('js')}}', '{{ path | escape('js')}}', '{{ 'monsieurbiz_sylius_media_manager.ui.rename_folder_confirm'| trans({'%path%': path}) | escape('js') }}', '{{ 'monsieurbiz_sylius_media_manager.ui.rename_folder_confirm_bis'| trans() }}')" | ||
> | ||
{{ 'monsieurbiz_sylius_media_manager.ui.rename' | trans }} | ||
</div> | ||
<div | ||
class="ui button mini basic" | ||
onclick="this.parentNode.parentNode.querySelector('.monsieurbiz-sylius-file-manager__rename-folder').style.display='none';this.parentNode.parentNode.querySelector('.monsieurbiz-sylius-file-manager__rename-folder-label').style.display='block';" | ||
> | ||
{{ 'monsieurbiz_sylius_media_manager.ui.cancel' | trans }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} |
1 change: 1 addition & 0 deletions
1
src/Resources/views/Admin/MediaManager/Modal/_content.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{% include '@MonsieurBizSyliusMediaManagerPlugin/Admin/MediaManager/Modal/Content/_newFolder.html.twig' %} | ||
{% include '@MonsieurBizSyliusMediaManagerPlugin/Admin/MediaManager/Modal/Content/_deleteFolder.html.twig' %} | ||
{% include '@MonsieurBizSyliusMediaManagerPlugin/Admin/MediaManager/Modal/Content/_renameFolder.html.twig' %} | ||
{% include '@MonsieurBizSyliusMediaManagerPlugin/Admin/MediaManager/Modal/Content/_files.html.twig' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters