<%@ include file="/includes.jsp" %>
<tags:dialogBox title="">
    <table width="100%">
        <tr>
            <td>
                <c:forEach var="formMap" items="${summary.formsMap}">
                <c:set var="formHasData" value="false"/>
                    <div class="summaryFormContainer">
					<div class="summaryFormHeader">
						<span class="summaryFormType">&nbsp;Form</span>
						
						<span class="summaryFormTitle">
							<c:out value="${formMap.key }"/>
							</span>
							
					</div>
					<c:forEach var="form" items="${formMap.value}" varStatus="s">
					<c:set var="formHasData" value="true"/>
                        <c:forEach var="page" items="${form.pages }">
                            <div class="summaryPageContainer ">
                                <c:forEach var="section" items="${page.sections }">
                                    <div class="summarySectionContainer ">
                                        <table class="summaryFieldTable" width="100%">
                                            <c:forEach var="field" items="${section.fields }">
                                            
	                                            <%-- check if any of the field values have a value and display if so --%>
												<c:set var="fieldHasData" value="false"/>
												<c:forEach var="value" items="${field.values }">
													<c:if test="${! empty value}">
														<c:set var="fieldHasData" value="true" />
													</c:if>																	
												</c:forEach>
											
												<c:if test="${ fieldHasData }">
	                                            
	                                                <tr class="summaryFieldRow">
	                                                    <td class="summaryFieldTitle" width="30%"><c:out value="${field.label }"/></td>
	                                                    <td class="summaryFieldValue" width="70%">
	                                                        <c:if test="${field.values eq null}">--</c:if>
	                                                        <c:forEach var="value" items="${field.values }">
	                                                            <c:out value="${value}"/><br/>
	                                                        </c:forEach>
	                                                    </td>
	                                                </tr>
	                                                
	                                            </c:if>
                                                
                                            </c:forEach>
                                            
                                            
                                        </table>
                                    </div>
                                </c:forEach>
                            </div>
                        </c:forEach>
                        
                        <div class="summaryFormisEmptyMessage">
						<c:if test="${!formHasData}">				
							(this form contains no information)
						</c:if>							
						</div></c:forEach>
                        
                        
                    </div>
                </c:forEach>
            </td>
        </tr>
    </table>
</tags:dialogBox>