Skip to content

Commit 075be8a

Browse files
committed
Enh: Migration to Bootstrap 5 for HumHub 1.18
1 parent 8bc87c5 commit 075be8a

File tree

9 files changed

+50
-56
lines changed

9 files changed

+50
-56
lines changed

components/BaseFileController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
namespace humhub\modules\drawio\components;
1010

11+
use humhub\components\Controller;
12+
use humhub\modules\file\models\File;
1113
use Yii;
1214
use yii\web\HttpException;
13-
use yii\helpers\Url;
14-
use humhub\modules\file\models\File;
15-
use humhub\components\Controller;
1615

1716
/**
1817
* Description of BaseFileController

docs/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Changelog
22
=========
33

4-
1.0.6 - Unreleased
4+
1.1.0 (Unreleased)
55
----------------------
66
- Enh #18: Update Active Form for Bootstrap 5
77
- Enh #19: Use PHP CS Fixer
8+
- Enh: Migration to Bootstrap 5 for HumHub 1.18
89

910
1.0.5 - April 4, 2024
1011
----------------------

README.md renamed to docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Create charts in the easiest way imaginable. With our draw.io integration it has
66

77
- Create, edit and share diagrams with the well renowned tool
88
- Increase your productivity by collaboratively designing projects
9-
- Comment, discuss and show your appreciaten with a like
9+
- Comment, discuss and show your appreciation with a like

module.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"diagrams",
88
"visualization"
99
],
10-
"version": "1.0.6",
10+
"version": "1.1.0",
1111
"humhub": {
12-
"minVersion": "1.10"
12+
"minVersion": "1.18"
1313
},
1414
"homepage": "https://github.com/humhub-contrib/drawio",
1515
"authors": [
@@ -22,9 +22,9 @@
2222

2323
],
2424
"screenshots": [
25-
"resources/screen1.PNG",
26-
"resources/screen2.PNG",
27-
"resources/screen3.PNG",
25+
"resources/screen1.PNG",
26+
"resources/screen2.PNG",
27+
"resources/screen3.PNG",
2828
"resources/screen4.PNG"
29-
]
29+
]
3030
}

views/admin/index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
use humhub\modules\ui\form\widgets\ActiveForm;
3+
use humhub\widgets\form\ActiveForm;
44
use yii\helpers\Html;
5+
56
?>
67

78
<div class="panel panel-default">
@@ -11,11 +12,11 @@
1112
<div class="panel-body">
1213

1314
<?php $form = ActiveForm::begin(['id' => 'configure-form']); ?>
14-
<div class="form-group">
15+
<div class="mb-3">
1516
<?= $form->field($model, 'serverUrl'); ?>
1617
</div>
1718

18-
<div class="form-group">
19+
<div class="mb-3">
1920
<?= Html::submitButton('Save', ['class' => 'btn btn-primary', 'data-ui-loader' => '']) ?>
2021
</div>
2122

views/create/index.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
<?php
22

3+
use humhub\helpers\Html;
34
use humhub\modules\drawio\assets\Assets;
4-
use humhub\modules\ui\form\widgets\ActiveForm;
5-
use humhub\libs\Html;
6-
use humhub\widgets\ModalDialog;
5+
use humhub\widgets\modal\Modal;
76

87
Assets::register($this);
9-
10-
$modal = ModalDialog::begin([
11-
'header' => Yii::t('DrawioModule.base', '<strong>Create</strong> draw.io diagram'),
12-
])
138
?>
149

15-
<?php $form = ActiveForm::begin(); ?>
10+
<?php $form = Modal::beginFormDialog([
11+
'title' => Yii::t('DrawioModule.base', '<strong>Create</strong> draw.io diagram'),
12+
'footer' => Html::submitButton('Save', ['data-action-click' => 'drawio.createSubmit', 'data-ui-loader' => '', 'class' => 'btn btn-primary']),
13+
]) ?>
1614

17-
<div class="modal-body">
18-
<?= $form->field($model, 'fileName', ['template' => '{label}<div class="input-group">{input}<div class="input-group-addon">' . $ext . '</div></div>{hint}{error}']); ?>
15+
<?= $form->field($model, 'fileName', ['template' => '{label}<div class="input-group">{input}<div class="input-group-text">' . $ext . '</div></div>{hint}{error}']); ?>
1916
<?= $form->field($model, 'openFlag')->checkbox(); ?>
20-
</div>
21-
22-
<div class="modal-footer">
23-
<?= Html::submitButton('Save', ['data-action-click' => 'drawio.createSubmit', 'data-ui-loader' => '', 'class' => 'btn btn-primary']); ?>
24-
</div>
25-
26-
<?php ActiveForm::end(); ?>
2717

28-
<?php ModalDialog::end(); ?>
18+
<?php Modal::endFormDialog()?>

views/open/index.php

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
<div class="modal-dialog animated fadeIn" style="width:96%">
2-
<div class="modal-content drawioModal" style="background-color:transparent;">
3-
<?=
4-
\humhub\modules\drawio\widgets\EditorWidget::widget([
5-
'file' => $file,
6-
]);
7-
?>
8-
</div>
9-
</div>
10-
<script <?= \humhub\libs\Html::nonce() ?>>
11-
window.onload = function (evt) {
12-
setSize();
13-
}
14-
window.onresize = function (evt) {
15-
setSize();
16-
}
17-
setSize();
1+
<?php
182

19-
function setSize() {
20-
$('.drawioModal').css('height', window.innerHeight - 110 + 'px');
21-
}
22-
</script>
3+
use humhub\components\View;
4+
use humhub\modules\drawio\widgets\EditorWidget;
5+
use humhub\modules\file\models\File;
6+
use humhub\widgets\modal\Modal;
7+
8+
/**
9+
* @var $file File
10+
* @var $this View
11+
*/
12+
13+
// Force modal full height
14+
$this->registerCss('#drawio-modal .modal-content {height: calc(100vh - 45px);}');
15+
?>
16+
17+
<?php Modal::beginDialog([
18+
'size' => Modal::SIZE_EXTRA_LARGE,
19+
'closeButton' => false,
20+
]) ?>
21+
<?= EditorWidget::widget([
22+
'file' => $file,
23+
]) ?>
24+
<?php Modal::endDialog() ?>

widgets/EditorWidget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace humhub\modules\drawio\widgets;
1010

11-
use humhub\libs\Html;
11+
use humhub\helpers\Html;
1212
use humhub\modules\file\libs\FileHelper;
1313
use humhub\modules\file\models\File;
1414
use humhub\widgets\JsWidget;

widgets/views/editor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
use humhub\libs\Html;
3+
use humhub\helpers\Html;
4+
use humhub\modules\drawio\assets\Assets;
45

5-
\humhub\modules\drawio\assets\Assets::register($this);
6+
Assets::register($this);
67
?>
78

89
<?= Html::beginTag('div', $options) ?>

0 commit comments

Comments
 (0)