aboutsummaryrefslogtreecommitdiff
path: root/subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-07-02 21:24:02 -0700
committerScott Jackson <daneren2005@gmail.com>2012-07-02 21:24:02 -0700
commita1a18f77a50804e0127dfa4b0f5240c49c541184 (patch)
tree19a38880afe505beddb5590379a8134d7730a277 /subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp
parentb61d787706979e7e20f4c3c4f93c1f129d92273f (diff)
downloaddsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.tar.gz
dsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.tar.bz2
dsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.zip
Initial Commit
Diffstat (limited to 'subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp')
-rw-r--r--subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp51
1 files changed, 51 insertions, 0 deletions
diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp
new file mode 100644
index 00000000..9e956de3
--- /dev/null
+++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/rating.jsp
@@ -0,0 +1,51 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%>
+<%@ include file="include.jsp" %>
+
+<%--
+Creates HTML for displaying the rating stars.
+PARAMETERS
+ path: Album path. May be null if readonly.
+ readonly: Whether rating can be changed.
+ rating: The rating, an integer from 0 (no rating), through 10 (lowest rating), to 50 (highest rating).
+--%>
+
+<c:forEach var="i" begin="1" end="5">
+
+ <sub:url value="setRating.view" var="ratingUrl">
+ <sub:param name="path" value="${param.path}"/>
+ <sub:param name="action" value="rating"/>
+ <sub:param name="rating" value="${i}"/>
+ </sub:url>
+
+ <c:choose>
+ <c:when test="${param.rating ge i * 10}">
+ <spring:theme code="ratingOnImage" var="imageUrl"/>
+ </c:when>
+ <c:when test="${param.rating ge i*10 - 7 and param.rating le i*10 - 3}">
+ <spring:theme code="ratingHalfImage" var="imageUrl"/>
+ </c:when>
+ <c:otherwise>
+ <spring:theme code="ratingOffImage" var="imageUrl"/>
+ </c:otherwise>
+ </c:choose>
+
+ <c:choose>
+ <c:when test="${param.readonly}">
+ <img src="${imageUrl}" style="margin-right:-3px" alt="" title="<fmt:message key="rating.rating"/> ${param.rating/10}">
+ </c:when>
+ <c:otherwise>
+ <a href="${ratingUrl}"><img src="${imageUrl}" style="margin-right:-3px" alt="" title="<fmt:message key="rating.rating"/> ${i}"></a>
+ </c:otherwise>
+ </c:choose>
+
+</c:forEach>
+
+<sub:url value="setRating.view" var="clearRatingUrl">
+ <sub:param name="path" value="${param.path}"/>
+ <sub:param name="action" value="rating"/>
+ <sub:param name="rating" value="0"/>
+</sub:url>
+
+<c:if test="${not param.readonly}">
+ | <a href="${clearRatingUrl}"><img src="<spring:theme code="clearRatingImage"/>" alt="" title="<fmt:message key="rating.clearrating"/>" style="margin-left:-3px; margin-right:5px"></a>
+</c:if>