diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 40647b75cd73addfa351895aa7bffe63a8e8396a..4bcee607d33263e4e7427e491192b42c802e2871 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -185,6 +185,7 @@ jobOffer.hiringMessage.enter = An optional message that a student will see after jobOffer.hiringMessage.edit = Edit Hiring Message jobOffer.hiringMessage.add = Add Hiring Message jobOffer.hiringMessage.view = View hiring message +jobOffer.responseMessage = Your Response jobOffer.rejectMessage = Rejection Message jobOffer.rejectMessage.enter = An optional message that a rejected student will see... jobOffer.rejectMessage.view = View rejection message diff --git a/src/main/resources/templates/application/view_many.html b/src/main/resources/templates/application/view_many.html index 969519a5b92bacbf373353f06cf86a6da4b9eb3a..82831356105f2691279005677ead1ce5e34b7f74 100644 --- a/src/main/resources/templates/application/view_many.html +++ b/src/main/resources/templates/application/view_many.html @@ -100,18 +100,25 @@ </td> <td> <div class="flex justify-end gap-3"> + <button + th:if="${!(app.content == null || app.content.isEmpty())}" + class="button p-min" + data-style="outlined" + th:data-dialog="|view-response-message-overlay-${offer.id}|" + th:aria-label="#{application.viewContent}" + th:text="#{application.viewContent}"></button> <button th:if="${(status == 'ACCEPTED' || status == 'OFFERED') && !(offer.hiringMessage == null || offer.hiringMessage.isEmpty())}" class="button p-min" data-style="outlined" - th:data-dialog="|view-hiring-message-overlay-${app.jobOfferId}|" + th:data-dialog="|view-hiring-message-overlay-${offer.id}|" th:aria-label="#{jobOffer.hiringMessage.view}" th:text="#{jobOffer.hiringMessage.view}"></button> <button th:if="${status == 'REJECTED_BY_TEACHER' && !(offer.rejectMessage == null || offer.rejectMessage.isEmpty())}" class="button p-min" data-style="outlined" - th:data-dialog="|view-reject-message-overlay-${app.jobOfferId}|" + th:data-dialog="|view-reject-message-overlay-${offer.id}|" th:aria-label="#{jobOffer.rejectMessage.view}" th:text="#{jobOffer.rejectMessage.view}"></button> <form @@ -145,12 +152,15 @@ </div> </div> </td> - <div + <th:block th:if="${(status == 'ACCEPTED' || status == 'OFFERED') && !(offer.hiringMessage == null || offer.hiringMessage.isEmpty())}" - th:replace="~{job_offer/view_hiring_message :: overlay}"></div> - <div + th:replace="~{job_offer/message_overlay :: overlay('hiring', ${offer.id}, ${offer.hiringMessage})}"></th:block> + <th:block th:if="${status == 'REJECTED_BY_TEACHER' && !(offer.rejectMessage == null || offer.rejectMessage.isEmpty())}" - th:replace="~{job_offer/view_reject_message :: overlay}"></div> + th:replace="~{job_offer/message_overlay :: overlay('reject', ${offer.id}, ${offer.rejectMessage})}"></th:block> + <th:block + th:if="${!(app.content == null || app.content.isEmpty())}" + th:replace="~{job_offer/message_overlay :: overlay('response', ${offer.id}, ${app.content})}"></th:block> </tr> <tr th:if="${applications.isEmpty()}"> <td data-empty="true" colspan="6" th:text="#{application.empty}"></td> diff --git a/src/main/resources/templates/job_offer/view_hiring_message.html b/src/main/resources/templates/job_offer/message_overlay.html similarity index 82% rename from src/main/resources/templates/job_offer/view_hiring_message.html rename to src/main/resources/templates/job_offer/message_overlay.html index 0809eece69e98ddd8d22066139ebecd6679b20e4..ec2a629c7606885bef1aba984f2828941e0589a0 100644 --- a/src/main/resources/templates/job_offer/view_hiring_message.html +++ b/src/main/resources/templates/job_offer/message_overlay.html @@ -24,14 +24,14 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> <body> <dialog - th:fragment="overlay" - th:id="|view-hiring-message-overlay-${offer.id}|" + th:fragment="overlay(type, jobOfferId, messageHtml)" + th:id="|view-${type}-message-overlay-${jobOfferId}|" data-closable class="dialog"> <div class="flex vertical p-7"> - <h1 class="font-500 underlined" th:text="#{jobOffer.hiringMessage}"></h1> + <h1 class="font-500 underlined" th:text="#{|jobOffer.${type}Message|}"></h1> - <div class="article" th:utext="${offer.hiringMessageHtml}"></div> + <div class="article" th:utext="${messageHtml}"></div> <div> <button diff --git a/src/main/resources/templates/job_offer/view_many.html b/src/main/resources/templates/job_offer/view_many.html index b72c1f2ecf0f101e672d7979046179e82f2020ca..b36fe3a2c9882630b7b1d563f278080a68fbe91e 100644 --- a/src/main/resources/templates/job_offer/view_many.html +++ b/src/main/resources/templates/job_offer/view_many.html @@ -228,10 +228,10 @@ <th:block th:if="${app.exists() && (status == 'ACCEPTED' || status == 'OFFERED') && !(offer.hiringMessage == null || offer.hiringMessage.isEmpty())}" - th:replace="~{job_offer/view_hiring_message :: overlay}"></th:block> + th:replace="~{job_offer/message_overlay :: overlay('hiring', ${offer.id}, ${offer.hiringMessageHtml})}"></th:block> <th:block th:if="${app.exists() && status == 'REJECTED_BY_TEACHER' && !(offer.rejectMessage == null || offer.rejectMessage.isEmpty())}" - th:replace="~{job_offer/view_reject_message :: overlay}"></th:block> + th:replace="~{job_offer/message_overlay :: overlay('reject', ${offer.id}, ${offer.rejectMessageHtml})}"></th:block> </tr> </tbody> </th:block> diff --git a/src/main/resources/templates/job_offer/view_reject_message.html b/src/main/resources/templates/job_offer/view_reject_message.html deleted file mode 100644 index fb28aa24578708660cd3b82b6e6959f3fac5e35b..0000000000000000000000000000000000000000 --- a/src/main/resources/templates/job_offer/view_reject_message.html +++ /dev/null @@ -1,47 +0,0 @@ -<!-- - - TAM - Copyright (C) 2021 - Delft University of Technology - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - ---> -<!DOCTYPE html> -<html - lang="en" - xmlns:th="http://www.thymeleaf.org" - xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> - <body> - <dialog - th:fragment="overlay" - th:id="|view-reject-message-overlay-${offer.id}|" - data-closable - class="dialog"> - <div class="flex vertical p-7"> - <h1 class="underlined font-500" th:text="#{jobOffer.rejectMessage}"></h1> - - <div class="article" th:utext="${offer.rejectMessageHtml}"></div> - - <div> - <button - type="button" - class="button p-less" - th:aria-label="#{general.close}" - th:text="#{general.close}" - data-cancel></button> - </div> - </div> - </dialog> - </body> -</html>