<%
  def voteNode = uicomponent.getNode() ;
  if(uicomponent.getOriginalNode().getPrimaryNodeType().getName().equals("nt:file")) {
    if(voteNode.getNodes().getSize() > 0) {
      def nodeIter = voteNode.getNodes() ;
      while(nodeIter.hasNext()) {
        def ntFile = nodeIter.nextNode() ;
        if(ntFile.getPrimaryNodeType().getName().equals("nt:file")) {
          voteNode = ntFile ;
        }
      }
    }
  } 
  double voteRating = 0 ;
  if(voteNode.hasProperty("exo:votingRate")) voteRating = voteNode.getProperty("exo:votingRate").getDouble() ;
  long voteTotal = 0 ;
  if(voteNode.hasProperty("exo:voteTotalOfLang")) voteTotal = voteNode.getProperty("exo:voteTotalOfLang").getLong() ;
%>
<style>
	<% _ctx.include(uicomponent.getTemplateSkin("mix:votable", "Stylesheet")); %>
</style>
<div class="UIVote">
  <div class="VoteResultContainer">
	  <div class="LeftVoteBar">
	    <div class="RightVoteBar">
	      <div class="CenterVoteBar">
					<div class="RatingInfoContainer">
					  <div class="AvgRatingImages">
					    <%
					      int iVote = 0;
					      while(++iVote <= voteRating) {
					    %>
					          <div class="Voted"><span></span></div>
					      <%
					        }
					        while(iVote++ <= 5) {
					      %>
					        <div class="Unvoted"><span></span></div>
					      <%}%>
						</div>
					</div>
					<div class="VoteRatingInfo">
				    <div class="VoteRatingLabel"><%=_ctx.appRes("Vote.view.label.avg-rating")%>: </div><div class="VotedInfo">$voteRating</div>
				    <div class="VoteRatingLabel"><%=_ctx.appRes("Vote.view.label.subscription")%>: </div><div class="VotedInfo">$voteTotal</div>
					</div>
					<div style="clear: left;"><span></span></div>
				</div>
		 	</div>
		</div>
	</div>
</div>