<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="sec" uri="http://www.springframework.org/security/tags" %>
<%@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}">

<c:set var="SICK_NOTE_MESSAGEKEY">
    <spring:message code='${sickNote.sickNoteType.messageKey}'/>
</c:set>

<head>
    <title>
        <spring:message code="sicknote.header.title" arguments="${SICK_NOTE_MESSAGEKEY}, ${sickNote.person.niceName}"/>
    </title>
    <uv:custom-head/>
    <script defer src="<asset:url value='sick_note.js' />"></script>
</head>
<body>

<spring:url var="URL_PREFIX" value="/web"/>

<uv:menu/>

<div class="content">

    <div class="container">

        <div class="row">

            <div class="col-xs-12 col-sm-12 col-md-6">

                <uv:section-heading>
                    <jsp:attribute name="actions">
                        <sec:authorize access="hasAuthority('OFFICE')">
                            <c:if test="${sickNote.active}">
                                <a href="${URL_PREFIX}/sicknote/${sickNote.id}/edit" class="icon-link tw-px-1" data-title="<spring:message code="action.edit"/>">
                                    <icon:pencil className="tw-w-5 tw-h-5" />
                                </a>
                                <a href="${URL_PREFIX}/sicknote/${sickNote.id}/convert" class="icon-link tw-px-1" data-title="<spring:message code="action.convert"/>">
                                    <icon:refresh className="tw-w-5 tw-h-5" />
                                </a>
                                <a href="#modal-cancel" role="button" data-toggle="modal" class="icon-link tw-px-1" data-title="<spring:message code="action.delete"/>">
                                    <icon:trash className="tw-w-5 tw-h-5" />
                                </a>
                                <uv:print/>
                            </c:if>
                        </sec:authorize>
                    </jsp:attribute>
                    <jsp:body>
                        <h1>
                            <spring:message code="sicknote.title"/>
                        </h1>
                    </jsp:body>
                </uv:section-heading>

                <form:form method="POST" action="${URL_PREFIX}/sicknote/${sickNote.id}/cancel">
                    <div id="modal-cancel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                         aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        <icon:x-circle className="tw-w-8 tw-h-8" solid="true" />
                                    </button>
                                    <h4 id="myModalLabel" class="modal-title"><spring:message
                                        code="action.delete"/>?</h4>
                                </div>
                                <div class="modal-body">
                                    <spring:message code="action.sicknote.cancel.confirm"/>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-danger is-sticky" type="submit"><spring:message
                                        code="action.delete"/></button>
                                    <button class="btn btn-default is-sticky" data-dismiss="modal" aria-hidden="true">
                                        <spring:message code="action.cancel"/></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form:form>

                <uv:box className="tw-mb-6">
                    <jsp:attribute name="icon">
                        <uv:box-icon className="tw-bg-red-600 tw-text-white">
                            <c:choose>
                                <c:when test="${sickNote.sickNoteType.category == 'SICK_NOTE_CHILD'}">
                                    <icon:child className="tw-w-8 tw-h-8" />
                                </c:when>
                                <c:otherwise>
                                    <icon:medkit className="tw-w-8 tw-h-8" />
                                </c:otherwise>
                            </c:choose>
                        </uv:box-icon>
                    </jsp:attribute>
                    <jsp:body>
                        <span class="tw-text-sm tw-text-black tw-text-opacity-75">
                            <spring:message
                                code="sicknotes.details.box.person.has"
                                arguments="${sickNote.person.niceName}"
                            />
                        </span>
                        <span class="tw-my-1 tw-text-lg tw-font-medium">
                            <c:out value="${SICK_NOTE_MESSAGEKEY}" />
                        </span>
                        <span class="tw-text-sm tw-text-black tw-text-opacity-75">
                            <c:choose>
                                <c:when test="${sickNote.startDate == sickNote.endDate}">
                                    <c:set var="SICK_NOTE_DATE">
                                        <spring:message code="${sickNote.weekDayOfStartDate}.short"/>,
                                        <uv:date date="${sickNote.startDate}"/>
                                    </c:set>
                                    <c:set var="SICK_NOTE_DAY_LENGTH">
                                        <spring:message code="${sickNote.dayLength}"/>
                                    </c:set>
                                    <spring:message
                                        code="absence.period.singleDay"
                                        arguments="${SICK_NOTE_DATE};${SICK_NOTE_DAY_LENGTH}"
                                        argumentSeparator=";"
                                    />
                                </c:when>
                                <c:otherwise>
                                    <c:set var="SICK_NOTE_START_DATE">
                                        <spring:message code="${sickNote.weekDayOfStartDate}.short"/>,
                                        <uv:date date="${sickNote.startDate}"/>
                                    </c:set>
                                    <c:set var="SICK_NOTE_END_DATE">
                                        <spring:message code="${sickNote.weekDayOfEndDate}.short"/>,
                                        <uv:date date="${sickNote.endDate}"/>
                                    </c:set>
                                    <spring:message
                                        code="absence.period.multipleDays"
                                        arguments="${SICK_NOTE_START_DATE};${SICK_NOTE_END_DATE}"
                                        argumentSeparator=";"
                                    />
                                </c:otherwise>
                            </c:choose>
                        </span>
                    </jsp:body>
                </uv:box>

                <table class="list-table striped-table bordered-table tw-text-sm">
                    <tbody>
                    <tr>
                        <td>
                            <spring:message code="absence.period.duration"/>
                        </td>
                        <td>
                            = <uv:number number="${sickNote.workDays}"/> <spring:message
                            code="duration.workDays"/>
                            <c:if test="${sickNote.active == false}">
                                <span><spring:message code="sicknote.data.inactive"/></span>
                            </c:if>
                        </td>
                    </tr>
                    <tr>
                        <td><spring:message code="sicknote.data.aub.short"/></td>
                        <td>
                            <div class="tw-flex tw-items-center">
                            <c:choose>
                                <c:when test="${sickNote.aubPresent}">
                                    <icon:check className="tw-w-4 tw-h-4" />
                                    &nbsp;<uv:date date="${sickNote.aubStartDate}"/> - <uv:date date="${sickNote.aubEndDate}"/>
                                </c:when>
                                <c:otherwise>
                                    <icon:x className="tw-w-4 tw-h-4" />
                                    &nbsp;<spring:message code="sicknote.data.aub.notPresent"/>
                                </c:otherwise>
                            </c:choose>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
            <%-- End of first column --%>

            <div class="col-xs-12 col-sm-12 col-md-6">

                <uv:section-heading>
                    <jsp:attribute name="actions">
                        <sec:authorize access="hasAuthority('OFFICE')">
                            <a href="#" class="icon-link tw-px-1" onclick="$('div#comment-form').show();" data-title="<spring:message code="action.comment.new" />">
                                <icon:annotation className="tw-w-5 tw-h-5" />
                            </a>
                        </sec:authorize>
                    </jsp:attribute>
                    <jsp:body>
                        <h2>
                            <spring:message code="sicknote.progress.title"/>
                        </h2>
                    </jsp:body>
                </uv:section-heading>

                <table class="list-table striped-table bordered-table tw-text-sm">
                    <tbody>
                    <c:forEach items="${comments}" var="comment" varStatus="loopStatus">
                        <tr>
                            <td class="hidden-print">
                                <img
                                    src="<c:out value='${comment.person.gravatarURL}?d=mm&s=40'/>"
                                    alt="<spring:message code="gravatar.alt" arguments="${comment.person.niceName}"/>"
                                    class="gravatar gravatar--medium tw-rounded-full"
                                    width="40px"
                                    height="40px"
                                    onerror="this.src !== '/images/gravatar.jpg' && (this.src = '/images/gravatar.jpg')"
                                />
                            </td>
                            <td>
                                <c:out value="${comment.person.niceName}"/>
                            </td>
                            <td>
                                <c:choose>
                                    <c:when test="${empty comment.text}">
                                        <spring:message code="sicknote.progress.${comment.action}"/>
                                        <uv:instant date="${comment.date}"/>
                                    </c:when>
                                    <c:otherwise>
                                        <spring:message code="sicknote.progress.${comment.action}"/>
                                        <uv:instant date="${comment.date}"/>
                                        <c:choose>
                                            <c:when test="${comment.action == 'COMMENTED'}">
                                                :
                                            </c:when>
                                            <c:otherwise>
                                                <spring:message code="sicknote.progress.comment"/>
                                            </c:otherwise>
                                        </c:choose>
                                        <br/>
                                        <em><c:out value="${comment.text}"/></em>
                                    </c:otherwise>
                                </c:choose>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>

                <sec:authorize access="hasAuthority('OFFICE')">

                    <c:choose>
                        <c:when test="${not empty errors}">
                            <c:set var="STYLE" value="display: block"/>
                            <div class="feedback">
                                <div class="alert alert-danger">
                                    <spring:message code="application.action.reason.error"/>
                                </div>
                            </div>
                        </c:when>
                        <c:otherwise>
                            <c:set var="STYLE" value="display: none"/>
                        </c:otherwise>
                    </c:choose>

                    <div id="comment-form" style="${STYLE}">
                        <form:form method="POST" action="${URL_PREFIX}/sicknote/${sickNote.id}/comment"
                                   modelAttribute="comment">
                            <small>
                                <span id="text-comment"></span> <spring:message code="action.comment.maxChars"/>
                            </small>
                            <form:textarea rows="2" path="text" cssClass="form-control"
                                           cssErrorClass="form-control error"
                                           onkeyup="count(this.value, 'text-comment');"
                                           onkeydown="maxChars(this,200); count(this.value, 'text-comment');"/>
                            <br/>
                            <button class="btn btn-success col-xs-12 col-sm-5" type="submit">
                                <spring:message code="action.save"/>
                            </button>
                            <button class="btn btn-default col-xs-12 col-sm-5 pull-right" type="button"
                                    onclick="$('div#comment-form').hide();">
                                <spring:message code="action.cancel"/>
                            </button>
                        </form:form>
                    </div>

                </sec:authorize>

                <div class="print:hidden">
                    <uv:section-heading>
                        <h2>
                            <spring:message code="sicknote.data.person"/><commit_msg>do not print employee box on sicknote page<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="sec" uri="http://www.springframework.org/security/tags" %>
