Enh #68: Online Indicator Position (#6493)

* Enh #68: Online Indicator Position

* Enh #68: Online Indicator Position

---------

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Marc Farré 2023-08-10 23:51:04 +02:00 committed by GitHub
parent 64a5099897
commit 36791347cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5954 additions and 6 deletions

View File

@ -6,10 +6,11 @@ HumHub Changelog
- Fix #6472: Initialization of account profile field type "Markdown"
- Fix #6471: Wording "Default Homepage" in Space Default Settings
- Fix #6468: Module Administration - Marketplace Links broken without Pretty URLs
- Enh #6469: Added Info text for Marketplace page
- Enh #6469: Added Info text for Marketplace page
- Fix #112: Reorder Table Rows
- Fix #6476: Fix module disabling in queue
- Enh #6469: Implement conditions for `fixed-settings` in config
- Enh #68: Online Indicator Position
- Fix #6492: Fix module form "Set as default"
- Fix #6457: Regression with membership cache. Also move cache to `Membership::findMembership`.

View File

@ -35,9 +35,12 @@ class IsOnlineService
}
}
public function getStatus(): bool
public function getStatus(bool $showSelfStatus = false): bool
{
return $this->isEnabled() && Yii::$app->cache->exists($this->getCacheKey());
return
$this->isEnabled()
&& Yii::$app->cache->exists($this->getCacheKey())
&& ($showSelfStatus || $this->user->id !== Yii::$app->user->id);
}
public function isEnabled(): bool

View File

@ -34,6 +34,8 @@ class Image extends BaseImage
public bool $hideOnlineStatus = false;
public bool $showSelfOnlineStatus = false;
/**
* @inheritdoc
*/
@ -72,7 +74,7 @@ class Image extends BaseImage
} else {
Html::addCssClass($this->htmlOptions, ['has-online-status', $imgSize]);
}
$userIsOnline = $isOnlineService->getStatus();
$userIsOnline = $isOnlineService->getStatus($this->showSelfOnlineStatus);
$html .= Html::tag('span', '', [
'class' => ['tt user-online-status', $userIsOnline ? 'user-is-online' : 'user-is-offline'],
'title' => $userIsOnline ?

View File

@ -44,7 +44,7 @@ $userModel = Yii::$app->user->identity;
'link' => false,
'width' => 32,
'htmlOptions' => ['id' => 'user-account-image'],
'hideOnlineStatus' => true,
'showSelfOnlineStatus' => true,
]) ?>
<b class="caret"></b>

View File

@ -94,6 +94,10 @@
span {
font-size: 12px;
}
#user-account-image {
margin-bottom: 0;
}
}
}
@ -209,13 +213,16 @@
.dropdown-footer {
margin: 10px 10px 5px;
.btn.btn-default {
border: 1px solid @default;
box-shadow: none;
&:hover {
border-color: @background3;
background: @background3;
}
&:active {
border-color: @text-color-secondary;
background: white;

File diff suppressed because one or more lines are too long