Skip to content

Commit

Permalink
Update wording
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Feb 23, 2022
1 parent 5f723c1 commit b76df96
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 46 deletions.
10 changes: 5 additions & 5 deletions assets/CalendarAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public static function register($view)
{
$view->registerJsConfig('calendar.Calendar', [
'text' => [
'button.today' => Yii::t('CalendarModule.calendar', 'today'),
'button.month' => Yii::t('CalendarModule.calendar', 'month'),
'button.week' => Yii::t('CalendarModule.calendar', 'week'),
'button.day' => Yii::t('CalendarModule.calendar', 'day'),
'button.list' => Yii::t('CalendarModule.calendar', 'list'),
'button.today' => Yii::t('CalendarModule.calendar', 'Today'),
'button.month' => Yii::t('CalendarModule.calendar', 'Month'),
'button.week' => Yii::t('CalendarModule.calendar', 'Week'),
'button.day' => Yii::t('CalendarModule.calendar', 'Day'),
'button.list' => Yii::t('CalendarModule.calendar', 'List'),
]
]);
return parent::register($view);
Expand Down
6 changes: 3 additions & 3 deletions models/CalendarEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ public function attributeLabels()
'all_day' => Yii::t('CalendarModule.base', 'All Day'),
'recurring' => Yii::t('CalendarModule.base', 'Recurring'),
'reminder' => Yii::t('CalendarModule.base', 'Enable Reminder'),
'allow_decline' => Yii::t('CalendarModule.base', 'Allow participation state \'decline\''),
'allow_maybe' => Yii::t('CalendarModule.base', 'Allow participation state \'maybe\''),
'participation_mode' => Yii::t('CalendarModule.base', 'Participation Mode'),
'allow_decline' => Yii::t('CalendarModule.base', 'Allow option \'Decline\''),
'allow_maybe' => Yii::t('CalendarModule.base', 'Allow option \'Undecided\''),
'participation_mode' => Yii::t('CalendarModule.base', 'Mode'),
'max_participants' => Yii::t('CalendarModule.base', 'Maximum number of participants'),
'location' => Yii::t('CalendarModule.base', 'Location'),
];
Expand Down
12 changes: 11 additions & 1 deletion models/forms/CalendarEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class CalendarEntryForm extends Model
*/
public $topics = [];

/**
* @var bool
*/
public $sendUpdateNotification = 0;

/**
* @var CalendarEntry
*/
Expand Down Expand Up @@ -218,7 +223,7 @@ public function rules()
return [
['timeZone', 'in', 'range' => DateTimeZone::listIdentifiers()],
['topics', 'safe'],
[['is_public', 'type_id'], 'integer'],
[['is_public', 'type_id', 'sendUpdateNotification'], 'integer'],
[['start_date', 'end_date'], 'required'],
[['start_time', 'end_time'], 'date', 'type' => 'time', 'format' => CalendarUtils::getTimeFormat()],
['start_date', CalendarDateFormatValidator::class, 'timeField' => 'start_time'],
Expand All @@ -240,6 +245,7 @@ public function attributeLabels()
'location' => Yii::t('CalendarModule.base', 'Location'),
'is_public' => Yii::t('CalendarModule.base', 'Public'),
'topics' => Yii::t('TopicModule.base', 'Topics'),
'sendUpdateNotification' => Yii::t('CalendarModule.base', 'Notify participants about changes'),
];
}

Expand Down Expand Up @@ -440,6 +446,10 @@ public function save()

Topic::attach($this->entry->content, $this->topics);

if ($this->sendUpdateNotification && !$this->entry->isNewRecord) {
$this->entry->participation->sendUpdateNotification();
}

$result = true;

