Skip to content
Snippets Groups Projects
Commit acae918a authored by Otto Visser's avatar Otto Visser
Browse files

Merge branch 'development' into 'master'

Development

See merge request !230
parents db6e881b c4d13f9b
No related branches found
No related tags found
No related merge requests found
* text eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
......@@ -345,10 +345,10 @@ public class RequestController {
RedirectAttributes redirectAttributes) {
Request request = getRequest(id);
assert request.getRequestEntity().getId().equals(user.getId());
if (!request.getLeftFeedback()) {
if (!request.hasFeedback()) {
request.setFeedback(feedback);
}
if (!request.getLeftFeedbackRating()) {
if (!request.hasFeedbackRating()) {
request.setFeedbackRating(rating);
}
requestRepository.save(request);
......
......@@ -284,12 +284,12 @@ public class Request implements RecordsEvents<Request>, Serializable, Comparable
this.feedback = feedback;
}
public Boolean getLeftFeedback() {
return !(feedback == null || feedback.isEmpty());
public Boolean hasFeedback() {
return feedback != null && !feedback.isEmpty();
}
public Boolean getLeftFeedbackRating() {
return !(feedbackRating == null);
public Boolean hasFeedbackRating() {
return feedbackRating != null;
}
public LocalDateTime getCreatedAt() {
......
......@@ -328,12 +328,12 @@
</td>
<td>
<th:block
th:if="${(request.isHandled() and request.getLeftFeedback() and request.getRequestEntity().getId().equals(#authenticated.getId()))}">
th:if="${(request.isHandled() and request.hasFeedback() and request.getRequestEntity().getId().equals(#authenticated.getId()))}">
You have given feedback to your teaching assistant.
</th:block>
<th:block
th:if="${request.isHandled() and !(request.getLeftFeedback() and request.getRequestEntity().getId().equals(#authenticated.getId()))}">
th:if="${request.isHandled() and !(request.hasFeedback() and request.getRequestEntity().getId().equals(#authenticated.getId()))}">
<a href="#" class="text-white"
th:href="@{/request/{id}(id=${request.id})}">
Click to add feedback for the Teaching assistant
......
......@@ -51,19 +51,19 @@
</div>
<div class="row">
<div class="col-sm-12" th:if="${request.isHandled() and !(request.getLeftFeedback() and request.getLeftFeedbackRating())}">
<div class="row" th:if="${request.getRequestEntity().getId().equals(#authenticated.getId())}">
<div class="col-sm-12" th:if="${request.isHandled() and (!request.hasFeedback() or !request.hasFeedbackRating())}">
<div class="page-header" >
<h4>Feedback</h4>
</div>
<form action="#" th:action="@{/request/{id}/feedback(id=${request.id})}" method="post" class="form-horizontal">
<div class="form-group" th:if="${request.isHandled() and !request.getLeftFeedback() and request.getRequestEntity().getId().equals(#authenticated.getId())}">
<div class="form-group" th:if="${!request.hasFeedback()}">
<label for="inputFeedback" class="col-sm-2 control-label">Feedback</label>
<div class="col-sm-8">
<textarea maxlength="250" class="form-control" id="inputFeedback" name="feedback" placeholder="Leave feedback about the TA."></textarea>
</div>
</div>
<div class= "form-group" th:if="${request.isHandled() and !request.getLeftFeedbackRating()}">
<div class= "form-group" th:if="${!request.hasFeedbackRating()}">
<div class="btn-group btn-group-toggle col-sm-2" data-toggle="buttons">
<label class="btn btn-secondary">
<input type="radio" name="rating" value="1" id="rating0" autocomplete="off"><i class="far fa-sad-tear"></i>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment