<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<oneit:dynIncluded>
<%
    ObjectTransaction   objTran         = process.getTransaction ();
    String              nextPage        = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
    JobApplication      jobApplication  = (JobApplication) process.getAttribute("JobApplication");
    Job                 job             = jobApplication.getJob();
    
%>
    <script>
        $(document.body).addClass('bg-color');
    </script>
    
    <div class="main-application-outline">
        <div class="selection-aust-logo">
            <img src="images/australia-post.png" />
            <span><oneit:toString value="<%= job.getJobTitle() %>"  mode="EscapeHTML"/></span>
        </div>
        <div class="show-mobile-title">
            <div class="mobile-title-page">Section 1 - Selection Criteria</div>
            <div class="mobile-estimated">Estimated time to complete: <b>5 mins</b></div>
        </div>
        <div class="section-title m-hide">Section 1</div>
        <div class="section-c-title m-hide">
            Selection Criteria
        <span>Estimated time to complete: <b>5 mins</b></span>
        </div>
        <div class="section-tab-view">
            
            <oneit:form name="editApplication"  method="post"   enctype="multipart/form-data">
            
                <oneit:dynInclude   page="/extensions/applicantportal/inc/multifieldtext.jsp"   data="<%= CollectionUtils.EMPTY_MAP%>"/>
                
                <oneit:dynInclude   page="/extensions/applicantportal/inc/application_main_tabs.jsp"    PageNumber="1"  data="<%= CollectionUtils.EMPTY_MAP%>"/>

                <div class="section-page-area">
                    <div class="main-sc-section">
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper at magna a
                            tristique. Ut ut magna ut mauris sagittis placerat. Suspendisse vitae tempus sem. Lorem
                            ipsum dolor sit amet, consectetur adipiscing elit.
                        </p>
                    </div>         
                    <%
                        for(CriteriaType ct: CriteriaType.getCriteriaTypeArray())
                        {
                            Collection<AssessmentCriteriaAnswer>    answerList  =   jobApplication.getACAnswersByType(ct);

                            if(!answerList.isEmpty())
                            {
                    %>
                                <div class="selection-br-line"></div>
                                <div class="main-sc-section">
                                    <div class="selection-form-title"><oneit:toString value="<%= ct %>" mode="EscapeHTML"/></div>
                                    <%
                                        for(AssessmentCriteriaAnswer answer: answerList)
                                        {
                                            String  optionKey   = WebUtils.getInputKey(request, answer, AssessmentCriteriaAnswer.FIELD_Answer);
                                    %>
                                            <div class="form-group-new question-y-n">
                                                <label class="second-label"><oneit:toString value="<%= answer.getAssessmentCriteria() %>" mode="EscapeHTML"/></label>
                                                <div class="radio radio-primary second-radio-primary">
                                                    <input type="radio" name="<%= optionKey %>" value="y" id="radio5" <%= answer.getAnswer() == true ? "selected" : "" %>/>
                                                    <input type="radio" name="radio30" id="radio5" value="option1" checked="">
                                                    <label for="radio5">
                                                        Yes
                                                    </label>
                                                </div>
                                                <div class="radio radio-primary second-radio-primary">
                                                    <input type="radio" name="<%= optionKey %>" value="n" id="radio6" <%= answer.getAnswer() == false ? "selected" : "" %>/>
                                                    <input type="radio" name="radio30" id="radio6" value="option1" checked="">
                                                    <label for="radio6">
                                                        No
                                                    </label>
                                                </div>
                                            </div>              
                                            <div class="textarea-box">
                                                <textarea class="form-control second-style" placeholder="Please add any notes to support your answer"></textarea>
                                            </div>
                                    <%
                                        }
                                    %>
                                </div>
                    <%
                            }
                        }
                    %>
                    <div class="selection-br-line"></div>
                    <div class="main-sc-section btn-remove-padd">
                        <div class="section-btn text-center">
                            <input type="button" class="box-btn-gray" value="Save and exit" />
                            <oneit:button   value="Proceed to step 2"   name="gotoPage" cssClass="box-btn"
                                            requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
                                                                            .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
                                                                            .toMap() %>"/>
                        </div>
                    </div>
                </div>
            </oneit:form>
        </div>
    </div>
</oneit:dynIncluded>