{% extends '@ProductsNotifications/base--full.html.twig' %}
{% form_theme form '@ui2022/schoolnow/forms/themes/default.html.twig' %}
{% block styles %}uilib bg-white{% endblock %}
{% block topbar %}
{% set steps =
[
{
text: 'Create message',
button: {
button: 'form',
type: 'submit',
styles: 'wizard',
form: {
name: form.action.vars.full_name,
value: 'save',
form: form.vars.id,
formaction: path('app.notifications.dashboard.messages.manage', {
message: message.id,
jump: path('app.notifications.dashboard.messages.update', {
message: message.id,
}),
}),
},
},
},
{
active: true,
text: 'Review and test',
},
]
%}
{% include '@ui2022/topbar--wizard.html.twig' with {
steps: steps,
subactions: [
{
text: 'Exit',
link: path('app.notifications.dashboard.messages.main'),
styles: 'lighter md',
attr: {
id: 'btn__exit',
},
},
{
button: 'form',
type: 'submit',
text: 'Save',
styles: 'lighter md',
form: {
name: form.action.vars.full_name,
value: 'save',
form: form.vars.id,
formaction: path('app.notifications.dashboard.messages.manage', {
message: message.id,
saved: false
}),
},
},
],
actions: [
{
button: 'a',
text: 'Send test',
link: path('app.notifications.dashboard.messages.test', {
message: message.id,
}),
styles: 'lighter md',
modal: 'modal__test',
},
{
text: 'Send',
styles: 'orange wide md',
modal: 'modal__send',
},
],
} %}
{% endblock %}
{% block content %}
{% set isWebsiteAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__WEBSITE')) %}
{% set isFacebookAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__FACEBOOK')) %}
{% set isTwitterAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__TWITTER')) %}
{% set isInstagramAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__INSTAGRAM')) %}
{% set isEmailAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__EMAIL')) %}
{% set isVoiceAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__VOICE')) %}
{% set isSmsAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__SMS')) %}
{% set isAppAllowed = message.hasStarterChannel(constant('Products\\NotificationsBundle\\Entity\\Notifications\\Channels\\ChannelsInterface::CHANNELS__APP')) %}
{{ form_start(form) }}
{% include '@ui2022/schoolnow/review__schedule.html.twig' with {
form: form.scheduled,
picker: form.scheduledAt,
} %}
{% embed '@ui2022/schoolnow/review__feature.html.twig' with {
title: message.title,
} %}
{% block content %}
<p>
<a
id="edit-message"
class="font-14 featured__link"
href="{{- path('app.notifications.dashboard.messages.update', { message: message.id }) -}}"
data-url="{{-
path('app.notifications.dashboard.messages.manage', {
message: message.id,
saved: false,
jump: path('app.notifications.dashboard.messages.update', {
message: message.id,
}),
})
-}}"
>
Edit Message
</a>
</p>
{% endblock %}
{% endembed %}
<div class="container-md">
{% embed '@ui2022/schoolnow/review__block--grid.html.twig' with {
title: 'Contacts',
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--icon.html.twig' with {
icon: 'icon-contacts-user',
} %}
{% include '@ui2022/schoolnow/review__cell--list.html.twig' with {
items: message.lists|map(list => "#{list.name} (#{counts.lists[list.id]|number_format})"),
} %}
{% include '@ui2022/schoolnow/review__cell--count.html.twig' with {
text: counts.total|number_format,
} %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__block--grid.html.twig' with {
title: 'Translations',
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--icon.html.twig' with {
icon: 'icon-translations',
} %}
{% embed '@ui2022/schoolnow/review__cell--content.html.twig' %}
{% block content %}
{% for language in languages %}
<a
class="lang_pill mb-2 {% if language['isActive'] %}active{% endif %}"
href="#"
data-locale="{{ language['locale'] }}"
data-toggle="sidepanel"
data-target="{{ '#translation-sidepanel-' ~ language['locale'] }}"
>
{{- language['humanReadableLocaleName'] -}}
</a>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__block--grid.html.twig' with {
title: 'Branding',
} %}
{% block content %}
<div class="col-12 container">
{{ form_widget(form.branding) }}
</div>
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__block.html.twig' with {
title: 'Share to',
attr: {
class: 'review-sharing-block',
},
} %}
{% block content %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isWebsiteAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.website,
locked: (not isWebsiteAllowed),
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/website-alert-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Website Alert',
details:
(message.websiteDepartments)
?
message.websiteDepartments|map(
department => department.name
)|join(', ')
:
null,
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
{% for department in message.websiteDepartments %}
<div class="socialpreview__head">
<span class="socialpreview__head--pic" style="border-radius: 0%;">
<i class="far fa-2x fa-folder"></i>
</span>
<span class="socialpreview__head--title">{{ department.name }}</span>
</div>
{% endfor %}
{{ form_row(form.websiteEndDateTime) }}
{{ form_row(form.websiteLevel) }}
{{ form_row(form.websiteBehavior) }}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isFacebookAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.facebook,
locked: (not isFacebookAllowed),
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/facebook-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Facebook',
details:
(message.facebookSocialAccounts)
?
message.facebookSocialAccounts|map(
account => account.name
)|join(', ')
:
null,
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
{% for facebook in message.facebookSocialAccounts %}
<div class="socialpreview__head">
<span class="socialpreview__head--pic">
<img src="{{- path('app.notifications.dashboard.default.social_avatar', {
account: facebook.id,
}) -}}" width="48" height="47" />
</span>
<span class="socialpreview__head--title">{{ facebook.name }}</span>
<span class="socialpreview__head--icon socialpreview__head--fb">
<i class="icon-facebook-circle"></i>
</span>
</div>
{% endfor %}
<div class="socialpreview__comment">
{{ form_widget(form.facebookNote, {
attr: {
placeholder: 'Add comment',
class: 'clearstyle',
},
}) }}
</div>
<div class="socialpreview__view">
{% if message.media|length > 0 %}
<img class="img-fluid d-block mx-auto" src="{{- (message.media.feature|decorate_media)._urls.medium -}}" width="594" height="417" alt="Facebook Preview" />
{% endif %}
<div class="socialpreview__meta">
<span class="socialpreview__url">www.schoolnow.com</span>
<span class="socialpreview__title">{{ message.title }}</span>
<span class="socialpreview__desc text-truncate">{{ message.description|striptags }}</span>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isTwitterAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.twitter,
locked: (not isTwitterAllowed),
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/twitter-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Twitter',
details:
(message.twitterSocialAccounts)
?
message.twitterSocialAccounts|map(
account => '@%s'|format(account.twitterUserName)
)|join(', ')
:
null,
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
{% for social in message.twitterSocialAccounts %}
<div class="socialpreview__head">
<span class="socialpreview__head--pic">
<img src="{{- path('app.notifications.dashboard.default.social_avatar', {
account: social.id,
}) -}}" width="48" height="47" />
</span>
<span class="socialpreview__head--title">
{{ social.name }}
<span class="text-body font-14 d-block text-semibold">@{{ social.twitterUserName }}</span>
</span>
<span class="socialpreview__head--icon socialpreview__head--fb">
<i class="icon-twitter-circle"></i>
</span>
</div>
{% endfor %}
<div class="socialpreview__comment">
{{ form_widget(form.twitterNote, {
attr: {
placeholder: 'Add comment',
class: 'clearstyle',
},
}) }}
</div>
<div class="socialpreview__view">
{% if message.media|length > 0 %}
<img class="img-fluid d-block mx-auto" src="{{- (message.media.feature|decorate_media)._urls.medium -}}" width="594" height="417" alt="Twitter Preview" />
{% endif %}
<div class="socialpreview__meta">
<span class="socialpreview__url">www.schoolnow.com</span>
<span class="socialpreview__title">{{ message.title }}</span>
<span class="socialpreview__desc text-truncate">{{ message.description|striptags }}</span>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isInstagramAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.instagram,
locked: ( (not isInstagramAllowed) or (not message.media|length) ),
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/instagram-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Instagram',
details:
(message.instagramSocialAccounts)
?
message.instagramSocialAccounts|map(
account => account.name
)|join(', ')
:
null,
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
{% for social in message.instagramSocialAccounts %}
<div class="socialpreview__head">
<span class="socialpreview__head--pic">
<img src="{{- path('app.notifications.dashboard.default.social_avatar', {
account: social.id,
}) -}}" width="48" height="47" />
</span>
<span class="socialpreview__head--title">@{{ social.name }}</span>
<span class="socialpreview__head--icon socialpreview__head--fb">
<i class="fab fa-instagram"></i>
</span>
</div>
{% endfor %}
<div class="socialpreview__view">
{% if message.media|length > 0 %}
<img class="img-fluid d-block mx-auto" src="{{- (message.media.feature|decorate_media)._urls.medium -}}" width="594" height="417" alt="Instagram Preview" />
{% endif %}
<div class="socialpreview__meta">
<span class="socialpreview__url">www.schoolnow.com</span>
<span class="socialpreview__title">{{ message.title }}</span>
<span class="socialpreview__desc text-truncate"></span>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% if isEmailAllowed or isVoiceAllowed or isSmsAllowed or isAppAllowed %}
{% include '@ui2022/schoolnow/review__row--title.html.twig' with {
text: 'Send to',
} %}
{% endif %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isEmailAllowed,
disabled: (not message.isUrgent),
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.email,
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/email-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Email',
details: (message.emailName and message.emailFrom) ? ('From: ' ~ message.emailName ~ ' <' ~ message.emailFrom ~ '>'),
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
<div>
<h6>Subject:</h6>
<p>{{ message.emailSubject }}</p>
</div>
<div class="pt-3 mb-4">
<h6>Email:</h6>
<div class="email__box border pt-2">
<iframe
id="{{ form.channels.email.vars.id }}__preview"
scrolling="no"
style="width: 100%; border: 0;"
src="{{-
path('app.notifications.dashboard.messages.email_preview', {
message: message.id,
})
-}}">
</iframe>
<script type="text/javascript">
(function (window, document, $, undefined) {
$(function () {
var $frame = $('#{{ form.channels.email.vars.id }}__preview');
$frame.closest('.blocklist__panel').on('show.bs.collapse', function (e) {
setTimeout(function () {
$frame.height($($frame[0].contentWindow.document).height());
}, 1);
});
});
})(window, document, jQuery);
</script>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isVoiceAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.voice,
locked: (not isVoiceAllowed or not message.isUrgent or not message.recording),
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/voice-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Voice',
details: 'From: %s %s'|format(
configs.twilio
? configs.twilio.incomingPhoneNumber|phone_number_format
: '?',
(message.voiceCallerId) ? 'Caller ID: %s'|format(message.voiceCallerId.phoneNumber|phone_number_format) : null
)|trim,
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
{% if message.recording and message.recording.recorded %}
<audio id="{{ form.channels.voice.vars.id }}__playback" controls class="w-100">
<source src="{{ blobs(message.recording).recordingUrl(message.recording)|escape('html_attr') }}"></source>
</audio>
<script type="text/javascript">
(function (window, document, $, undefined) {
$(function () {
var $panel = $('#{{ form.channels.voice.vars.id }}__blocklist__panel'),
$playback = $('#{{ form.channels.voice.vars.id }}__playback');
$panel.on('hide.bs.collapse', function (e) {
$playback[0].pause();
$playback[0].currentTime = 0;
});
});
})(window, document, jQuery);
</script>
{% if message.recording.methodName is same as('speech') %}
<blockqoute></blockqoute>
<div class="sms__thread">
<div class="row flex-nowrap row--10 sms__row">
<div class="col">
<div class="sms__msg">
<p>{{ message.recording.speechText }}</p>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isSmsAllowed,
disabled: (not message.isUrgent),
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.sms,
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/text-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'SMS',
details: 'From: %s'|format(
configs.twilio
? configs.twilio.incomingPhoneNumber|phone_number_format
: '?'
),
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
<div class="sms__thread">
<div class="row flex-nowrap row--10 sms__row">
<div class="col-auto">
<div class="sms__avatar">
<img class="sms__avatar--img" src="/ui2022/images/send-message-avatar.svg" width="30" height="34" alt="" />
</div>
</div>
<div class="col">
<div class="sms__msg">
<p>{{ message.smsContent }} <a href="#">https://cmps.st/{{ token(8) }}</a></p>
</div>
</div>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/schoolnow/review__row.html.twig' with {
active: true,
show: isAppAllowed,
} %}
{% block content %}
{% include '@ui2022/schoolnow/review__cell--checkmark.html.twig' with {
form: form.channels.app,
} %}
{% include '@ui2022/schoolnow/review__cell--svg.html.twig' with {
src: asset('/ui2022/images/mobile-app-active.svg'),
} %}
{% include '@ui2022/schoolnow/review__cell--title.html.twig' with {
title: 'Mobile App',
details: '',
} %}
{% embed '@ui2022/schoolnow/review__cell--collapse.html.twig' %}
{% block content %}
<div class="sms__thread">
<div class="row flex-nowrap row--10 sms__row">
<div class="col-auto">
<div class="sms__avatar">
<img class="sms__avatar--img" src="/ui2022/images/send-message-avatar.svg" width="30" height="34" alt="" />
</div>
</div>
<div class="col">
<div class="sms__msg">
<p>{{ message.appBody }}</p>
</div>
</div>
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
</div>
{% if form.translations.translations is empty %}
<div class="d-none">
{{ form_label(form.translations) }}
{{ form_widget(form.translations) }}
</div>
{% else %}
{% for translationForm in form.translations.translations %}
{% set locale = translationForm.vars.value.locale %}
{% set humanReadableLocale = humanReadableLocales[locale] is defined ? humanReadableLocales[locale] : locale %}
{% embed '@ui2022/schoolnow/modal--sidepanel.html.twig' with {
attr: {
id: ('translation-sidepanel-' ~ locale),
class: 'translation-sidepanel',
'data-locale': locale,
},
} %}
{% block header %}
<div class="sidepanel__head-left">
<h2 class="text-an-demibold">{{ humanReadableLocale }}</h2>
</div>
<div class="sidepanel__head--right">
{% include '@ui2022/button--button.html.twig' with {
text: 'Hide',
styles: 'lighter',
attr: {
'data-dismiss': 'sidepanel',
},
} %}
</div>
{% endblock %}
{% block content %}
<div class="mb-3">
{{ form_label(translationForm.title) }}
{{ form_widget(translationForm.title) }}
</div>
<div class="mb-3 text-black">
{{ form_label(translationForm.description) }}
{{ form_widget(translationForm.description) }}
</div>
<div class="{% if not isVoiceAllowed %}d-none{% endif %}">
{% if translationForm.script is defined and translationForm.recording is defined %}
<div class="mb-3">
{{ form_label(translationForm.script) }}
{{ form_widget(translationForm.script) }}
</div>
<div class="mb-3">
{{ form_label(translationForm.recording) }}
{{ form_widget(translationForm.recording, {
row_attr: {
class: 'pt-0 mb-5',
},
}) }}
<script type="text/javascript">
(function (window, document, $, undefined) {
$(function () {
{% if translationForm.script is defined and translationForm.recording is defined %}
$('#{{ translationForm.script.vars.id }}').on('input', function (e) {
let $target = $(e.currentTarget),
react = $('#{{ translationForm.recording.vars.id }}').data('react');
react.api.setSpeech($target.val());
});
$('#{{ translationForm.script.vars.id }}').trigger('input');
{% endif %}
});
})(window, document, jQuery);
</script>
</div>
{% endif %}
</div>
{{ form_rest(translationForm) }}
{% endblock %}
{% endembed %}
{% endfor %}
{% endif %}
{{ form_rest(form) }}
{{ form_end(form) }}
<script type="text/javascript">
(function (window, document, $, undefined) {
$(function () {
$('#edit-message').on('click', function (e) {
e.preventDefault();
const form = $(this).closest('form');
const redirectUrl = $(this).data('url');
form.attr('action', redirectUrl);
form.submit();
});
{% if app.request.get('saved') == 1 %}
toastr.options = {
positionClass: "toast-top-left mt-5 pt-4",
fadeIn: 1000,
timeOut: 3000,
fadeOut: 1000,
};
toastr.success('Saved');
{% endif %}
var initialState = $('#{{ form.vars.id }}').serialize();
$('#btn__exit').on('click', function (e) {
var $this = $(this),
$modal = $('#modal__exit'),
currentState = $('#{{ form.vars.id }}').serialize();
if (currentState !== initialState) {
$modal.modal();
return false;
}
});
$('.translation_voice_player').click(function (event) {
event.preventDefault();
const locale = $(this).data('locale');
$('#translation_voice_' + locale + '__container').addClass('d-none');
$('#translation_voice_recorder_' + locale).removeClass('d-none');
});
$('.translation-sidepanel').on('do-show.cs.sidepanel', function (e) {
toastr.clear();
})
$('.translation-sidepanel').on('do-hide.cs.sidepanel', function (e) {
toastr.clear();
const speechRadioButtons = $(this).find('.systab__btn[value="speech"]');
if (speechRadioButtons.length !== 1) {
return;
}
const isModeTextToSpeech = speechRadioButtons.first().is(":checked");
const textToSpeechButtons = $(this).find('.btn-text-to-speech');
if (textToSpeechButtons.length !== 1) {
return;
}
const textToSpeechButton = textToSpeechButtons.first();
const hasPendingTextChanges = ( (textToSpeechButton) && (!textToSpeechButtons.first().is(":disabled")) );
if (isModeTextToSpeech && hasPendingTextChanges) {
toastr.options = {
positionClass: "toast-top-left mt-5 pt-4",
timeOut: 0,
tapToDismiss: true,
fadeOut: 0,
};
const recordingError =
'<h5 class="text-white">Voice transcript has changed</h5>' +
'<p>Click <i>"Convert text to speech"</i></p>';
toastr.error(recordingError);
textToSpeechButton.on('click', function () {
toastr.clear();
});
return false;
}
})
$('.translation-sidepanel').on('hidden.cs.sidepanel', function (e) {
toastr.clear();
const locale = $(this).data('locale');
const audioPlayers = $(this).find('audio');
for (let i = 0; i < audioPlayers.length; i++) {
audioPlayers[i].pause();
audioPlayers[i].currentTime = 0;
}
const form = $('#message_channels_form').first();
const url = '/_dashboard/notifications/messages/' + {{ message.id }} + '/' + locale + '/is_translation_modified';
$.ajax({
type: "POST",
url: url,
data: form.serialize(),
success: function(data)
{
const localeTagElement = $('.lang_pill[data-locale='+locale+']').first();
if (data.isModifiedOverall === true) {
localeTagElement.addClass('active');
} else {
localeTagElement.removeClass('active');
}
if (data.isScriptModified === true && data.isRecordingModified !== true) {
toastr.options = {
positionClass: "toast-top-left mt-5 pt-4",
timeOut: 0,
tapToDismiss: true,
fadeOut: 0,
};
const recordingWarning =
'<h5 class="text-white">Forgot recording?</h5>' +
'<p>Voice transcript changed,<br />but recording not updated.</p>' +
'<p>' +
'<button type="button" class="btn btn-sm btn-light mr-3 flash-edit-translation">Edit translation</button>' +
'<button type="button" class="btn btn-sm btn-light flash-hide">Hide</button>' +
'</p>';
toastr.warning(recordingWarning);
$('.flash-edit-translation').off('click').on('click', function () {
toastr.clear();
localeTagElement.click();
})
$('.flash-hide').off('click').on('click', function () {
toastr.clear();
})
}
}
})
});
$('#{{ form.branding.vars.id }}').on('change', function (e) {
const url = '{{- path('app.notifications.dashboard.messages.email_preview', {message: message.id}) -}}' + ($(this).val() ? '/' + $(this).val() : '');
$('#{{ form.channels.email.vars.id }}__preview').attr('src', url);
});
$('#{{ form.branding.vars.id }}').trigger('change');
});
})(window, document, jQuery);
</script>
{% endblock %}
{% block modals %}
{{ parent() }}
{% include '@ui2022/modal.html.twig' with {
attr: {
id: 'modal__test',
class: 'modal-ajax',
},
dialog_styles: 'dialog--createmsg dialog--testmsg dialog--scrollable',
} %}
{% embed '@ui2022/modal.html.twig' with {
attr: {
id: 'modal__exit',
},
} %}
{% block content %}
{% embed '@ui2022/modal__content.html.twig' with {
styles: 'bg-danger',
} %}
{% block body %}
<div class="crmsg__dialogs">
<img class="crmsg__icon" src="/ui2022/images/icon-createmsg-exit.svg" width="77.48" height="71.37" />
<h2 class="crmsg__title">
You have unsaved changes
</h2>
<p class="crmsg__desc font-18">
Would you like to save changes or exit?
</p>
<div class="crmsg__btngroup">
{% include '@ui2022/button--a.html.twig' with {
text: 'Just Exit',
link: path('app.notifications.dashboard.messages.main'),
styles: 'danger',
attr: {
class: 'mr-4',
},
} %}
{% include '@ui2022/button--form.html.twig' with {
type: 'submit',
text: 'Save & Exit',
styles: 'white',
form: {
name: form.action.vars.full_name,
value: 'save',
form: form.vars.id,
formaction: path('app.notifications.dashboard.messages.manage', {
message: message.id,
saved: false,
jump: path('app.notifications.dashboard.messages.main'),
}),
},
} %}
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% embed '@ui2022/modal.html.twig' with {
attr: {
id: 'modal__send',
},
} %}
{% block content %}
{% embed '@ui2022/modal__content.html.twig' with {
styles: 'bg-orange',
} %}
{% block body %}
<div class="crmsg__dialogs">
<img class="crmsg__icon" src="/ui2022/images/icon-send-msg.svg" width="85" height="85" />
<h2 class="crmsg__title">
Confirm you are ready to send!
</h2>
<p class="crmsg__desc font-18">
Please confirm you would like to proceed.
</p>
<div class="crmsg__btngroup">
{% include '@ui2022/button--form.html.twig' with {
type: 'submit',
text: 'Send now',
styles: 'orange',
form: {
name: form.action.vars.full_name,
value: 'send',
form: form.vars.id,
},
} %}
</div>
</div>
{% endblock %}
{% endembed %}
{% endblock %}
{% endembed %}
{% endblock %}