[%# manage/emailpost.tt 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'. %] [%- sections.title = '.title' | ml -%] [%- CALL dw.active_resource_group( "foundation" ) -%] [%- sections.head = BLOCK %] [%- END -%]

[% '.intro' | ml({aopts => "href='${site.root}/manage/emailpost?mode=help'"}) %]

[%- INCLUDE components/errors.tt errors = errors -%]

[% '.addresses.header' | ml %]

[% '.addresses.text' | ml %]

[% dw.form_auth %] [%- address = addrlist.keys.sort; # Limited to addr_max number of addresses. FOREACH idx IN [ 0 .. addr_max ]; a_name = "addresses_$idx" -%] [% END %]
[% '.addresses.table.address' | ml %] [% 'setting.emailposting.option.senderrors' | ml %] [% 'setting.emailposting.option.helpmessage' | ml %]
[% form.textbox( name = a_name, size = 40, maxlength = 80, value = formdata.$a_name || address.$idx ) %] [% selected = addrlist.${address.$idx}.get_errors ? 1 : 0; c_sel = "check_$idx"; form.checkbox( name = c_sel, selected => formdata.$c_sel || selected ) %] [% h_sel = "help_$idx"; form.checkbox( name = h_sel, selected => formdata.$h_sel || 0 ) %]

[% '.pin.header' | ml %]

[% '.pin.text' | ml({num => 4}) %]

[% form.textbox( name = 'pin', size = 10, maxlength = 20, value = formdata.pin || u.emailpost_pin, type = 'password', autocomplete='new-password', class = 'inline') %]

[% '.settings.header' | ml %]

[% '.settings.text' | ml({aopts => "href='${site.root}/manage/emailpost?mode=help'"}) %]

[% '.settings.entry.header' | ml %]

[%- icons = u.icon_keyword_menu; IF icons.size > 0; form.select( id = 'emailpost_userpic', name = 'emailpost_userpic', items = icons, selected = u.emailpost_userpic ); ELSE; '.settings.entry.userpic.select.none' | ml; END -%]
[%- groups = [ 'default', dw.ml('.settings.entry.security.select.default'), 'public', dw.ml('.settings.entry.security.select.public'), 'private', dw.ml('.settings.entry.security.select.private'), 'friends', dw.ml('.settings.entry.security.select.access') ]; IF u.trust_groups.size && u.trust_groups.size > 0; groups.push('--------'); groups.push('--------'); END; FOREACH grp IN u.trust_groups; groups.push(grp.groupname); groups.push(grp.groupname); END; form.select( id = 'emailpost_security', name = 'emailpost_security', items = groups, selected = u.emailpost_security ) -%]
[%- opts = [ 'default', dw.ml('.settings.entry.comments.select.default'), 'noemail', dw.ml('.settings.entry.comments.select.noemail'), 'off', dw.ml('.settings.entry.comments.select.off') ]; form.select( id = 'emailpost_comments', name = 'emailpost_comments', items = opts, selected = u.emailpost_comments ) -%]
[% form.submit( name = 'save', value = dw.ml('.button.save'), raw = 'action=save' ) %]