@model QRRapidoApp.Models.Ads.AffiliateAdViewModel @inject Microsoft.Extensions.Localization.IStringLocalizer Localizer @{ var content = Model.Content; var containerClass = string.IsNullOrWhiteSpace(Model.ContainerCssClass) ? "ad-container affiliate-ad" : $"{Model.ContainerCssClass} affiliate-ad"; var ctaText = string.IsNullOrWhiteSpace(content.CtaText) ? "Ver oferta" : content.CtaText; var slotKey = Model.SlotKey?.ToLowerInvariant(); var isWideSlot = string.Equals(slotKey, "header") || string.Equals(slotKey, "footer"); var imageStyle = slotKey switch { "header" => "max-height:140px;object-fit:contain;width:100%;", "footer" => "max-height:140px;object-fit:contain;width:100%;", "sidebar" => "max-height:200px;object-fit:contain;width:100%;", "content" => "max-height:220px;object-fit:contain;width:100%;", _ => "max-height:220px;object-fit:contain;width:100%;" }; var hasImage = !string.IsNullOrWhiteSpace(content.ImageUrl); if (isWideSlot) { containerClass = $"{containerClass} affiliate-ad-wide"; } }
@Localizer["Advertisement"]
@if (isWideSlot) {
@if (hasImage) {
@content.Title @if (!string.IsNullOrWhiteSpace(content.BadgeText)) { @content.BadgeText }
}
@if (!hasImage && !string.IsNullOrWhiteSpace(content.BadgeText)) { @content.BadgeText }
@content.Title
@if (!string.IsNullOrWhiteSpace(content.Description)) {

@content.Description

} @if (!string.IsNullOrWhiteSpace(content.PriceText)) {
@content.PriceText
}
} else {
@if (hasImage) { @content.Title }
@if (!string.IsNullOrWhiteSpace(content.BadgeText)) { @content.BadgeText }
@content.Title
@if (!string.IsNullOrWhiteSpace(content.Description)) {

@content.Description

} @if (!string.IsNullOrWhiteSpace(content.PriceText)) {
@content.PriceText
} @ctaText
}