<commit_before><%namespace name="components" file="/components.html"/>


<%def name="row(tile, comment)">
	<div class="tile">
		<div class="logo">
			<img src="/img/icons/discuss_24.png" />
		</div>
		<div class="base">
			%if len(tile.tagline):
				<h3><a href="${h.entity_url(comment)}">${_("Comment")}</a> 
					${_("on %s") % h.delegateable_link(comment.topic)|n}</h3>
			%endif
			<div class="text">
				${tile.tagline|n}
			</div>
			<div class="meta">
				${h.user_link(comment.creator, scope=comment.topic)|n}
				%if len(comment.revisions) == 1:  
					&middot; ${_("created %s") % h.relative_time(comment.create_time)|n}
				%else:
					&middot; ${_("edited %s") % h.relative_time(comment.latest.create_time)|n}
				%endif  	
			</div>
		</div>
	</div>
</%def>

<%def name="full(tile, comment, recurse=True, collapse=True, link_discussion=False)">
	<%	
	if not tile.show:
		return
	%>
	<div class="comment" id="c${comment.id}">
		<div class="tile 
				        ${'canonical' if comment.canonical else ''} 
				        ${'pro' if comment.latest.sentiment == c.model.Comment.SENT_PRO else ''} 
   				      ${'con' if comment.latest.sentiment == c.model.Comment.SENT_CON else ''} 
				        ${tile.position}" id="tile_c${comment.id}">
			<div class="logo rate">
				%if can.comment.rate(comment):
					<a class="up icon otip" title="${_("Support this comment")}" href="${h.entity_url(comment.poll, member='rate')}?_method=POST&position=1&${h.url_token()}" 
						onclick="return rate('#tile_c${comment.id}', ${comment.poll.id}, 1);">
						&nbsp;
					</a>
					<a href="${h.entity_url(comment.poll, member='votes')}" 
						class="score">${tile.score}</a>
					<a class="down icon ttip" title="${_("Oppose this comment")}" href="${h.entity_url(comment.poll, member='rate')}?_method=POST&position=-1&${h.url_token()}" 
						onclick="return rate('#tile_c${comment.id}', ${comment.poll.id}, -1);">
						&nbsp;
					</a>
				%else:
					<a class="up icon inactive">&nbsp;</a>
					<a href="${h.entity_url(comment.poll, member='votes')}" 
						class="score">${tile.score}</a>
					<a class="down icon inactive">&nbsp;</a>
				%endif
			</div>
			
			<div class="base">
			<div class="pre">
				<div class="top_actions comment">				
					%if can.comment.edit(comment):
						<a class="button edit" onClick="return comment_edit(${comment.id})" href="${h.entity_url(comment, member='edit')}">${_("edit")}</a> 
					%endif
									
					%if can.comment.delete(comment):
						<a class="button delete" href="${h.entity_url(comment, member='ask_delete')}">${_("delete")}</a> 
					%endif
								
					%if can.comment.reply(comment) and (recurse or link_discussion):
						<a class="button add reply" onClick="return comment_reply(${comment.id})" href="/comment/new?reply=${comment.id}&topic=${comment.topic.id}&wiki=1">${_("reply")}</a>
					%endif 
					
					%if collapse:
						<a class="button delete hide" onclick="return comment_hide(${comment.id})" href="#">-</a>
						<a class="button add show" onclick="return comment_show(${comment.id})" href="#">+</a>
					%endif
										
					%if link_discussion and tile.num_children:
						<a class="button add reply" onclick="return comment_link_discussion(${comment.id})" href="/comment/${comment.id}">${_("discussion")} (${tile.num_children}) &raquo;</a>
					%endif
				</div>
				
				
				%if comment.is_deleted():
					${_("deleted %s") % h.relative_time(comment.delete_time)|n}
				%else:
					<b>${h.user_link(comment.creator, scope=comment.topic)|n}</b>
					%if not comment.is_edited(): 
						&middot; ${_("%s") % h.relative_time(comment.create_time)|n}
					%else:
						&middot;
						%if comment.latest.user == comment.creator:
							${_("edited %s") % h.relative_time(comment.latest.create_time)|n}
						%else:
						 	${_("edited %s by %s") % (h.relative_time(comment.latest.create_time),
								               			   h.user_link(comment.latest.user, scope=comment.topic))|n}
						%endif 	
					%endif
					(${"%s &middot; " % _("editable") if comment.wiki else ''|n}<a href="${h.entity_url(comment, member='history')}">${_("history")}</a>)
				%endif
				
				<a name="c${comment.id}">&nbsp;</a>
			</div>
			<div class="text hide_edit">
				%if not comment.is_deleted():
					${tile.text|n}
				%else:
					<span class="hint">${_("This comment has been deleted.")}</span>
				%endif
			</div>
			
			<div class="edit_form">
				${self.edit_form(comment)}
			</div>
			<div class="reply_form sub ${'base_reply' if reply_here else ''}">
				${self.create_form(comment, comment.topic)}
			</div>
			</div>
		</div>
		%if recurse or link_discussion:
			<div class="sub ${'link_discussion' if link_discussion else ''}">
				%for r_comment, r_tile in tile.replies():
					${self.full(r_tile, r_comment, collapse=collapse)}
				%endfor
			</div>
		%endif
	</div>
</%def>

<%def name="edit_form(comment)">
	<form name="edit_comment" class="inplace comment_form" method="POST" action="/comment/${comment.id}">
		${h.field_token()|n}
		<input type="hidden" name="_method" value="PUT" />
		%if not comment.canonical and comment.reply:
			${_("argumenting")}
			<input type="radio" value="1" name="sentiment" ${'checked="checked"' if comment.latest.sentiment == 1 else ''} /> 
			${_("pro")}
			<input type="radio" value="0" name="sentiment" ${'checked="checked"' if comment.latest.sentiment not in [-1, 1] else ''}  /> 
			${_("neutral")}
			<input type="radio" value="-1" name="sentiment" ${'checked="checked"' if comment.latest.sentiment == -1 else ''} /> 
			${_("con")}
			<br/>
		%endif
		
		<textarea class="description" style="min-height: ${max(7, min(30, len(comment.latest.text)/50))}em !important;" name="text">${comment.latest.text}</textarea>
		${components.formatting()}
		${components.savebox(h.entity_url(comment.topic))}
	</form>
</%def>

<%def name="create_form(parent, topic, canonical=0, arm=False, can_wiki=True)">
	<form name="create_comment" class="inplace comment_form" method="POST" action="/comment">
		${h.field_token()|n}
		<input type="hidden" name="topic" value="${topic.id}" />
		%if parent:
			<input type="hidden" name="reply" value="${parent.id}" />
		%endif
		<input type="hidden" name="canonical" value="${canonical}" />
		<div style="width: auto;">
		%if not canonical:
			${_("argumenting")}
			<% pos = h.proposal_position(topic) %>
			<input type="radio" value="1" name="sentiment" ${'checked="checked"' if pos == 1 else ''} /> ${_("pro")}
			<input type="radio" value="0" name="sentiment" ${'checked="checked"' if pos not in [-1, 1] else ''}  /> ${_("neutral")}
			<input type="radio" value="-1" name="sentiment" ${'checked="checked"' if pos == -1 else ''} /> ${_("con")}
			<br/>
		%endif
		%if arm:
			<label for="text" class="armhint">${arm}</label>
		%endif
		<textarea class="description armlabel" name="text"></textarea><br/>
		${components.formatting()}
		${components.savebox("/d/%s" % parent.topic.id if parent else request.params.get('topic'))}
		%if can_wiki:
			<input type="checkbox" checked="checked" name="wiki" value="1" />
			${_("Allow others to edit this comment.")}
		%endif
		</div>
	</form>
</%def>

<%def name="header(tile, comment, active)">
	<div class="top_actions title">
		%if can.comment.edit(comment):
			<a class="button edit" onClick="return comment_edit(${comment.id})" 
				href="${h.entity_url(comment, member='edit')}">${_("edit")}</a> 
		%endif
						
		%if can.comment.delete(comment):
			<a class="button delete" 
				href="${h.entity_url(comment, member='ask_delete')}">${_("delete")}</a> 
		%endif
		
		${components.watch(comment)}
	</div>

	<h1 class="page_title"><img src="/img/icons/discuss_24.png" class="cd" /> 
		${_("Discussion on %s") % h.delegateable_link(comment.topic, icon_size=24)|n}</h1>
	
	<div class="panel ${active}">
		<ul class="menu">
			<li><a href="${h.entity_url(comment)}">${_("Context")}</a></li>
			<li><a href="${h.entity_url(comment, comment_page=True)}" 
				class="discussion">${_("Comment")}</a></li>	
			<li><a href="${h.entity_url(comment, member='history')}" 
				class="history">${_("History")} (${len(comment.revisions)})</a></li>
			<li><a href="${h.entity_url(comment.poll, member='votes')}" 
				class="votes">${_("Votes")} (${len(comment.poll.tally)})</a></li>
		</ul>
	</div>
</%def><commit_msg>[svn r895] allow page sentiments<commit_after><%namespace name="components" file="/components.html"/>


<%def name="row(tile, comment)">
	<div class="tile">
		<div class="logo">
			<img src="/img/icons/discuss_24.png" />
		</div>
		<div class="base">
			%if len(tile.tagline):
				<h3><a href="${h.entity_url(comment)}">${_("Comment")}</a> 
					${_("on %s") % h.delegateable_link(comment.topic)|n}</h3>
			%endif
			<div class="text">
				${tile.tagline|n}
			</div>
			<div class="meta">
				${h.user_link(comment.creator, scope=comment.topic)|n}
				%if len(comment.revisions) == 1:  
					&middot; ${_("created %s") % h.relative_time(comment.create_time)|n}
				%else:
					&middot; ${_("edited %s") % h.relative_time(comment.latest.create_time)|n}
				%endif  	
			</div>
		</div>
	</div>
</%def>

<%def name="full(tile, comment, recurse=True, collapse=True, link_discussion=False)">
	<%	
	if not tile.show:
		return
	%>
	<div class="comment" id="c${comment.id}">
		<div class="tile 
				        ${'canonical' if comment.canonical else ''} 
				        ${'pro' if comment.latest.sentiment == c.model.Comment.SENT_PRO else ''} 
   				      ${'con' if comment.latest.sentiment == c.model.Comment.SENT_CON else ''} 
				        ${tile.position}" id="tile_c${comment.id}">
			<div class="logo rate">
				%if can.comment.rate(comment):
					<a class="up icon otip" title="${_("Support this comment")}" href="${h.entity_url(comment.poll, member='rate')}?_method=POST&position=1&${h.url_token()}" 
						onclick="return rate('#tile_c${comment.id}', ${comment.poll.id}, 1);">
						&nbsp;
					</a>
					<a href="${h.entity_url(comment.poll, member='votes')}" 
						class="score">${tile.score}</a>
					<a class="down icon ttip" title="${_("Oppose this comment")}" href="${h.entity_url(comment.poll, member='rate')}?_method=POST&position=-1&${h.url_token()}" 
						onclick="return rate('#tile_c${comment.id}', ${comment.poll.id}, -1);">
						&nbsp;
					</a>
				%else:
					<a class="up icon inactive">&nbsp;</a>
					<a href="${h.entity_url(comment.poll, member='votes')}" 
						class="score">${tile.score}</a>
					<a class="down icon inactive">&nbsp;</a>
				%endif
			</div>
			
			<div class="base">
			<div class="pre">
				<div class="top_actions comment">				
					%if can.comment.edit(comment):
						<a class="button edit" onClick="return comment_edit(${comment.id})" href="${h.entity_url(comment, member='edit')}">${_("edit")}</a> 
					%endif
									
					%if can.comment.delete(comment):
						<a class="button delete" href="${h.entity_url(comment, member='ask_delete')}">${_("delete")}</a> 
					%endif
								
					%if can.comment.reply(comment) and (recurse or link_discussion):
						<a class="button add reply" onClick="return comment_reply(${comment.id})" href="/comment/new?reply=${comment.id}&topic=${comment.topic.id}&wiki=1">${_("reply")}</a>
					%endif 
					
					%if collapse:
						<a class="button delete hide" onclick="return comment_hide(${comment.id})" href="#">-</a>
						<a class="button add show" onclick="return comment_show(${comment.id})" href="#">+</a>
					%endif
										
					%if link_discussion and tile.num_children:
						<a class="button add reply" onclick="return comment_link_discussion(${comment.id})" href="/comment/${comment.id}">${_("discussion")} (${tile.num_children}) &raquo;</a>
					%endif
				</div>
				
				
				%if comment.is_deleted():
					${_("deleted %s") % h.relative_time(comment.delete_time)|n}
				%else:
					<b>${h.user_link(comment.creator, scope=comment.topic)|n}</b>
					%if not comment.is_edited(): 
						&middot; ${_("%s") % h.relative_time(comment.create_time)|n}
					%else:
						&middot;
						%if comment.latest.user == comment.creator:
							${_("edited %s") % h.relative_time(comment.latest.create_time)|n}
						%else:
						 	${_("edited %s by %s") % (h.relative_time(comment.latest.create_time),
								               			   h.user_link(comment.latest.user, scope=comment.topic))|n}
						%endif 	
					%endif
					(${"%s &middot; " % _("editable") if comment.wiki else ''|n}<a href="${h.entity_url(comment, member='history')}">${_("history")}</a>)
				%endif
				
				<a name="c${comment.id}">&nbsp;</a>
			</div>
			<div class="text hide_edit">
				%if not comment.is_deleted():
					${tile.text|n}
				%else:
					<span class="hint">${_("This comment has been deleted.")}</span>
				%endif
			</div>
			
			<div class="edit_form">
				${self.edit_form(comment)}
			</div>
			<div class="reply_form sub ${'base_reply' if reply_here else ''}">
				${self.create_form(comment, comment.topic)}
			</div>
			</div>
		</div>
		%if recurse or link_discussion:
			<div class="sub ${'link_discussion' if link_discussion else ''}">
				%for r_comment, r_tile in tile.replies():
					${self.full(r_tile, r_comment, collapse=collapse)}
				%endfor
			</div>
		%endif
	</div>
</%def>

<%def name="edit_form(comment)">
	<form name="edit_comment" class="inplace comment_form" method="POST" action="/comment/${comment.id}">
		${h.field_token()|n}
		<input type="hidden" name="_method" value="PUT" />
		%if not comment.textual:
			${_("argumenting")}
			<input type="radio" value="1" name="sentiment" ${'checked="checked"' if comment.latest.sentiment == 1 else ''} /> 
			${_("pro")}
			<input type="radio" value="0" name="sentiment" ${'checked="checked"' if comment.latest.sentiment not in [-1, 1] else ''}  /> 
			${_("neutral")}
			<input type="radio" value="-1" name="sentiment" ${'checked="checked"' if comment.latest.sentiment == -1 else ''} /> 
			${_("con")}
			<br/>
		%endif
		
		<textarea class="description" style="min-height: ${max(7, min(30, len(comment.latest.text)/50))}em !important;" name="text">${comment.latest.text}</textarea>
		${components.formatting()}
		${components.savebox(h.entity_url(comment.topic))}
	</form>
</%def>

<%def name="create_form(parent, topic, canonical=0, arm=False, can_wiki=True)">
	<form name="create_comment" class="inplace comment_form" method="POST" action="/comment">
		${h.field_token()|n}
		<input type="hidden" name="topic" value="${topic.id}" />
		%if parent:
			<input type="hidden" name="reply" value="${parent.id}" />
		%endif
		<input type="hidden" name="canonical" value="${canonical}" />
		<div style="width: auto;">
		%if not canonical:
			${_("argumenting")}
			<% pos = h.proposal_position(topic) %>
			<input type="radio" value="1" name="sentiment" ${'checked="checked"' if pos == 1 else ''} /> ${_("pro")}
			<input type="radio" value="0" name="sentiment" ${'checked="checked"' if pos not in [-1, 1] else ''}  /> ${_("neutral")}
			<input type="radio" value="-1" name="sentiment" ${'checked="checked"' if pos == -1 else ''} /> ${_("con")}
			<br/>
		%endif
		%if arm:
			<label for="text" class="armhint">${arm}</label>
		%endif
		<textarea class="description armlabel" name="text"></textarea><br/>
		${components.formatting()}
		${components.savebox("/d/%s" % parent.topic.id if parent else request.params.get('topic'))}
		%if can_wiki:
			<input type="checkbox" checked="checked" name="wiki" value="1" />
			${_("Allow others to edit this comment.")}
		%endif
		</div>
	</form>
</%def>

<%def name="header(tile, comment, active)">
	<div class="top_actions title">
		%if can.comment.edit(comment):
			<a class="button edit" onClick="return comment_edit(${comment.id})" 
				href="${h.entity_url(comment, member='edit')}">${_("edit")}</a> 
		%endif
						
		%if can.comment.delete(comment):
			<a class="button delete" 
				href="${h.entity_url(comment, member='ask_delete')}">${_("delete")}</a> 
		%endif
		
		${components.watch(comment)}
	</div>

	<h1 class="page_title"><img src="/img/icons/discuss_24.png" class="cd" /> 
		${_("Discussion on %s") % h.delegateable_link(comment.topic, icon_size=24)|n}</h1>
	
	<div class="panel ${active}">
		<ul class="menu">
			<li><a href="${h.entity_url(comment)}">${_("Context")}</a></li>
			<li><a href="${h.entity_url(comment, comment_page=True)}" 
				class="discussion">${_("Comment")}</a></li>	
			<li><a href="${h.entity_url(comment, member='history')}" 
				class="history">${_("History")} (${len(comment.revisions)})</a></li>
			<li><a href="${h.entity_url(comment.poll, member='votes')}" 
				class="votes">${_("Votes")} (${len(comment.poll.tally)})</a></li>
		</ul>
	</div>
</%def>
{'fraction_non_alphanumeric': 0.2249924539692122, 'fraction_numerical': 0.0046483549652882586, 'mean_word_length': 4.047531992687386, 'pattern_counts': {'":': 0, '<': 273, '<?xml version=': 0, '>': 273, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6704101', 'n_tokens_mistral': 7017, 'n_tokens_neox': 5852, 'n_words': 1073}