Merge branch '5.3'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / notificationSettings.tpl
CommitLineData
3e93caf9 1{capture assign='pageTitle'}{lang}wcf.user.menu.settings{/lang}: {lang}wcf.user.notification.notifications{/lang} - {lang}wcf.user.menu.settings{/lang}{/capture}
320f4a6d 2
3e93caf9 3{capture assign='contentTitle'}{lang}wcf.user.menu.settings{/lang}: {lang}wcf.user.notification.notifications{/lang}{/capture}
320f4a6d 4
320f4a6d
MW
5{include file='userMenuSidebar'}
6
524f0f91 7{include file='header' __disableAds=true __sidebarLeftHasMenu=true}
320f4a6d 8
ee629b22 9{include file='formError'}
320f4a6d
MW
10
11{if $success|isset}
fc7cf040 12 <p class="success" role="status">{lang}wcf.global.success.edit{/lang}</p>
320f4a6d
MW
13{/if}
14
6030ad27 15<form method="post" action="{link controller='NotificationSettings'}{/link}" id="notificationSettings">
6da35219
AE
16 <div class="section">
17 {foreach from=$events key='eventCategory' item='eventList'}
18 <div class="notificationSettings">
19 <div class="notificationSettingsCategory">
20 <div class="notificationSettingsEvent">{lang}wcf.user.notification.{$eventCategory}{/lang}</div>
b2bd88ee
AE
21 <div class="notificationSettingsState">{lang}wcf.user.notification.status.active{/lang}</div>
22 <div class="notificationSettingsEmail">{lang}wcf.user.notification.status.email{/lang}</div>
6da35219 23 </div>
6030ad27 24 {foreach from=$eventList item=event}
6da35219
AE
25 <div class="notificationSettingsItem">
26 <div class="notificationSettingsEvent">
27 <label for="settings_{@$event->eventID}">{lang}wcf.user.notification.{$event->objectType}.{$event->eventName}{/lang}</label>
28 </div>
29 <div class="notificationSettingsState">
30 <label>
8a723bf2 31 <input type="checkbox" id="settings_{@$event->eventID}" name="settings[{@$event->eventID}][enabled]" class="jsCheckboxNotificationSettingsState" value="1" data-object-id="{@$event->eventID}"{if !$settings[$event->eventID][enabled]|empty} checked{/if}>
6da35219
AE
32 <span class="icon icon24 fa-bell green pointer"></span>
33 <span class="icon icon24 fa-bell-slash red pointer"></span>
34 </label>
35 </div>
36 <div class="notificationSettingsEmail">
6030ad27 37 {if $event->supportsEmailNotification()}
6da35219 38 <input type="hidden" id="settings_{$event->eventID}_mailNotificationType" name="settings[{@$event->eventID}][mailNotificationType]" value="{$settings[$event->eventID][mailNotificationType]}">
8a723bf2 39 <a href="#" class="notificationSettingsEmailType jsTooltip{if $settings[$event->eventID][enabled]|empty} disabled{/if}" role="button" title="{lang}wcf.user.notification.mailNotificationType.{@$settings[$event->eventID][mailNotificationType]}{/lang}" data-object-id="{@$event->eventID}">
6da35219
AE
40 {if $settings[$event->eventID][mailNotificationType] === 'none'}
41 <span class="icon icon24 fa-times red jsIconNotificationSettingsEmailType"></span>
42 {else}
43 <span class="icon icon24 {if $settings[$event->eventID][mailNotificationType] === 'instant'}fa-flash{else}fa-clock-o{/if} green jsIconNotificationSettingsEmailType"></span>
44 {/if}
45 <span class="icon icon16 fa-caret-down"></span>
46 </a>
6030ad27 47 {/if}
6da35219
AE
48 </div>
49 </div>
6030ad27 50 {/foreach}
6da35219
AE
51 </div>
52 {/foreach}
53 </div>
6030ad27
MW
54
55 {event name='sections'}
56
320f4a6d
MW
57
58 <div class="formSubmit">
e5f9b56c 59 <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
bb3d4ee5 60 {csrfToken}
320f4a6d
MW
61 </div>
62</form>
63
3e93caf9 64<script data-relocate="true">
58d7e8f8 65 require(['Language', 'WoltLabSuite/Core/Controller/User/Notification/Settings'], function(Language, ControllerUserNotificationSettings) {
3e93caf9 66 Language.addObject({
e2e8c155
MW
67 'wcf.user.notification.mailNotificationType.daily': '{jslang}wcf.user.notification.mailNotificationType.daily{/jslang}',
68 'wcf.user.notification.mailNotificationType.instant': '{jslang}wcf.user.notification.mailNotificationType.instant{/jslang}',
69 'wcf.user.notification.mailNotificationType.none': '{jslang}wcf.user.notification.mailNotificationType.none{/jslang}'
3e93caf9
MW
70 });
71
6da35219 72 ControllerUserNotificationSettings.init();
3e93caf9
MW
73 });
74</script>
320f4a6d 75
3e93caf9 76{include file='footer'}