BS5 - User Profile Image + Space Image Issue #497 - https://github.com/humhub/humhub-internal/issues/497

This commit is contained in:
Marc Farré 2025-01-06 14:02:34 +00:00
parent d2d7e91f5d
commit f1788cc664
12 changed files with 63 additions and 86 deletions

View File

@ -395,6 +395,7 @@ Doc: https://getbootstrap.com/docs/5.3/components/badge/
- Search for `media-list` and remove the HTML element, or, to keep a similar style, use the class `hh-list` and replace the `ul` tag with a `div`. E.g. `<ul class="media-list">` -> `<div class="hh-list">`
- Inside, replace `li` tags with `div` or `a` tags. E.g. `<li class="media">` -> `<div class="d-flex">`
- Search for `media` classes (search regex expression for HTML tags: `<\w+\s+[^>]*class\s*=\s*["'](?:[^"']*\s)?media(?:\s[^"']*)?["'][^>]*>`) and replace with `d-flex`
- Search for `img-space` classes and surround the `UserImage` and `SpaceImage` with the `img-profile-space` (see example in `protected/humhub/modules/content/widgets/views/wallEntry.php`)
- `media-heading` -> `mt-0` (removes the top margin, keeping it close to the top of the content area) ; the related HTML tag can be replaced with `h5` or `h4`
- `media-body` -> `flex-grow-1`
- `media-left` -> `flex-shrink-0 me-2`

View File

@ -25,25 +25,24 @@ use yii\helpers\Url;
<?php endif; ?>
<div class="d-flex">
<?php if ($originator !== null) : ?>
<!-- Show user image -->
<div class="flex-shrink-0 me-2">
<div class="flex-shrink-0 me-2 img-profile-space">
<?php if ($originator !== null) : ?>
<!-- Show user image -->
<?= $originator->getProfileImage()->render(32, ['link' => false]) ?>
</div>
<?php endif; ?>
<?php endif; ?>
<!-- Show space image, if you are outside from a space -->
<?php if (
!Yii::$app->controller instanceof ContentContainerController
&& $record->content->container instanceof Space
) : ?>
<div class="flex-shrink-0 me-2">
<!-- Show space image, if you are outside from a space -->
<?php if (
!Yii::$app->controller instanceof ContentContainerController
&& $record->content->container instanceof Space
) : ?>
<?= Image::widget([
'space' => $record->content->container,
'width' => 20,
'htmlOptions' => ['class' => 'img-space'],
]) ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="flex-grow-1 text-break">

View File

@ -10,38 +10,38 @@ use humhub\widgets\form\ActiveForm;
/* @var $model UserDeleteForm */
?>
<div class="panel-body">
<h4><?= Yii::t('AdminModule.user', 'Confirm user deletion'); ?></h4>
<h4><?= Yii::t('AdminModule.user', 'Confirm user deletion') ?></h4>
<br>
<p><strong><?= Yii::t('AdminModule.user', 'Are you sure that you want to delete following user?'); ?></strong></p>
<p><strong><?= Yii::t('AdminModule.user', 'Are you sure that you want to delete following user?') ?></strong></p>
<div class="bg-light p-3">
<div class="d-flex">
<div class="flex-shrink-0 me-2">
<?= UserImage::widget(['user' => $model->user, 'width' => 38, 'link' => true]); ?>
<?= UserImage::widget(['user' => $model->user, 'width' => 38, 'link' => true]) ?>
</div>
<div class="flex-grow-1">
<h4 class="mt-0"><?= Html::containerLink($model->user); ?></h4>
<h4 class="mt-0"><?= Html::containerLink($model->user) ?></h4>
<?= Html::encode($model->user->email) ?>
</div>
</div>
<hr>
<p><i class="fa fa-exclamation-triangle" style="color:var(--danger)"></i>
&nbsp;<?= Yii::t('AdminModule.user', 'All the personal data of this user will be irrevocably deleted.'); ?>
&nbsp;<?= Yii::t('AdminModule.user', 'All the personal data of this user will be irrevocably deleted.') ?>
</p>
<?php if (count($model->getOwningSpaces()) !== 0): ?>
<p><b><?= Yii::t('AdminModule.user', 'The user is the owner of these spaces:'); ?></b></p>
<p><b><?= Yii::t('AdminModule.user', 'The user is the owner of these spaces:') ?></b></p>
<?php foreach ($model->getOwningSpaces() as $space): ?>
<div class="d-flex">
<div class="flex-shrink-0 me-2">
<?= SpaceImage::widget(['space' => $space, 'width' => 38, 'link' => true]); ?>
<?= SpaceImage::widget(['space' => $space, 'width' => 38, 'link' => true]) ?>
</div>
<div class="flex-grow-1">
<h4 class="mt-0"><?= Html::containerLink($space); ?></h4>
<?= Yii::t('SpaceModule.base', '{count} members', ['count' => $space->getMemberships()->count()]); ?>
<h4 class="mt-0"><?= Html::containerLink($space) ?></h4>
<?= Yii::t('SpaceModule.base', '{count} members', ['count' => $space->getMemberships()->count()]) ?>
</div>
</div>
<?php endforeach; ?>
@ -52,9 +52,9 @@ use humhub\widgets\form\ActiveForm;
<br/>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'deleteContributions')->checkbox(['disabled' => !$model->isAttributeSafe('deleteContributions')]); ?>
<?= $form->field($model, 'deleteContributions')->checkbox(['disabled' => !$model->isAttributeSafe('deleteContributions')]) ?>
<?php if (count($model->getOwningSpaces()) !== 0): ?>
<?= $form->field($model, 'deleteSpaces')->checkbox(); ?>
<?= $form->field($model, 'deleteSpaces')->checkbox() ?>
<?php endif; ?>
<br/>

View File

@ -34,25 +34,23 @@ use yii\helpers\Url;
<?php endif; ?>
<!-- end: show wall entry options -->
<div class="flex-shrink-0 me-2">
<div class="flex-shrink-0 me-2 img-profile-space">
<?= UserImage::widget([
'user' => $user,
'width' => 40,
'width' => 32,
'htmlOptions' => ['data-contentcontainer-id' => $user->contentcontainer_id],
]) ?>
</div>
<?php if ($showContentContainer && $container instanceof Space): ?>
<div class="flex-shrink-0 me-2">
<?= SpaceImage::widget([
'space' => $container,
'width' => 20,
'htmlOptions' => ['class' => 'img-space'],
'link' => 'true',
'linkOptions' => ['data-contentcontainer-id' => $container->contentcontainer_id],
]) ?>
</div>
<?php endif; ?>
<?php if ($showContentContainer && $container instanceof Space): ?>
<?= SpaceImage::widget([
'space' => $container,
'width' => 20,
'htmlOptions' => ['class' => 'img-space'],
'link' => 'true',
'linkOptions' => ['data-contentcontainer-id' => $container->contentcontainer_id],
]) ?>
<?php endif; ?>
</div>
<div class="flex-grow-1">
<h4 class="mt-0">

View File

@ -24,7 +24,8 @@ use humhub\widgets\TimeAgo;
data-notification-group="<?= !empty($record->baseModel->getGroupkey())
? Html::encode(get_class($record->baseModel) . ':' . $record->baseModel->getGroupKey())
: '' ?>">
<div class="flex-shrink-0 me-2">
<div class="flex-shrink-0 me-2 img-profile-space">
<?php if ($originator) : ?>
<?= UserImage::widget([
'user' => $originator,
@ -42,11 +43,13 @@ use humhub\widgets\TimeAgo;
]) ?>
<?php endif; ?>
</div>
<div class="flex-grow-1">
<?= $content ?>
<br>
<?= TimeAgo::widget(['timestamp' => $record->created_at]) ?>
</div>
<div class="flex-shrink-0 ms-2 order-last text-center">
<?php if ($isNew) : ?>
<span class="badge-new"></span>

View File

@ -22,7 +22,7 @@ use humhub\widgets\modal\ModalButton;
<div id="userlist-content" class="hh-list">
<?php foreach ($users as $user) : ?>
<a href="<?= $user->getUrl(); ?>" data-modal-close="1" class="d-flex">
<a href="<?= $user->getUrl() ?>" data-modal-close="1" class="d-flex">
<div class="flex-shrink-0 me-2">
<?= Image::widget([
'user' => $user,
@ -32,15 +32,15 @@ use humhub\widgets\modal\ModalButton;
</div>
<div class="flex-grow-1">
<h4 class="mt-0"><?= Html::encode($user->displayName); ?></h4>
<h5><?= Html::encode($user->displayNameSub); ?></h5>
<h4 class="mt-0"><?= Html::encode($user->displayName) ?></h4>
<h5><?= Html::encode($user->displayNameSub) ?></h5>
</div>
</a>
<?php endforeach; ?>
</div>
<div class="pagination-container">
<?= AjaxLinkPager::widget(['pagination' => $pagination]); ?>
<?= AjaxLinkPager::widget(['pagination' => $pagination]) ?>
</div>
<script <?= Html::nonce() ?>>

View File

@ -8,14 +8,7 @@
}
.d-flex {
position: relative;
padding: 10px;
max-width: 295px;
.img-space {
position: absolute;
top: 24px;
left: 24px;
}
}
}

View File

@ -26,6 +26,16 @@ img {
image-orientation: from-image;
}
.img-profile-space {
position: relative;
.img-space {
position: absolute;
top: 15px;
left: 15px;
}
}
.has-online-status {
position: relative;
display: inline-block;

View File

@ -19,12 +19,6 @@
}
#notification_overview_list {
.img-space {
position: absolute;
top: 25px;
left: 25px;
}
.d-flex {
border-left: none;
background: none;

View File

@ -187,16 +187,6 @@
color: #d9534f;
}
> div {
position: relative;
.img-space {
position: absolute;
top: 14px;
left: 14px;
}
}
&.new {
background-color: transparent;
border-left: none;

View File

@ -11049,14 +11049,6 @@ span.likeLinkContainer .like.disabled, span.likeLinkContainer .unlike.disabled {
#topbar-first .notifications .dropdown-menu div.hh-list a.d-flex i.declined {
color: #d9534f;
}
#topbar-first .notifications .dropdown-menu div.hh-list a.d-flex > div {
position: relative;
}
#topbar-first .notifications .dropdown-menu div.hh-list a.d-flex > div .img-space {
position: absolute;
top: 14px;
left: 14px;
}
#topbar-first .notifications .dropdown-menu div.hh-list a.d-flex.new {
background-color: transparent;
border-left: none;
@ -11367,6 +11359,14 @@ audio, canvas, progress, video {
img {
image-orientation: from-image;
}
.img-profile-space {
position: relative;
}
.img-profile-space .img-space {
position: absolute;
top: 15px;
left: 15px;
}
.has-online-status {
position: relative;
display: inline-block;
@ -12274,11 +12274,6 @@ div.mb-3 div.checkbox .invalid-feedback:empty {
.field-filterform-allfilter input[type=checkbox]:focus {
border-color: #ccc !important;
}
#notification_overview_list .img-space {
position: absolute;
top: 25px;
left: 25px;
}
#notification_overview_list .d-flex {
border-left: none;
background: none;
@ -12956,15 +12951,9 @@ div.nested-comments-root div.comment-container {
padding: 0;
}
.activities .d-flex {
position: relative;
padding: 10px;
max-width: 295px;
}
.activities .d-flex .img-space {
position: absolute;
top: 24px;
left: 24px;
}
.contentForm_options {
margin-top: 10px;
min-height: 29px;

File diff suppressed because one or more lines are too long