<%@ 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>
<div class="main-application-outline">
<%
    ObjectTransaction   objTran         = process.getTransaction ();
    String              nextPage        = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
    Job                 job             = (Job) process.getAttribute("Job");
    Candidate           candidate       = Utils.getCandidateUser(transaction);
    JobApplication      jobApplication  = JobApplication.searchCandidateJob(objTran, candidate, job);

    if(jobApplication == null)
    {
        jobApplication  = JobApplication.createNewApplication(candidate, job);
    }
    
    process.setAttribute("JobApplication", jobApplication);
    
    if(jobApplication.getApplicationStatus()==ApplicationStatus.SUBMITTED)
    {
%>
        <div class="welcome-aust-logo">
            <p class="overview-title" align="center">You have already applied to this job.</p>
        </div>
<%
    }
    else
    {
%>
        <div class="welcome-aust-logo"><img src="images/australia-post.png" /></div>
        <div class="welcome-title">Welcome <oneit:toString value="<%= candidate.getFirstName() %>"/>, here's your application outline</div>
        <div class="appli-aust-title"><oneit:toString value="<%= job.getJobTitle() %>"  mode="EscapeHTML"/></div>
        <p class="appli-content">
            <oneit:toString value="<%= job.getJobDescription() %>"  mode="ParagraphHTML"    nullValue="-"/>
        </p>
        <div class="three-block">
            <div class="col-sm-4 col-xs-12 app-block eq-height">
                <div class="block-icon"><img src="images/selection-assessment.png" /></div>
                <div class="app-block-title">Selection Criteria</div>
                <div class="estimated-time">Estimated time to complete: <span>5 mins</span></div>
                <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.
                </p>
              </div>
            <div class="col-sm-4 col-xs-12 app-block app-second-block eq-height">
                <div class="block-icon"><img src="images/workplace-culture.png" /></div>
                <div class="app-block-title">Workplace Culture</div>
                <div class="estimated-time">Estimated time to complete: <span>5 mins</span></div>
                <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.
                </p>
            </div>
            <div class="col-sm-4 col-xs-12 app-block eq-height last-border">
                <div class="block-icon"><img src="images/job-match-icon.png" /></div>
                <div class="app-block-title">Job Match Assessment</div>
                <div class="estimated-time">Estimated time to complete: <span>20 mins</span></div>
                <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.
                </p>
            </div>
        </div>
        <oneit:form name="applyJob" method="post" enctype="multipart/form-data">
            <div class="app-out-btn">
                <span>Total time to complete: Approximately 40 minutes</span>
                <oneit:button   value="Begin the application"   name="gotoPage" skin="link" cssClass="box-btn"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
                                                                .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
                                                                .toMap() %>"/>
            </div>
        </oneit:form>
<%
    }
%>
</div>
</oneit:dynIncluded>