mirror of
https://github.com/humhub/humhub.git
synced 2025-02-19 23:54:54 +01:00
Layout improvements
This commit is contained in:
parent
e014f5d3eb
commit
03531aa61d
@ -3,16 +3,16 @@
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Class m200930_151638_add_summary
|
||||
* Class m200930_151639_add_about
|
||||
*/
|
||||
class m200930_151638_add_summary extends Migration
|
||||
class m200930_151639_add_about extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('space', 'summary', 'text after description');
|
||||
$this->addColumn('space', 'about', 'text after description');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -20,7 +20,7 @@ class m200930_151638_add_summary extends Migration
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m200930_151638_add_summary cannot be reverted.\n";
|
||||
echo "m200930_151639_add_about cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -32,7 +32,7 @@ class m200930_151638_add_summary extends Migration
|
||||
}
|
||||
public function down()
|
||||
{
|
||||
echo "m200930_151638_add_summary cannot be reverted.\n";
|
||||
echo "m200930_151639_add_about cannot be reverted.\n";
|
||||
return false;
|
||||
}
|
||||
*/
|
@ -46,7 +46,7 @@ use Yii;
|
||||
* @property string $guid
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string $summary
|
||||
* @property string $about
|
||||
* @property string $url
|
||||
* @property integer $join_policy
|
||||
* @property integer $visibility
|
||||
@ -121,7 +121,8 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
$rules = [
|
||||
[['join_policy', 'visibility', 'status', 'auto_add_new_members', 'default_content_visibility'], 'integer'],
|
||||
[['name'], 'required'],
|
||||
[['description', 'summary', 'tags', 'color'], 'string'],
|
||||
[['description', 'about', 'tags', 'color'], 'string'],
|
||||
[['description'], 'string', 'max' => 100],
|
||||
[['join_policy'], 'in', 'range' => [0, 1, 2]],
|
||||
[['visibility'], 'in', 'range' => [0, 1, 2]],
|
||||
[['visibility'], 'checkVisibility'],
|
||||
@ -132,7 +133,7 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
];
|
||||
|
||||
if (Yii::$app->getModule('space')->useUniqueSpaceNames) {
|
||||
$rules[] = [['name'], 'unique', 'targetClass' => static::class, 'when' => function($model) {
|
||||
$rules[] = [['name'], 'unique', 'targetClass' => static::class, 'when' => function ($model) {
|
||||
return $model->isAttributeChanged('name');
|
||||
}];
|
||||
}
|
||||
@ -147,7 +148,7 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
{
|
||||
$scenarios = parent::scenarios();
|
||||
|
||||
$scenarios[static::SCENARIO_EDIT] = ['name', 'color', 'description', 'summary', 'tags', 'join_policy', 'visibility', 'default_content_visibility', 'url'];
|
||||
$scenarios[static::SCENARIO_EDIT] = ['name', 'color', 'description', 'about', 'tags', 'join_policy', 'visibility', 'default_content_visibility', 'url'];
|
||||
$scenarios[static::SCENARIO_CREATE] = ['name', 'color', 'description', 'join_policy', 'visibility'];
|
||||
$scenarios[static::SCENARIO_SECURITY_SETTINGS] = ['default_content_visibility', 'join_policy', 'visibility'];
|
||||
|
||||
@ -164,7 +165,7 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
'name' => Yii::t('SpaceModule.base', 'Name'),
|
||||
'color' => Yii::t('SpaceModule.base', 'Color'),
|
||||
'description' => Yii::t('SpaceModule.base', 'Description'),
|
||||
'summary' => Yii::t('SpaceModule.base', 'Summary'),
|
||||
'about' => Yii::t('SpaceModule.base', 'About'),
|
||||
'join_policy' => Yii::t('SpaceModule.base', 'Join Policy'),
|
||||
'visibility' => Yii::t('SpaceModule.base', 'Visibility'),
|
||||
'status' => Yii::t('SpaceModule.base', 'Status'),
|
||||
@ -178,12 +179,15 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function attributeHints()
|
||||
{
|
||||
return [
|
||||
'visibility' => Yii::t('SpaceModule.manage', 'Choose the security level for this workspace to define the visibleness.'),
|
||||
'join_policy' => Yii::t('SpaceModule.manage', 'Choose the kind of membership you want to provide for this workspace.'),
|
||||
'default_content_visibility' => Yii::t('SpaceModule.manage', 'Choose if new content should be public or private by default')
|
||||
'default_content_visibility' => Yii::t('SpaceModule.manage', 'Choose if new content should be public or private by default'),
|
||||
'description' => Yii::t('SpaceModule.base', 'Max. 100 characters.'),
|
||||
'about' => Yii::t('SpaceModule.base', 'Shown on About Page.'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -516,7 +520,7 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
{
|
||||
$user = !$user && !Yii::$app->user->isGuest ? Yii::$app->user->getIdentity() : $user;
|
||||
|
||||
if(!$user) {
|
||||
if (!$user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ use humhub\widgets\Button;
|
||||
|
||||
<?= SpaceNameColorInput::widget(['form' => $form, 'model' => $model]) ?>
|
||||
<?= $form->field($model, 'description')->textInput(); ?>
|
||||
<?= $form->field($model, 'summary')->widget(RichTextField::class); ?>
|
||||
<?= $form->field($model, 'about')->widget(RichTextField::class); ?>
|
||||
<?= $form->field($model, 'tags')->textInput(['maxlength' => 200]); ?>
|
||||
|
||||
<?= Button::save()->submit() ?>
|
||||
|
@ -19,8 +19,7 @@ $animation = $model->hasErrors() ? 'shake' : 'fadeIn';
|
||||
<div class="modal-body">
|
||||
|
||||
<?= SpaceNameColorInput::widget(['form' => $form, 'model' => $model]) ?>
|
||||
|
||||
<?= $form->field($model, 'description')->textarea(['placeholder' => Yii::t('SpaceModule.manage', 'space description'), 'rows' => '3']); ?>
|
||||
<?= $form->field($model, 'description'); ?>
|
||||
|
||||
<a data-toggle="collapse" id="access-settings-link" href="#collapse-access-settings" style="font-size: 11px;">
|
||||
<i class="fa fa-caret-right"></i> <?php echo Yii::t('SpaceModule.manage', 'Advanced access settings'); ?>
|
||||
|
@ -4,92 +4,104 @@ use humhub\modules\space\models\Space;
|
||||
use humhub\modules\space\widgets\AboutPageSidebar;
|
||||
use humhub\modules\content\widgets\richtext\RichText;
|
||||
use humhub\modules\user\widgets\Image;
|
||||
|
||||
/**
|
||||
* @var Space $space
|
||||
* @var array $userGroups
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?= Yii::t('SpaceModule.base', '<strong>About Space</strong>') ?>
|
||||
<?= Yii::t('SpaceModule.base', '<strong>About</strong> this Space') ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php if ($space->summary || $space->description):?>
|
||||
<div>
|
||||
<?= Yii::t('SpaceModule.base', '<strong>Description</strong>') ?>
|
||||
<div data-ui-markdown data-ui-show-more
|
||||
data-read-more-text="<?= Yii::t('SpaceModule.base', 'Read More') ?>">
|
||||
<?= RichText::output(empty($space->summary) ? $space->description : $space->summary) ?>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<?php endif;?>
|
||||
<div>
|
||||
<?= Yii::t('SpaceModule.base', '<strong>Contact Persons</strong>') ?>
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_OWNER])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><?= Yii::t('SpaceModule.base', 'Owner'); ?>
|
||||
(<?= count($userGroups[Space::USERGROUP_OWNER]) ?>)
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_OWNER] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 32,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_ADMIN])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><?= Yii::t('SpaceModule.base', 'Admins'); ?>
|
||||
(<?= count($userGroups[Space::USERGROUP_ADMIN]) ?>)
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_ADMIN] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 32,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_MODERATOR])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><?= Yii::t('SpaceModule.base', 'Moderators'); ?>
|
||||
(<?= count($userGroups[Space::USERGROUP_MODERATOR]) ?>)
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_MODERATOR] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 32,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<?= Yii::t('SpaceModule.base', '<strong>Security Settings</strong>'); ?>
|
||||
<?php if ($space->about || $space->description): ?>
|
||||
<div>
|
||||
<h5><?= Yii::t('SpaceModule.base', 'Join Policy')?></h5>
|
||||
<i class="fa fa-users"></i>
|
||||
<?= Space::joinPolicyOptions()[$space->join_policy] ?>
|
||||
<div data-ui-markdown data-ui-show-more
|
||||
data-read-more-text="<?= Yii::t('SpaceModule.base', 'Read More') ?>">
|
||||
<?= RichText::output(empty($space->about) ? $space->description : $space->about) ?>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_OWNER])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><p></ü><strong><?= Yii::t('SpaceModule.base', 'Owner'); ?></strong>
|
||||
</p></div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_OWNER] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 40,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_ADMIN])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><p><strong><?= Yii::t('SpaceModule.base', 'Admin'); ?></strong></p>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_ADMIN] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 40,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h5><?= Yii::t('SpaceModule.base', 'Space Visibility')?></h5>
|
||||
<i class="fa fa-globe"></i>
|
||||
<?= Space::visibilityOptions()[$space->visibility] ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($userGroups[Space::USERGROUP_MODERATOR])): ?>
|
||||
<div class="media">
|
||||
<div class="media-heading"><p><strong><?= Yii::t('SpaceModule.base', 'Moderator'); ?></strong></p></div>
|
||||
<div class="media-body">
|
||||
<?php foreach ($userGroups[Space::USERGROUP_MODERATOR] as $user) {
|
||||
echo Image::widget([
|
||||
'user' => $user, 'width' => 40,
|
||||
'htmlOptions' => ['style' => 'padding: 3px'],
|
||||
'imageOptions' => ['style' => 'border:1px solid ' . $this->theme->variable('success')]
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<p><strong><?= Yii::t('SpaceModule.base', 'Join Policy') ?></strong></p>
|
||||
<p><i class="fa fa-users colorInfo"></i> <?= Space::joinPolicyOptions()[$space->join_policy] ?></p>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<p><strong><?= Yii::t('SpaceModule.base', 'Space Visibility') ?></strong></p>
|
||||
<p><i class="fa fa-globe colorInfo"></i> <?= Space::visibilityOptions()[$space->visibility] ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -11,12 +11,10 @@ use humhub\widgets\PanelMenu;
|
||||
|
||||
<div class="panel panel-default panel-my-membership" id="my-membership-panel">
|
||||
<?= PanelMenu::widget(['id' => 'space-my-membership-panel']); ?>
|
||||
<div class="panel-heading"><?= Yii::t('SpaceModule.base', '<strong>My Membership Info</strong>'); ?></div>
|
||||
<div class="panel-heading"><?= Yii::t('SpaceModule.base', '<strong>About</strong> my membership'); ?></div>
|
||||
<div class="panel-body">
|
||||
<div><b><?= Yii::t('SpaceModule.base', 'Current Role') ?>: </b><?= ucfirst($role) ?></div>
|
||||
<div><b><?= Yii::t('SpaceModule.base', 'Permissions') ?>: </b>
|
||||
<div><?= empty($permissions) ? '-' : implode(", ", $permissions) ?></div>
|
||||
</div>
|
||||
<div><b><?= Yii::t('SpaceModule.base', 'Member Since') ?>: </b><?= $memberSince ?></div>
|
||||
|
||||
<p><b><?= Yii::t('SpaceModule.base', 'Role') ?>: </b><?= ucfirst($role) ?></p>
|
||||
<p><b><?= Yii::t('SpaceModule.base', 'Member since') ?>: </b><?= $memberSince ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user