[%# HTML for the talkform / "slow reply" component shown on journal ReplyPages Authors: Nick Fagerlund Copyright (c) 2019 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'. -%] [%- IF foundation_beta -%][%# use new quickreply-style talkform -%]
[%- dw.form_auth -%] [%- hidden_form_elements -%] [%- IF errors -%]
    [% FOREACH error IN errors -%]
  • [% error %]
  • [%- END %]

[%- END -%] [%- create_link -%] [%# "From" fields %]
[%- IF comment.editid -%]
[%- IF remote_opts.banned -%] [%- IF journal.is_community -%] [%- '.opt.bannedfrom.comm' | ml -%] [%- ELSE -%] [%- '.opt.bannedfrom' | ml -%] [%- END -%] [%- ELSE -%] [%- dw.img( 'id_user', '' ) -%] [%- IF remote_opts.screened %] [%- '.opt.willscreen' | ml -%] [%- END -%] [%- form.hidden( name = 'usertype', value = 'cookieuser' ) -%] [%- form.hidden( name = 'cookieuser' id = 'cookieuser' value = remote.user ) -%] [%- END -%]
[%- ELSE -%][%# New comment, not editing. -%] [%# Anonymous: -%]
[%- IF public_entry AND journal.allows_anon -%] [%- IF journal.screens_anon %] [% '.opt.willscreen' | ml %] [%- END -%] [%- ELSE -%] [%- IF ! public_entry %] [% '.opt.noanonpost.nonpublic' | ml -%] [%- ELSIF ! journal.allows_non_access -%] [% ( journal.is_community ? '.opt.membersonly' : '.opt.friendsonly' ) | ml( username => "$journal.user" ) %] [%- ELSE -%] [% '.opt.noanonpost' | ml -%] [%- END -%] [%- END -%]
[%- IF remote.openid_identity AND default_usertype != 'openid' -%] [%# ...then we're legit logged in as an OpenID user, not just holding a temp $remote on a partial form submission (captcha, error, etc.) -%]
[%- IF remote_opts.allowed -%] [%- IF remote_opts.screened %] [% '.opt.willscreen' | ml -%][%- END -%] [%- ELSE -%] [%- IF remote_opts.banned -%][%# p. cut and dried -%] [%- journal.is_community ? '.opt.bannedfrom.comm' : '.opt.bannedfrom' | ml( journal => journal.user ) -%] [%- ELSIF journal.allows_non_access -%][%# your email's not validated. -%] [%- '.opt.noopenidpost' | ml( aopts1 => "href='${site.root}/changeemail'" aopts2 => "href='${site.root}/register'" ) -%] [%- ELSE -%][%# you're not on the access list -%] [%- journal.is_community ? '/talkpost_do.tt.error.notamember' : '/talkpost_do.tt.error.notafriend' | ml( user => journal.user ) -%] [%- END -%] [%- END -%]
[%- ELSE -%][%# not logged in as openid user -%]
[% help_icon( 'openid' ) %] [%- IF journal.screens_all -%] [%- '.opt.willscreen' | ml -%] [%- ELSIF journal.screens_non_access -%] [%- '.opt.willscreenfriend' | ml -%] [%- ELSIF journal.screens_anon -%] [%- '.opt.willscreenopenid' | ml -%] [%- END -%]
[%- END -%] [%# logged-in site user -%] [%- IF remote && ! remote.openid_identity -%]
[%- IF remote_opts.allowed -%] [%- IF remote_opts.screened -%] [%- '.opt.willscreen' | ml -%][%- END -%] [%- ELSE -%] [%- IF remote_opts.banned -%] [%- journal.is_community ? '.opt.bannedfrom.comm' : '.opt.bannedfrom' | ml( journal => journal.user ) -%] [%- ELSE -%][%# you're not on the access list -%] [%- journal.is_community ? '/talkpost_do.tt.error.notamember' : '/talkpost_do.tt.error.notafriend' | ml( user => journal.user ) -%] [%- END -%] [%- END -%] [%- UNLESS remote_opts.banned -%] [%- END -%]
[%- END -%] [%# not-logged-in site user -%]
[%- IF journal.screens_all -%] [%- '.opt.willscreen' | ml -%] [%- ELSIF journal.screens_non_access -%] [%- '.opt.willscreenfriend' | ml -%] [%- END -%]
[%# site user login form, always present but sometimes hidden -%] [%- IF ! create_link && ! remote -%] [%- '.noaccount' | ml( aopts => "href='${site.root}/create'") -%] [%- END -%] [%- END -%][%# figuring out whether it's an edit or new reply. -%]
[%- current_icon = comment.current_icon; current_icon_kw = comment.current_icon_kw; focus_after_browse = "#body" -%] [% INCLUDE "components/icon-select-icon.tt" IF remote %] [% INCLUDE "components/icon-select-dropdown.tt" IF remote %]
[%# Subject, subjecticon, quote button %]
[%- form.textbox( label = dw.ml( '.opt.subject2' ) labelclass = 'invisible' size = 50 maxlength = 100 name = 'subject' id = 'subject' placeholder = dw.ml( '.opt.subject2' ) value = comment.subject ) -%] [%- form.hidden( id = 'subjectIconField' name = 'subjecticon' value = comment.subjecticon ) -%] [%# The current subjecticon, as the button to open the menu. %] [%- print_subjecticon_by_id( comment.subjecticon, "id='subjectIconImage' role='button' class='js-only' style='display: none;' title='Click to change the subject icon'" ) -%]
[%- '.nosubjecthtml' | ml -%]
[%# Markup controls %]
[%- form.select( label = 'Formatting type' labelclass = 'invisible' name = 'prop_editor' id = 'prop_editor' selected = editors.selected items = editors.items ) -%] [%- dw.img('help', '', { alt => dw.ml('markup.helplink.alttext'), title => dw.ml('markup.helplink.alttext'), style => 'vertical-align: middle;' } ) -%]
[%# Message body text %]
[%- form.textarea( label = dw.ml( '.opt.message2' ) labelclass = 'invisible' rows = 10 cols = 80 wrap = 'soft' name = 'body' id = 'body' value = comment.body ) -%]
[%# Misc checkboxes, captcha, edit reason - after body, before post buttons %]
[%- IF remote_opts.can_unscreen_parent -%]
[%- form.checkbox( label = dw.ml('.opt.unscreenparent') name = 'unscreen_parent' id = 'unscreen_parent' value = 1 selected = 0 ) -%] [%- END -%] [%- IF captcha -%]
[%- captcha.html -%] [%- form.hidden( name = 'captcha_type' value = captcha.type ) -%] [%- END -%] [%- IF comment.editid -%]
[%- form.textbox( label = dw.ml('.opt.editreason') name = 'editreason' id = 'editreason' value = comment.editreason size = 75 maxlength = 255 ) -%]
[% '.noedithtml' | ml %]
[%- END -%]
[%# post button controls and info notices. %]
[%- ELSE -%][%# not in S2 foundation beta, use old table-based talkform -%]
[%- dw.form_auth -%] [%- hidden_form_elements -%] [%- IF errors -%]
[%- END -%] [%- create_link -%] [%# First row: "From" fields %] [%# Second row: Subject and metadata fields %] [%# Third row: Message body text %] [%# Fourth row: Edit reason field (optional) %] [%- IF comment.editid -%] [%- END -%] [%# Final row: post button controls and info notices. (Previously subsumed into either row three or four.) %]
[%- '.opt.from' | ml %] [%- IF comment.editid -%]
[%- IF remote_opts.banned -%] [%- IF journal.is_community -%] [%- '.opt.bannedfrom.comm' | ml -%] [%- ELSE -%] [%- '.opt.bannedfrom' | ml -%] [%- END -%] [%- ELSE -%] [%- dw.img( 'id_user', '' ) -%] [%- IF remote_opts.screened %] [%- '.opt.willscreen' | ml -%] [%- END -%] [%- form.hidden( name = 'usertype', value = 'cookieuser' ) -%] [%- form.hidden( name = 'cookieuser' id = 'cookieuser' value = remote.user ) -%] [%- END -%]
[%- ELSE -%][%# New comment, not editing. -%] [%# Anonymous: -%]
[%- IF public_entry AND journal.allows_anon -%] [%- IF journal.screens_anon %] [% '.opt.willscreen' | ml %] [%- END -%] [%- ELSE -%] [%- IF ! public_entry %] [% '.opt.noanonpost.nonpublic' | ml -%] [%- ELSIF ! journal.allows_non_access -%] [% ( journal.is_community ? '.opt.membersonly' : '.opt.friendsonly' ) | ml( username => "$journal.user" ) %] [%- ELSE -%] [% '.opt.noanonpost' | ml -%] [%- END -%] [%- END -%]
[%- IF remote.openid_identity AND default_usertype != 'openid' -%] [%# ...then we're legit logged in as an OpenID user, not just holding a temp $remote on a partial form submission (captcha, error, etc.) -%]
[%- IF remote_opts.allowed -%] [%- IF remote_opts.screened %] [% '.opt.willscreen' | ml -%][%- END -%] [%- ELSE -%] [%- IF remote_opts.banned -%][%# p. cut and dried -%] [%- journal.is_community ? '.opt.bannedfrom.comm' : '.opt.bannedfrom' | ml( journal => journal.user ) -%] [%- ELSIF journal.allows_non_access -%][%# your email's not validated. -%] [%- '.opt.noopenidpost' | ml( aopts1 => "href='${site.root}/changeemail'" aopts2 => "href='${site.root}/register'" ) -%] [%- ELSE -%][%# you're not on the access list -%] [%- journal.is_community ? '/talkpost_do.tt.error.notamember' : '/talkpost_do.tt.error.notafriend' | ml( user => journal.user ) -%] [%- END -%] [%- END -%]
[%- ELSE -%][%# not logged in as openid user -%]
[% help_icon( 'openid' ) %] [%- IF journal.screens_all -%] [%- '.opt.willscreen' | ml -%] [%- ELSIF journal.screens_non_access -%] [%- '.opt.willscreenfriend' | ml -%] [%- ELSIF journal.screens_anon -%] [%- '.opt.willscreenopenid' | ml -%] [%- END -%]
[%- END -%] [%# logged-in site user -%] [%- IF remote && ! remote.openid_identity -%]
[%- IF remote_opts.allowed -%] [%- IF remote_opts.screened -%] [%- '.opt.willscreen' | ml -%][%- END -%] [%- ELSE -%] [%- IF remote_opts.banned -%] [%- journal.is_community ? '.opt.bannedfrom.comm' : '.opt.bannedfrom' | ml( journal => journal.user ) -%] [%- ELSE -%][%# you're not on the access list -%] [%- journal.is_community ? '/talkpost_do.tt.error.notamember' : '/talkpost_do.tt.error.notafriend' | ml( user => journal.user ) -%] [%- END -%] [%- END -%] [%- UNLESS remote_opts.banned -%] [%- END -%]
[%- END -%] [%# not-logged-in site user -%]
[%- IF journal.screens_all -%] [%- '.opt.willscreen' | ml -%] [%- ELSIF journal.screens_non_access -%] [%- '.opt.willscreenfriend' | ml -%] [%- END -%]
[%# site user login form, always present but sometimes hidden -%] [%- IF ! create_link && ! remote -%] [%- '.noaccount' | ml( aopts => "href='${site.root}/create'") -%] [%- END -%] [%- END -%][%# figuring out whether it's an edit or new reply. -%]
[%- '.opt.subject' | ml -%] [%- form.textbox( name = 'subject' id = 'subject' size = 50 maxlength = 100 value = comment.subject ) -%] [%- form.hidden( id = 'subjectIconField' name = 'subjecticon' value = comment.subjecticon ) -%] [%# The current subjecticon, as the button to open the menu. %] [%- print_subjecticon_by_id( comment.subjecticon, "id='subjectIconImage' title='Click to change the subject icon' class='js-only' style='display: none;cursor:pointer;cursor:hand'" ) -%]
[%- '.nosubjecthtml' | ml -%]
[%- IF remote AND remote.icon_keyword_menu.size > 0 -%]
[%- '.label.picturetouse2' | ml %] [% form.select( name = 'prop_picture_keyword' id = 'prop_picture_keyword' selected = comment.current_icon_kw items = remote.icon_keyword_menu ) -%] [%- IF remote.can_use_userpic_select -%] [%- END -%]
[%- END -%]
[%- form.select( label = 'Formatting type' labelclass = 'invisible' name = 'prop_editor' id = 'prop_editor' selected = editors.selected items = editors.items ) -%] [%- dw.img('help', '', { alt => dw.ml('markup.helplink.alttext'), title => dw.ml('markup.helplink.alttext'), style => 'vertical-align: middle;' } ) -%] [%- IF remote_opts.can_manage_community -%] [%- form.checkbox( name = 'prop_admin_post' id = 'prop_admin_post' value = 1 selected = comment.admin_post label = 'Admin Post' ) -%] [%- END -%]
[%- '.opt.message' | ml -%] [%- form.textarea( rows = 10 cols = 75 wrap = 'soft' name = 'body' id = 'commenttext' value = comment.body ) -%] [%- IF remote_opts.can_unscreen_parent -%]
[%- form.checkbox( label = dw.ml('.opt.unscreenparent') name = 'unscreen_parent' id = 'unscreen_parent' value = 1 selected = 0 ) -%] [%- END -%] [%- IF captcha -%]
[%- captcha.html -%] [%- form.hidden( name = 'captcha_type' value = captcha.type ) -%] [%- END -%]
[%- '.opt.editreason' | ml -%] [%- form.textbox( name = 'editreason' id = 'editreason' value = comment.editreason size = 75 maxlength = 255 ) -%]
[% '.noedithtml' | ml %]
  [%- form.submit( name = "submitpost" value = comment.editid ? dw.ml('.opt.edit') : dw.ml('.opt.submit') ) -%]   [%- form.submit( name = "submitpreview" value = dw.ml('talk.btn.preview') id = "submitpview" ) -%] [%- form.hidden( name = "previewplaceholder" id = "previewplaceholder" value = 1 ) -%] [%- IF journal.is_iplogging -%]
[%- IF journal.is_iplogging == 'all' -%] [% '.logyourip' | ml -%] [%- ELSIF journal.is_iplogging == 'anon' -%] [% '.loganonip' | ml -%] [%- END -%]
[%- help_icon( 'iplogging' ) -%] [%- END -%] [%- IF journal.is_linkstripped -%]
[%- '.linkstripped' | ml -%]
[%- END %]
[%- END -%][%# check for S2 foundation beta -%]