if ($this->showReminderTab()) {
Expand Down
4 changes: 2 additions & 2 deletions models/forms/CalendarEntryParticipationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public function rules()
public function attributeLabels()
{
return [
'sendUpdateNotification' => Yii::t('CalendarModule.base', 'Send update notification'),
'sendUpdateNotification' => Yii::t('CalendarModule.base', 'Notify participants about changes'),
'forceJoin' => ($this->entry->isNewRecord)
? Yii::t('CalendarModule.base', 'Add all space members to this event')
: Yii::t('CalendarModule.base', 'Invite all participants from the space'),
: Yii::t('CalendarModule.base', 'Invite all Space members'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function createEventToday($title = 'My Test Entry', $description = 'My Te
{
$this->waitForElementVisible('.fc-today');
$this->click('.fc-today');
$this->waitForText('Create event');
$this->waitForText('Create Event');

$this->fillField('CalendarEntry[title]', $title);
$this->fillField('#calendarentry-description .humhub-ui-richtext' , $description);
Expand Down
14 changes: 7 additions & 7 deletions tests/codeception/acceptance/CreateSpaceEntryCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class CreateSpaceEntryCest
{

public function testInstallAndCreatEntry(AcceptanceTester $I)
{
$I->amAdmin();
Expand All @@ -30,7 +30,7 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->click('Calendar', '.layout-nav-container');
$I->waitForElementVisible('.fc-today');
$I->click('.fc-today');
$I->waitForText('Create event', null, '#globalModal');
$I->waitForText('Create Event', null, '#globalModal');

$I->fillField('CalendarEntry[title]', 'My Test Entry');
$I->fillField('#calendarentry-description .humhub-ui-richtext', 'My Test Entry Description');
Expand Down Expand Up @@ -90,7 +90,7 @@ public function testAddAll(AcceptanceTester $I)

$I->waitForElementVisible('.fc-today');
$I->click('.fc-today');
$I->waitForText('Create event');
$I->waitForText('Create Event');

$I->fillField('CalendarEntry[title]', 'New Test Event');

Expand All @@ -104,7 +104,7 @@ public function testAddAll(AcceptanceTester $I)

$I->expect('All space members to be attending');
$I->click('New Test Event');
$I->waitForText('2 attending', null,'#globalModal');
$I->waitForText('2 Attending', null,'#globalModal');
$I->amOnSpace(1, '/calendar/view/index');

$I->wantToTest('Adding a new space member and using then using the add all members again');
Expand All @@ -126,7 +126,7 @@ public function testAddAll(AcceptanceTester $I)
$I->waitForText('New Test Event',null, '#globalModal');
$I->click('Invite', '#globalModal .modal-footer');

$I->waitForText('Event Participants', null, '#globalModal');
$I->waitForText('Participants', null, '#globalModal');
$I->waitForElementVisible('[for="calendarentryparticipationform-forcejoin"]', null, '#globalModal');
$I->click('[for="calendarentryparticipationform-forcejoin"]');
$I->click('Save', '#globalModal');
Expand All @@ -135,7 +135,7 @@ public function testAddAll(AcceptanceTester $I)

$memberCount = Membership::getSpaceMembersQuery(Space::findOne(['id' => 1]))->count();

$I->waitForText($memberCount.' attending', null,'#globalModal');
$I->waitForText($memberCount.' Attending', null,'#globalModal');

$I->wantToTest('closing the event');

Expand All @@ -161,7 +161,7 @@ public function testAddAll(AcceptanceTester $I)
$I->waitForElementVisible('.fc-today');
$I->click('.fc-today');

$I->waitForText('Create event', null, '#globalModal');
$I->waitForText('Create Event', null, '#globalModal');
$I->fillField('CalendarEntry[title]', 'User Test Event 2');
$I->click('Next', '#globalModal');
$I->waitForText('Participants', null, '#globalModal');
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/acceptance/GlobalCalendarCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGlobalCalendarCreateEntry(AcceptanceTester $I)
$I->waitForText('Next', null, '#globalModal');
$I->click('Next', '#globalModal');

$I->waitForText('Create event', null, '#globalModal');
$I->waitForText('Create Event', null, '#globalModal');
$I->fillField('CalendarEntry[title]', 'My Test Profile Entry');
$I->fillField('#calendarentry-description .humhub-ui-richtext', 'My Test Profile Entry Description');
$I->click('Next', '#globalModal');
Expand Down
14 changes: 7 additions & 7 deletions tests/codeception/acceptance/ParticipationCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->selectOption('#calendarentry-participation_mode', 2);

$I->canSee('Maximum number of participants', '#globalModal');
$I->canSee('Allow participation state', '#globalModal');
$I->canSee('Allow option', '#globalModal');

$I->selectOption('#calendarentry-participation_mode', 0);

$I->wait(1);

$I->cantSee('Maximum number of participants', '#globalModal');
$I->cantSee('Allow participation state', '#globalModal');
$I->cantSee('Allow option', '#globalModal');

$I->click('[type="submit"]');
$I->wait(1);
Expand All @@ -48,7 +48,7 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->dontSee('Decline', '#globalModal button');

$I->click('Invite', '#globalModal');
$I->waitForText('Event Participants',null, '#globalModal');
$I->waitForText('Participants',null, '#globalModal');

$I->selectOption('#calendarentry-participation_mode', 2);

Expand All @@ -64,7 +64,7 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->see('Decline', '#globalModal button');

$I->click('Invite', '#globalModal');
$I->waitForText('Event Participants',null, '#globalModal');
$I->waitForText('Participants',null, '#globalModal h4');
$I->click('.tab-participation');
$I->click('[for="calendarentry-allow_decline"]', '#globalModal');
$I->click('[for="calendarentry-allow_maybe"]', '#globalModal');
Expand All @@ -78,9 +78,9 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->dontSee('Decline', '#globalModal button');

$I->click('Attend', '#globalModal');
$I->waitForText('1 attending', null, '#globalModal');
$I->click('1 attending', '#globalModal');
$I->waitForText('Event Participants', null, '#globalModal');
$I->waitForText('1 Attending', null, '#globalModal');
$I->click('1 Attending', '#globalModal');
$I->waitForText('Participants', null, '#globalModal');
$I->see('Admin Tester', '#globalModal');
}
}
4 changes: 2 additions & 2 deletions tests/codeception/acceptance/SettingsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->createEventToday('Setting Event','Setting Description',null,null,false);
$I->click('Next', '#globalModal');

$I->waitForText('Event Participants',null, '#globalModal');
$I->waitForText('Participants',null, '#globalModal');
$I->seeInField('#calendarentry-participation_mode', 0);
$I->dontSeeElement('.participationOnly');

Expand All @@ -52,7 +52,7 @@ public function testInstallAndCreatEntry(AcceptanceTester $I)
$I->amOnSpace1('/calendar/view');
$I->createEventToday('Setting Event','Setting Description',null,null,false);
$I->click('Next', '#globalModal');
$I->waitForText('Event Participants',null, '#globalModal');
$I->waitForText('Participants',null, '#globalModal h4');
$I->seeInField('#calendarentry-participation_mode', 2);
$I->seeElement('.participationOnly');
$I->dontSeeCheckboxIsChecked('#calendarentry-allow_decline');
Expand Down
4 changes: 4 additions & 0 deletions views/entry/edit-basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@
])->label(false) ?>

<?= $form->field($calendarEntryForm, 'topics')->widget(TopicPicker::class, ['contentContainer' => $contentContainer]); ?>

<?php if (!$calendarEntryForm->entry->isNewRecord) : ?>
<?= $form->field($calendarEntryForm, 'sendUpdateNotification')->checkbox() ?>
<?php endif; ?>
</div>
4 changes: 2 additions & 2 deletions views/entry/edit-participation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
?>
<div class="modal-body">
<?= $form->field($entry, 'participation_mode')
->dropDownList(CalendarEntryParticipationForm::getModeItems(), ['data-action-change' => 'changeParticipationMode'])->label(false) ?>
->dropDownList(CalendarEntryParticipationForm::getModeItems(), ['data-action-change' => 'changeParticipationMode']) ?>

<div class="participationOnly" style="<?= $entry->participation->isEnabled() ? '' : 'display:none' ?>">
<?= $form->field($entry, 'max_participants')->textInput() ?>
<?= $form->field($entry, 'allow_decline')->checkbox() ?>
<?= $form->field($entry, 'allow_maybe')->checkbox() ?>
<?= $form->field($entry, 'participant_info')->widget(RichTextField::class, ['placeholder' => Yii::t('CalendarModule.base', 'Participation Info'), 'pluginOptions' => ['maxHeight' => '300px']])->label(false) ?>
<?= $form->field($entry, 'participant_info')->widget(RichTextField::class, ['placeholder' => Yii::t('CalendarModule.base', 'Additional Information for participants'), 'pluginOptions' => ['maxHeight' => '300px']])->label(false) ?>

<?php if (!$entry->isNewRecord) : ?>
<?= $form->field($calendarEntryParticipationForm, 'sendUpdateNotification')->checkbox() ?>
Expand Down
6 changes: 3 additions & 3 deletions views/entry/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
CalendarBaseAssets::register($this);

if ($calendarEntryForm->entry->isNewRecord) {
$header = Yii::t('CalendarModule.views_entry_edit', '<strong>Create</strong> event');
$header = Yii::t('CalendarModule.views_entry_edit', '<strong>Create</strong> Event');
$saveButtonText = Yii::t('CalendarModule.views_entry_edit', 'Next');
} else {
$header = Yii::t('CalendarModule.views_entry_edit', '<strong>Edit</strong> event');
$header = Yii::t('CalendarModule.views_entry_edit', '<strong>Edit</strong> Event');
$saveButtonText = null;
}

Expand All @@ -44,7 +44,7 @@
'params' => ['form' => $form, 'calendarEntryForm' => $calendarEntryForm, 'contentContainer' => $contentContainer],
'items' => [
[
'label' => Yii::t('CalendarModule.views_entry_edit', 'Basic'),
'label' => Yii::t('CalendarModule.views_entry_edit', 'General'),
'view' => 'edit-basic',
'linkOptions' => ['class' => 'tab-basic'],
],
Expand Down
2 changes: 1 addition & 1 deletion views/entry/modal-participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$visibleStyle = [];
?>
<?php ModalDialog::begin([
'header' =>'<strong>' . Yii::t('CalendarModule.views_entry_view', 'Event Participants') . '</strong>',
'header' =>'<strong>' . Yii::t('CalendarModule.views_entry_view', 'Participants') . '</strong>',
'size' => 'large',
]) ?>
<?php $form = ActiveForm::begin(['enableClientValidation' => false]) ?>
Expand Down
2 changes: 1 addition & 1 deletion widgets/DownloadIcsLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public function run()
return;
}

return Html::a(Yii::t('CalendarModule.base', 'Download as ICS file'), Url::toEntryDownloadICS($this->calendarEntry), ['target' => '_blank']);
return Html::a(Yii::t('CalendarModule.base', 'Donwload ICS'), Url::toEntryDownloadICS($this->calendarEntry), ['target' => '_blank']);
}
}
2 changes: 1 addition & 1 deletion widgets/EditLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class EditLink extends WallEntryControlLink

public function init()
{
$this->label = Yii::t('ContentModule.widgets_views_editLink', 'Edit');
$this->label = Yii::t('CalendarModule.base', 'Edit Event');
$this->icon = 'fa-pencil';
$this->options = [
'data-action-click' => 'calendar.editModal',
Expand Down
4 changes: 2 additions & 2 deletions widgets/ParticipantItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public static function getStatuses(?CalendarEntry $entry = null): array
$statuses = [];
} else {
$statuses = [
CalendarEntryParticipant::PARTICIPATION_STATE_ACCEPTED => Yii::t('CalendarModule.views_entry_edit', 'Attend'),
CalendarEntryParticipant::PARTICIPATION_STATE_MAYBE => Yii::t('CalendarModule.views_entry_edit', 'Maybe'),
CalendarEntryParticipant::PARTICIPATION_STATE_ACCEPTED => Yii::t('CalendarModule.views_entry_edit', 'Attending'),
CalendarEntryParticipant::PARTICIPATION_STATE_MAYBE => Yii::t('CalendarModule.views_entry_edit', 'Undecided'),
CalendarEntryParticipant::PARTICIPATION_STATE_DECLINED => Yii::t('CalendarModule.views_entry_edit', 'Declined'),
];
}
Expand Down
2 changes: 1 addition & 1 deletion widgets/ParticipantsLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ParticipantsLink extends WallEntryControlLink

public function init()
{
$this->label = Yii::t('CalendarModule.base', 'Edit Participants');
$this->label = Yii::t('CalendarModule.base', 'Participants');
$this->icon = 'fa-users';
$this->options = [
'data-action-click' => 'ui.modal.load',
Expand Down
2 changes: 1 addition & 1 deletion widgets/views/participantAddForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<?= UserPickerField::widget([
'model' => $model,
'attribute' => 'newParticipants',
'placeholder' => Yii::t('AdminModule.user', 'Add new participants...'),
'placeholder' => Yii::t('AdminModule.user', 'Add participants...'),
'options' => ['label' => false],
'url' => $searchUsersUrl,
]) ?>
Expand Down
2 changes: 1 addition & 1 deletion widgets/views/participantList.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<?= ParticipantFilter::widget() ?>

<p class="calendar-entry-participants-count"><?= $pagination->totalCount
? Yii::t('CalendarModule.views_entry_edit', '{count} participants', ['count' => '<span>' . $pagination->totalCount . '</span>'])
? Yii::t('CalendarModule.views_entry_edit', '{count} Participants', ['count' => '<span>' . $pagination->totalCount . '</span>'])
: Yii::t('CalendarModule.views_entry_edit', 'No participants')
?></p>
<?php endif; ?>
Expand Down
8 changes: 4 additions & 4 deletions widgets/views/participants.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?php if ($calendarEntry->participation->isEnabled()) : ?>
<h5 style="margin:0 0 5px;font-weight:600"><?= Yii::t('CalendarModule.widgets_views_participants', 'Participants') ?></h5>

<?php $title = Yii::t('CalendarModule.widgets_views_participants', ":count attending", [':count' => $countAttending]); ?>
<?php $title = Yii::t('CalendarModule.widgets_views_participants', ':count Attending', [':count' => $countAttending]); ?>
<?php if ($countAttending > 0) : ?>
<?= ModalButton::instance($title)
->load(Url::toParticipationUserList($calendarEntry, CalendarEntryParticipant::PARTICIPATION_STATE_ACCEPTED))
Expand All @@ -26,7 +26,7 @@

<?php if($calendarEntry->allow_maybe) : ?>
&middot;
<?php $title = Yii::t('CalendarModule.widgets_views_participants', ":count maybe", [':count' => $countMaybe]); ?>
<?php $title = Yii::t('CalendarModule.widgets_views_participants', ':count Undecided', [':count' => $countMaybe]); ?>
<?php if ($countMaybe > 0) : ?>
<?= ModalButton::instance($title)
->load(Url::toParticipationUserList($calendarEntry, CalendarEntryParticipant::PARTICIPATION_STATE_MAYBE))
Expand All @@ -38,7 +38,7 @@

<?php if($calendarEntry->allow_decline) : ?>
&middot;
<?php $title = Yii::t('CalendarModule.widgets_views_participants', ":count declined", [':count' => $countDeclined]); ?>
<?php $title = Yii::t('CalendarModule.widgets_views_participants', ':count Declined', [':count' => $countDeclined]); ?>
<?php if ($countDeclined > 0) : ?>
<?= ModalButton::instance($title)
->load(Url::toParticipationUserList($calendarEntry, CalendarEntryParticipant::PARTICIPATION_STATE_DECLINED))
Expand All @@ -48,7 +48,7 @@
<?php endif ?>
<?php endif ?>

&middot; <?php $title = Yii::t('CalendarModule.widgets_views_participants', ":count invited", [':count' => $countInvited]); ?>
&middot; <?php $title = Yii::t('CalendarModule.widgets_views_participants', ':count Invited', [':count' => $countInvited]); ?>
<?php if ($countInvited > 0) : ?>
<?= ModalButton::instance($title)
->load(Url::toParticipationUserList($calendarEntry, CalendarEntryParticipant::PARTICIPATION_STATE_INVITED))
Expand Down

0 comments on commit b76df96

Please sign in to comment.