@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>


@{
	var dropPoints = GetLoop("ParcelShops");
	if (dropPoints.Any())
	{
		foreach (LoopItem dropPoint in dropPoints)
		{
			string pointRadioName = string.Format("{0}{1}", GetString("FieldPrefix"), "ParcelShopNumber");
			string pointRadioId = string.Format("{0}{1}", pointRadioName, dropPoint.GetString("Number"));
			string pointRadioValue = dropPoint.GetString("Number");

			List<string> dropPointInfo = new List<string>();
			dropPointInfo.Add(dropPoint.GetString("Streetname"));
			dropPointInfo.Add(dropPoint.GetString("ZipCode"));
			dropPointInfo.Add(dropPoint.GetString("CityName"));
			//dropPointInfo.Add(dropPoint.GetString("Streetname2"));
			if (!Dynamicweb.Context.Current.Items.Contains("DroppointsRendered")) {
				Dynamicweb.Context.Current.Items.Add("DroppointsRendered", true);
			}

			string dropPointInfoString = (string.Join(",", dropPointInfo.Select(x => x).ToArray())).Replace(",", ", ");

			<label class="ps-5 list-group-item list-group-flush list-group-item-action" @(dropPoint.GetBoolean("IsSelected") ? "aria-current=\"true\"" : string.Empty) for="@pointRadioId" role="button" style="@(dropPoint.GetBoolean("IsSelected") ? "background-color: rgba(var(--swift-foreground-color-rgb), 0.05)" : null)">
				<div class="form-check">
					<input @(dropPoint.GetBoolean("IsSelected") || dropPoint.GetInteger("ParcelShops.LoopCounter") == 1  ? "checked" : string.Empty) class="form-check-input" type="radio" @(dropPoint.GetBoolean("ServicePointRequired") ? "required" : string.Empty) name="@pointRadioName" id="@pointRadioId" value="@pointRadioValue">
					<div class="d-flex flex-column">
						<span class="form-check-label">@dropPoint.GetString("CompanyName")</span>
						<span class="opacity-75 fs-8">
							@dropPointInfoString
						</span>
					</div>
				</div>
			</label>
		}
	}
}
