Add more icons
|
|
@ -42,7 +42,7 @@ else
|
||||||
{
|
{
|
||||||
@if (shift.IsPngIcon)
|
@if (shift.IsPngIcon)
|
||||||
{
|
{
|
||||||
<img src="@shift.Icon" alt="@shift.Name" style="width: 24px; height: 24px;" />
|
<img src="icons\@shift.Icon" alt="@shift.Name" style="width: 24px; height: 24px;" />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,31 @@
|
||||||
<ProjectReference Include="..\Services\ShiftScheduler.Services.csproj" />
|
<ProjectReference Include="..\Services\ShiftScheduler.Services.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="wwwroot\break-icon.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\break-icon.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\G2.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\Bg.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\F1.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\G1.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\G2TS.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\icons\Kompensation.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
BIN
Client/wwwroot/icons/Bg.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
Client/wwwroot/icons/F1.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
Client/wwwroot/icons/G1.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
Client/wwwroot/icons/G2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Client/wwwroot/icons/G2TS.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Client/wwwroot/icons/Kompensation.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
|
|
@ -103,21 +103,20 @@ namespace ShiftScheduler.Services
|
||||||
if (shift != null && shift.IsPngIcon)
|
if (shift != null && shift.IsPngIcon)
|
||||||
{
|
{
|
||||||
// For PNG icons, embed the image
|
// For PNG icons, embed the image
|
||||||
var iconPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", shift.Icon);
|
var iconPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "icons", shift.Icon);
|
||||||
if (File.Exists(iconPath))
|
if (File.Exists(iconPath))
|
||||||
{
|
{
|
||||||
table.Cell().Element(CellStyleMiddle).Image(iconPath).FitArea();
|
table.Cell().Height(24).Element(CellStyleMiddle).Image(iconPath).FitArea();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Fallback to shift name if PNG not found
|
|
||||||
table.Cell().Element(CellStyleMiddle).Text(shift.Name);
|
table.Cell().Element(CellStyleMiddle).Text(shift.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// For text/emoji icons, render as text
|
// For text/emoji icons, render as text
|
||||||
var icon = shift?.Icon ?? "";
|
var icon = shift?.Icon ?? shift?.Name;
|
||||||
table.Cell().Element(CellStyleMiddle).Text(icon);
|
table.Cell().Element(CellStyleMiddle).Text(icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,23 +125,11 @@ namespace ShiftScheduler.Services
|
||||||
RenderEmptyCell(table);
|
RenderEmptyCell(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shifname
|
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
|
||||||
{
|
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
|
||||||
var shiftName = shiftWithTransport?.Shift.Name ?? "";
|
|
||||||
table.Cell().Element(CellStyleMiddle).Text(shiftName);
|
|
||||||
}
|
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
|
||||||
{
|
|
||||||
RenderEmptyCell(table);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Morning times
|
// Morning times
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
foreach (var day in Enumerable.Range(0, dayInWeek))
|
||||||
{
|
{
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
||||||
var morningTime = $"🌅 {shiftWithTransport?.Shift.MorningTime}";
|
var morningTime = shiftWithTransport?.Shift.MorningTime.Length > 0 ? $"🌅 {shiftWithTransport?.Shift.MorningTime}" : "";
|
||||||
table.Cell().Element(CellStyleMiddle).Text(morningTime);
|
table.Cell().Element(CellStyleMiddle).Text(morningTime);
|
||||||
}
|
}
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
||||||
|
|
@ -154,7 +141,7 @@ namespace ShiftScheduler.Services
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
foreach (var day in Enumerable.Range(0, dayInWeek))
|
||||||
{
|
{
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
||||||
var afternoonTime = $"🌆 {shiftWithTransport?.Shift.AfternoonTime}";
|
var afternoonTime = shiftWithTransport?.Shift.AfternoonTime.Length > 0 ? $"🌆 {shiftWithTransport?.Shift.AfternoonTime}" : "";
|
||||||
table.Cell().Element(CellStyleMiddle).Text(afternoonTime);
|
table.Cell().Element(CellStyleMiddle).Text(afternoonTime);
|
||||||
}
|
}
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
||||||
|
|
@ -201,7 +188,7 @@ namespace ShiftScheduler.Services
|
||||||
transportLines.Add(afternoonInfo);
|
transportLines.Add(afternoonInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return transportLines.Count > 0 ? string.Join("\n", transportLines) : "-";
|
return transportLines.Count > 0 ? string.Join("\n", transportLines) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string FormatTransportConnection(TransportConnection transport)
|
private static string FormatTransportConnection(TransportConnection transport)
|
||||||
|
|
|
||||||