__section__
default
__description__
The main box for printing comments

* comments = big ol' arrayref of comments
* title = title of story
* count = count of comments
* sid = story ID
* cid = base comment ID
* pid = base parent ID
* lvl = what nesting level we're at
__title__

__page__
misc
__lang__
en_US
__name__
printCommentsMain
__template__
[% horiz = 0; rooted = 0;
   IF gSkin.name == 'idle' || user.lowbandwidth;
   	horiz = 1;
   ELSIF user.comments_control;
   	rooted = 1 IF user.comments_control == 'rooted';
   	horiz = 1 IF rooted || user.comments_control == 'horizontal';
   ELSE;
   	horiz = 1 IF constants.comments_control_horizontal;
   END %]
[% discussion2 = Slash.discussion2() %]
[% spilltext = "Spill at <b>${user.commentspill}</b>!";
   fineprint = 'The following comments are owned by whoever posted them.  We are not responsible for them in any way.';
   modpoints = BLOCK %]
	| <b>[% user.points %]</b>
	<a href="[% gSkin.rootdir %]/moderation.shtml">
	moderator</a>
	point[% user.points == 1 ? '' : 's' %] &nbsp; 
[% END %]

[% IF user.is_admin && user.d2prefs_debug %]
[% IF (!user.is_anon); PROCESS d2prefs; END %]
[% END %]

<a name="acomments"></a>
<div class="commentwrap" id="commentwrap">
[% IF (!user.is_anon && !user.acl.discussion2_uofm) || user.is_admin %]
<div class="commentBox" style="font-size: 120%">
	<form method="GET" action="[% gSkin.rootdir %]/comments.pl">
	<div>
[% IF title %]
<span class="escape-link"><a href="[% link | strip_urlattr %]" title="Back to Article - [% title | strip_attribute %]">[% title %]</a></span>
[% END %]
	<input type="hidden" name="op" value="setDiscussion2">
	<input type="hidden" name="sid" value="[% sid %]">
	[% IF cid %]<input type="hidden" name="cid" value="[% cid %]">[% END %]
	[% IF pid %]<input type="hidden" name="pid" value="[% pid %]">[% END %]
	<input type="checkbox" name="discussion2_slashdot" value="1" onchange="this.form.submit();"[% constants.markup_checked_attribute IF discussion2 == 'slashdot' %]>
	I am willing to help test <a href="http://slashdot.org/faq/com-mod.shtml#cm120">Slashdot's New Discussion System</a>.
	<noscript><input type="submit"></noscript>

	</div>
	</form>
</div>
[% END; IF (user.acl.discussion2_uofm_signup && !user.acl.discussion2_uofm && (user.is_admin || !user.is_subscriber)) && constants.uofm_key && constants.uofm_iv && env.http_user_agent.search('Firefox/1\.5') %]
<div class="commentBox" style="font-size: 120%">
<a href="[% Slash.tempUofmLinkGenerate() %]">Want to test an experimental interface for comments?</a>
</div>
[% END %]

[% UNLESS discussion2 %]
<div class="commentBox">
[% IF title %]
	<a href="[% link | strip_urlattr %]">[% title %]</a>
[% ELSE %]
	[% Slash.linkComment({
		sid	=> sid,
		pid	=> pid,
		subject	=> 'Top',
		subject_only => 1,
	}) %]
[% END %]

	|

[% IF user.is_anon %]
	<a href="[% gSkin.rootdir %]/users.pl">Log In/Create an Account</a>
[% ELSE %]
		<a href="[% gSkin.rootdir %]/my/comments">Preferences</a>
[% END %]

		| [% Slash.linkComment({
			sid	=> sid,
			pid	=> 0,
			subject	=> 'Top',
			subject_only => 1,
		}) %]
[% IF user.points; modpoints; END %]

[% IF count %]
	| <b>[% count %]</b> comments
[% END %]

[% IF lvl && user.mode == 'thread' %]
	([% spilltext %]) | Index Only
[% END %]

[% IF form.startat %]
		| Starting at #[% form.startat %]
[% END %]

		| <a href="[% gSkin.rootdir %]/search.pl?op=comments&amp;sid=[% sid %]">Search Discussion</a>
	</div>
[% END %]
	<div class="commentBoxForm" id="commentControlBox">
[% UNLESS discussion2 %]
		<form action="[% gSkin.rootdir %]/comments.pl">
		[% IF user.state.no_d2 %]<input type="hidden" name="no_d2" value="1">[% END %]
		<fieldset>
		<legend>Display Options</legend>
		[% UNLESS discussion2 %]
		
		Threshold: [%
			Slash.selectThreshold(comments.0.totals);
			IF user.mode != 'parents' && user.mode != 'child';
			  Slash.selectMode(user.mode);
			END;
			Slash.selectSortcode(user.commentsort) %]
		[% END %]

	[% UNLESS user.is_anon %]
		[% UNLESS discussion2 %]
		Save: <input type="checkbox" name="savechanges" class="button">
		[% END %]
	[%- END %]
		[% UNLESS discussion2 %]
		<input type="submit" name="op" value="Change" class="button">
		[% END %]

		<input type="hidden" name="sid" value="[% sid %]">
		[% IF cid %]<input type="hidden" name="cid" value="[% cid %]">[% END %]
		[% IF pid %]<input type="hidden" name="pid" value="[% pid %]">[% END %]
		[% IF form.startat %]<input type="hidden" name="startat" value="[% form.startat %]">[% END %]
		[% UNLESS user.state.discussion_archived || user.state.discussion_future_nopost %]
			<input type="submit" name="op" value="Reply" class="button">
		[% END %]

		</fieldset>
		</form>
[% END %]<div></div>
	<div class="commentBox">
		<small>
		<b>The Fine Print:</b> [% fineprint %]
		</small>
[% IF !user.state.no_d2 %]<noscript><br><small>Without JavaScript enabled, you might want to
[% IF user.is_anon %]use [% Slash.linkComment({
	sid	=> sid,
	pid	=> pid,
	subject	=> 'the classic discussion system',
	subject_only => 1,
	no_d2   => 1
}) %] instead.  If you <a href="[% gSkin.rootdir %]/login.pl">login</a>, you can remember this preference.
[% ELSE %]<a href="[% gSkin.rootdir %]/users.pl?op=editcomm">turn on Classic Discussion System in your preferences</a> instead.
[% END %]</small></noscript>[% END %]
	</div>
	</div>
	[% IF discussion2 %]
		<div id="d2out" class="[% IF horiz %]horizontal[% IF rooted %] rooted[% END %][% ELSE %]vertical[% END %]">
		<div id="d2act" class="hide">
		<div class="loki" id="gods">
		<div class="block">
			<div class="title">
				<h4>
				[% IF title %]
					<span class="h-inline"><a href="[% link | strip_urlattr %]" title="Back to Article - [% title | strip_attribute %]">[% title %]</a></span>
					<span class="titlecount"><a href="[% link | strip_urlattr %]#topcomment" title="Back to Top Comment - [% title | strip_attribute %]"><span id="titlecountnum">[% count %]</span>&nbsp;Comment[% count == 1 ? '' : 's' %]</a></span>
				[% ELSE %] 
					[% Slash.linkComment({
						sid	=> sid,
						pid	=> pid,
						subject	=> 'Comments',
						subject_only => 1,
				}) %]
				[% END %]
		<span class="ccw-header-links">
    [% IF discussion2 && !cid && !pid %]
        <a href="#" onclick="ajaxFetchComments(0,1); return false"><span id="more_comments_num_b"></span> More</a> | 
    [% END; IF user.is_admin && user.d2prefs_debug %]
        <a href="#" onclick="showPrefs('reading'); return false">Prefs</a>
    [% ELSIF user.is_anon;
   	PROCESS userlogin_cover
   		return_url = gSkin.rootdir _ '/comments.pl?sid=' _ sid %]
        <a href="[% gSkin.rootdir %]/login.pl" onclick="show_login_box(); return false">Login</a>
    [% ELSE %]
        <a href="[% gSkin.rootdir %]/my/comments"[% IF constants.modal_prefs_active %] onclick="getModalPrefs('d2', 'Discussion 2'); return false"[% END %]>Prefs</a>
    [% END %]

		[% UNLESS user.state.discussion_archived || user.state.discussion_future_nopost %]
			| [% Slash.linkComment({
				sid          => sid,
				cid          => cid,
				op           => 'reply',
				subject      => 'Reply',
				subject_only => 1,
				onclick      => ((discussion2 && (!constants.subscribe || user.is_subscriber)) ? "replyTo(0); return false;" : '')
			}) %]
		[% END %]
		</span>
		<span id="d2toggle" title="Toggle window location" onclick="toggleDisplayOptions()" class="close">/</span>
				</h4>
			</div>
		</div>
<script type="text/javascript">
gCommentControlWidget = null;

YAHOO.slashdot.ThresholdApp = function() {
  return {
    init: function() {
      gCommentControlWidget = new YAHOO.slashdot.ThresholdWidget([% "'X'" IF horiz %]);
      gCommentControlWidget.setTHT(user_threshold, user_highlightthresh);
    }
  };
}();

YAHOO.util.Event.addListener(window, "load", YAHOO.slashdot.ThresholdApp.init);
</script>
		<div id="bones">
      <div id="ccw">
        <div id="ccw-body" class="ccw-core">
          <div id="ccw-panel-container" class="ccw-core">
            <div id="ccw-full-panel" class="ccw-panel">
              <div class="ccw-panel-border"></div>
              <div id="ccw-full-count-pos" class="ccw-core-pos ccw-count-pos">
                <span id="ccw-full-count-text" class="ccw-count-text"><span id="currentFull"></span><span id="ccw-full-phrase">&nbsp;Full</span></span>
              </div>
            </div>
            <div id="ccw-abbr-panel" class="ccw-panel">
              <div class="ccw-panel-border"></div>
              <div id="ccw-abbr-count-pos" class="ccw-core-pos ccw-count-pos">
                <span id="ccw-abbr-count-text" class="ccw-count-text"><span id="currentOneline"></span><span id="ccw-abbr-phrase">&nbsp;Abbreviated</span></span>
              </div>
            </div>
            <div id="ccw-hide-panel" class="ccw-panel">
              <div id="ccw-hide-count-pos" class="ccw-core-pos ccw-count-pos">
                <span id="ccw-hide-count-text" class="ccw-count-text"><span id="currentHidden"></span><span id="ccw-hide-phrase">&nbsp;Hidden</span></span>
              </div>
            </div>
          </div>
    
          <div id="ccw-control" class="ccw-core">
            <div id="ccw-centering-rail" class="ccw-core">
              <div id="ccw-hide-bar-pos" class="ccw-core-pos">
                <div id="ccw-hide-bar" class="ccw-bar">
                  <div id="ccw-hide-bar-tab" class="ccw-bar-tab"></div>
                  <div id="ccw-hide-bar-upzone" class="ccw-upzone" onclick="gCommentControlWidget.stepTHT(HIDE_BAR, +1)"></div>
                  <div id="ccw-hide-bar-downzone" class="ccw-downzone" onclick="gCommentControlWidget.stepTHT(HIDE_BAR, -1)"></div>
                </div>
              </div>
              <div id="ccw-abbr-bar-pos" class="ccw-core-pos">
                <div id="ccw-abbr-bar" class="ccw-bar">
                  <div id="ccw-abbr-bar-tab" class="ccw-bar-tab"></div>
                  <div id="ccw-abbr-bar-upzone" class="ccw-upzone" onclick="gCommentControlWidget.stepTHT(ABBR_BAR, +1)"></div>
                  <div id="ccw-abbr-bar-downzone" class="ccw-downzone" onclick="gCommentControlWidget.stepTHT(ABBR_BAR, -1)"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
		</div>
		<div class="commentControlFooter">
    [% IF discussion2 && !cid && !pid %]
        <a href="#" onclick="ajaxFetchComments(0,1); return false"><span id="more_comments_num_c"></span> More</a> | 
    [% END; IF user.is_admin && user.d2prefs_debug %]
        <a href="#" onclick="showPrefs('reading'); return false">Prefs</a>
    [% ELSIF user.is_anon;
   	PROCESS userlogin_cover
   		return_url = gSkin.rootdir _ '/comments.pl?sid=' _ sid %]
        <a href="[% gSkin.rootdir %]/login.pl" onclick="show_login_box(); return false">Login</a>
    [% ELSE %]
        <a href="[% gSkin.rootdir %]/my/comments"[% IF constants.modal_prefs_active %] onclick="getModalPrefs('d2', 'Discussion 2'); return false"[% END %]>Prefs</a>
    [% END %]
		[% UNLESS user.state.discussion_archived || user.state.discussion_future_nopost %]
			| [% Slash.linkComment({
				sid          => sid,
				cid          => cid,
				op           => 'reply',
				subject      => 'Reply',
				subject_only => 1,
				onclick      => ((discussion2 && (!constants.subscribe || user.is_subscriber)) ? "replyTo(0); return false;" : '')
			}) %]
		[% END %]
			<div id="bindings-legend">Keybindings Beta<br>
<a href="#" onclick="keyHandler('','Q'); return false" title="previous comment by load order">Q</a>
<a href="#" onclick="keyHandler('','W'); return false" title="previous thread"               >W</a>
<a href="#" onclick="keyHandler('','E'); return false" title="next comment by load order"    >E</a><br>
<a href="#" onclick="keyHandler('','A'); return false" title="previous comment in thread"    >A</a>
<a href="#" onclick="keyHandler('','S'); return false" title="next thread"                   >S</a>
<a href="#" onclick="keyHandler('','D'); return false" title="next comment in thread"        >D</a>
			</div>
		</div>
		<div id="commentControlBoxStatus" class="hide"><b>Loading ... Please wait.</b></div>
	</div>
</div>
		</div>
	[% END %]
</div>
<a name="topcomment"></a>

__seclev__
10000
__version__
$Id: printCommentsMain;misc;default,v 1.106 2008/03/19 21:09:47 pudge Exp $
