Files
BeWoPlaner/BeWoPlanerMobil/Views/DevExpressScheduler/HorizontalAppointmentTemplatePartial.cshtml
2026-06-29 13:45:41 +02:00

89 lines
2.8 KiB
Plaintext

@using BeWoPlanerMobil.Service
@using BeWoPlanerMobil.Util
@using BS.Shared.DataContracts
@using BS.Shared.DataContracts.Compact
@model DevExpress.XtraScheduler.Appointment
@functions
{
string GetSubjectAndLocation()
{
var locationPart = false == string.IsNullOrWhiteSpace(Model.Location) ? $" ({Model.Location})" : string.Empty;
return $" {Model.Subject}{locationPart}";
}
string GetHeaderTime()
{
return Model.AllDay ? string.Empty : $"{Model.Start.ToShortTimeString()} - {Model.End.ToShortTimeString()}";
}
}
<style type="text/css">
.horizontal-appointment-template-div {
cursor: default;
background-color: #C0FFD0;
font-family: "Signika Negative";
border-radius: 5px;
}
.horizontal-appointment-info {
white-space: nowrap;
overflow: hidden;
font: 10pt 'Signika Negative';
display: block;
}
.horizontal-appointment-label .recurring-label-span {
margin-left: auto;
margin-right: 0;
}
.horizontal-appointment-label {
display: inline-block;
margin-right: 5px;
margin-left: 0.25em;
margin-top: 0.25em;
}
.horizontal-recurring-label-span {
margin-top: 5px;
margin-right: 10px;
right: 10px;
}
</style>
@{
var background = Model.CustomFields["IsTask"] is true ? "#993B3B" : "#C0FFD0";
var color = Model.CustomFields["IsTask"] is true ? "#FFFFFF" : "#37414D";
}
<div class="horizontal-appointment-template-div" style="border-left: @MobileUtils.GetLeftAppointmentBorder(Model);background: @MobileUtils.GetAppointmentRightBackground(Model) right / 5px 100% no-repeat, @background;">
<div class="horizontal-appointment-info" style="color: @color;">
<label class="horizontal-appointment-label">
@GetHeaderTime() <span style="font-weight: bold;">@GetSubjectAndLocation()</span>
</label>
<div class="clearfix d-inline">
@if(Model.CustomFields[nameof(SchedulerAppointmentDC.ServiceRecordList)] is List<ServiceRecordDC> serviceRecords && serviceRecords.Any())
{
<i class="fas fa-clock text-bewo-service-records float-right horizontal-recurring-label-span mr-1"></i>
}
@if(Model.IsRecurring)
{
if(Model.Id is long)
{
<span class="fa-stack fa-1x text-info float-right" style="height:fit-content;width:fit-content;position:absolute;top:10px;right:@MobileUtils.GetCssRightValue(Model);">
<i class="fas fa-solid fa-stack-1x fa-slash"></i>
<i class="fas fa-solid fa-stack-1x fa-sync-alt"></i>
</span>
}
else
{
<i class="fas fa-sync-alt text-info float-right mr-1 horizontal-recurring-label-span"></i>
}
}
</div>
</div>
</div>