__section__
default
__description__
Template which renders the comment editor.

* error_message = error message if there is an error
* preview = preview of comment, if applicable
* reply = hashref of comment replying to
* hide_name = hide name / log out link
* hide_email = hide email display
* extras = array of any extras associated with this comment
 
__title__

__page__
comments
__lang__
en_US
__name__
edit_comment
__template__
<div id="wide">
[% IF form.pid %]
        [% PROCESS titlebar title="Reply to: $reply.subject" %]
        <div class="generalbody">
		<ul id="commentlisting">
                [% Slash.dispComment(reply) %]
		</li>
		</ul>
        </div>
[% END %]

[% IF newdiscussion || form.newdiscussion %]
	[% PROCESS titlebar title="Create New $label" %]
[% ELSE %]
	[% PROCESS titlebar title="Post Comment" %]
[% END %]
	<div class="generalbody">
<!-- error message -->
<!-- newdiscussion [% newdiscussion %] form.newdiscussion [% form.newdiscussion %] -->
[% IF error_message %]
        <div class="error">
                [% error_message %]
        </div>
[% END %]
<!-- end error message -->
<form action="[% gSkin.rootdir %]/comments.pl" method="post">
[% IF preview %]                
	<fieldset>
		<legend>
        [% IF newdiscussion || form.newdiscussion %]
                Preview [% $label %]
        [% ELSE %]              
                Preview Comment
        [% END %]               
		</legend>
		[% preview %]   
	</fieldset>
[% END %]    
	<fieldset>
	<legend>Edit Comment</legend>
	<input type="hidden" name="sid" value="[% form.sid || sid %]">
	<input type="hidden" name="pid" value="[% form.pid %]">
	[% IF form.returnto_commentpostsuccess && form.returnto_commentpostsuccess_confirm %]
		<input type="hidden" name="returnto_commentpostsuccess"
			value="[% form.returnto_commentpostsuccess | strip_attribute %]">
		<input type="hidden" name="returnto_commentpostsuccess_confirm"
			value="[% form.returnto_commentpostsuccess_confirm | strip_attribute %]">
	[% END %]
	<input type="hidden" name="mode" value="[% user.mode %]">
	<input type="hidden" name="startat" value="[% user.startat %]">
	<input type="hidden" name="threshold" value="[% user.threshold %]">
	<input type="hidden" name="commentsort" value="[% user.commentsort %]">
        [% IF gotmodwarning %]<input type="hidden" name="gotmodwarning" value="1">[% END %]

[% IF newdiscussion || form.newdiscussion %]
	<input type="hidden" name="indextype" value="[% indextype %]">
	<input type="hidden" name="newdiscussion" value="[% newdiscussion %]">
[% END %]

[% PROCESS formkey_tag %]

[% userlink = '' %]
[% IF user.is_anon %]
<!-- anon login code -->
	[% userlink = "<a href=\"${gSkin.rootdir}/users.pl\">Create an Account</a>" %]
		You are not logged in.  You can log in now using the
		convenient form below, or
		<a href="[% gSkin.rootdir %]/users.pl">Create an Account</a>,
		or post as <b>[% user.nickname | strip_literal %]</b>.
	<input type="hidden" name="rlogin" value="1">

	[% PROCESS formLabel value => 'Nick' %]
		<input type="text" name="unickname" value="[% form.nickname | strip_attribute %]">

	[% PROCESS formLabel value => 'Password' %]
		<input type="password" name="upasswd">
		<input type="checkbox" name="login_temp" value="yes"> Public Terminal

[% ELSE;
	userlink = "<a href=\"${gSkin.rootdir}/login.pl?op=userclose\">Log Out</a>";
END %]
	[% UNLESS hide_name %]
	[% PROCESS formLabel value => 'Name' %]
		<a href="[% gSkin.rootdir %]/users.pl">[% user.nickname | strip_literal %]</a> [ [% userlink %] ]
	[% END %]
[% IF user.fakeemail %]
	[% UNLESS hide_email %]
	[% PROCESS formLabel value => 'Email' %]
		[% user.fakeemail | strip_literal %]
	[% END %]
<!-- end anon login code -->
[% END %]
[% IF user.homepage %]
	[% PROCESS formLabel value => 'URL' %]
		<a href="[% user.homepage %]" rel="nofollow">[% user.homepage | strip_literal %]</a>
