Skip to content

Commit

Permalink
Merge pull request #406 from humhub/fix/404-invite-notification-empty…
Browse files Browse the repository at this point in the history
…-block

Fix #404: Invite notification - Empty block
  • Loading branch information
luke- authored Aug 3, 2023
2 parents 9753395 + f64c214 commit ea54f8f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 40 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.5.2 (Unreleased)
------------------
- Enh #405: Improve UI of create/edit form on mobile
- Fix #404: Invite notification - Empty block

1.5.1 (July 16, 2023)
----------------------
Expand Down
30 changes: 15 additions & 15 deletions widgets/mails/views/eventInfoHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,59 @@

use humhub\libs\Html;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;
use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\content\widgets\richtext\converter\RichTextToEmailHtmlConverter;
use humhub\widgets\mails\MailButton;
use humhub\widgets\mails\MailButtonList;

/* @var $event CalendarEventIF */
/* @var $url string */
/* @var $extraInfo string*/
/* @var $extraInfo string */

if(!isset($url)) {
if (!isset($url)) {
$url = $event->getUrl();
}

$formatter = new CalendarDateFormatter(['calendarItem' => $event]);

?>

<div style="overflow:hidden">
<table width="100%" style="table-layout:fixed;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td colspan="2" style="word-wrap:break-word;padding-top:5px; padding-bottom:5px; font-size: 14px; line-height: 22px; font-family:Open Sans,Arial,Tahoma, Helvetica, sans-serif; color:<?= Yii::$app->view->theme->variable('text-color-main', '#777') ?>; font-weight:300; text-align:left;">
<td colspan="2"
style="word-wrap:break-word;padding-top:5px; padding-bottom:5px; font-size: 14px; line-height: 22px; font-family:Open Sans,Arial,Tahoma, Helvetica, sans-serif; color:<?= Yii::$app->view->theme->variable('text-color-main', '#777') ?>; font-weight:300; text-align:left;">

<?php if(!empty($event->getTitle())) :?>
<h1><?= Html::encode($event->getTitle())?></h1>
<?php if (!empty($event->getTitle())): ?>
<h1><?= Html::encode($event->getTitle()) ?></h1>
<?php endif; ?>

<?php if(!empty($event->getStartDateTime())) : ?>
<?php if (!empty($event->getStartDateTime())): ?>
<?= Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
]) ?>
<br>
<?php endif; ?>

<?php if($event instanceof CalendarEventParticipationIF) : ?>
<?php if($event->getOrganizer()) : ?>
<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()) : ?>
<b><?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => Html::encode($event->getOrganizer()->displayName)]) ?></b>
<?php endif; ?>
<?php endif; ?>

<?php if(!empty($event->getLocation())) : ?>
<b><?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation())?></b>
<?php if (!empty($event->getLocation())): ?>
<b><?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation()) ?></b>
<br>
<?php endif; ?>

<?php if(!empty($event->getDescription())) : ?>
<?php if (!empty($event->getDescription())): ?>
<p><?= RichTextToEmailHtmlConverter::process($event->getDescription()) ?></p>
<?php endif; ?>

<?php if(isset($extraInfo)) : ?>
<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<h2><?= Yii::t('CalendarModule.mail', 'Additional information:'); ?></h2>
<p><?= RichTextToEmailHtmlConverter::process($extraInfo) ?></p>
<?php endif; ?>

</td>
</tr>
</table>
Expand Down
44 changes: 19 additions & 25 deletions widgets/mails/views/eventInfoText.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,47 @@

use humhub\libs\Html;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;
use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\content\widgets\richtext\RichText;
use humhub\widgets\mails\MailButton;
use humhub\widgets\mails\MailButtonList;

/* @var $event CalendarEventIF */
/* @var $url string */
/* @var $extraInfo string*/
/* @var $extraInfo string */

if(!isset($url)) {
if (!isset($url)) {
$url = $event->getUrl();
}

$formatter = new CalendarDateFormatter(['calendarItem' => $event])

?>
<?= $event->getTitle() ?>


<?php if(!empty($event->getStartDateTime())) : ?>
<?= strip_tags(Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
])) ?>
<?php if (!empty($event->getStartDateTime())): ?>
<?= strip_tags(Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
])) ?>
<?php endif; ?>
<?php if($event instanceof CalendarEventParticipationIF) : ?>
<?php if($event->getOrganizer()) : ?>


<?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => $event->getOrganizer()->displayName]) ?>

<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()): ?>
<?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => Html::encode($event->getOrganizer()->displayName)]) ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(!empty($event->getLocation())) : ?>

<?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= $event->getLocation() ?>

<?php if (!empty($event->getLocation())): ?>
<?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation()) ?>
<?php endif; ?>
<?php if(!empty($event->getDescription())) : ?>

<?= RichText::preview($event->getDescription()) ?>

<?php if (!empty($event->getDescription())): ?>
<?= RichText::preview($event->getDescription()) ?>
<?php endif; ?>
<?php if(isset($extraInfo)) : ?>
<?= Yii::t('CalendarModule.mail', 'Additional information:'); ?>


<?= RichText::preview($extraInfo) ?>
<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<?= Yii::t('CalendarModule.mail', 'Additional information:'); ?>
<?= RichText::preview($extraInfo) ?>
<?php endif; ?>

<?= Yii::t('CalendarModule.mail', 'View Online: {url}', ['url' => $url]); ?>

0 comments on commit ea54f8f

Please sign in to comment.