Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

567 report break icon #889

Merged
merged 2 commits into from
Oct 18, 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 @@ -10,6 +10,7 @@
record DetailDayEntryDto(
String username,
String comment,
boolean isBreak,
@DateTimeFormat(iso = TIME) LocalTime start,
@DateTimeFormat(iso = TIME) LocalTime end
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private DetailDayDto toDetailDayReportDto(ReportDay reportDay, boolean different
}

private DetailDayEntryDto toDetailDayEntryDto(ReportDayEntry reportDayEntry) {
return new DetailDayEntryDto(reportDayEntry.user().fullName(), reportDayEntry.comment(), reportDayEntry.start().toLocalTime(), reportDayEntry.end().toLocalTime());
return new DetailDayEntryDto(reportDayEntry.user().fullName(), reportDayEntry.comment(), reportDayEntry.isBreak(), reportDayEntry.start().toLocalTime(), reportDayEntry.end().toLocalTime());
}

private DetailDayAbsenceDto toDetailDayAbsenceDto(ReportDayAbsence reportDayAbsence, Locale locale) {
Expand Down
29 changes: 29 additions & 0 deletions src/main/resources/templates/icons/coffee.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
role="img"
aria-hidden="true"
focusable="false"
th:classappend="${className}"
>
<path d="M10 2v2" />
<path d="M14 2v2" />
<path d="M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1" />
<path d="M6 2v2" />
</svg>
</body>
</html>
13 changes: 10 additions & 3 deletions src/main/resources/templates/reports/user-report-week.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,16 @@
></span>
</p>
<p class="flex items-center gap-0.5">
<svg
th:replace="~{icons/timer::svg(className='shrink-0 stroke-1 w-[1.425rem] h-[1.425rem] text-blue-300 transition-colors group-hover:text-blue-400')}"
/>
<th:block th:if="${!dayEntry.isBreak}">
<svg
th:replace="~{icons/timer::svg(className='shrink-0 stroke-1 w-[1.425rem] h-[1.425rem] text-blue-300 transition-colors group-hover:text-blue-400')}"
/>
</th:block>
<th:block th:if="${dayEntry.isBreak}">
<svg
th:replace="~{icons/coffee::svg(className='shrink-0 stroke-1 w-[1.425rem] h-[1.425rem] text-blue-300 transition-colors group-hover:text-blue-400')}"
/>
</th:block>
<span
class="tabular-nums whitespace-nowrap"
th:text="${{dayEntry.duration}}"
Expand Down
Loading