Merge branch 'develop' into feature/marketplace-community-beta

This commit is contained in:
Lucas Bartholemy 2020-07-15 17:50:08 +02:00
commit 5019bd8cc9
3 changed files with 35 additions and 21 deletions

View File

@ -94,7 +94,11 @@ humhub.module('content.form', function(module, require, $) {
$('#notifyUserContainer').hide();
Widget.instance('#notifyUserInput').reset();
$('#postTopicContainer').hide();
Widget.instance('#postTopicInput').reset();
var topicPicker = Widget.instance('#postTopicInput');
if(topicPicker) {
topicPicker.reset();
}
};
CreateForm.prototype.resetFilePreview = function() {
@ -162,7 +166,11 @@ humhub.module('content.form', function(module, require, $) {
CreateForm.prototype.setTopics = function() {
$('#postTopicContainer').show();
Widget.instance('#postTopicInput').focus();
var topicPicker = Widget.instance('#postTopicInput');
if(topicPicker) {
topicPicker.focus();
}
};
var init = function() {

View File

@ -145,12 +145,15 @@ class WallStreamFilterNavigation extends FilterNavigation
'sortOrder' => 200
], static::PANEL_POSITION_RIGHT);
$this->addFilterBlock(static::FILTER_BLOCK_TOPIC, [
'title' => Yii::t('StreamModule.filter', 'Topic'),
'sortOrder' => 300
], static::PANEL_POSITION_RIGHT);
if(TopicPicker::showTopicPicker(ContentContainerHelper::getCurrent())) {
$this->addFilterBlock(static::FILTER_BLOCK_TOPIC, [
'title' => Yii::t('StreamModule.filter', 'Topic'),
'sortOrder' => 300
], static::PANEL_POSITION_RIGHT);
}
}
/**
* @inheritdoc
*/
@ -251,17 +254,19 @@ class WallStreamFilterNavigation extends FilterNavigation
private function initTopicFilter()
{
$this->addFilter([
'id' => static::FILTER_TOPICS,
'class' => PickerFilterInput::class,
'picker' => TopicPicker::class,
'category' => TopicStreamFilter::CATEGORY,
'pickerOptions' => [
'id' => 'stream-topic-picker',
'name' => 'stream-topic-picker',
'addOptions' => false
]
], static::FILTER_BLOCK_TOPIC);
if(TopicPicker::showTopicPicker(ContentContainerHelper::getCurrent())) {
$this->addFilter([
'id' => static::FILTER_TOPICS,
'class' => PickerFilterInput::class,
'picker' => TopicPicker::class,
'category' => TopicStreamFilter::CATEGORY,
'pickerOptions' => [
'id' => 'stream-topic-picker',
'name' => 'stream-topic-picker',
'addOptions' => false
]
], static::FILTER_BLOCK_TOPIC);
}
}
private function initContentTypeFilter()

View File

@ -11,6 +11,7 @@ namespace humhub\modules\user\controllers;
use humhub\modules\user\components\ProfileStream;
use humhub\modules\user\Module;
use Yii;
use yii\helpers\Url;
use yii\web\HttpException;
use yii\db\Expression;
use humhub\modules\content\components\ContentContainerController;
@ -63,13 +64,13 @@ class ProfileController extends ContentContainerController
/**
* User profile home
*
* @todo Allow change of default action
* @return string the response
* @todo Allow change of default action
*/
public function actionIndex()
{
if ($this->module->profileDefaultRoute !== null) {
return $this->redirect($this->getUser()->createUrl($this->module->profileDefaultRoute));
return $this->redirect(Url::to([$this->module->profileDefaultRoute, 'container' => $this->getUser()]));
}
return $this->actionHome();
@ -78,7 +79,7 @@ class ProfileController extends ContentContainerController
public function actionHome()
{
if ($this->module->profileDisableStream) {
$this->redirect('about');
return $this->redirect(Url::to(['/user/profile/about', 'container' => $this->getUser()]));
}
return $this->render('home', ['user' => $this->contentContainer]);
@ -95,7 +96,7 @@ class ProfileController extends ContentContainerController
public function actionFollow()
{
if(Yii::$app->getModule('user')->disableFollow) {
if (Yii::$app->getModule('user')->disableFollow) {
throw new HttpException(403, Yii::t('ContentModule.base', 'This action is disabled!'));
}