mirror of
https://github.com/humhub/humhub.git
synced 2025-04-22 16:11:55 +02:00
Fix #3973: Profile categories not editable
This commit is contained in:
parent
298f19ece3
commit
8647e0d5a4
3
.gitignore
vendored
3
.gitignore
vendored
@ -36,4 +36,5 @@ favicon.ico
|
||||
|
||||
**/tests/codeception/_support/_generated/**
|
||||
|
||||
**/tests/codeception/_output/**
|
||||
**/tests/codeception/_output/**
|
||||
/.php_cs.cache
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
use humhub\modules\user\models\ProfileField;
|
||||
use humhub\modules\user\models\ProfileFieldCategory;
|
||||
use humhub\widgets\Button;
|
||||
@ -14,8 +13,13 @@ use yii\helpers\Url;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?= Button::success(Yii::t('AdminModule.user', 'Add new field'))
|
||||
->icon('plus')->sm()->link(Url::to(['edit-field', 'categoryId' => $category->id]))->right() ?>
|
||||
->icon('plus')->sm()->link(Url::to(['edit-field', 'categoryId' => $category->id]))->right()->style('margin-left:5px') ?>
|
||||
|
||||
<?= Button::primary(Yii::t('AdminModule.user', 'Edit category'))
|
||||
->icon('pencil')->sm()->link(Url::to(['edit-category', 'id' => $category->id]))->right() ?>
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => new ArrayDataProvider(['allModels' => $category->fields]),
|
||||
@ -69,5 +73,3 @@ use yii\helpers\Url;
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
|
@ -1,54 +1,43 @@
|
||||
<?php
|
||||
|
||||
use humhub\compat\CActiveForm;
|
||||
use humhub\modules\ui\form\widgets\ActiveForm;
|
||||
use humhub\modules\user\models\ProfileFieldCategory;
|
||||
use humhub\widgets\Button;
|
||||
use yii\helpers\Url;
|
||||
use humhub\libs\Html;
|
||||
|
||||
/* @var $category ProfileFieldCategory */
|
||||
?>
|
||||
<div class="panel-body">
|
||||
<div class="pull-right">
|
||||
<?= Html::backButton(['index'], ['label' => Yii::t('AdminModule.base', 'Back to overview'), 'class' => 'pull-right']); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$category->isNewRecord) : ?>
|
||||
<?php if (!$category->isNewRecord): ?>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Edit profile category'); ?></h4>
|
||||
<?php else: ?>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Create new profile category'); ?></h4>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
|
||||
<?php $form = CActiveForm::begin(); ?>
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= $form->labelEx($category, 'title') ?>
|
||||
<?= $form->textField($category, 'title', ['class' => 'form-control']); ?>
|
||||
<?= $form->error($category, 'title'); ?>
|
||||
</div>
|
||||
<?= $form->field($category, 'title') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= $form->labelEx($category, 'description') ?>
|
||||
<?= $form->textArea($category, 'description', ['class' => 'form-control', 'rows' => '5']); ?>
|
||||
<?= $form->error($category, 'description'); ?>
|
||||
</div>
|
||||
<?= $form->field($category, 'description')->textarea(['rows' => 5]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= $form->labelEx($category, 'sort_order') ?>
|
||||
<?= $form->textField($category, 'sort_order', ['class' => 'form-control']); ?>
|
||||
<?= $form->error($category, 'sort_order'); ?>
|
||||
</div>
|
||||
<?= $form->field($category, 'sort_order') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= $form->labelEx($category, 'translation_category') ?>
|
||||
<?= $form->textField($category, 'translation_category', ['class' => 'form-control']); ?>
|
||||
<?= $form->error($category, 'translation_category'); ?>
|
||||
</div>
|
||||
<?= $form->field($category, 'translation_category') ?>
|
||||
|
||||
<hr>
|
||||
|
||||
<?= Html::submitButton(Yii::t('AdminModule.user', 'Save'), ['class' => 'btn btn-primary', 'data-ui-loader' => ""]); ?>
|
||||
<?= Button::save()->submit() ?>
|
||||
|
||||
<?php if (!$category->isNewRecord && !$category->is_system) : ?>
|
||||
<?= Html::a(Yii::t('AdminModule.user', 'Delete'), Url::to(['delete-category', 'id' => $category->id]), ['class' => 'btn btn-danger']); ?>
|
||||
<?php if (!$category->isNewRecord && !$category->is_system): ?>
|
||||
<?= Button::danger(Yii::t('AdminModule.user', 'Delete'))
|
||||
->link(Url::to(['delete-category', 'id' => $category->id]))->confirm()->right()?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php CActiveForm::end(); ?>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
|
@ -1,10 +1,12 @@
|
||||
<?php
|
||||
|
||||
use humhub\compat\HForm;
|
||||
use humhub\libs\Html;
|
||||
use humhub\modules\user\models\ProfileField;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $field ProfileField */
|
||||
/* @var $hForm HForm */
|
||||
?>
|
||||
|
||||
<div class="panel-body">
|
||||
@ -12,16 +14,16 @@ use yii\widgets\ActiveForm;
|
||||
<?= Html::backButton(['index'], ['label' => Yii::t('AdminModule.base', 'Back to overview'), 'class' => 'pull-right']); ?>
|
||||
</div>
|
||||
|
||||
<?php if (!$field->isNewRecord) : ?>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Edit profile field'); ?></h4>
|
||||
<?php if (!$field->isNewRecord): ?>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Edit profile field') ?></h4>
|
||||
<?php else: ?>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Create new profile field'); ?></h4>
|
||||
<h4><?= Yii::t('AdminModule.user', 'Create new profile field') ?></h4>
|
||||
<?php endif; ?>
|
||||
|
||||
<br>
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<?= $hForm->render($form); ?>
|
||||
<?= $hForm->render($form); ?>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user