[% END %]

	[% IF newdiscussion || form.newdiscussion %]
			[% PROCESS formLabel value=>'Topic' %]
				[% Slash.selectTopic('topic', form.topic, section, 1) %]
		[% IF section_select %]
			Section: 
				[% section_select %]
		[% END %]
			[% PROCESS formLabel value=>'URL' %]
				<input type="text" name="url" value="[% form.url | strip_attribute %]" size="50">
	[% END %]

	[% PROCESS formLabel value => 'Subject' %]
		<input type="text" name="postersubj" value="[% form.postersubj | strip_attribute %]" size="50" maxlength="50">
	[% FOR extra = extras %]
	
		<b>[% extra.0 %]
		
		[% IF extra.2 == 'text' %]
			<input type="text" name="[% extra.1 %]" value="[% form.${extra.1} | strip_attribute %]" size="50">
		[% ELSIF extra.2 == 'list' %]
			[% pulldown = extra.1 %]
			[% Slash.createSelect(extra.1, Slash.db.getDescriptions('genericstring',pulldown), form.${extra.1}, 1, 1) %]	
		[% END %]
		</b>
	[% END %]
	
		[% PROCESS formLabel value => 'Comment' %]
		<textarea wrap="virtual" name="postercomment" id="postercomment" rows="[% user.textarea_rows || constants.textarea_rows %]" cols="[% user.textarea_cols || constants.textarea_cols %]">[% form.postercomment | strip_literal %]</textarea>
		[% PROCESS formNote note => 'Use the Preview Button! Check those URLs!' %]
		<br>
		[% IF user.is_anon %]
		[% anon_messages = [
			"Logged-in users aren't forced to preview their comments.",
		#	"Logged-in posts are seen by xx as many users.",
			"Score: 0 (Logged-in users start at Score: 1)."
		]%]
		<br>[% anon_messages.rand %]
		<a href="[% gSkin.rootdir %]/users.pl">Create an Account!</a>
		[% END %]

	 

[% IF !user.is_anon && user.karma > constants.goodkarma %]
		<input type="hidden" name="nobonus_present" value="1">
		<input type="checkbox" name="nobonus"[% IF form.nobonus; constants.markup_checked_attribute ; END %]> No Karma Bonus
[% do_br = 1; END;
IF !user.is_anon && user.is_subscriber %]
		<input type="hidden" name="nosubscriberbonus_present" value="1">
		<input type="checkbox" name="nosubscriberbonus"[% IF form.nosubscriberbonus; constants.markup_checked_attribute ; END %]> No Subscriber Bonus
[% do_br = 1; END;
IF constants.allow_anonymous && user.karma > -1 && !user.is_anon && (discussion.commentstatus == 'enabled' || discussion.commentstatus == 'logged_in')  %]
		<input type="hidden" name="postanon_present" value="1">
		<input type="checkbox" name="postanon"[% IF form.postanon; constants.markup_checked_attribute ; END %]> Post Anonymously
[% do_br = 1; END;
IF do_br %]<br>[% END %]

[% 
	formats = Slash.db.getDescriptions('postmodes');
	
	format_select = form.posttype ?
	Slash.createSelect('posttype', formats, form.posttype, 1, 1)
	:
	Slash.createSelect('posttype', formats, user.posttype, 1);
%]

[% IF constants.plugin.HumanConf && constants.hc && constants.hc_sw_comments && user.state.hc %]
	[% IF user.state.hcinvalid %]
		[% user.state.hcerror %]
	[% ELSE %]
		[% user.state.hcquestion %]
		[% user.state.hchtml %]
		<input type="text" name="hcanswer" value="[% form.hcanswer | strip_attribute %]" size=8 maxlength=8>
		[% IF !user.is_anon || (user.is_anon && preview) %]
		<input type="submit" name="op" value="Submit" class="button">
		[% END %]
		<input type="submit" name="op" value="Preview" class="button">
		[% format_select %]
	[% END %]
[% ELSE %]
<p>
	[% format_select %]
	<input type="submit" name="op" value="Preview" class="button">
	[% IF !user.is_anon || (user.is_anon && preview) %]
	<input type="submit" name="op" value="Submit" class="button">
	[% END %]
	[% IF form.pid && Slash.discussion2() == "slashdot" %]
	<script src="[% constants.imagedir %]/comments.js?[% constants.cvs_tag_currentcode %]" type="text/javascript"></script>
	<script type="text/javascript">
<!--
	comment_body_reply[[% form.pid %]] = '[% pid_reply %]';
	document.write('<input type="button" name="quotereply" id="quotereply" value="Quote" class="button" onclick="quoteReply([% form.pid %])">');
//-->
	</script>
	[% END %]

</p>
[% END %]
			<div class="notes">
				<b>Allowed HTML</b><br>
				&lt;[% constants.approvedtags.join("&gt;			&lt;") %]&gt;
				[% IF constants.approvedtags.grep("ECODE").0 %]
					(Use "ECODE" instead of "PRE" or "CODE".)
				[% END %]
	
				<br>	
				<b>URLs</b><br>
				<code>&lt;URL:http://example.com/&gt;</code> will auto-link a URL
				<br>
				<b>Important Stuff</b>
				<ul>
					<li>Please try to keep posts on topic.</li>
					<li>Try to reply to other people's comments instead of starting new threads.</li>
					<li>Read other people's messages before posting your own to avoid simply duplicating what has already been said.</li>
					<li>Use a clear subject that describes what your message is about.</li>
					<li>Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)</li>
					[% IF user.is_anon %]
						<li>If you want replies to your comments sent to you, consider <a href="[% gSkin.rootdir %]/my/">logging in</a> or <a href="[% gSkin.rootdir %]/login.pl?op=newuserform">creating an account</a>.</li>
					[% END %]
				</ul>

				<p>
					If you are having a problem with accounts or comment posting,
					please <a href="mailto:[% constants.adminmail | strip_attribute %]">yell for help</a>.
				</p>
			</div>	
		</fieldset>
		</form>
	</div>
</div>
__seclev__
1000
__version__
$Id: edit_comment;comments;default,v 1.51 2007/10/24 20:09:52 jamiemccarthy Exp $
