mourningdove/views/manage/emailpost.tt

130 lines
4.6 KiB
Text
Raw Normal View History

2026-05-24 01:03:05 +00:00
[%# manage/emailpost.tt
Authors:
Jen Griffin <kareila@livejournal.com>
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 %]
<style type="text/css">
div.indent {
padding-left: 2rem;
margin-bottom: 1.25rem;
}
td.center {
text-align: center;
}
.settings td {
padding: 3px;
}
</style>
[%- END -%]
<p>[% '.intro' | ml({aopts => "href='${site.root}/manage/emailpost?mode=help'"}) %]</p>
[%- INCLUDE components/errors.tt errors = errors -%]
<h2>[% '.addresses.header' | ml %]</h2>
<p>[% '.addresses.text' | ml %]</p>
<form method='post' action='emailpost'>
[% dw.form_auth %]
<table border="0">
<thead><tr>
<th>[% '.addresses.table.address' | ml %]</th>
<th>[% 'setting.emailposting.option.senderrors' | ml %]</th>
<th>[% 'setting.emailposting.option.helpmessage' | ml %]</th>
</tr></thead>
[%- address = addrlist.keys.sort;
# Limited to addr_max number of addresses.
FOREACH idx IN [ 0 .. addr_max ]; a_name = "addresses_$idx" -%]
<tr><td>
[% form.textbox( name = a_name, size = 40, maxlength = 80,
value = formdata.$a_name || address.$idx ) %]
</td><td class='center'>
[% selected = addrlist.${address.$idx}.get_errors ? 1 : 0;
c_sel = "check_$idx";
form.checkbox( name = c_sel, selected => formdata.$c_sel || selected ) %]
</td><td class='center'>
[% h_sel = "help_$idx";
form.checkbox( name = h_sel, selected => formdata.$h_sel || 0 ) %]
</td></tr>
[% END %]
</table>
<h2>[% '.pin.header' | ml %]</h2>
<p>[% '.pin.text' | ml({num => 4}) %]</p>
<div class='indent'>
[% form.textbox( name = 'pin', size = 10, maxlength = 20,
value = formdata.pin || u.emailpost_pin,
type = 'password', autocomplete='new-password', class = 'inline') %]
</div>
<h2>[% '.settings.header' | ml %]</h2>
<p>[% '.settings.text' | ml({aopts => "href='${site.root}/manage/emailpost?mode=help'"}) %]</p>
<div class="row">
<div class='indent columns large-6 end'>
<h3>[% '.settings.entry.header' | ml %]</h3>
<div class="row">
<div class="columns medium-3 medium-right">
<label for="emailpost_userpic">[% '.settings.entry.userpic' | ml %]</label>
</div>
<div class="columns medium-9">
[%- 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 -%]
</div>
</div>
<div class="row">
<div class="columns medium-3 medium-right">
<label for="emailpost_security">[% '.settings.entry.security' | ml %]</label>
</div>
<div class="columns medium-9">
[%- 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 ) -%]
</div>
</div>
<div class="row">
<div class="columns medium-3 medium-right">
<label for="emailpost_comments">[% '.settings.entry.comments' | ml %]</label>
</div>
<div class="columns medium-9">
[%- 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 ) -%]
</div>
</div>
</div>
</div>
[% form.submit( name = 'save', value = dw.ml('.button.save'), raw = 'action=save' ) %]
</form>