Adds new components for service employees and addons Introduces detailed views with selectable employees and add-ons Updates localization translations for new sections Implements time range slider functionality for availability
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using PlanTempus.Application.Features.Localization.Services;
|
|
|
|
namespace PlanTempus.Application.Features.Services.Components;
|
|
|
|
public class ServiceDetailAddonsViewComponent : ViewComponent
|
|
{
|
|
private readonly ILocalizationService _localization;
|
|
|
|
public ServiceDetailAddonsViewComponent(ILocalizationService localization)
|
|
{
|
|
_localization = localization;
|
|
}
|
|
|
|
public IViewComponentResult Invoke(string key)
|
|
{
|
|
var service = ServiceDetailCatalog.Get(key);
|
|
|
|
var model = new ServiceDetailAddonsViewModel
|
|
{
|
|
// Data
|
|
Addons = service.Addons,
|
|
|
|
// Labels
|
|
LabelAddonsForService = _localization.Get("services.detail.addons.addonsForService"),
|
|
LabelAddExistingAddon = _localization.Get("services.detail.addons.addExistingAddon")
|
|
};
|
|
|
|
return View(model);
|
|
}
|
|
}
|
|
|
|
public class ServiceDetailAddonsViewModel
|
|
{
|
|
// Data
|
|
public required List<ServiceAddon> Addons { get; init; }
|
|
|
|
// Labels
|
|
public required string LabelAddonsForService { get; init; }
|
|
public required string LabelAddExistingAddon { get; init; }
|
|
}
|