Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Adapt report system #944

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ public class ReportPostProposal {
private Long authorId;

private Long userId;

private String type;

private Long commentId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public HomepagePostPreviewProposal create(CreatePostProposal proposal) {
@Override
public void report(ReportPostProposal proposal) {
Map<String, Object> templateModel = new HashMap<>();
templateModel.put("post_url", String.format("https://www.dhbwhub.de/post/?id=%d", proposal.getPostId()));
templateModel.put("post_url", String.format("https://www.dhbwhub.de/%s/?id=%d", proposal.getType().equals("eventComment") ? "event" : "post", proposal.getPostId()));
templateModel.put("content_type", proposal.getType());
templateModel.put("comment_id", proposal.getCommentId());
templateModel.put("user_id_of_reporter", proposal.getUserId());
templateModel.put("user_id_of_author", proposal.getAuthorId());
templateModel.put("report_reason", proposal.getReportReason());
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/templates/report-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<h4>Details zum Vorfall:</h4>
<ul>
<li><strong>URL zum Post:</strong> <td th:text="${post_url}"></td></li>
<li><strong>Typ:</strong> <td th:text="${content_type}"></td></li>
<li th:if="${comment_id != null}"><strong>Kommentar-ID:</strong> <td th:text="${comment_id}"></td></li>
<li><strong>Benutzer-ID des Reporters:</strong> <td th:text="${user_id_of_reporter}"></td></li>
<li><strong>Benutzer-ID des Autors:</strong> <td th:text="${user_id_of_author}"></td></li>
<li><strong>Report Grund:</strong> <td th:text="${report_reason}"></td></li>
Expand Down
Loading