Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ nbproject
.idea/*
.gitmodules
/composer.lock

package-lock.json
node_modules/*
38 changes: 38 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = function (grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssmin: {
target: {
files: {
'resources/css/sharebetween.min.css': ['resources/css/sharebetween.css']
}
}
},
sass: {
options: {
implementation: require('sass')
},
dev: {
files: {
'resources/css/sharebetween.css': 'resources/css/sharebetween.scss'
}
}
},
watch: {
scripts: {
files: ['resources/css/*.scss'],
tasks: ['build'],
options: {
spawn: false,
},
},
},
});

grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('build', ['sass', 'cssmin']);
};
2 changes: 1 addition & 1 deletion controllers/ShareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use humhub\modules\space\models\Space;
use humhub\modules\user\models\User;
use humhub\modules\user\Module as UserModule;
use humhub\widgets\ModalClose;
use humhub\widgets\modal\ModalClose;
use Yii;

class ShareController extends \humhub\components\Controller
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.1.0 (August 18, 2025)
-----------------------
- Enh #78: Migration to Bootstrap 5 for HumHub 1.18

1.0.11 (May 28, 2025)
---------------------
- Fix #75: Fix activity description
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "Share content",
"description": "Share content between Spaces in the simplest way possible.",
"keywords": ["share", "between", "content"],
"version": "1.0.11",
"version": "1.1.0",
"humhub": {
"minVersion": "1.14"
"minVersion": "1.18"
},
"screenshots": [
"resources/screen1.png",
Expand Down
2 changes: 1 addition & 1 deletion notifications/SharedContentCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use humhub\modules\space\models\Space;
use humhub\modules\user\models\User;
use Yii;
use yii\bootstrap\Html;
use humhub\helpers\Html;

class SharedContentCreated extends ContentCreated
{
Expand Down
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "humhub-modules-sharebetween",
"description": "HumHub Share Content Module",
"directories": {
"doc": "docs",
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/humhub-contrib/sharebetween.git"
},
"bugs": {
"url": "https://github.com/humhub-contrib/sharebetween/issues"
},
"homepage": "https://github.com/humhub-contrib/sharebetween#readme",
"devDependencies": {
"grunt": "^1.5.3",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-sass": "^3.1.0",
"sass": "^1.83.0"
}
}
20 changes: 20 additions & 0 deletions resources/css/sharebetween.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.panel.sharebetween-wall-entry > .panel-body {
padding: 10px;
}
.panel.sharebetween-wall-entry > .panel-body > .wall-entry-header-info {
padding-bottom: 5px;
border-bottom: 2px solid var(--bs-border-color);
}
.panel.sharebetween-wall-entry > .panel-body > .wall-entry-header-info a {
color: var(--hh-text-color-main);
}
.panel.sharebetween-wall-entry > .panel-body > .wall-entry {
margin-top: 10px;
}
.panel.sharebetween-wall-entry > .panel-body > .wall-entry > .panel {
margin: 0;
box-shadow: none;
}
.panel.sharebetween-wall-entry > .panel-body > .wall-entry > .panel > .panel-body {
padding: 0;
}
2 changes: 1 addition & 1 deletion resources/css/sharebetween.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
padding: 10px;
> .wall-entry-header-info {
padding-bottom: 5px;
border-bottom: 2px solid #eee;
border-bottom: 2px solid var(--bs-border-color);
a {
color: #555;
color: var(--hh-text-color-main);
}
}
> .wall-entry {
Expand Down
34 changes: 14 additions & 20 deletions views/share/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,23 @@
use humhub\modules\content\models\Content;
use humhub\modules\sharebetween\models\ShareForm;
use humhub\modules\space\widgets\SpacePickerField;
use humhub\modules\ui\form\widgets\ActiveForm;
use humhub\widgets\ModalButton;
use humhub\widgets\ModalDialog;
use humhub\widgets\modal\ModalButton;
use humhub\widgets\modal\Modal;
use yii\helpers\Url;

/* @var $model ShareForm */
/* @var $content Content */
/* @var $allowShareOnProfile bool */
?>
<?php ModalDialog::begin(['header' => Yii::t('SharebetweenModule.base', '<strong>Share</strong> content')]); ?>
<?php $form = ActiveForm::begin([]); ?>
<div class="modal-body">
<?= $form->field($model, 'spaces')->widget(SpacePickerField::class, [
'url' => Url::to(['/sharebetween/share/search-spaces', 'id' => $content->id]),
'minInput' => 0,
])->label(false) ?>
<?php if ($allowShareOnProfile) : ?>
<?= $form->field($model, 'onProfile')->checkbox() ?>
<?php endif; ?>
</div>
<div class="modal-footer">
<?= ModalButton::submitModal() ?>
<?= ModalButton::cancel() ?>
</div>
<?php ActiveForm::end() ?>
<?php ModalDialog::end(); ?>
<?php $form = Modal::beginFormDialog([
'title' => Yii::t('SharebetweenModule.base', '<strong>Share</strong> content'),
'footer' => ModalButton::cancel() . ' ' . ModalButton::save()->submit(),
]); ?>
<?= $form->field($model, 'spaces')->widget(SpacePickerField::class, [
'url' => Url::to(['/sharebetween/share/search-spaces', 'id' => $content->id]),
'minInput' => 0,
])->label(false) ?>
<?php if ($allowShareOnProfile) : ?>
<?= $form->field($model, 'onProfile')->checkbox() ?>
<?php endif; ?>
<?php Modal::endFormDialog(); ?>
10 changes: 7 additions & 3 deletions widgets/ShareLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace humhub\modules\sharebetween\widgets;

