<%@ 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>
<%
    Job     job         = (Job) process.getAttribute("Job");
    String  nextPage    = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB);
    String  firstPage   = WebUtils.getSamePageInRenderMode(request, "Page");
    String  secondPage  = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
    String  thirdPage   = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
    String  fourthPage  = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_MATCH);

    Debug.assertion(job != null, "Job is null in admin portal create job");
%>
    <oneit:form name="editJob" method="post" enctype="multipart/form-data">

        <div class="container-fluid">
            
            <oneit:dynInclude   page="/extensions/applicantportal/inc/multifieldtext.jsp"   data="<%= CollectionUtils.EMPTY_MAP%>"/>

            <h1 class="page-title review-title">Review Job</h1>
            
            <div class="page-subtitle-">
                <span class=""> Executive Role $599.00 &nbsp;&nbsp;&nbsp;&nbsp; Available for 30 days </span>
                <span class="pull-right plan-link"> Post multiple jobs per month? <a href="#">See our plans</a></span>
            </div>
            
            <oneit:dynInclude   page="/extensions/adminportal/inc/job_main_tabs.jsp"    PageNumber="5"    data="<%= CollectionUtils.EMPTY_MAP%>"/>

            <div class="form-page-area">
                <div class="create-job">
                  <div class="assessment-criteria">
                    <div class="form-group">
                        <label class="label-16">Detail</label>
                        <oneit:button   value="EDIT"   name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right"   skin="link"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                    </div>              
                    <div class="form-group">
                        <div class="review-medium-title">
                            <oneit:ormlabel  obj="<%= job %>"   field="JobTitle" />
                            <span class="skill-label">
                                <oneit:toString value="<%= job.getJobTitle() %>"    mode="EscapeHTML" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="review-medium-title">
                            <oneit:ormlabel  obj="<%= job %>"   field="JobDescription" />
                            <span class="skill-label">
                                <oneit:toString value="<%= job.getJobDescription() %>"  mode="ParagraphHTML" />
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="row main-review-label">
                            <div class="col-sm-3 col-xs-12 review-label">
                                <oneit:ormlabel  obj="<%= job %>"    field="Level" />
                            </div>
                            <div class="col-sm-9 col-xs-12 review-data">
                                <oneit:toString value="<%= job.getLevel() %>"   mode="EscapeHTML" />
                            </div>
                        </div>
                        <div class="row main-review-label">
                            <div class="col-sm-3 col-xs-12 review-label">Client</div>
                            <div class="col-sm-9 col-xs-12 review-data">Australia Post</div>
                        </div>
                        <div class="row main-review-label">
                            <div class="col-sm-3 col-xs-12 review-label">Reference Number</div>
                            <div class="col-sm-9 col-xs-12 review-data">00589</div>
                        </div>
                    </div>
                    <div class="form-brack-line-sub"></div>
                    
                    <div class="form-group">
                        <label class="label-16">Requirements</label>
                        <oneit:button   value="EDIT"   name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right"   skin="link"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                    </div>
                    <%
                        for(CriteriaType criteria : CriteriaType.getCriteriaTypeArray())
                        {
                            Collection<AssessmentCriteria>  assessmentCriterias =   job.getAssessmentCriteraByType(criteria);

                            if(assessmentCriterias.size() == 0)
                            {
                                continue;
                            }
                    %>
                            <div class="form-group">
                                <div class="beloning">
                                    <oneit:toString value="<%= criteria.getName() %>" mode="EscapeHTML"/>
                                </div>
                            </div>
                                <div class="form-group">
                            <%
                                for (AssessmentCriteria assessmentCriteria : assessmentCriterias)
                                {
                            %>
                                        <span class="skill-label">
                                            <oneit:toString value="<%= assessmentCriteria.getName() %>" mode="EscapeHTML"/> - 
                                            <oneit:toString value="<%= assessmentCriteria.getImportance() %>" mode="EscapeHTML"/>
                                        </span>
                            <%  }    %>
                                </div>
                    <%  }   %>
                    <div class="form-brack-line-sub"></div>
                    
                    <div class="form-group">
                        <label class="label-16">Culture</label>
                        <oneit:button   value="EDIT"   name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right"   skin="link"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                    </div>
                    <%
                        for(CultureClass cultureClass : CultureClass.getCultureClassArray())
                        {
                    %>
                            <div class="form-group">
                                <div class="beloning">
                                    <oneit:toString value="<%= cultureClass %>" mode="EscapeHTML"/>
                                </div>
                            </div>

                            <div class="form-group">
                            <%
                                for (CultureCriteria criteria : job.getCultureCriteriasForClass(cultureClass))
                                {
                            %>
                                    <div class="row main-review-label">
                                        <div class="col-sm-3 col-xs-12 review-label culture-element">
                                            <oneit:toString value="<%= criteria.getCultureElement() %>" mode="EscapeHTML"/> 
                                        </div>
                                        <div class="col-sm-9 col-xs-12 review-data">
                                            <oneit:toString value="<%= criteria.getCultureElementRating()!= null ? criteria.getCultureElementRating().getDescription() : ""%>" mode="EscapeHTML"/> 
                                            (<oneit:toString value="<%= criteria.getImportance() %>" mode="EscapeHTML"/>)
                                        </div>
                                    </div>
                            <%  }    %>
                            </div>
                    <%  }   %>
                    
                    <div class="form-brack-line-sub"></div>
                    
                    <div class="form-group">
                        <label class="label-16">Job Match Assessment</label>
                        <oneit:button   value="EDIT"   name="gotoPage" cssClass="add-more-btn review-edit-btn pull-right"   skin="link"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fourthPage)
                                                                    .mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
                                                                    .toMap() %>"/>
                    </div>
                    <div class="form-group">              
                        <div class="beloning job-match-ass">
                            <oneit:toString value="<%= job.getAssessmentType() %>" mode="EscapeHTML"/> <oneit:toString value="<%= job.getAssessmentType().getQuestionDetails() %>" mode="EscapeHTML"/> 
                        </div>
                    </div>
                    <div class="text-center">
                        <oneit:button   value="Confirm and make payment"    name="saveJob" cssClass="btn btn-primary top-margin-25 largeBtn"
                                        requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
                                                                        .mapEntry ("restartProcess", Boolean.TRUE)
                                                                        .mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
                                                                        .toMap() %>" />
                    </div>
                    <div class="job-active-time">Your job will be active for 30 days from being published</div>
                  </div>
                </div>
            </div>
        </div>    
    </oneit:form>
</oneit:dynIncluded>