<%@ taglib prefix="c" uri="/WEB-INF/common" %>
<%@ taglib prefix="r" uri="/WEB-INF/tags/results/" %>


<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<f:loadBundle var="bundle" basename="tvark.Resources"/>

<c:body step="#{5}">

    <h:outputFormat value="#{bundle.formatStepTitle}" styleClass="float-title">
        <f:param value="5" />
        <f:param value="#{bundle.titleResults}" />
    </h:outputFormat>
    
    <h:commandLink action="resultParameters">
        <h:outputText value="#{bundle.schoolSchedule}" rendered="#{resultsBean.scheduleOwner.isSchool}" styleClass="float-title" />
        <h:outputFormat value="#{bundle.studentSchedule}" rendered="#{resultsBean.scheduleOwner.isStudent}" styleClass="float-title">
            <f:param value="#{resultsBean.studentId}" />
        </h:outputFormat>
        <h:outputFormat value="#{bundle.teacherSchedule}" rendered="#{resultsBean.scheduleOwner.isTeacher}" styleClass="float-title">
            <f:param value="#{resultsBean.teacherId}" />
        </h:outputFormat>
        <h:outputFormat value="#{bundle.roomShedule}" rendered="#{resultsBean.scheduleOwner.isRoom}" styleClass="float-title">
            <f:param value="#{resultsBean.roomId}" />
        </h:outputFormat>
        <h:outputFormat value="#{bundle.groupSchedule}" rendered="#{resultsBean.scheduleOwner.isGroup}" styleClass="float-title">
            <f:param value="#{resultsBean.groupId}" />
        </h:outputFormat>
	</h:commandLink>
    
    <h:outputText value="#{bundle.initialSchedule}" rendered="#{resultsBean.displayMode.isInitial || resultsBean.displayMode.isBoth}" styleClass="heading" />
    <h:panelGroup rendered="#{resultsBean.displayMode.isInitial || resultsBean.displayMode.isBoth}">
        <r:schedule schedule="#{resultsBean.initialSchedule}"  />
    </h:panelGroup>
    
    <h:outputText value="#{bundle.optimizedSchedule}" rendered="#{resultsBean.displayMode.isFinal || resultsBean.displayMode.isBoth}" styleClass="heading marginTop" />
    <h:panelGroup rendered="#{resultsBean.displayMode.isFinal || resultsBean.displayMode.isBoth}">
        <r:schedule schedule="#{resultsBean.finalSchedule}"  />
    </h:panelGroup>

    <h:panelGroup styleClass="marginTop">
        <h:outputFormat value="#{bundle.initialFinalPenalties}">
            <f:param value="#{resultsBean.initial.penalty}" />
            <f:param value="#{resultsBean.final.penalty}" />
        </h:outputFormat>
    </h:panelGroup>    
    
    <h:panelGroup styleClass="marginTop">
	    <h:outputLink target="_blank" value="download.jsp">
	        <h:outputText value="#{bundle.downloadZip}" />
	    </h:outputLink>
    </h:panelGroup>    
</c:body>
