<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"      prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"       prefix="fmt" %>
<%@ taglib uri="http://struts.apache.org/tags-html"     prefix="html" %>

<h2>Synonyme f&uuml;r "<html:link action="topicview?id=${requestScope.Topic.id}">${requestScope.Topic.name}</html:link>"</h2>

<c:choose>
	<c:when test="${not empty requestScope.Synonyms}">
		<ul>
		<c:forEach items="${requestScope.Synonyms}" var="i" varStatus="nr">
			<li>
				<html:link action="topicview?id=${i.synonym.id}">${i.synonym.name}</html:link>
				<c:if test="${i.ratingsCount > 0}">
					<jsp:include page="/WEB-INF/content/rating.jsp">
						<jsp:param name="wert" value="${i.averageRatingValue}"/>
					</jsp:include>
				</c:if>
				
				<div class="FORMULAR">
					<html:form action="changesynonymrating?id=${requestScope.Topic.id}&amp;synid=${i.id}">
						Ich stimme dem Synonym "${i.synonym.name}"
						<input type="radio" <c:if test="${requestScope.Ratings[nr.index] == 'YES'}">checked</c:if> name="synrating" value="YES">zu
						<input type="radio" <c:if test="${requestScope.Ratings[nr.index] == 'NO'}">checked</c:if> name="synrating" value="NO">nicht zu
						<input type="radio" <c:if test="${requestScope.Ratings[nr.index] == 'NEUTRAL'}">checked</c:if> name="synrating" value="NEUTRAL">keine Meinung
						&nbsp;&nbsp;<input type="submit" value="Bewerten">
					</html:form>
				</div>
			</li>
		</c:forEach>
		</ul>
	</c:when>
	<c:otherwise>
		<p>Derzeit noch keine.
	</c:otherwise>
</c:choose>

<p>&nbsp;</p>

<hr>

<p>&nbsp;</p>

<div class="FORMULAR">

	<html:errors/>

	<div class="FLOATNOTE">
		In dieser Beispielanwendung werden die 10 zuletzt angesehenen Topics als m&ouml;gliche Synonyme angeboten.
		Falls hier keine Topics aufgelistet sind, rufen Sie bitte zun&auml;chst andere Topics auf, die noch nicht
		synonym zu diesem Topic sind.
	</div>

	<c:if test="${not empty requestScope.Topics}">
		<p>Als synonym zu "${requestScope.Topic.name}" markieren:</p>
		<ul>
			<c:forEach items="${requestScope.Topics}" var="i">
				<li> <html:link action="addsynonym?id=${requestScope.Topic.id}&amp;synid=${i.id}">${i.name}</html:link> </li>
			</c:forEach>
		</ul>
	</c:if>
</div>

<p><br clear="all"></p>
