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

Use icon fa-unlock for public files #183

Merged
merged 1 commit into from
Jun 13, 2023
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
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

0.16.2 - Unreleased
--------------------
- Fix #180: Use icon `fa-unlock` for public files

0.16.1 - May 1, 2023
--------------------
- Fix #177: Hard delete records on disable module
Expand Down
4 changes: 2 additions & 2 deletions models/rows/BaseFileRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function getModel()
*/
public function getVisibilityIcon()
{
return $this->getModel()->content->isPublic() ? 'fa-unlock-alt': 'fa-lock';
return $this->getModel()->content->isPublic() ? 'fa-unlock': 'fa-lock';
}

/**
Expand Down Expand Up @@ -260,4 +260,4 @@ public function canEdit()
// We do not allow base files to be deleted in the cfiles module
return false;
}
}
}
4 changes: 2 additions & 2 deletions models/rows/FileSystemItemRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getDownloadCount()
*/
public function getVisibilityIcon()
{
return $this->item->content->isPublic() ? 'fa-unlock-alt': 'fa-lock';
return $this->item->content->isPublic() ? 'fa-unlock': 'fa-lock';
}

/**
Expand All @@ -219,4 +219,4 @@ public function getVisibilityTitle()
* @return WallStreamModuleEntryWidget
*/
abstract public function getContext(): WallStreamModuleEntryWidget;
}
}
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"organisation",
"sharing"
],
"version": "0.16.1",
"version": "0.16.2",
"humhub": {
"minVersion": "1.14"
},
Expand Down
10 changes: 5 additions & 5 deletions tests/codeception/acceptance/VisibilityCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public function testVisibility(AcceptanceTester $I)
$I->waitForText('visibility2', null, '#fileList');

$I->expect('all subfiles and subfolders to be public too');
$I->seeElement('.folder-visibility .fa-unlock-alt');
$I->seeElement('[data-cfiles-item="folder_4"] .fa-unlock-alt');
$I->seeElement('[data-cfiles-item="file_1"] .fa-unlock-alt');
$I->seeElement('.folder-visibility .fa-unlock');
$I->seeElement('[data-cfiles-item="folder_4"] .fa-unlock');
$I->seeElement('[data-cfiles-item="file_1"] .fa-unlock');

$I->click('visibility2', '#fileList');
$I->waitForText('visibility2', null,'#cfiles-crumb');
$I->seeElement('[data-cfiles-item="file_2"] .fa-unlock-alt');
$I->seeElement('[data-cfiles-item="file_2"] .fa-unlock');

$I->amGoingTo('Reset the file visibility of /visibility/visibility2/test.txt to private');
$I->clickFileContext(2, 'Edit');
Expand All @@ -88,4 +88,4 @@ public function testVisibility(AcceptanceTester $I)
$I->waitForText('visibility2',null,'#cfiles-crumb');
$I->dontSee('test.txt', '#fileList');
}
}
}
4 changes: 2 additions & 2 deletions widgets/views/breadcrumbBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/* @var $folder \humhub\modules\cfiles\models\Folder */

if($folder->content->isPublic()) {
$visibilityIcon = 'fa-unlock-alt';
$visibilityIcon = 'fa-unlock';
$visibilityTitle = Yii::t('CfilesModule.base', 'This folder is public.');
} else {
$visibilityIcon = 'fa-lock';
$visibilityTitle = Yii::t('CfilesModule.base', 'This folder is private.');
}

$visibilityIcon = $folder->content->isPublic() ? 'fa-unlock-alt': 'fa-lock' ;
$visibilityIcon = $folder->content->isPublic() ? 'fa-unlock': 'fa-lock' ;
?>

<div class="panel panel-default" style="margin-bottom:10px;">
Expand Down
4 changes: 2 additions & 2 deletions widgets/views/fileSelectionMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class="caret"></span>
data-action-submit
data-fid="<?= $folder->id ?>"
data-action-url="<?= $makePublicUrl ?>">
<i class="fa fa-unlock-alt"></i> <?= Yii::t('CfilesModule.base', 'Make Public') ?>
<i class="fa fa-unlock"></i> <?= Yii::t('CfilesModule.base', 'Make Public') ?>
</a>
<li>
<li>
Expand All @@ -79,4 +79,4 @@ class="caret"></span>
<?php endif; ?>
</ul>
</div>
</div>
</div>