<commit_before><%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="uv" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="icon" tagdir="/WEB-INF/tags/icons" %>
<%@taglib prefix="asset" uri="/WEB-INF/asset.tld" %>

<!DOCTYPE html>
<html lang="${language}" class="tw-<c:out value='${theme}' />">

<head>
    <title>
        <c:choose>
            <c:when test="${application.id == null}">
                <spring:message code="application.data.header.title.new"/>
            </c:when>
            <c:otherwise>
                <spring:message code="application.data.header.title.edit"/>
            </c:otherwise>
        </c:choose>
    </title>
    <uv:custom-head/>
    <script>
        if (!window.uv) {
            window.uv = {};
        }
        window.uv.personId = '<c:out value="${person.id}" />';
        window.uv.webPrefix = "<spring:url value='/web' />";
        window.uv.apiPrefix = "<spring:url value='/api' />";
        // 0=sunday, 1=monday
        window.uv.weekStartsOn = 1;

        window.uv.i18n = [];
        window.uv.i18n['application.status.allowed'] = "<spring:message code='ALLOWED' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.applicationsOfColleagues'] = "<spring:message code='application.applier.applicationsOfColleagues' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.none'] = "<spring:message code='application.applier.none' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.invalidPeriod'] = "<spring:message code='application.applier.invalidPeriod' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.day'] = "<spring:message code='application.applier.day' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.days'] = "<spring:message code='application.applier.days' javaScriptEscape='true' />";
    </script>
    <uv:datepicker-localisation/>
    <link rel="stylesheet" type="text/css"
          href="<asset:url value='account_form~app_form~app_statistics~overtime_form~sick_note_form~sick_notes~workingtime_form.css' />"/>
    <link rel="stylesheet" type="text/css"
          href="<asset:url value='account_form~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_notes~workingtime_form.css' />"/>
    <link rel="stylesheet" type="text/css" href="<asset:url value='npm.timepicker.css' />"/>
    <link rel="stylesheet" type="text/css" href="<asset:url value='npm.duetds.css' />"/>
    <script defer src="<asset:url value='npm.duetds.js' />"></script>
    <script defer src="<asset:url value='npm.date-fns.js' />"></script>
    <script defer src="<asset:url value='npm.timepicker.js' />"></script>
    <script defer src="<asset:url value='app_detail~app_form~person_overview.js' />"></script>
    <script defer src="<asset:url value='app_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_form~app_statistics~overtime_form~sick_note_form~sick_notes~workingtime_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_notes~workingtime_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_detail~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_no~704d57c1.js' />"></script>
    <script defer src="<asset:url value='app_form.js' />"></script>
</head>

<body>

<spring:url var="URL_PREFIX" value="/web"/>
<c:set var="DATE_PATTERN">
    <spring:message code="pattern.date"/>
</c:set>
<c:set var="TIME_PATTERN">
    <spring:message code="pattern.time"/> <spring:message code="application.data.time.placeholder"/>
</c:set>
<uv:menu/>

<c:choose>
    <c:when test="${application.id == null}">
        <c:set var="ACTION" value="${URL_PREFIX}/application"/>
        <c:set var="ADD_REPLACEMENT_ACTION" value="${URL_PREFIX}/application/new"/>
        <c:set var="heading">
            <spring:message code="application.data.title.new"/>
        </c:set>
        <c:set var="BUTTON_SUBMIT_TITLE">
            <spring:message code="action.apply.vacation"/>
        </c:set>
    </c:when>
    <c:otherwise>
        <c:set var="ACTION" value="${URL_PREFIX}/application/${application.id}"/>
        <c:set var="ADD_REPLACEMENT_ACTION" value="${URL_PREFIX}/application/${application.id}"/>
        <c:set var="heading">
            <spring:message code="application.data.title.edit"/>
        </c:set>
        <c:set var="BUTTON_SUBMIT_TITLE">
            <spring:message code="action.apply.vacation.edit"/>
        </c:set>
    </c:otherwise>
</c:choose>

<c:set var="IS_SPECIALLEAVE_SHOWN" value="${application.vacationType.category == 'SPECIALLEAVE' ? '' : 'hidden'}"/>
<c:set var="IS_OVERTIME_SHOWN" value="${application.vacationType.category == 'OVERTIME' ? '' : 'hidden'}"/>
<c:set var="IS_DAYS_COUNT_SHOWN" value="hidden"/>

<div class="content">
    <div class="container">
        <c:choose>
            <c:when test="${noHolidaysAccount}">
                <spring:message code="application.applier.account.none"/>
            </c:when>
            <c:otherwise>
                <form:form id="applicationForm" method="POST" action="${ACTION}" modelAttribute="application"
                           class="form-horizontal" role="form">
                    <form:hidden path="id" value="${application.id}"/>
                    <form:hidden path="person" value="${person.id}"/>

                    <c:if test="${not empty errors.globalErrors}">
                        <div class="row">
                            <div class="col-xs-12 alert alert-danger"><commit_msg>Add hidden button so on enter the submit is called and not replacement button<commit_after><%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="uv" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="icon" tagdir="/WEB-INF/tags/icons" %>
<%@taglib prefix="asset" uri="/WEB-INF/asset.tld" %>

<!DOCTYPE html>
<html lang="${language}" class="tw-<c:out value='${theme}' />">

<head>
    <title>
        <c:choose>
            <c:when test="${application.id == null}">
                <spring:message code="application.data.header.title.new"/>
            </c:when>
            <c:otherwise>
                <spring:message code="application.data.header.title.edit"/>
            </c:otherwise>
        </c:choose>
    </title>
    <uv:custom-head/>
    <script>
        if (!window.uv) {
            window.uv = {};
        }
        window.uv.personId = '<c:out value="${person.id}" />';
        window.uv.webPrefix = "<spring:url value='/web' />";
        window.uv.apiPrefix = "<spring:url value='/api' />";
        // 0=sunday, 1=monday
        window.uv.weekStartsOn = 1;

        window.uv.i18n = [];
        window.uv.i18n['application.status.allowed'] = "<spring:message code='ALLOWED' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.applicationsOfColleagues'] = "<spring:message code='application.applier.applicationsOfColleagues' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.none'] = "<spring:message code='application.applier.none' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.invalidPeriod'] = "<spring:message code='application.applier.invalidPeriod' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.day'] = "<spring:message code='application.applier.day' javaScriptEscape='true' />";
        window.uv.i18n['application.applier.days'] = "<spring:message code='application.applier.days' javaScriptEscape='true' />";
    </script>
    <uv:datepicker-localisation/>
    <link rel="stylesheet" type="text/css"
          href="<asset:url value='account_form~app_form~app_statistics~overtime_form~sick_note_form~sick_notes~workingtime_form.css' />"/>
    <link rel="stylesheet" type="text/css"
          href="<asset:url value='account_form~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_notes~workingtime_form.css' />"/>
    <link rel="stylesheet" type="text/css" href="<asset:url value='npm.timepicker.css' />"/>
    <link rel="stylesheet" type="text/css" href="<asset:url value='npm.duetds.css' />"/>
    <script defer src="<asset:url value='npm.duetds.js' />"></script>
    <script defer src="<asset:url value='npm.date-fns.js' />"></script>
    <script defer src="<asset:url value='npm.timepicker.js' />"></script>
    <script defer src="<asset:url value='app_detail~app_form~person_overview.js' />"></script>
    <script defer src="<asset:url value='app_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_form~app_statistics~overtime_form~sick_note_form~sick_notes~workingtime_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_notes~workingtime_form.js' />"></script>
    <script defer
            src="<asset:url value='account_form~app_detail~app_form~app_statistics~overtime_form~person_overview~sick_note_form~sick_no~704d57c1.js' />"></script>
    <script defer src="<asset:url value='app_form.js' />"></script>
</head>

<body>

<spring:url var="URL_PREFIX" value="/web"/>
<c:set var="DATE_PATTERN">
    <spring:message code="pattern.date"/>
</c:set>
<c:set var="TIME_PATTERN">
    <spring:message code="pattern.time"/> <spring:message code="application.data.time.placeholder"/>
</c:set>
<uv:menu/>

<c:choose>
    <c:when test="${application.id == null}">
        <c:set var="ACTION" value="${URL_PREFIX}/application"/>
        <c:set var="ADD_REPLACEMENT_ACTION" value="${URL_PREFIX}/application/new"/>
        <c:set var="heading">
            <spring:message code="application.data.title.new"/>
        </c:set>
        <c:set var="BUTTON_SUBMIT_TITLE">
            <spring:message code="action.apply.vacation"/>
        </c:set>
    </c:when>
    <c:otherwise>
        <c:set var="ACTION" value="${URL_PREFIX}/application/${application.id}"/>
        <c:set var="ADD_REPLACEMENT_ACTION" value="${URL_PREFIX}/application/${application.id}"/>
        <c:set var="heading">
            <spring:message code="application.data.title.edit"/>
        </c:set>
        <c:set var="BUTTON_SUBMIT_TITLE">
            <spring:message code="action.apply.vacation.edit"/>
        </c:set>
    </c:otherwise>
</c:choose>

<c:set var="IS_SPECIALLEAVE_SHOWN" value="${application.vacationType.category == 'SPECIALLEAVE' ? '' : 'hidden'}"/>
<c:set var="IS_OVERTIME_SHOWN" value="${application.vacationType.category == 'OVERTIME' ? '' : 'hidden'}"/>
<c:set var="IS_DAYS_COUNT_SHOWN" value="hidden"/>

<div class="content">
    <div class="container">
        <c:choose>
            <c:when test="${noHolidaysAccount}">
                <spring:message code="application.applier.account.none"/>
            </c:when>
            <c:otherwise>
                <form:form id="applicationForm" method="POST" action="${ACTION}" modelAttribute="application"
                           class="form-horizontal" role="form">
                    <form:hidden path="id" value="${application.id}"/>
                    <form:hidden path="person" value="${person.id}"/>
                    <button type="submit" hidden></button>

                    <c:if test="${not empty errors.globalErrors}">
                        <div class="row">
                            <div class="col-xs-12 alert alert-danger">
{'fraction_non_alphanumeric': 0.18884548250353253, 'fraction_numerical': 0.004322167733355498, 'mean_word_length': 3.5749049429657793, 'pattern_counts': {'":': 0, '<': 243, '<?xml version=': 0, '>': 243, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '250656', 'n_tokens_mistral': 4042, 'n_tokens_neox': 3870, 'n_words': 535}