Razor Compilation Error
We tried, we really did, but we just can't compile your view.
We're sorry :-(
Graphics courtesy of the awesome Matthew Inman
We tried, we really did, but we just can't compile your view.
We're sorry :-(
Graphics courtesy of the awesome Matthew Inman
Error compiling template: Views/ViewSiteProduct.cshtml
Errors:
[CS0016] Line: 0 Column: 0 - Could not write to output file 'c:\Windows\Temp\Temp_9bbb46617e3c420b98c1432b715361bd.dll' -- 'The requested operation could not be completed due to a file system limitation ' (show)
Details:
@using NetringRepository.Nancy.Extensions.HtmlHelpers
@using NetringRepository.Nancy.Extensions.HtmlHelpers.DropDownList
@using NetringRepository.Nancy.Extensions.HtmlHelpers.Forms
@using NetringRepository.Nancy.Extensions.HtmlHelpers.Hidden
@using NetringRepository.Nancy.Extensions.HtmlHelpers.Numbers
@using System.Globalization
@using System.Linq
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Overseer.Website.ViewModels.ViewSiteProduct>
@{
var headingLead = Model.Title.Clone();
// Get price of the selected variant
var priceGross = Model.PriceGross;
var variant = Model.SelectedVariant;
if (variant != null)
{
priceGross = variant.PriceGross;
}
@if (!Model.UseProductRFQ)
{
Model.Title = Model.Heading + " - " + priceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB")) + " - " + Model.Title;
}
}
<div class="container py-4">
<div class="row">
@* Image *@
<div class="col-12 col-md-6 col-lg-4 mb-3" style="max-width:750px;">
@if (Model.ViewSiteImages.Count > 0)
{
<img src="/Content/images/thumbnail/750/750/@Model.FirstViewSiteImage.Path" alt="" class="rounded img-fluid mb-3" width="750" height="750">
<div class="row justify-content-start">
@if (Model.ViewSiteImages.Count > 1)
{
for (var i = 0; i < Model.ViewSiteImages.Count; i++)
{
<a href="/Content/images/@Model.ViewSiteImages[i].Path" class="col-auto" data-lightbox="product-images" data-title="@Model.ViewSiteImages[i].Description">
<img src="/Content/images/thumbnail/100/100/@Model.ViewSiteImages[i].Path" alt="" class="rounded img-fluid" width="100" height="100">
</a>
}
}
</div>
}
else
{
<img src="/Content/images/thumbnail/750/750/default.png" alt="" class="card-img-top img-fluid" width="750" height="750">
}
</div>
@* Product Details *@
<div class="col-12 col-md">
<div class="row">
<div class="col mb-3">
<h1 class="mb-3">@Model.Heading</h1>
<p class="lead mb-0"><strong>Product Code: </strong><span class="text-uppercase">@Model.Code</span></p>
</div>
<div class="col-auto mb-3">
@using (Html.BeginForm(this, new { action = "/add/rfq/" + Model.Id, method = "post" }))
{
<div class="form-group">
<button type="submit" class="btn btn-primary font-weight-bold btn-lg">Add to RFQ</button>
</div>
}
</div>
</div>
@if (!Model.InStock && !Model.UseProductRFQ)
{
<div class="card border border-warning border-dashed text-secondary text-center">
<div class="card-body">
<p class="mb-0">Sorry! This product is out of stock. We're working on getting more for you soon.</p>
</div>
</div>
}
else
{
<div class="row mb-3">
<div class="col-auto">
@if (!Model.UseProductRFQ)
{
var json = Newtonsoft.Json.JsonConvert.SerializeObject(
Model.ViewProductVariants.Select(x => new { sku = x.Sku, priceGross = x.PriceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB")) }));
@using (Html.BeginForm(this, new { action = "/add", method = "post", data_variants = json }))
{
@Html.HiddenFor(x => Model.Id, new { data_product = "id" })
@* Options *@
@Html.Partial("Views/Products/_ViewOptionGroups.cshtml", Model)
@* Quantity *@
@{
var quantities = new List<Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem>()
{
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("1", "1", Model.Quantity == 1),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("2", "2", Model.Quantity == 2),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("3", "3", Model.Quantity == 3),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("4", "4", Model.Quantity == 4),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("5", "5", Model.Quantity == 5),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("6", "6", Model.Quantity == 6),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("7", "7", Model.Quantity == 7),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("8", "8", Model.Quantity == 8),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("9", "9", Model.Quantity == 9),
new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("10", "10", Model.Quantity == 10),
};
}
<div class="form-group">
@Html.LabelFor(x => Model.Quantity)
@Html.DropDownListFor(x => Model.Quantity, quantities, new { @class = "custom-select custom-select-sm " })
@Html.ErrorsFor(x => Model.Quantity)
</div>
@* Price *@
<div class="form-group">
<p class="h2 mb-3">
<span class="sr-only">
@(Model.ViewProductVariants.Count == 1 ? "Price per item" : "Price per item with selected options"))
</span>
<span data-product="price">
@priceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB"))
</span>
</p>
<button type="submit" class="btn btn-primary font-weight-bold btn-lg">Add to Cart</button>
</div>
}
@Html.Raw(Model.Content)
}
else
{
@Html.Raw(Model.Content)
}
</div>
</div>
}
</div>
</div>
@{
Model.PopulateRelatedViewSiteProducts();
// Related Products
if (Model.RelatedViewProducts.Count > 0)
{
<hr />
<h2 class="h1 mb-3">Related Products</h2>
@Html.Partial("Views/_ViewChildren.cshtml", Model.RelatedViewProducts)
}
}
</div>
@section Scripts
{
<script>
$(function () {
// Validation
$('form').validate({
rules: {
Quantity: {
required: true
}
}
})
$('[data-toggle="quantity"]').click(function () {
var $this = $(this)
var target = $this.data('target')
var increment = $this.data('increment')
var decrement = $this.data('decrement')
var $target = $(target)
var value = parseInt($target.val())
var max = parseInt($target.attr('max'))
var min = parseInt($target.attr('min'))
if (Number.isNaN(value)) {
$target.val(1)
}
else if (increment && (value + 1 <= max)) {
$target.val(value + 1)
}
else if (decrement && (value - 1 >= min)) {
$target.val(value - 1)
}
})
$('[data-toggle="option"]').change(function () {
var values = $('[data-product="id"],[data-toggle="option"]').map(function () {
return $(this).val()
}).get()
var variants = $('form').data('variants')
// Find the variant that contains all the ids
var variant = variants.find(function (v1, i1, a1) {
return v1.sku.split('-').every(function (v2, i2, a2) {
return values.includes(v2) && (a2.length == values.length)
})
})
var regex = /- £[\d*\.?\d*]+ -/;
$('[data-product="price"]').text(variant.priceGross)
document.title = document.title.replace(regex, "- " + variant.priceGross + " -")
})
});
</script>
}
Compilation Source://------------------------------------------------------------------------------
Line 1: // <auto-generated>
Line 2: // This code was generated by a tool.
Line 3: // Runtime Version:4.0.30319.42000
Line 4: //
Line 5: // Changes to this file may cause incorrect behavior and will be lost if
Line 6: // the code is regenerated.
Line 7: // </auto-generated>
Line 8: //------------------------------------------------------------------------------
Line 9:
Line 10: namespace RazorOutput {
Line 11: using Microsoft.CSharp.RuntimeBinder;
Line 12: using System;
Line 13: using System.IO;
Line 14: using Newtonsoft.Json;
Line 15: using Overseer.Website;
Line 16: using Overseer.Website.Library;
Line 17: using Overseer.Library;
Line 18: using System.Collections.Generic;
Line 19:
Line 20: #line 1 "roo"
Line 21: using NetringRepository.Nancy.Extensions.HtmlHelpers;
Line 22:
Line 23: #line default
Line 24: #line hidden
Line 25:
Line 26: #line 2 "roo"
Line 27: using NetringRepository.Nancy.Extensions.HtmlHelpers.DropDownList;
Line 28:
Line 29: #line default
Line 30: #line hidden
Line 31:
Line 32: #line 3 "roo"
Line 33: using NetringRepository.Nancy.Extensions.HtmlHelpers.Forms;
Line 34:
Line 35: #line default
Line 36: #line hidden
Line 37:
Line 38: #line 4 "roo"
Line 39: using NetringRepository.Nancy.Extensions.HtmlHelpers.Hidden;
Line 40:
Line 41: #line default
Line 42: #line hidden
Line 43:
Line 44: #line 5 "roo"
Line 45: using NetringRepository.Nancy.Extensions.HtmlHelpers.Numbers;
Line 46:
Line 47: #line default
Line 48: #line hidden
Line 49:
Line 50: #line 6 "roo"
Line 51: using System.Globalization;
Line 52:
Line 53: #line default
Line 54: #line hidden
Line 55:
Line 56: #line 7 "roo"
Line 57: using System.Linq;
Line 58:
Line 59: #line default
Line 60: #line hidden
Line 61:
Line 62:
Line 63: public class RazorView : Nancy.ViewEngines.Razor.NancyRazorViewBase<Overseer.Website.ViewModels.ViewSiteProduct> {
Line 64:
Line 65: #line hidden
Line 66:
Line 67: public RazorView() {
Line 68: }
Line 69:
Line 70: public override void Execute() {
Line 71:
Line 72: #line 9 "roo"
Line 73:
Line 74: var headingLead = Model.Title.Clone();
Line 75:
Line 76: // Get price of the selected variant
Line 77:
Line 78: var priceGross = Model.PriceGross;
Line 79:
Line 80: var variant = Model.SelectedVariant;
Line 81:
Line 82: if (variant != null)
Line 83: {
Line 84: priceGross = variant.PriceGross;
Line 85: }
Line 86:
Line 87:
Line 88:
Line 89: #line default
Line 90: #line hidden
Line 91:
Line 92: #line 23 "roo"
Line 93: if (!Model.UseProductRFQ)
Line 94: {
Line 95: Model.Title = Model.Heading + " - " + priceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB")) + " - " + Model.Title;
Line 96: }
Line 97:
Line 98: #line default
Line 99: #line hidden
Line 100:
Line 101: #line 26 "roo"
Line 102:
Line 103:
Line 104:
Line 105: #line default
Line 106: #line hidden
Line 107: WriteLiteral("\r\n\r\n<div");
Line 108:
Line 109: WriteLiteral(" class=\"container py-4\"");
Line 110:
Line 111: WriteLiteral(">\r\n\r\n\t<div");
Line 112:
Line 113: WriteLiteral(" class=\"row\"");
Line 114:
Line 115: WriteLiteral(">\r\n\t\t");
Line 116:
Line 117: WriteLiteral("\r\n\t\t<div");
Line 118:
Line 119: WriteLiteral(" class=\"col-12 col-md-6 col-lg-4 mb-3\"");
Line 120:
Line 121: WriteLiteral(" style=\"max-width:750px;\"");
Line 122:
Line 123: WriteLiteral(">\r\n");
Line 124:
Line 125:
Line 126: #line 34 "roo"
Line 127:
Line 128:
Line 129: #line default
Line 130: #line hidden
Line 131:
Line 132: #line 34 "roo"
Line 133: if (Model.ViewSiteImages.Count > 0)
Line 134: {
Line 135:
Line 136:
Line 137: #line default
Line 138: #line hidden
Line 139: WriteLiteral("\t\t\t\t<img");
Line 140:
Line 141: WriteAttribute("src", Tuple.Create(" src=\"", 1056), Tuple.Create("\"", 1126)
Line 142: , Tuple.Create(Tuple.Create("", 1062), Tuple.Create("/Content/images/thumbnail/750/750/", 1062), true)
Line 143:
Line 144: #line 36 "roo"
Line 145: , Tuple.Create(Tuple.Create("", 1096), Tuple.Create<System.Object, System.Int32>(Model.FirstViewSiteImage.Path
Line 146:
Line 147: #line default
Line 148: #line hidden
Line 149: , 1096), false)
Line 150: );
Line 151:
Line 152: WriteLiteral(" alt=\"\"");
Line 153:
Line 154: WriteLiteral(" class=\"rounded img-fluid mb-3\"");
Line 155:
Line 156: WriteLiteral(" width=\"750\"");
Line 157:
Line 158: WriteLiteral(" height=\"750\"");
Line 159:
Line 160: WriteLiteral(">\r\n");
Line 161:
Line 162:
Line 163: #line 37 "roo"
Line 164:
Line 165:
Line 166:
Line 167: #line default
Line 168: #line hidden
Line 169: WriteLiteral("\t\t\t\t<div");
Line 170:
Line 171: WriteLiteral(" class=\"row justify-content-start\"");
Line 172:
Line 173: WriteLiteral(">\r\n");
Line 174:
Line 175:
Line 176: #line 39 "roo"
Line 177:
Line 178:
Line 179: #line default
Line 180: #line hidden
Line 181:
Line 182: #line 39 "roo"
Line 183: if (Model.ViewSiteImages.Count > 1)
Line 184: {
Line 185: for (var i = 0; i < Model.ViewSiteImages.Count; i++)
Line 186: {
Line 187:
Line 188:
Line 189: #line default
Line 190: #line hidden
Line 191: WriteLiteral("\t\t\t\t\t\t\t<a");
Line 192:
Line 193: WriteAttribute("href", Tuple.Create(" href=\"", 1369), Tuple.Create("\"", 1421)
Line 194: , Tuple.Create(Tuple.Create("", 1376), Tuple.Create("/Content/images/", 1376), true)
Line 195:
Line 196: #line 43 "roo"
Line 197: , Tuple.Create(Tuple.Create("", 1392), Tuple.Create<System.Object, System.Int32>(Model.ViewSiteImages[i].Path
Line 198:
Line 199: #line default
Line 200: #line hidden
Line 201: , 1392), false)
Line 202: );
Line 203:
Line 204: WriteLiteral(" class=\"col-auto\"");
Line 205:
Line 206: WriteLiteral(" data-lightbox=\"product-images\"");
Line 207:
Line 208: WriteLiteral(" data-title=\"");
Line 209:
Line 210:
Line 211: #line 43 "roo"
Line 212: Write(Model.ViewSiteImages[i].Description);
Line 213:
Line 214:
Line 215: #line default
Line 216: #line hidden
Line 217: WriteLiteral("\"");
Line 218:
Line 219: WriteLiteral(">\r\n\t\t\t\t\t\t\t\t<img");
Line 220:
Line 221: WriteAttribute("src", Tuple.Create(" src=\"", 1535), Tuple.Create("\"", 1604)
Line 222: , Tuple.Create(Tuple.Create("", 1541), Tuple.Create("/Content/images/thumbnail/100/100/", 1541), true)
Line 223:
Line 224: #line 44 "roo"
Line 225: , Tuple.Create(Tuple.Create("", 1575), Tuple.Create<System.Object, System.Int32>(Model.ViewSiteImages[i].Path
Line 226:
Line 227: #line default
Line 228: #line hidden
Line 229: , 1575), false)
Line 230: );
Line 231:
Line 232: WriteLiteral(" alt=\"\"");
Line 233:
Line 234: WriteLiteral(" class=\"rounded img-fluid\"");
Line 235:
Line 236: WriteLiteral(" width=\"100\"");
Line 237:
Line 238: WriteLiteral(" height=\"100\"");
Line 239:
Line 240: WriteLiteral(">\r\n\t\t\t\t\t\t\t</a>\r\n");
Line 241:
Line 242:
Line 243: #line 46 "roo"
Line 244: }
Line 245: }
Line 246:
Line 247:
Line 248: #line default
Line 249: #line hidden
Line 250: WriteLiteral("\t\t\t\t</div>\r\n");
Line 251:
Line 252:
Line 253: #line 49 "roo"
Line 254: }
Line 255: else
Line 256: {
Line 257:
Line 258:
Line 259: #line default
Line 260: #line hidden
Line 261: WriteLiteral("\t\t\t\t<img");
Line 262:
Line 263: WriteLiteral(" src=\"/Content/images/thumbnail/750/750/default.png\"");
Line 264:
Line 265: WriteLiteral(" alt=\"\"");
Line 266:
Line 267: WriteLiteral(" class=\"card-img-top img-fluid\"");
Line 268:
Line 269: WriteLiteral(" width=\"750\"");
Line 270:
Line 271: WriteLiteral(" height=\"750\"");
Line 272:
Line 273: WriteLiteral(">\r\n");
Line 274:
Line 275:
Line 276: #line 53 "roo"
Line 277: }
Line 278:
Line 279:
Line 280: #line default
Line 281: #line hidden
Line 282: WriteLiteral("\t\t</div>\r\n\t\t");
Line 283:
Line 284: WriteLiteral("\r\n\t\t<div");
Line 285:
Line 286: WriteLiteral(" class=\"col-12 col-md\"");
Line 287:
Line 288: WriteLiteral(">\r\n\t\t\t<div");
Line 289:
Line 290: WriteLiteral(" class=\"row\"");
Line 291:
Line 292: WriteLiteral(">\r\n\t\t\t\t<div");
Line 293:
Line 294: WriteLiteral(" class=\"col mb-3\"");
Line 295:
Line 296: WriteLiteral(">\r\n\t\t\t\t\t<h1");
Line 297:
Line 298: WriteLiteral(" class=\"mb-3\"");
Line 299:
Line 300: WriteLiteral(">");
Line 301:
Line 302:
Line 303: #line 59 "roo"
Line 304: Write(Model.Heading);
Line 305:
Line 306:
Line 307: #line default
Line 308: #line hidden
Line 309: WriteLiteral("</h1>\r\n\t\t\t\t\t<p");
Line 310:
Line 311: WriteLiteral(" class=\"lead mb-0\"");
Line 312:
Line 313: WriteLiteral("><strong>Product Code: </strong><span");
Line 314:
Line 315: WriteLiteral(" class=\"text-uppercase\"");
Line 316:
Line 317: WriteLiteral(">");
Line 318:
Line 319:
Line 320: #line 60 "roo"
Line 321: Write(Model.Code);
Line 322:
Line 323:
Line 324: #line default
Line 325: #line hidden
Line 326: WriteLiteral("</span></p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div");
Line 327:
Line 328: WriteLiteral(" class=\"col-auto mb-3\"");
Line 329:
Line 330: WriteLiteral(">\r\n");
Line 331:
Line 332:
Line 333: #line 63 "roo"
Line 334:
Line 335:
Line 336: #line default
Line 337: #line hidden
Line 338:
Line 339: #line 63 "roo"
Line 340: using (Html.BeginForm(this, new { action = "/add/rfq/" + Model.Id, method = "post" }))
Line 341: {
Line 342:
Line 343:
Line 344: #line default
Line 345: #line hidden
Line 346: WriteLiteral("\t\t\t\t\t\t<div");
Line 347:
Line 348: WriteLiteral(" class=\"form-group\"");
Line 349:
Line 350: WriteLiteral(">\r\n\t\t\t\t\t\t\t<button");
Line 351:
Line 352: WriteLiteral(" type=\"submit\"");
Line 353:
Line 354: WriteLiteral(" class=\"btn btn-primary font-weight-bold btn-lg\"");
Line 355:
Line 356: WriteLiteral(">Add to RFQ</button>\r\n\t\t\t\t\t\t</div>\r\n");
Line 357:
Line 358:
Line 359: #line 68 "roo"
Line 360: }
Line 361:
Line 362:
Line 363: #line default
Line 364: #line hidden
Line 365: WriteLiteral("\t\t\t\t</div>\r\n\t\t\t</div>\r\n");
Line 366:
Line 367:
Line 368: #line 71 "roo"
Line 369:
Line 370:
Line 371: #line default
Line 372: #line hidden
Line 373:
Line 374: #line 71 "roo"
Line 375: if (!Model.InStock && !Model.UseProductRFQ)
Line 376: {
Line 377:
Line 378:
Line 379: #line default
Line 380: #line hidden
Line 381: WriteLiteral("\t\t\t\t<div");
Line 382:
Line 383: WriteLiteral(" class=\"card border border-warning border-dashed text-secondary text-center\"");
Line 384:
Line 385: WriteLiteral(">\r\n\t\t\t\t\t<div");
Line 386:
Line 387: WriteLiteral(" class=\"card-body\"");
Line 388:
Line 389: WriteLiteral(">\r\n\t\t\t\t\t\t<p");
Line 390:
Line 391: WriteLiteral(" class=\"mb-0\"");
Line 392:
Line 393: WriteLiteral(">Sorry! This product is out of stock. We\'re working on getting more for you soon." +
Line 394: "</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n");
Line 395:
Line 396:
Line 397: #line 78 "roo"
Line 398: }
Line 399: else
Line 400: {
Line 401:
Line 402:
Line 403: #line default
Line 404: #line hidden
Line 405: WriteLiteral("\t\t\t\t<div");
Line 406:
Line 407: WriteLiteral(" class=\"row mb-3\"");
Line 408:
Line 409: WriteLiteral(">\r\n\t\t\t\t\t<div");
Line 410:
Line 411: WriteLiteral(" class=\"col-auto\"");
Line 412:
Line 413: WriteLiteral(">\r\n");
Line 414:
Line 415:
Line 416: #line 83 "roo"
Line 417:
Line 418:
Line 419: #line default
Line 420: #line hidden
Line 421:
Line 422: #line 83 "roo"
Line 423: if (!Model.UseProductRFQ)
Line 424: {
Line 425: var json = Newtonsoft.Json.JsonConvert.SerializeObject(
Line 426: Model.ViewProductVariants.Select(x => new { sku = x.Sku, priceGross = x.PriceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB")) }));
Line 427:
Line 428:
Line 429:
Line 430: #line default
Line 431: #line hidden
Line 432:
Line 433: #line 88 "roo"
Line 434: using (Html.BeginForm(this, new { action = "/add", method = "post", data_variants = json }))
Line 435: {
Line 436:
Line 437:
Line 438: #line default
Line 439: #line hidden
Line 440:
Line 441: #line 90 "roo"
Line 442: Write(Html.HiddenFor(x => Model.Id, new { data_product = "id" }));
Line 443:
Line 444:
Line 445: #line default
Line 446: #line hidden
Line 447:
Line 448: #line 90 "roo"
Line 449:
Line 450:
Line 451:
Line 452:
Line 453: #line default
Line 454: #line hidden
Line 455:
Line 456: #line 92 "roo"
Line 457:
Line 458:
Line 459:
Line 460: #line default
Line 461: #line hidden
Line 462:
Line 463: #line 93 "roo"
Line 464: Write(Html.Partial("Views/Products/_ViewOptionGroups.cshtml", Model));
Line 465:
Line 466:
Line 467: #line default
Line 468: #line hidden
Line 469:
Line 470: #line 93 "roo"
Line 471:
Line 472:
Line 473:
Line 474:
Line 475: #line default
Line 476: #line hidden
Line 477:
Line 478: #line 95 "roo"
Line 479:
Line 480:
Line 481:
Line 482: #line default
Line 483: #line hidden
Line 484:
Line 485: #line 96 "roo"
Line 486:
Line 487: var quantities = new List<Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem>()
Line 488: {
Line 489: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("1", "1", Model.Quantity == 1),
Line 490: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("2", "2", Model.Quantity == 2),
Line 491: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("3", "3", Model.Quantity == 3),
Line 492: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("4", "4", Model.Quantity == 4),
Line 493: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("5", "5", Model.Quantity == 5),
Line 494: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("6", "6", Model.Quantity == 6),
Line 495: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("7", "7", Model.Quantity == 7),
Line 496: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("8", "8", Model.Quantity == 8),
Line 497: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("9", "9", Model.Quantity == 9),
Line 498: new Nancy.ViewEngines.Razor.HtmlHelpersUnofficial.SelectListItem("10", "10", Model.Quantity == 10),
Line 499: };
Line 500:
Line 501:
Line 502: #line default
Line 503: #line hidden
Line 504:
Line 505: #line 110 "roo"
Line 506:
Line 507:
Line 508:
Line 509: #line default
Line 510: #line hidden
Line 511: WriteLiteral("\t\t\t\t\t\t\t\t<div");
Line 512:
Line 513: WriteLiteral(" class=\"form-group\"");
Line 514:
Line 515: WriteLiteral(">\r\n");
Line 516:
Line 517: WriteLiteral("\t\t\t\t\t\t\t\t\t");
Line 518:
Line 519:
Line 520: #line 112 "roo"
Line 521: Write(Html.LabelFor(x => Model.Quantity));
Line 522:
Line 523:
Line 524: #line default
Line 525: #line hidden
Line 526: WriteLiteral("\r\n");
Line 527:
Line 528: WriteLiteral("\t\t\t\t\t\t\t\t\t");
Line 529:
Line 530:
Line 531: #line 113 "roo"
Line 532: Write(Html.DropDownListFor(x => Model.Quantity, quantities, new { @class = "custom-select custom-select-sm " }));
Line 533:
Line 534:
Line 535: #line default
Line 536: #line hidden
Line 537: WriteLiteral("\r\n");
Line 538:
Line 539: WriteLiteral("\t\t\t\t\t\t\t\t\t");
Line 540:
Line 541:
Line 542: #line 114 "roo"
Line 543: Write(Html.ErrorsFor(x => Model.Quantity));
Line 544:
Line 545:
Line 546: #line default
Line 547: #line hidden
Line 548: WriteLiteral("\r\n\t\t\t\t\t\t\t\t</div>\r\n");
Line 549:
Line 550:
Line 551: #line 116 "roo"
Line 552:
Line 553:
Line 554: #line default
Line 555: #line hidden
Line 556:
Line 557: #line 116 "roo"
Line 558:
Line 559:
Line 560:
Line 561: #line default
Line 562: #line hidden
Line 563: WriteLiteral("\t\t\t\t\t\t\t\t<div");
Line 564:
Line 565: WriteLiteral(" class=\"form-group\"");
Line 566:
Line 567: WriteLiteral(">\r\n\t\t\t\t\t\t\t\t\t<p");
Line 568:
Line 569: WriteLiteral(" class=\"h2 mb-3\"");
Line 570:
Line 571: WriteLiteral(">\r\n\t\t\t\t\t\t\t\t\t\t<span");
Line 572:
Line 573: WriteLiteral(" class=\"sr-only\"");
Line 574:
Line 575: WriteLiteral(">\r\n");
Line 576:
Line 577: WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t");
Line 578:
Line 579:
Line 580: #line 120 "roo"
Line 581: Write(Model.ViewProductVariants.Count == 1 ? "Price per item" : "Price per item with selected options");
Line 582:
Line 583:
Line 584: #line default
Line 585: #line hidden
Line 586: WriteLiteral(")\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t<span");
Line 587:
Line 588: WriteLiteral(" data-product=\"price\"");
Line 589:
Line 590: WriteLiteral(">\r\n");
Line 591:
Line 592: WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t");
Line 593:
Line 594:
Line 595: #line 123 "roo"
Line 596: Write(priceGross.ToString("C", CultureInfo.GetCultureInfo("en-GB")));
Line 597:
Line 598:
Line 599: #line default
Line 600: #line hidden
Line 601: WriteLiteral("\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t<button");
Line 602:
Line 603: WriteLiteral(" type=\"submit\"");
Line 604:
Line 605: WriteLiteral(" class=\"btn btn-primary font-weight-bold btn-lg\"");
Line 606:
Line 607: WriteLiteral(">Add to Cart</button>\r\n\t\t\t\t\t\t\t\t</div>\r\n");
Line 608:
Line 609:
Line 610: #line 128 "roo"
Line 611: }
Line 612:
Line 613: #line default
Line 614: #line hidden
Line 615:
Line 616: #line 128 "roo"
Line 617:
Line 618:
Line 619:
Line 620: #line default
Line 621: #line hidden
Line 622:
Line 623: #line 129 "roo"
Line 624: Write(Html.Raw(Model.Content));
Line 625:
Line 626:
Line 627: #line default
Line 628: #line hidden
Line 629:
Line 630: #line 129 "roo"
Line 631:
Line 632: }
Line 633: else
Line 634: {
Line 635:
Line 636:
Line 637: #line default
Line 638: #line hidden
Line 639:
Line 640: #line 133 "roo"
Line 641: Write(Html.Raw(Model.Content));
Line 642:
Line 643:
Line 644: #line default
Line 645: #line hidden
Line 646:
Line 647: #line 133 "roo"
Line 648:
Line 649: }
Line 650:
Line 651:
Line 652: #line default
Line 653: #line hidden
Line 654: WriteLiteral("\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n");
Line 655:
Line 656:
Line 657: #line 137 "roo"
Line 658: }
Line 659:
Line 660:
Line 661: #line default
Line 662: #line hidden
Line 663: WriteLiteral("\t\t</div>\r\n\t</div>\r\n\r\n");
Line 664:
Line 665:
Line 666: #line 141 "roo"
Line 667:
Line 668:
Line 669: #line default
Line 670: #line hidden
Line 671:
Line 672: #line 141 "roo"
Line 673:
Line 674: Model.PopulateRelatedViewSiteProducts();
Line 675:
Line 676: // Related Products
Line 677: if (Model.RelatedViewProducts.Count > 0)
Line 678: {
Line 679:
Line 680:
Line 681: #line default
Line 682: #line hidden
Line 683: WriteLiteral("\t\t\t<hr />\r\n");
Line 684:
Line 685:
Line 686: #line 148 "roo"
Line 687:
Line 688:
Line 689:
Line 690: #line default
Line 691: #line hidden
Line 692: WriteLiteral("\t\t\t<h2");
Line 693:
Line 694: WriteLiteral(" class=\"h1 mb-3\"");
Line 695:
Line 696: WriteLiteral(">Related Products</h2>\r\n");
Line 697:
Line 698:
Line 699: #line 150 "roo"
Line 700:
Line 701:
Line 702:
Line 703: #line default
Line 704: #line hidden
Line 705:
Line 706: #line 151 "roo"
Line 707: Write(Html.Partial("Views/_ViewChildren.cshtml", Model.RelatedViewProducts));
Line 708:
Line 709:
Line 710: #line default
Line 711: #line hidden
Line 712:
Line 713: #line 151 "roo"
Line 714:
Line 715: }
Line 716:
Line 717:
Line 718: #line default
Line 719: #line hidden
Line 720: WriteLiteral("\r\n</div>\r\n\r\n");
Line 721:
Line 722: DefineSection("Scripts", () => {
Line 723:
Line 724: WriteLiteral(@"
Line 725: <script>
Line 726: $(function () {
Line 727: // Validation
Line 728: $('form').validate({
Line 729: rules: {
Line 730: Quantity: {
Line 731: required: true
Line 732: }
Line 733: }
Line 734: })
Line 735:
Line 736: $('[data-toggle=""quantity""]').click(function () {
Line 737:
Line 738: var $this = $(this)
Line 739:
Line 740: var target = $this.data('target')
Line 741: var increment = $this.data('increment')
Line 742: var decrement = $this.data('decrement')
Line 743:
Line 744: var $target = $(target)
Line 745: var value = parseInt($target.val())
Line 746: var max = parseInt($target.attr('max'))
Line 747: var min = parseInt($target.attr('min'))
Line 748:
Line 749: if (Number.isNaN(value)) {
Line 750: $target.val(1)
Line 751: }
Line 752: else if (increment && (value + 1 <= max)) {
Line 753: $target.val(value + 1)
Line 754: }
Line 755: else if (decrement && (value - 1 >= min)) {
Line 756: $target.val(value - 1)
Line 757: }
Line 758: })
Line 759:
Line 760:
Line 761: $('[data-toggle=""option""]').change(function () {
Line 762:
Line 763: var values = $('[data-product=""id""],[data-toggle=""option""]').map(function () {
Line 764: return $(this).val()
Line 765: }).get()
Line 766:
Line 767: var variants = $('form').data('variants')
Line 768:
Line 769: // Find the variant that contains all the ids
Line 770: var variant = variants.find(function (v1, i1, a1) {
Line 771: return v1.sku.split('-').every(function (v2, i2, a2) {
Line 772: return values.includes(v2) && (a2.length == values.length)
Line 773: })
Line 774: })
Line 775:
Line 776: var regex = /- £[\d*\.?\d*]+ -/;
Line 777:
Line 778: $('[data-product=""price""]').text(variant.priceGross)
Line 779:
Line 780: document.title = document.title.replace(regex, ""- "" + variant.priceGross + "" -"")
Line 781: })
Line 782: });
Line 783: </script>
Line 784: ");
Line 785:
Line 786: });
Line 787:
Line 788: }
Line 789: }
Line 790: }
Line 791: