Moved ContainerImageSet to subdirectory

This commit is contained in:
buddh4 2019-09-30 21:17:46 +02:00
parent d7cc871f17
commit 6333d9737c
5 changed files with 15 additions and 9 deletions

View File

@ -1,12 +1,12 @@
<?php
namespace humhub\modules\ui\assets;
namespace humhub\modules\ui\content\assets;
use yii\web\AssetBundle;
class UiImageSetAsset extends AssetBundle
{
public $sourcePath = '@ui/resources';
public $sourcePath = '@ui/content/resources';
public $js = [
'js/humhub.ui.imageset.js'
@ -15,4 +15,4 @@ class UiImageSetAsset extends AssetBundle
public $css = [
'css/humhub.ui.imageset.css'
];
}
}

View File

@ -1,6 +1,8 @@
<?php
namespace humhub\modules\ui\widgets;
namespace humhub\modules\ui\content\widgets;
use humhub\modules\ui\widgets\BaseImage;
class ContainerImageSet extends BaseImage
{
@ -34,13 +36,17 @@ class ContainerImageSet extends BaseImage
if ($this->hiddenImageWidth === null) {
$this->hiddenImageHeight = $this->hiddenImageWidth;
}
if($this->items && !is_array($this->items)) {
$this->items = [$this->items];
}
}
public function run()
{
$visibleItems = array_slice($this->items, 0, $this->max);
$hiddenItems = array_slice($this->items, $this->max);
return $this->render('@ui/widgets/views/containerImageSet', [
return $this->render('@ui/content/widgets/views/containerImageSet', [
'visibleItems' => $visibleItems,
'hiddenItems' => $hiddenItems,
'max' => $this->max,
@ -64,4 +70,4 @@ class ContainerImageSet extends BaseImage
'height' => $this->hiddenImageHeight
];
}
}
}

View File

@ -5,8 +5,9 @@ use humhub\modules\user\models\User;
use humhub\modules\space\widgets\Image as SpaceImage;
use humhub\modules\user\widgets\Image as UserImage;
use yii\helpers\Html;
use humhub\modules\ui\content\assets\UiImageSetAsset;
humhub\modules\ui\assets\UiImageSetAsset::register($this);
UiImageSetAsset::register($this);
?>
<div class="ui-imageset-wrapper">
<div class="ui-imageset-items" style="padding-right: <?= $options['width'] ?>px">
@ -25,8 +26,7 @@ humhub\modules\ui\assets\UiImageSetAsset::register($this);
style="width: <?= $options['width'] ?>px; height: <?= $options['height'] ?>px;"
data-toggle="tooltip"
data-placement="top"
data-original-title="Show more"
><?= count($hiddenItems) ?>+
data-original-title="Show more"><?= count($hiddenItems) ?>+
</div>
<div class="ui-imageset-hidden-items">
<?php