[%# HTML fragment for the notification subscription interface # converted from LJ::subscribe_interface in LJ/Web.pm Authors: Jen Griffin Copyright (c) 2023 by Dreamwidth Studios, LLC. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. For a copy of the license, please reference 'perldoc perlartistic' or 'perldoc perlgpl'. -%] [% dw.need_res( 'stc/esn.css', 'js/6alib/core.js', 'js/6alib/dom.js', 'js/6alib/checkallbutton.js', 'js/esn.js' ) %] [% form.hidden( name = 'ntypeids', id = 'ntypeids', value = ntypeids ) %] [% form.hidden( name = 'catids', id = 'catids', value = catids ) %] [%- ui_notify = ".notify_me" | ml( sitenameabbrev = site.nameabbrev ) -%] [%- table_style = settings_page ? 'style="clear: none;"' : '' -%] [% FOREACH cat IN catdata %]
[%- first_class = cat.catid == 0 ? " CategoryRowFirst" : "" -%] [%- cat_title = ".category.${cat.title_key}" | ml -%]
[% FOREACH cat.notify_headers %] [% END %] [% FOREACH sub IN cat.pending_subs %] [%- sub_classes = [ sub.inactive_class, sub.disabled_class, sub.altrow_class ] -%] [% IF sub.special_sub %] [% FOREACH class IN notify_classes %] [% END %] [% ELSIF sub.do_show %] [% IF sub.subscribed %] [% form.hidden( name = "${sub.input_name}-old", value = 1 ) %] [% END %] [% FOREACH opt IN sub.notif_options %] [% UNLESS opt.note_pending %] [% form.hidden( 'data-selected-by' => "${cat.catid}-${opt.ntypeid}", 'name' => "${opt.notify_input_name}-old", 'value' => opt.has_subs ) %] [% END %] [% END %] [% END %] [% END %] [%- cols = 2 + notify_classes.size -%] [% IF cat.empty_blurb; track_img = dw.img( 'track', '', { align => 'absmiddle', alt => ui_notify } ) %] [% END %] [% IF cat.special_subs %] [% END %] [% IF cat.show_upgrade_note %] [% END %] [% END %]
[% cat_title %]
[% ui_notify %]
[% '.notify_me.by' | ml %] [% form.checkbox( 'label' => title, 'class' => "CheckAll", 'disabled' => disabled, 'id' => "CheckAll-${cat.catid}-$ntypeid", 'noescape' => 1, 'data-select-all' => "${cat.catid}-$ntypeid", 'selected' => 0 ) %]
*[% sub.upgrade_notice %]   [% IF class != "LJ::NotificationMethod::Email" %] [% form.checkbox( disabled = 1, selected = 0 ) %] [% END %] [% IF sub.subid %] [%- deletesub_url = settings_page ? "${site.root}/manage/settings/?cat=notifications&" : "?"; deletesub_url = deletesub_url _ "deletesub_${sub.subid}=1" -%] [% dw.img( 'btn_trash', '' ) %] [% END %] [% form.checkbox( name = sub.input_name, id = sub.input_name, label = sub.title, selected = sub.selected, disabled = sub.disabled, class = "SubscriptionInboxCheck", noescape = 1 ) %]   [% form.checkbox( 'name' => opt.notify_input_name, 'id' => opt.notify_input_name, 'selected' => opt.note_selected, 'disabled' => opt.disabled, 'class' => "SubscribeCheckbox-${cat.catid}-${opt.ntypeid}", 'data-selected-by' => "${cat.catid}-${opt.ntypeid}", 'noescape' => 1 ) %]

[% '.nosubs.title' | ml %]
[% '.nosubs.text' | ml( img = track_img ) %]

* [% '.special_subs.note' | ml( sitenameabbrev = site.nameabbrev ) %]
† [% '.unavailable_subs.note' | ml %]
[% IF settings_page %] [% pagination %]
[% '.subs.total' | ml( subscription_stats ) %]
[% END %]