Enhances service details with employees and addon sections
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
This commit is contained in:
parent
5e3811347c
commit
7643a6ab82
20 changed files with 830 additions and 336 deletions
|
|
@ -0,0 +1,29 @@
|
|||
@model PlanTempus.Application.Features.Services.Components.ServiceDetailAddonsViewModel
|
||||
|
||||
<swp-card>
|
||||
<swp-section-label>@Model.LabelAddonsForService</swp-section-label>
|
||||
|
||||
<swp-selectable-list>
|
||||
@foreach (var addon in Model.Addons)
|
||||
{
|
||||
<swp-selectable-item class="no-avatar @(addon.Selected ? "selected" : "")">
|
||||
<swp-selectable-checkbox>
|
||||
<svg viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>
|
||||
</swp-selectable-checkbox>
|
||||
<swp-selectable-info>
|
||||
<swp-selectable-name>@addon.Name</swp-selectable-name>
|
||||
<swp-selectable-meta>
|
||||
<span>@addon.Price</span>
|
||||
<span>@addon.Duration</span>
|
||||
<swp-selectable-type class="@(addon.Required ? "required" : "")">@addon.Type</swp-selectable-type>
|
||||
</swp-selectable-meta>
|
||||
</swp-selectable-info>
|
||||
</swp-selectable-item>
|
||||
}
|
||||
</swp-selectable-list>
|
||||
|
||||
<swp-add-button>
|
||||
<i class="ph ph-plus"></i>
|
||||
@Model.LabelAddExistingAddon
|
||||
</swp-add-button>
|
||||
</swp-card>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
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; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue