<commit_before><%@include file="/inc/top_standard.jspf" %>

<t:action var="holds" type="org.subethamail.web.action.GetHeldMessages" />

<trim:list title="Held Messages" listId="${param.listId}">
	<c:choose>
		<c:when test="${empty holds}">
			<p>There are no held messages to this list.</p>
		</c:when>
		
		<c:otherwise>
			<table class="sort-table" id="lists-table">
			<thead>
				<tr>
					<td>Date</td>
					<td>Subject</td>
					<td>From</td>
					<td>Type</td>
					<td>Action</td>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="msg" items="${holds}" varStatus="loop">
					<c:choose>
						<c:when test="${loop.index % 2 == 0}">
							<c:set var="color" value="a"/>
						</c:when>
						<c:otherwise>
							<c:set var="color" value="b"/>
						</c:otherwise>
					</c:choose>
					<tr class="${color}">
						<td>
							<fmt:formatDate value="${msg.date}" type="both" dateStyle="short" timeStyle="short"/>
						</td>
						<td>
							<c:url var="msgUrl" value="/archive_msg.jsp">
								<c:param name="msgId" value="${msg.id}"/>
							</c:url>
							<a href="${msgUrl}" target="held">
								<c:if test="${empty msg.subject}">(no subject)</c:if><c:out value="${msg.subject}"/>
							</a>
						</td>
						<td>
							<c:out value="${msg.from}"/>
						</td>
						<td>
							<c:choose>
								<c:when test="${msg.hard}">
									<div class="error">HARD</div>
								</c:when>
								<c:otherwise>
									SOFT
								</c:otherwise>
							</c:choose>
						</td>
						<td>
							<form action="held_msg_action.jsp" method="post" style="display:inline">
								<input type="hidden" name="msgId" value="${msg.id}" />
								<input type="submit" name="action" value="Approve" />
							</form>
							<form action="held_msg_action.jsp" method="post" style="display:inline">
								<input type="hidden" name="msgId" value="${msg.id}" />
								<input type="submit" name="action" value="Discard" />
							</form>
							<form action="held_msg_action.jsp" method="post" style="display:inline">
								<input type="hidden" name="msgId" value="${msg.id}" />
								<input type="hidden" name="action" value="Sub_Approve"/>
								<input type="submit" name="submit" value="Subscribe and Approve" />
							</form>
						</td>
					</tr><commit_msg>optimize the forms put the form action in a c:url<commit_after><%@include file="/inc/top_standard.jspf" %>

<t:action var="holds" type="org.subethamail.web.action.GetHeldMessages" />

<trim:list title="Held Messages" listId="${param.listId}">
	<c:choose>
		<c:when test="${empty holds}">
			<p>There are no held messages to this list.</p>
		</c:when>
		
		<c:otherwise>
			<table class="sort-table" id="lists-table">
			<thead>
				<tr>
					<td>Date</td>
					<td>Subject</td>
					<td>From</td>
					<td>Type</td>
					<td>Action</td>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="msg" items="${holds}" varStatus="loop">
					<c:choose>
						<c:when test="${loop.index % 2 == 0}">
							<c:set var="color" value="a"/>
						</c:when>
						<c:otherwise>
							<c:set var="color" value="b"/>
						</c:otherwise>
					</c:choose>
					<tr class="${color}">
						<td>
							<fmt:formatDate value="${msg.date}" type="both" dateStyle="short" timeStyle="short"/>
						</td>
						<td>
							<c:url var="msgUrl" value="/archive_msg.jsp">
								<c:param name="msgId" value="${msg.id}"/>
							</c:url>
							<a href="${msgUrl}" target="held">
								<c:if test="${empty msg.subject}">(no subject)</c:if><c:out value="${msg.subject}"/>
							</a>
						</td>
						<td>
							<c:out value="${msg.from}"/>
						</td>
						<td>
							<c:choose>
								<c:when test="${msg.hard}">
									<div class="error">HARD</div>
								</c:when>
								<c:otherwise>
									SOFT
								</c:otherwise>
							</c:choose>
						</td>
						<td>
							<form action="<c:url value="/held_msg_action.jsp" />" method="post" style="display:inline">
								<input type="hidden" name="msgId" value="${msg.id}" />
								<input type="submit" name="action" value="Approve" />
								<input type="submit" name="action" value="Discard" />
							</form>
							<form action="<c:url value="/held_msg_action.jsp" />" method="post" style="display:inline">
								<input type="hidden" name="msgId" value="${msg.id}" />
								<input type="hidden" name="action" value="Sub_Approve"/>
								<input type="submit" name="submit" value="Subscribe and Approve" />
							</form>
						</td>
					</tr>
{'fraction_non_alphanumeric': 0.21827524575513851, 'fraction_numerical': 0.0008936550491510277, 'mean_word_length': 2.6339285714285716, 'pattern_counts': {'":': 0, '<': 156, '<?xml version=': 0, '>': 156, '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': '1981988', 'n_tokens_mistral': 2246, 'n_tokens_neox': 1564, 'n_words': 293}