use humhub\libs\Html;
use humhub\helpers\Html;
use humhub\modules\content\components\ContentActiveRecord;
use humhub\modules\content\models\Content;
use humhub\modules\sharebetween\models\Share;
use humhub\modules\sharebetween\services\ShareService;
use Yii;
use yii\base\Widget;
use yii\helpers\Url;

class ShareLink extends Widget
{
Expand Down Expand Up @@ -39,8 +40,11 @@ public function run()
'span',
Html::a(
Yii::t('SharebetweenModule.base', 'Share') . $this->getCounter(),
['/sharebetween/share', 'id' => $this->record->content->id],
['data-target' => '#globalModal'],
'#',
[
'data-action-click' => 'ui.modal.load',
'data-action-click-url' => Url::toRoute(['/sharebetween/share', 'id' => $this->record->content->id]),
],
),
['class' => 'share-between-container'],
);
Expand Down
2 changes: 1 addition & 1 deletion widgets/views/wallEntryBodyLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use humhub\modules\content\components\ContentActiveRecord;
use humhub\modules\sharebetween\assets\Assets;
use humhub\modules\ui\view\components\View;
use humhub\components\View;

/* @var $this View */
/* @var $model ContentActiveRecord */
Expand Down
6 changes: 3 additions & 3 deletions widgets/views/wallEntryHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* @license https://www.humhub.com/licences
*/

use humhub\libs\Html;
use humhub\helpers\Html;
use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\widgets\stream\WallStreamEntryOptions;
use humhub\modules\sharebetween\models\Share;
use humhub\modules\ui\icon\widgets\Icon;
use humhub\widgets\Link;
use humhub\widgets\bootstrap\Link;
use humhub\widgets\TimeAgo;

/* @var $model Share */
Expand All @@ -20,7 +20,7 @@
$sourceContainer = $model->getContentRecord()->content->container;
$currentContainer = $model->content->container;
?>
<div class="wall-entry-header-info media-body">
<div class="wall-entry-header-info flex-grow-1">
<?= Icon::get('share') ?>
<?= $sourceContainer instanceof ContentContainerActiveRecord
? Link::to($sourceContainer->getDisplayName(), $sourceContainer->createUrl())
Expand Down