<%@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}">

<c:set var="SICK_NOTE_MESSAGEKEY">
    <spring:message code='${sickNote.sickNoteType.messageKey}'/>
</c:set>

<head>
    <title>
        <spring:message code="sicknote.header.title" arguments="${SICK_NOTE_MESSAGEKEY}, ${sickNote.person.niceName}"/>
    </title>
    <uv:custom-head/>
    <script defer src="<asset:url value='sick_note.js' />"></script>
</head>
<body>

<spring:url var="URL_PREFIX" value="/web"/>

<uv:menu/>

<div class="content">

    <div class="container">

        <div class="row">

            <div class="col-xs-12 col-sm-12 col-md-6">

                <uv:section-heading>
                    <jsp:attribute name="actions">
                        <sec:authorize access="hasAuthority('OFFICE')">
                            <c:if test="${sickNote.active}">
                                <a href="${URL_PREFIX}/sicknote/${sickNote.id}/edit" class="icon-link tw-px-1" data-title="<spring:message code="action.edit"/>">
                                    <icon:pencil className="tw-w-5 tw-h-5" />
                                </a>
                                <a href="${URL_PREFIX}/sicknote/${sickNote.id}/convert" class="icon-link tw-px-1" data-title="<spring:message code="action.convert"/>">
                                    <icon:refresh className="tw-w-5 tw-h-5" />
                                </a>
                                <a href="#modal-cancel" role="button" data-toggle="modal" class="icon-link tw-px-1" data-title="<spring:message code="action.delete"/>">
                                    <icon:trash className="tw-w-5 tw-h-5" />
                                </a>
                                <uv:print/>
                            </c:if>
                        </sec:authorize>
                    </jsp:attribute>
                    <jsp:body>
                        <h1>
                            <spring:message code="sicknote.title"/>
                        </h1>
                    </jsp:body>
                </uv:section-heading>

                <form:form method="POST" action="${URL_PREFIX}/sicknote/${sickNote.id}/cancel">
                    <div id="modal-cancel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                         aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        <icon:x-circle className="tw-w-8 tw-h-8" solid="true" />
                                    </button>
                                    <h4 id="myModalLabel" class="modal-title"><spring:message
                                        code="action.delete"/>?</h4>
                                </div>
                                <div class="modal-body">
                                    <spring:message code="action.sicknote.cancel.confirm"/>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn btn-danger is-sticky" type="submit"><spring:message
                                        code="action.delete"/></button>
                                    <button class="btn btn-default is-sticky" data-dismiss="modal" aria-hidden="true">
                                        <spring:message code="action.cancel"/></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form:form>

                <uv:box className="tw-mb-6">
                    <jsp:attribute name="icon">
                        <uv:box-icon className="tw-bg-red-600 tw-text-white">
                            <c:choose>
                                <c:when test="${sickNote.sickNoteType.category == 'SICK_NOTE_CHILD'}">
                                    <icon:child className="tw-w-8 tw-h-8" />
                                </c:when>
                                <c:otherwise>
                                    <icon:medkit className="tw-w-8 tw-h-8" />
                                </c:otherwise>
                            </c:choose>
                        </uv:box-icon>
                    </jsp:attribute>
                    <jsp:body>
                        <span class="tw-text-sm tw-text-black tw-text-opacity-75">
                            <spring:message
                                code="sicknotes.details.box.person.has"
                                arguments="${sickNote.person.niceName}"
                            />
                        </span>
                        <span class="tw-my-1 tw-text-lg tw-font-medium">
                            <c:out value="${SICK_NOTE_MESSAGEKEY}" />
                        </span>
                        <span class="tw-text-sm tw-text-black tw-text-opacity-75">
                            <c:choose>
                                <c:when test="${sickNote.startDate == sickNote.endDate}">
                                    <c:set var="SICK_NOTE_DATE">
                                        <spring:message code="${sickNote.weekDayOfStartDate}.short"/>,
                                        <uv:date date="${sickNote.startDate}"/>
                                    </c:set>
                                    <c:set var="SICK_NOTE_DAY_LENGTH">
                                        <spring:message code="${sickNote.dayLength}"/>
                                    </c:set>
                                    <spring:message
                                        code="absence.period.singleDay"
                                        arguments="${SICK_NOTE_DATE};${SICK_NOTE_DAY_LENGTH}"
                                        argumentSeparator=";"
                                    />
                                </c:when>
                                <c:otherwise>
                                    <c:set var="SICK_NOTE_START_DATE">
                                        <spring:message code="${sickNote.weekDayOfStartDate}.short"/>,
                                        <uv:date date="${sickNote.startDate}"/>
                                    </c:set>
                                    <c:set var="SICK_NOTE_END_DATE">
                                        <spring:message code="${sickNote.weekDayOfEndDate}.short"/>,
                                        <uv:date date="${sickNote.endDate}"/>
                                    </c:set>
                                    <spring:message
                                        code="absence.period.multipleDays"
                                        arguments="${SICK_NOTE_START_DATE};${SICK_NOTE_END_DATE}"
                                        argumentSeparator=";"
                                    />
                                </c:otherwise>
                            </c:choose>
                        </span>
                    </jsp:body>
                </uv:box>

                <table class="list-table striped-table bordered-table tw-text-sm">
                    <tbody>
                    <tr>
                        <td>
                            <spring:message code="absence.period.duration"/>
                        </td>
                        <td>
                            = <uv:number number="${sickNote.workDays}"/> <spring:message
                            code="duration.workDays"/>
                            <c:if test="${sickNote.active == false}">
                                <span><spring:message code="sicknote.data.inactive"/></span>
                            </c:if>
                        </td>
                    </tr>
                    <tr>
                        <td><spring:message code="sicknote.data.aub.short"/></td>
                        <td>
                            <div class="tw-flex tw-items-center">
                            <c:choose>
                                <c:when test="${sickNote.aubPresent}">
                                    <icon:check className="tw-w-4 tw-h-4" />
                                    &nbsp;<uv:date date="${sickNote.aubStartDate}"/> - <uv:date date="${sickNote.aubEndDate}"/>
                                </c:when>
                                <c:otherwise>
                                    <icon:x className="tw-w-4 tw-h-4" />
                                    &nbsp;<spring:message code="sicknote.data.aub.notPresent"/>
                                </c:otherwise>
                            </c:choose>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
            <%-- End of first column --%>

            <div class="col-xs-12 col-sm-12 col-md-6">

                <uv:section-heading>
                    <jsp:attribute name="actions">
                        <sec:authorize access="hasAuthority('OFFICE')">
                            <a href="#" class="icon-link tw-px-1" onclick="$('div#comment-form').show();" data-title="<spring:message code="action.comment.new" />">
                                <icon:annotation className="tw-w-5 tw-h-5" />
                            </a>
                        </sec:authorize>
                    </jsp:attribute>
                    <jsp:body>
                        <h2>
                            <spring:message code="sicknote.progress.title"/>
                        </h2>
                    </jsp:body>
                </uv:section-heading>

                <table class="list-table striped-table bordered-table tw-text-sm">
                    <tbody>
                    <c:forEach items="${comments}" var="comment" varStatus="loopStatus">
                        <tr>
                            <td class="hidden-print">
                                <img
                                    src="<c:out value='${comment.person.gravatarURL}?d=mm&s=40'/>"
                                    alt="<spring:message code="gravatar.alt" arguments="${comment.person.niceName}"/>"
                                    class="gravatar gravatar--medium tw-rounded-full"
                                    width="40px"
                                    height="40px"
                                    onerror="this.src !== '/images/gravatar.jpg' && (this.src = '/images/gravatar.jpg')"
                                />
                            </td>
                            <td>
                                <c:out value="${comment.person.niceName}"/>
                            </td>
                            <td>
                                <c:choose>
                                    <c:when test="${empty comment.text}">
                                        <spring:message code="sicknote.progress.${comment.action}"/>
                                        <uv:instant date="${comment.date}"/>
                                    </c:when>
                                    <c:otherwise>
                                        <spring:message code="sicknote.progress.${comment.action}"/>
                                        <uv:instant date="${comment.date}"/>
                                        <c:choose>
                                            <c:when test="${comment.action == 'COMMENTED'}">
                                                :
                                            </c:when>
                                            <c:otherwise>
                                                <spring:message code="sicknote.progress.comment"/>
                                            </c:otherwise>
                                        </c:choose>
                                        <br/>
                                        <em><c:out value="${comment.text}"/></em>
                                    </c:otherwise>
                                </c:choose>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>

                <sec:authorize access="hasAuthority('OFFICE')">

                    <c:choose>
                        <c:when test="${not empty errors}">
                            <c:set var="STYLE" value="display: block"/>
                            <div class="feedback">
                                <div class="alert alert-danger">
                                    <spring:message code="application.action.reason.error"/>
                                </div>
                            </div>
                        </c:when>
                        <c:otherwise>
                            <c:set var="STYLE" value="display: none"/>
                        </c:otherwise>
                    </c:choose>

                    <div id="comment-form" style="${STYLE}">
                        <form:form method="POST" action="${URL_PREFIX}/sicknote/${sickNote.id}/comment"
                                   modelAttribute="comment">
                            <small>
                                <span id="text-comment"></span> <spring:message code="action.comment.maxChars"/>
                            </small>
                            <form:textarea rows="2" path="text" cssClass="form-control"
                                           cssErrorClass="form-control error"
                                           onkeyup="count(this.value, 'text-comment');"
                                           onkeydown="maxChars(this,200); count(this.value, 'text-comment');"/>
                            <br/>
                            <button class="btn btn-success col-xs-12 col-sm-5" type="submit">
                                <spring:message code="action.save"/>
                            </button>
                            <button class="btn btn-default col-xs-12 col-sm-5 pull-right" type="button"
                                    onclick="$('div#comment-form').hide();">
                                <spring:message code="action.cancel"/>
                            </button>
                        </form:form>
                    </div>

                </sec:authorize>

                <div class="print:tw-hidden">
                    <uv:section-heading>
                        <h2>
                            <spring:message code="sicknote.data.person"/>
{'fraction_non_alphanumeric': 0.12958330590481207, 'fraction_numerical': 0.004344677769732078, 'mean_word_length': 0.8818829358934654, 'pattern_counts': {'":': 0, '<': 523, '<?xml version=': 0, '>': 523, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 172, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3827853', 'n_tokens_mistral': 7359, 'n_tokens_neox': 6838, 'n_words': 1002}