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


<%@ 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" %>

<%@ attribute name="day" deferredValue="true" required="true" %>
<%@ attribute name="schedule" deferredValue="true" required="true" %>

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

<t:column>
    <f:facet name="header">     
        <h:panelGroup> 
	        <h:outputText value="#{bundle.day0}" rendered="#{day == 0}" />
	        <h:outputText value="#{bundle.day1}" rendered="#{day == 1}" />
	        <h:outputText value="#{bundle.day2}" rendered="#{day == 2}" />
	        <h:outputText value="#{bundle.day3}" rendered="#{day == 3}" />
	        <h:outputText value="#{bundle.day4}" rendered="#{day == 4}" />
        </h:panelGroup>
    </f:facet>
    <c:copy source="#{day}" target="#{requestScope.day}" />
    <c:copy source="#{schedule}" target="#{requestScope.schedule}" />
    
    <t:dataList var="lesson" value="#{schedule[day][index]}" rowIndexVar="rowIndex" rowCountVar="rowCount">
        <h:outputText value="#{lesson.subject.subjCode}" title="#{utilsBean.lessonTitle[lesson]}" />
        <h:outputText value="#{bundle.listSeparator}" rendered="#{rowIndex < rowCount - 1}" />
    </t:dataList>
    
    <h:outputText value="&nbsp;" rendered="#{empty schedule[day][index]}" escape="false" />
</t:column>
    
    
    
