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
29 changes: 28 additions & 1 deletion apps/dav/templates/settings-admin-caldav.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,39 @@
?>
<form id="CalDAV" class="section">
<h2><?php p($l->t('Calendar server')); ?></h2>
<p class="settings-hint">
<?php print_unescaped(str_replace(
[
'{calendarappstoreopen}',
'{calendardocopen}',
'{linkclose}',
],
[
'<a target="_blank" href="../apps/office/calendar">',
'<a target="_blank" href="' . link_to_docs('user-sync-calendars') . '" rel="noreferrer noopener">',
'</a>',
],
$l->t('Also install the {calendarappstoreopen}Calendar app{linkclose}, or {calendardocopen}connect your desktop & mobile for syncing ↗{linkclose}.')
)); ?>
</p>
<p>
<input type="checkbox" name="caldav_send_invitations" id="caldavSendInvitations" class="checkbox"
<?php ($_['send_invitations'] === 'yes') ? print_unescaped('checked="checked"') : null ?>/>
<label for="caldavSendInvitations"><?php p($l->t('Send invitations to attendees')); ?></label>
<br>
<em><?php p($l->t('Please make sure to properly set up the email settings above.')); ?></em>
<em>
<?php print_unescaped(str_replace(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use p and use the l10n sprintf method:

p($l->t('%s of %s used', [$_['usage'], $_['total_space']]));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p() will escape <a href="../admin#mail_general_settings">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, then just the translation ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but p will print the text and once it's printed i can't replace {emailopen} or {linkclose} 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print_unescaped($l->t(
    'Please make sure to properly set up %sthe email server↗%s.',
    '<a href="../admin#mail_general_settings">',
    '</a>'
));

And I can see %sthe causing issues.
I don't know, the str_replace seemed weird to me :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I throw <?php p($l->t('Please make sure to properly set up')) ?> <a href="../admin#mail_general_settings"><?php p($l->t('the email server ↗')) ?></a> in the ring 🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, the str_replace seemed weird to me 😀

As i said above already, I just copied it from https://github.com/nextcloud/server/blob/master/settings/templates/settings/personal/development.notice.php#L16
😉

[
'{emailopen}',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgehrke guess this is supposed to be called "linkopen"? Not sure :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically copied it from here: https://github.com/nextcloud/server/blob/master/settings/templates/settings/personal/development.notice.php#L16

{emailopen} will only be visible to the translators anyway.

'{linkclose}',
],
[
'<a href="../admin#mail_general_settings">',
'</a>',
],
$l->t('Please make sure to properly set up {emailopen}the email server{linkclose}.')
)); ?>
</em>
</p>
<p>
<input type="checkbox" name="caldav_generate_birthday_calendar" id="caldavGenerateBirthdayCalendar" class="checkbox"
Expand Down
9 changes: 9 additions & 0 deletions core/css/inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ input {
&:checked:disabled + label:before {
background-color: $color-checkbox-radio-disabled;
}

// Detail description below label of checkbox or radio button
& + label ~ em {
display: inline-block;
margin-left: 18px;
}
& + label ~ em:last-of-type {
margin-bottom: 12px;
}
}
&.checkbox {
+ label:before {
Expand Down