Error executing template "Designs/DS2016/eCom/Product/Product2016.cshtml"
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(GroupCollection groups, Page page, NavigationItem parentNode, Int32 thisLevel, Int32 maxLevel, Page productPage)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at Dynamicweb.Rendering.TemplateBase`1.RenderNavigation(Object settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_cb91bd74648e475ebd64969f6973043d.Execute() in D:\INETPUB\wwwroot\Files\Templates\Designs\DS2016\eCom\Product\Product2016.cshtml:line 79
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System; 2 @using System.Web; 3 @using DanskStandard.Domain.Enum; 4 @using Dynamicweb; 5 @using Dynamicweb.Core; 6 @using System.Linq; 7 @using Dynamicweb.Rendering 8 9 10 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 11 12 @{ 13 var standardLanguages = string.Empty; 14 15 var variantLanguages = GetLoop("VariantGroups").SingleOrDefault(v => v.GetString("Ecom:VariantGroup.ID") == "1616"); 16 if (variantLanguages != null) 17 { 18 standardLanguages = string.Join(" / ", variantLanguages.GetLoop("VariantAvailableOptions").Select(o => o.GetString("Ecom:VariantOption.Name"))).ToUpper(); 19 } 20 } 21 22 @{ 23 bool isDanish = GetGlobalValue("Global:Area.Culture.Name") == "da-DK"; 24 var previewHtmlExists = GetBoolean("Ecom:Product:Field.SpHasPreview"); 25 var previewPdfExists = GetBoolean("Ecom:Product:Field.SpHasPdfPreview"); 26 //!string.IsNullOrEmpty(GetString("SmartPage:Product.Preview.DownloadPath")); 27 var productIDSelector = GetValue("Ecom:Product.ID"); 28 var comitteeLoop = GetLoop("SmartPage:Product.Committees"); 29 string descriptionTextOverlay = isDanish ? GetString("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE") : string.Empty; 30 string descriptionText = isDanish ? GetString("Ecom:Product:Field.AX:InventTable.DanishTitle") : GetString("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE"); 31 bool descriptionIsEmpty = string.IsNullOrWhiteSpace(descriptionText); 32 bool harmonizingExists = GetBoolean("SmartPage:Product.DirectiveCE.Show") || GetBoolean("SmartPage:Product.DirectiveHarmonized.Show") || GetBoolean("SmartPage:Product.HasBrIds") || GetBoolean("Ecom:Product:Field.AxMotherHarmonized") || GetBoolean("SmartPage:Product.MotherIsHarmonized"); 33 string titleCSSClass = descriptionIsEmpty ? "col-sm-9" : "col-sm-12"; 34 string generalCSSClass = harmonizingExists ? "col-sm-6" : "col-sm-9"; 35 var underRevision = GetLoop("SmartPage:Product.UnderRevision"); 36 bool showRevision = underRevision.Any() && GetInteger("SmartPage:Product.UnderRevision.Count") > 0; 37 bool hasCourses = GetBoolean("SmartPage:Product.SPService.HasSPServiceProductsRelated") && isDanish; 38 var extendedBtnClass = hasCourses ? "has-ext-btns" : ""; 39 var isServicePlus = GetString("SmartPage:Product.MisType") == "Course" || GetString("SmartPage:Product.MisType") == "Workshop" || GetString("SmartPage:Product.MisType") == "Advice"; 40 var serviceType = isServicePlus ? "serviceplus" : "standard"; 41 var productImage = string.IsNullOrEmpty(GetString("Ecom:Product.Image.big.Clean")) ? string.Empty : GetString("Ecom:Product.Image.big.Clean"); 42 bool productImageExists = !string.IsNullOrEmpty(productImage); 43 var productTitle = GetValue("Ecom:Product.Name"); 44 string productAjaxPageID = Converter.ToString(Pageview.Area.Item["AjaxProductPageLink"]); 45 string productPageID = Converter.ToString(Pageview.Area.Item["ProductPageId"]); 46 47 bool lastVisitedIsAjax = GetGlobalValue("Smartpage:LatestProductListPageID") == productAjaxPageID; 48 49 string lastVisitedPage = GetGlobalValue("Smartpage:LatestProductListUrl"); 50 bool existingLastVisited = System.Web.HttpContext.Current.Request.RawUrl.ToString() == lastVisitedPage || lastVisitedIsAjax; 51 string lastVisitedPageName = GetGlobalValue("Smartpage:LatestProductListName"); 52 53 var previewPath = string.Format("/Default.aspx?ID={0}&product={1}&&disablestatistics=true", Converter.ToString(Pageview.Area.Item["SpPreviewPage"]), productIDSelector); 54 55 if (!descriptionIsEmpty) 56 { 57 Pageview.Meta.AddTag("description", descriptionText.Length > 160 ? descriptionText.Substring(0, 160).Replace("\n", "") + "..." : descriptionText.Replace("\n", "")); 58 } 59 60 } 61 62 <div class="top-breadcrumbs-container hidden-print"> 63 <div class="container"> 64 <div class="row"> 65 <div class="col-sm-8"> 66 @if (!existingLastVisited && !string.IsNullOrEmpty(lastVisitedPage) && !string.IsNullOrEmpty(lastVisitedPageName)) 67 { 68 <ul class="list-inline top-breadcrumbs" data-breadcrumbs-type="self"> 69 <li> 70 <a href="@lastVisitedPage">@lastVisitedPageName</a> 71 </li> 72 <li> 73 @productTitle 74 </li> 75 </ul> 76 } 77 else 78 { 79 @RenderNavigation(new { template = "LastLevelBreadCrumbs.xslt", startLevel = 2, expandmode = "pathonly", productName = GetValue("Ecom:Product.Name"), sameVisited = existingLastVisited }) 80 } 81 </div> 82 <div class="col-sm-4"> 83 <div class="print-btns hidden-xs pull-right"> 84 @{ 85 string query = Converter.ToString(System.Web.HttpContext.Current.Request.QueryString); 86 string currentURL = "/Default.aspx?" + query; 87 string printLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(currentURL, "pagesize", "100"); 88 printLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(printLink, "print", "true"); 89 string xmlLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(currentURL, "xml", "true"); 90 string onlyShowHundredProductsInXML = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(xmlLink, "pagesize", "100"); } 91 @{ //if (Dynamicweb.Input.FormatBoolean("print")) 92 if (query.Contains("print=true")) 93 { 94 <script type="text/javascript"> 95 window.onload = function () { 96 window.print(); 97 } 98 </script> 99 } 100 else 101 { 102 <a href="@printLink" class="hidden-print" target="_blank"> 103 <i class="custom-icon-print"></i> 104 </a> 105 } 106 } 107 <a href="@onlyShowHundredProductsInXML" class="hidden-print" target="_blank"> 108 <i class="custom-icon-xml"></i> 109 </a> 110 </div> 111 112 </div> 113 </div> 114 </div> 115 </div> 116 117 <div class="container"> 118 119 <div class="row"> 120 <div class="col-sm-12"> 121 122 <div id="productlist"> 123 124 <div class="js-product-informations product-informations" data-type="@serviceType"> 125 <div class="arrow-container"> 126 <i class="productlist-arrow-mob arrow-right productlist-align-arrow-right"></i> 127 </div> 128 <div class="hidden-print modal fade js-modal-buy" tabindex="-1" role="dialog" id="js-modal-buy-@productIDSelector"> 129 <div class="modal-dialog modal-buy"> 130 <div class="modal-content"> 131 132 <div class="show-desktop"> 133 <div class="modal-header"> 134 <h3 class="modal-title"> 135 @productTitle 136 </h3> 137 <div class="margin-top-0 remove-bold-and-add-line-h-1 pad-left-18"> 138 @HttpContext.Current.Server.HtmlEncode(descriptionText) 139 </div> 140 <div class="margin-top-15" style="border-bottom: 6px solid #E1E1E1"></div> 141 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 142 </div> 143 </div> 144 <div class="show-mobile"> 145 <div class="modal-header"> 146 <h3 class="modal-title"> 147 @productTitle 148 </h3> 149 <div class="margin-top-0 remove-bold-and-add-line-h-1 pad-left-18"> 150 @HttpContext.Current.Server.HtmlEncode(descriptionText) 151 </div> 152 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 153 </div> 154 </div> 155 156 <div class="modal-body"> 157 <div class="col-sm-12"> 158 @*<div class="show-desktop"><div class="margin-top-0">@HttpContext.Current.Server.HtmlEncode(descriptionText)</div></div>*@ 159 160 <div class="table table-condensed" id="js-table-@productIDSelector"> 161 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 162 @using Newtonsoft.Json; 163 @using System.Web; 164 165 <div class="js-ajax-buy-table-content"> 166 <!-- ajax content --> 167 @if (!GetBoolean("SmartPage:Product.ValidToBuy")) 168 { 169 <p> 170 171 @Translate("Smartpage:Product.NotValidToBuy", "Standarden kan bestilles ved kontakt til Forlag og Kundecenter på telefon +45 39 96 61 31 eller mail <a href='mailto:dssalg@ds.dk'>dssalg@ds.dk</a>") 172 173 </p> 174 } 175 else 176 { 177 @: @renderBuyOptions() 178 } 179 </div> 180 181 182 183 @helper renderBuyOptions() 184 { 185 //init values 186 var optionNames = new Dictionary<string, string>(); 187 var selectedOptionIds = new HashSet<string>(); 188 var optionSortOrder = new Dictionary<string, int>(); 189 190 foreach (var vg in GetLoop("VariantGroups")) 191 { 192 string groupId = vg.GetString("Ecom:VariantGroup.ID"); 193 string _defaultSelectedOption = ""; 194 string _firstOption = ""; //set this to "selected" if no other options have the selected property 195 foreach (var vao in vg.GetLoop("VariantAvailableOptions")) 196 { 197 string optionId = vao.GetString("Ecom:VariantOption.ID"); 198 if (_firstOption == "") 199 { 200 _firstOption = optionId; 201 } 202 if (!optionNames.ContainsKey(optionId)) 203 { 204 string optName = vao.GetString("Ecom:VariantOption.Name"); 205 if (groupId == "1616") //1616 = lang --> has sortOrder 206 { 207 optionSortOrder.Add(optionId, vao.GetInteger("Ecom:VariantOption.SortOrder")); 208 } 209 optionNames.Add(optionId, vao.GetString("Ecom:VariantOption.Name")); 210 211 } 212 if (_defaultSelectedOption == "" && vao.GetBoolean("Ecom:VariantOption.Selected")) 213 { 214 _defaultSelectedOption = optionId; 215 } 216 } 217 if (_defaultSelectedOption == "") 218 { 219 _defaultSelectedOption = _firstOption; 220 } 221 selectedOptionIds.Add(_defaultSelectedOption); 222 } 223 224 @functions { 225 public class Variant : IComparable<Variant> 226 { 227 public string Id { get; set; } 228 public string Name { get; set; } 229 private string _price; 230 public string Price { get { return hasSubVariants() ? SubVariants.Any(v => v.Selected) ? SubVariants.First(v => v.Selected).Price : SubVariants.First().Price : _price; } set { _price = value; } } 231 public bool Selected { get; set; } 232 public int? SortOrder { get; set; } 233 public List<Variant> SubVariants { get; set; } 234 public bool hasSubVariants() { return SubVariants != null && SubVariants.Any(); } 235 public string getSerializedSubVariants() 236 { 237 SubVariants.Sort(); 238 return JsonConvert.SerializeObject(SubVariants.Select(v => new { Id = v.Id, Name = v.Name, Price = v.Price, Selected = v.Selected })); 239 } 240 public override int GetHashCode() { return Id.GetHashCode(); } 241 public override bool Equals(object obj) { return Id == ((Variant)obj).Id; } 242 public int CompareTo(Variant obj) { return (this.SortOrder != null) ? ((int)this.SortOrder).CompareTo(obj.SortOrder) : this.Name.CompareTo(obj.Name); } 243 } 244 } 245 //build variants 246 var pdfText = Dynamicweb.Frontend.PageView.Current().Area.Item["SpPDFText"] as string; 247 var variants = new Dictionary<string, List<Variant>>(); 248 foreach (var vc in GetLoop("VariantCombinations")) 249 { 250 string variationId = vc.GetString("Ecom:VariantCombination.VariantID"); 251 string price = vc.GetString("Ecom:VariantCombination.Product.Price.PriceWithoutVATFormatted"); 252 253 string[] _optionIds = variationId.Split('.'); 254 string langId = _optionIds[0]; 255 string langNameStr = optionNames[langId]; 256 257 string formatId = _optionIds[1]; 258 string formatNameStr = optionNames[formatId]; 259 string formatHeaderStr = (formatId == "44_PDF" || formatId == "44_PDF3") ? "PDF" : optionNames[formatId]; 260 261 if (formatHeaderStr == "PDF") //pdf format 262 { 263 Variant format = new Variant() 264 { 265 Id = variationId, 266 Name = formatNameStr, 267 Price = price, 268 Selected = selectedOptionIds.Contains(formatId), 269 }; 270 271 Variant lang = new Variant() 272 { 273 Id = langId, 274 Name = langNameStr, 275 Selected = selectedOptionIds.Contains(langId), 276 SortOrder = optionSortOrder[langId], 277 SubVariants = new List<Variant>() { format } 278 }; 279 280 if (!variants.ContainsKey(formatHeaderStr)) 281 { 282 variants.Add(formatHeaderStr, new List<Variant>() { lang }); 283 } 284 else 285 { 286 var vaList = variants[formatHeaderStr]; 287 if (vaList.Contains(lang)) 288 { //update sub 289 vaList.Single(v => v.Equals(lang)).SubVariants.Add(format); 290 } 291 else //new lang 292 { 293 vaList.Add(lang); 294 } 295 } 296 297 } 298 else //normal format 299 { 300 Variant lang_format = new Variant() 301 { 302 Id = variationId, 303 Name = langNameStr, 304 Price = price, 305 Selected = selectedOptionIds.Contains(langId), 306 }; 307 308 if (!variants.ContainsKey(formatHeaderStr)) 309 { 310 variants.Add(formatHeaderStr, new List<Variant>() { lang_format }); 311 } 312 else 313 { 314 variants[formatHeaderStr].Add(lang_format); 315 } 316 317 } 318 } 319 320 321 //build html output 322 int counter = 0; 323 int variantsCount = variants.Keys.Count; 324 foreach (string formatHeader in variants.Keys) 325 { 326 counter++; 327 List<Variant> vaList = variants[formatHeader]; 328 vaList.Sort(); 329 Variant selectedVariant = null; 330 string _c = (formatHeader == "PDF") ? "js-sel-halfvariant" : "js-sel-fullvariant"; 331 332 <div class="show-desktop"> 333 <div class="row"> 334 <div class="col-md-4"> 335 <p class="margin-bottom-5 font-family-bold-and-color-blue"> 336 @formatHeader 337 @if (formatHeader.Contains("PDF")) 338 { 339 <i class="glyphicon glyphicon-info-sign no-tooltip-arrow variant-tooltip" data-toggle="tooltip" data-placement="right" data-html="true" title="@pdfText"></i> 340 } 341 </p> 342 </div> 343 <div class="col-md-4"></div> 344 <div class="col-md-2"></div> 345 <div class="col-md-2"></div> 346 </div> 347 </div> 348 349 <div class="show-mobile"> 350 <h2 class="font-family-bold-and-color-blue"> 351 @formatHeader 352 @if (formatHeader.Contains("PDF")) 353 { 354 <i class="glyphicon glyphicon-info-sign no-tooltip-arrow variant-tooltip" data-toggle="tooltip" data-placement="right" data-html="true" title="@pdfText"></i> 355 } 356 </h2> 357 </div> 358 359 <div class="row js-variant-container"> 360 361 <div class="col-md-4"> 362 363 364 <div class="pos-relative"> 365 366 <span class="select-title-label-text">@Translate("Smartpage:mobile.addtocart.Select.title.label", "Sprog") </span> 367 368 <select class="desktop-select @_c"> 369 @foreach (Variant variant in vaList) 370 { 371 if (variant.Selected) { selectedVariant = variant; } 372 string sel = (variant.Selected) ? "selected=\"selected\"" : ""; 373 string vari = variant.hasSubVariants() ? "data-variations = \"" + HttpUtility.HtmlAttributeEncode(variant.getSerializedSubVariants()) + "\"" : ""; 374 string price = variant.hasSubVariants() ? "" : "data-price=\"" + variant.Price + "\""; 375 <option class="font-family-bold-and-color-blue" value="@variant.Id" @vari @sel @price>@variant.Name</option> 376 } 377 </select> 378 </div> 379 </div> 380 381 <div class="col-md-4"> 382 @if (selectedVariant != null && selectedVariant.hasSubVariants()) //show (sub)format select 383 { 384 List<Variant> subVariants = selectedVariant.SubVariants; 385 subVariants.Sort(); 386 <div class="pos-relative"> 387 <span class="select-title-label-text">@Translate("Smartpage:mobile.addtocart.Select.title.Amount.label", "Antal Enheder") </span> 388 389 <select class="desktop-select js-sel-fullvariant"> 390 @foreach (Variant subvariant in selectedVariant.SubVariants) 391 { 392 string sel = (subvariant.Selected) ? "selected=\"selected\"" : ""; 393 <option value="@subvariant.Id" @sel data-price="@subvariant.Price">@subvariant.Name</option> 394 } 395 </select> 396 </div> 397 } 398 </div> 399 400 <div class="show-desktop"> 401 <div class="col-md-2 pos-relative "> 402 @if (selectedVariant != null) 403 { 404 <p class="addtocart-modal-price-desktop font-size-medium-and-color-blue"> 405 @Translate("Smartpage:Modal.addtocart.price.label", "Pris") 406 <span class="js-variant-price display-block">@selectedVariant.Price</span> 407 </p> 408 409 } 410 </div> 411 </div> 412 413 <div class="col-md-2 show-mobile"> 414 <div class="margin-top-15 font-size-medium-and-color-blue"> 415 @if (selectedVariant != null) 416 { 417 @Translate("Smartpage:Productbuymodal.Price.Placeholder", "Pris: ") <span class="js-variant-price">@selectedVariant.Price</span> 418 } 419 </div> 420 </div> 421 422 <div class="show-desktop"> 423 <div class="col-md-2"> 424 <button class="width-120 btn btn-primary js-add-to-basket pull-right hidden-print"> 425 @Translate("SmartPage:Product.Buy", "Læg i kurv") 426 </button> 427 </div> 428 </div> 429 <div class="col-md-2 show-mobile"> 430 <br /> 431 <button class="margin-bottom-30 margin-top-0 btn btn-primary js-add-to-basket hidden-print margin-top-15" style="width: 100%"> 432 @Translate("SmartPage:Product.Buy", "Læg i kurv") 433 </button> 434 @if (variantsCount != counter) 435 { 436 <div style="border-bottom: 3px solid #E1E1E1"></div> 437 } 438 </div> 439 440 441 </div> 442 } 443 } 444 445 446 </div> 447 448 </div> 449 </div> 450 <div class="modal-footer"> 451 <div class="show-desktop"> 452 <div class="center-btns"> 453 <button type="button" class="btn btn-primary" data-dismiss="modal">@Translate("Smartpage:ProductList.Buy.ContinueShopping", "Fortsæt med at handle")</button> 454 <a href="/Default.aspx?ID=@GetGlobalValue("Global:eCommerce.CartPageID")" class="btn btn-default">@Translate("Smartpage:ProductList.Buy.GoToCheckout", "Gå til checkout")</a> 455 </div> 456 </div> 457 <div class="show-mobile"> 458 <div class="row"> 459 <div class="col-xs-12"> 460 <button type="button" class="btn btn-primary width-100" data-dismiss="modal">@Translate("Smartpage:ProductList.Buy.ContinueShopping", "Fortsæt med at handle")</button> 461 </div> 462 <div class="col-xs-12"> 463 <a href="/Default.aspx?ID=@GetGlobalValue("Global:eCommerce.CartPageID")" class="width-100 btn btn-default">@Translate("Smartpage:ProductList.Buy.GoToCheckout", "Gå til checkout")</a> 464 </div> 465 </div> 466 </div> 467 468 469 </div> 470 </div><!-- /.modal-content --> 471 </div><!-- /.modal-dialog --> 472 </div><!-- /.modal --> 473 @if (previewHtmlExists) 474 { 475 <div class="hidden-print modal fade js-modal-preview-html" tabindex="-1" role="dialog" id="js-preview-modal-@productIDSelector" data-preview-path="@previewPath"> 476 <div class="modal-dialog modal-preview-box"> 477 <div class="modal-content"> 478 <div class="modal-header"> 479 <a href="#" class="pull-right close-preview" data-dismiss="modal">@Translate("Smartpage:ProductList.Modal.ClosePreview", "Luk preview") <span class="close-icon">&times;</span></a> 480 </div> 481 <div class="modal-body"></div> 482 </div><!-- /.modal-content --> 483 </div><!-- /.modal-dialog --> 484 </div><!-- /.modal --> 485 } 486 @if (previewPdfExists) 487 { 488 <div class="hidden-print modal fade js-modal-preview-pdf" data-preview-path="@(previewPath + "&pdf=1")" data-target-pdf="@(string.Format("/admin/public/Download.aspx?file=/Files/Files/Products/{0}_attachPV.pdf&ForceDownload=false", productIDSelector))" data-target-canvas="js-canvas-@productIDSelector" tabindex="-1" role="dialog" id="js-pdf-preview-modal-@productIDSelector"> 489 <div class="modal-dialog modal-preview-box"> 490 <div class="modal-content"> 491 <div class="modal-header"> 492 <div class="btn-group" role="group" aria-label="..."> 493 <button type="button" class="js-prev-btn btn btn-default">@Translate("Smartpage:Modal.Prev", "Prev")</button> 494 <button type="button" class="js-current-page btn btn-default">1</button> 495 <button type="button" class="js-next-btn btn btn-default">@Translate("Smartpage:Modal.Next", "Next")</button> 496 </div> 497 <a href="#" class="pull-right close-preview" data-dismiss="modal">@Translate("Smartpage:ProductList.Modal.ClosePreview", "Luk preview") <span class="close-icon">&times;</span></a> 498 </div> 499 <div class="modal-body"> 500 <canvas id="js-canvas-@productIDSelector" class="img-responsive"></canvas> 501 </div> 502 </div><!-- /.modal-content --> 503 </div><!-- /.modal-dialog --> 504 </div> 505 } 506 <div class="productlist-content-titles"> 507 <ul class="nav nav-tabs hidden-print productlist-content-ul-mob" role="tablist"> 508 <li role="presentation"> 509 <a href='#js-start-@GetValue("Ecom:Product.ID")' aria-controls="profile" role="tab" data-toggle="tab">@renderProductTypeSingle()</a> 510 </li> 511 @if (previewHtmlExists) 512 { 513 <li role="presentation"> 514 <a href="javascript:void(0);" class="preview-button" data-toggle="modal" data-target="#js-preview-modal-@GetValue("Ecom:Product.ID")"> 515 @Translate("Smartpage:ProductList.Detail.PreviewHtml", "Preview HTML") 516 </a> 517 </li> 518 } 519 @if (previewPdfExists) 520 { 521 <li role="presentation"> 522 <a href="javascript:void(0);" class="preview-button" data-toggle="modal" data-target="#js-pdf-preview-modal-@GetValue("Ecom:Product.ID")"> 523 @Translate("Smartpage:ProductList.Detail.PreviewPdf", "Preview PDF") 524 </a> 525 </li> 526 } 527 @if (GetBoolean("SmartPage:Product.HasDirective") || harmonizingExists) 528 { 529 <li role="presentation"> 530 <a href="#js-law-@productIDSelector" data-toggle="tab" role="tab"> 531 @Translate("Smartpage:ProductList.Detail.Law", "Lovgivgning") 532 </a> 533 </li> 534 } 535 <li class="active" role="presentation"> 536 <a href='#js-details-@GetValue("Ecom:Product.ID")' aria-controls="profile" role="tab" data-toggle="tab">@Translate("Smartpage:ProductList.Details.Title", "Detaljer")</a> 537 </li> 538 <li class="watch-line pull-right js-tab-li show-checkbox-on-mobile"> 539 @if (!GetBoolean("Smartpage:Product.IsBasket")) 540 { 541 if (GetBoolean("SmartPage:Product.ProductStatus.WebMonitor")) 542 { 543 <div class="checkbox-inline"> 544 <label for="js-watch-@productIDSelector" class="checkbox-label-style-custom checkbox-watch js-subscription-create hidden-print" data-type="Dia2" data-toggle="tooltip" title='@Translate("SmartPage:Product.Monitor.Information", "Du kan overvåge standarden og få information direkte i din indboks")'> 545 @Translate("SmartPage:Product.Monitor", "Overvåg") 546 <input type="checkbox" id="js-watch-@productIDSelector" class="checkbox-style-custom checkbox-input js-checkbox-watch"> 547 <span class="checkbox-checkmark"></span> 548 549 </label> 550 </div> 551 } 552 } 553 </li> 554 </ul> 555 </div> 556 <!-- end general info --> 557 <div class="pre-content"> 558 <form class="col-sm-12 padding-10"> 559 <input type="hidden" class="js-sel-product-id" name="ProductID" value="@GetValue("Ecom:Product.ID")" /> 560 <input type="hidden" class="js-sel-variant-id" name="VariantID" value="@GetValue("Ecom:Product.DefaultVariantComboID")" /> 561 <div class="row"> 562 @if (!descriptionIsEmpty) 563 { 564 titleCSSClass = "col-sm-12"; 565 } 566 <h1 class="@titleCSSClass product-title h2"> 567 @productTitle 568 569 @{ 570 DanskStandard.Domain.Enum.StatusCode statusCode; 571 if (Enum.TryParse(GetString("SmartPage:Product.ProductStatus.Code"), out statusCode)) 572 { 573 if (statusCode != StatusCode.Current) 574 { 575 <span class="display-block-xs status-title">(@renderStatusCodeSingle())</span> 576 } 577 } 578 } 579 </h1> 580 @if (descriptionIsEmpty) 581 { 582 <div class="col-sm-3 add-to-no-description"> 583 @renderHasCoursesSingle(hasCourses) 584 @if (GetBoolean("SmartPage:Product.ValidToBuy")) 585 { 586 <button class="btn-50 margin-bottom-0 btn btn-primary pull-right hidden-print" data-toggle="modal" data-target="#js-modal-buy-@productIDSelector"> 587 @Translate("SmartPage:Product.Buy", "Læg i kurv") 588 </button> 589 } 590 </div> 591 } 592 @if (!descriptionIsEmpty) 593 { 594 var descriptionClass = productImageExists ? "col-sm-7" : "col-sm-8"; 595 if (productImageExists) 596 { 597 <div class="col-sm-1"> 598 <img src="@productImage" class="img-responsive hidden-print" alt="@productTitle)" /> 599 </div> 600 } 601 <div class="product-info-text @descriptionClass"> 602 @if (!string.IsNullOrEmpty(descriptionTextOverlay)) 603 { 604 <p data-toggle="tooltip" title="@HttpContext.Current.Server.HtmlEncode(descriptionTextOverlay)">@HttpContext.Current.Server.HtmlEncode(descriptionText)</p> 605 } 606 else 607 { 608 <p>@HttpContext.Current.Server.HtmlEncode(descriptionText)</p> 609 } 610 </div> 611 <div class="col-sm-4 @extendedBtnClass"> 612 @renderHasCoursesSingle(hasCourses) 613 @if (GetBoolean("SmartPage:Product.ValidToBuy")) 614 { 615 <button class="btn btn-50 btn-primary pull-right hidden-print" data-toggle="modal" data-target="#js-modal-buy-@productIDSelector"> 616 @Translate("SmartPage:Product.Buy", "Læg i kurv") 617 </button> 618 } 619 </div> 620 } 621 </div> 622 <hr class="product-divider margin-top-30 margin-bottom-30" /> 623 <div class="row"> 624 <div class="col-sm-3"> 625 <div class="product-details-list"> 626 <div class="prefix">@Translate("Smartpage:ProductList.StatusCodeText", "Status"):</div> 627 <div class="list-content regular"> 628 @renderStatusCodeSingle() 629 </div> 630 </div> 631 <div class="product-details-list"> 632 <div class="prefix">@Translate("Smartpage:ProductList.Type", "Type"):</div> 633 <div class="list-content regular"> 634 @renderProductTypeSingle() 635 </div> 636 </div> 637 <div class="product-details-list"> 638 <div class="prefix">@Translate("Smartpage:ProductList.Language", "Sprog"):</div> 639 <div class="list-content"> 640 @standardLanguages 641 @*@GetString("Ecom:Product:Field.AX:InventTable.DSPubLanguage").Replace(";", " / ").ToUpper()*@ 642 </div> 643 </div> 644 </div> 645 <div class="@generalCSSClass"> 646 @if (GetLoop("AssociatedGroups").Any(i => i.GetString("Ecom:Group.ID").Contains("COMMITTEEDS"))) 647 { 648 <div class="product-details-list"> 649 <div class="prefix">@Translate("Smartpage:ProductList.Category", "Kategori"):</div> 650 <div class="list-content"> 651 652 653 654 @foreach (var group in GetLoop("AssociatedGroups").Where(i => i.GetString("Ecom:Group.ID").Contains("COMMITTEEDS"))) 655 { 656 if (!string.IsNullOrWhiteSpace(group.GetString("Ecom:Group.ID"))) 657 { 658 var currentGroup = Dynamicweb.Ecommerce.Products.Group.GetGroupById(group.GetString("Ecom:Group.ID")); 659 var groupIsNull = currentGroup == null; 660 661 if (!groupIsNull) 662 { 663 var parentLanguageIsNull = currentGroup.ParentGroupsDefaultLanguage == null; 664 if (!parentLanguageIsNull) 665 { 666 if (currentGroup.ParentGroupsDefaultLanguage.Count > 0) 667 { 668 if (currentGroup.ParentGroupsDefaultLanguage != null) 669 { 670 if (currentGroup.ParentGroupsDefaultLanguage.FirstOrDefault() != null) 671 { 672 string parentId = currentGroup.ParentGroupsDefaultLanguage.FirstOrDefault().Id; 673 if (parentId != null) 674 { 675 Dynamicweb.Ecommerce.Products.Group parent = Dynamicweb.Ecommerce.Products.Group.GetGroupById(parentId); 676 if (parent != null) 677 { 678 <a href="/Default.aspx?ID=@Converter.ToString(Pageview.Area.Item["ProductPageId"])&amp;groupid=@parent.Id"> 679 @parent.Name 680 </a> 681 } 682 } 683 } 684 else 685 { 686 @Translate("Smartpage:ProductList.ParentGroup", "Parent group not found") 687 } 688 } 689 } 690 } 691 692 } 693 } 694 } 695 696 </div> 697 </div> 698 } 699 @if (showRevision) 700 { 701 <div class="product-details-list"> 702 <div class="prefix">@Translate("Smartpage:ProductList.Revision", "Revision"):</div> 703 <div class="list-content"> 704 @renderUnderRevisionSingle(underRevision, "list-unstyled list-inline", isDanish) 705 </div> 706 </div> 707 } 708 709 @if (GetLoop("SmartPage:Product.RevisionOf").Any()) 710 { 711 <div class="product-details-list"> 712 <div class="prefix">@Translate("SmartPage:Product.RevisionOf", "Revision af"):</div> 713 <div class="list-content"> 714 <ul class="list-unstyled margin-top-0 margin-bottom-0"> 715 @foreach (var related in GetLoop("SmartPage:Product.RevisionOf")) 716 { 717 var extraInfo = Pageview.Page.ID != 1 ? related.GetString("SmartPage:Product.DanishTitle") : related.GetString("SmartPage:Product.EnglishTitle"); 718 var productLink = "/Default.aspx?ID=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&amp;ProductID=" + related.GetString("SmartPage:Product.ProductId"); 719 <li> 720 <a data-original-title="@extraInfo" data-toggle="tooltip" href='@productLink'> 721 @related.GetValue("SmartPage:Product.ProductName") 722 </a> 723 </li> 724 } 725 </ul> 726 </div> 727 </div> 728 } 729 730 @renderReplaceBySingle() 731 @if (GetBoolean("SmartPage:Product.ValidToBuy")) 732 { 733 <div class="product-details-list"> 734 <div class="prefix">@Translate("Smartpage:ProductList.Price", "Pris"):</div> 735 <div class="list-content"> 736 @GetValue("Ecom:Product.Price.PriceWithoutVATFormatted") 737 </div> 738 </div> 739 } 740 </div> 741 @if (harmonizingExists) 742 { 743 <div class="col-sm-3"> 744 <strong class="product-detail-list-title">@Translate("Smartpage:ProductList.Harmony.Text", "Harmonisering"):</strong> 745 @renderHarmonizingSingle() 746 </div> 747 } 748 </div> 749 750 </form> 751 </div> 752 <!-- end general info --> 753 <div class="tab-content"> 754 <div class="tab-pane" role="tabpanel" id='js-start-@GetValue("Ecom:Product.ID")'> 755 <!-- general info --> 756 </div> 757 @if (GetBoolean("SmartPage:Product.HasDirective") || harmonizingExists) 758 { 759 <div class="tab-pane details-pane js-law-panel" role="tabpanel" id='js-law-@GetValue("Ecom:Product.ID")'> 760 <!-- law info --> 761 <hr class="product-divider margin-top-10 margin-bottom-30" /> 762 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Detail.Law", "Lovgivgning")</h4> 763 @{ 764 var standardDirectivesNames = GetLoop("SmartPage:Product.StandardDirectives.Names"); 765 if (GetBoolean("SmartPage:Product.StandardDirectives.Count") && standardDirectivesNames.Count > 0) 766 { 767 <h5 class="margin-top-0">@Translate("SmartPage:Product.HarmonizedUnder", "Harmoniseret under:")</h5> 768 <ul class="list-unstyled"> 769 @foreach (var item in standardDirectivesNames) 770 { 771 <li> 772 @if (isDanish) 773 { 774 @item.GetValue("SmartPage:Product.StandardDirectives.Name") 775 } 776 else 777 { 778 @item.GetValue("SmartPage:Product.StandardDirectives.NameUK") 779 } 780 <br /> 781 <br /> 782 </li> 783 } 784 </ul> 785 } 786 } 787 @{ 788 if (GetBoolean("SmartPage:Product.DirectiveHarmonized.Show")) 789 { 790 var standardDirectivesLinks = GetLoop("SmartPage:Product.StandardDirectives.Links"); 791 <h5 class="margin-top-0">@Translate("SmartPage:Product.HarmonizedStandards", "Harmoniserede standarder"):</h5> 792 <ul class="list-unstyled"> 793 @foreach (var item in standardDirectivesLinks) 794 { 795 <li> 796 <a href="@item.GetValue("SmartPage:Product.StandardDirectives.Link")" target="_blank"> 797 @item.GetValue("SmartPage:Product.StandardDirectives.Link") 798 </a> 799 </li> 800 } 801 </ul> 802 } 803 } 804 @if (GetBoolean("Ecom:Product:Field.AxMotherHarmonized")) 805 { 806 var replacingLoop = GetLoop("SmartPage:Product.Replacing").Where(r => r.GetBoolean("SmartPage:Product.HasDirectives") && (r.GetString("SmartPage:Product.ProductStatus.Code") == "Extended" || r.GetString("SmartPage:Product.ProductStatus.Code") == "Withdrawn")); 807 if (replacingLoop.Any()) 808 { 809 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 810 sb.Append("<ul class='list-unstyled'>"); 811 foreach (var item in replacingLoop) 812 { 813 var link = "/default.aspx?Id=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + item.GetString("SmartPage:Product.ProductId"); 814 sb.Append("<li>"); 815 sb.Append(" <a href=\"" + link + "\">" + item.GetString("SmartPage:Product.ProductName") + "</a>"); 816 sb.Append("</li>"); 817 } 818 sb.Append("</ul>"); 819 820 <text> 821 @string.Format(Converter.ToString(Pageview.Area.Item["MotherHarmonized"]), sb.ToString()) 822 </text> 823 } 824 825 } 826 @if (GetBoolean("SmartPage:Product.DirectiveCE.Show") || GetBoolean("SmartPage:Product.DirectiveHarmonized.Show") || GetBoolean("Ecom:Product:Field.AxMotherHarmonized") || GetBoolean("SmartPage:Product.MotherIsHarmonized")) 827 { 828 <h5 class="margin-top-0">@Translate("Smartpage:ProductList.Links", "Links")</h5> 829 <ul class="list-unstyled"> 830 @if (GetBoolean("SmartPage:Product.DirectiveCE.Show")) 831 { 832 <li> 833 <a href="@Pageview.Area.Item["CELink"]" target="_blank" data-toggle="tooltip" title='@Translate("SmartPage:Product.ToolTip.CE", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")'>@Translate("SmartPage:Product.Button.CE", "Læs mere om CE-mærkning")</a> 834 </li> 835 } 836 @if (GetBoolean("SmartPage:Product.DirectiveHarmonized.Show") || GetBoolean("Ecom:Product:Field.AxMotherHarmonized")) 837 { 838 <li> 839 <a href="@Pageview.Area.Item["HarmonizedLink"]" target="_blank" data-toggle="tooltip" title='@Translate("SmartPage:Product.ToolTip.Harmonized", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")'>@Translate("SmartPage:Product.Button.Harmonized", "Læs mere om harmoniserede standarder")</a> 840 </li> 841 } 842 </ul> 843 } 844 @if (GetBoolean("SmartPage:Product.HasBrIds")) 845 { 846 <div class="br-15-content"> 847 @Converter.ToString(Pageview.Area.Item["BR15Text"]) 848 </div> 849 } 850 </div> 851 } 852 <div class="tab-pane active details-pane js-details-panel" role="tabpanel" id='js-details-@GetValue("Ecom:Product.ID")'> 853 <!-- details --> 854 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.SpSalesText"))) 855 { 856 <hr class="product-divider margin-top-10 margin-bottom-20" /> 857 <div class="row"> 858 <div class="col-sm-12"> 859 <div> 860 @GetString("Ecom:Product:Field.SpSalesText") 861 </div> 862 </div> 863 </div> 864 } 865 <hr class="product-divider margin-top-10 margin-bottom-20" /> 866 <div class="row"> 867 <div class="col-sm-12"> 868 @if (isDanish) 869 { 870 if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.AX:InventTable.DSDKScope"))) 871 { 872 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Details.Description", "Beskrivelse")</h4> 873 <div class="description"> 874 @GetString("Ecom:Product:Field.AX:InventTable.DSDKScope").Replace("\n", "<br />") 875 </div> 876 } 877 else 878 { 879 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Details.Description", "Beskrivelse")</h4> 880 <div class="description margin-bottom-0"> 881 @GetString("Ecom:Product:Field.AX:InventTable.DS_UKScope").Replace("\n", "<br />") 882 </div> 883 } 884 } 885 else 886 { 887 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Details.Description", "Beskrivelse")</h4> 888 <div class="description"> 889 @GetString("Ecom:Product:Field.AX:InventTable.DS_UKScope").Replace("\n", "<br />") 890 </div> 891 } 892 893 </div> 894 </div> 895 @{ 896 int count = 0; 897 if (showRevision) 898 { 899 count++; 900 } 901 if (GetLoop("SmartPage:Product.Replacing").Where(p => p.GetInteger("SmartPage:Product.ProductLevel") == 0).Any()) 902 { 903 count++; 904 } 905 if (GetInteger("SmartPage:Related.AssociatedProducts.Count") > 0) 906 { 907 count++; 908 } 909 910 string classCss = "col-sm-12"; 911 switch (count) 912 { 913 case 2: 914 classCss = "col-sm-6"; 915 break; 916 case 3: 917 classCss = "col-sm-4"; 918 break; 919 case 4: 920 classCss = "col-sm-3"; 921 break; 922 case 0: 923 classCss = "hide"; 924 break; 925 } 926 } 927 @if (classCss != "hide") 928 { 929 <hr class="product-divider margin-top-30 margin-bottom-30" /> 930 } 931 <div class="row"> 932 933 @if (showRevision) 934 { 935 <div class="@classCss"> 936 <h4 class="margin-top-0">@Translate("SmartPage:Product.UnderRevision", "Under revision")</h4> 937 @renderUnderRevisionSingle(underRevision, "list-unstyled", isDanish) 938 </div> 939 } 940 941 942 @{ 943 var replacing = GetLoop("SmartPage:Product.Replacing"); 944 if (replacing.Any()) 945 { 946 <div class="@classCss"> 947 <h4 class="margin-top-0">@Translate("SmartPage:Product.Replacing", "Erstatter"):</h4> 948 949 <ul class="list-unstyled"> 950 @foreach (var item in replacing) 951 { 952 <li> 953 <a href="/Default.aspx?ID=@Pageview.Area.Item["ProductPageId"]&amp;ProductID=@item.GetValue("SmartPage:Product.ProductId")"> 954 @item.GetValue("SmartPage:Product.ProductName") 955 </a> 956 </li> 957 } 958 </ul> 959 </div> 960 } 961 } 962 963 @if (GetInteger("SmartPage:Related.AssociatedProducts.Count") > 0) 964 { 965 var associatedProducts = GetLoop("SmartPage:Related.AssociatedProducts"); 966 <div class="@classCss"> 967 <h4 class="margin-top-0">@Translate("SmartPage:Product.AssociatedProducts", "Relaterede varer")</h4> 968 <ul class="list-unstyled"> 969 @foreach (var item in associatedProducts) 970 { 971 <li> 972 @if (isDanish) 973 { 974 <a href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@item.GetValue("Ecom:Product:Field.AX:InventTable.DanishTitle")"> 975 @item.GetValue("Ecom:Product.Name") 976 </a> 977 } 978 else 979 { 980 <a href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@item.GetValue("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE")"> 981 @item.GetValue("Ecom:Product.Name") 982 </a> 983 } 984 </li> 985 } 986 </ul> 987 </div> 988 } 989 </div> 990 <hr class="product-divider margin-top-30 margin-bottom-30" /> 991 <div class="row"> 992 <div class="col-sm-12 regular-details"> 993 @renderGeneralDetailsSingle() 994 </div> 995 </div> 996 @{ 997 var handbookContainedLoop = GetLoop("SmartPage:Product.ContainedIn"); 998 var handbookContainsLoop = GetLoop("SmartPage:Related.HandbookContainsProducts"); 999 var shadowProductsLoop = GetLoop("SmartPage:Product.ShadowProducts"); 1000 var shadowProductsFromProductId = GetLoop("Smartpage:Product.ShadowProductsFromProductId"); 1001 1002 1003 1004 if (handbookContainedLoop.Any() || handbookContainsLoop.Any() || shadowProductsLoop.Any() || shadowProductsFromProductId.Any()) 1005 { 1006 1007 <hr class="product-divider margin-top-30 margin-bottom-30" /> 1008 <div class="row"> 1009 @if (handbookContainedLoop.Any()) 1010 { 1011 <div class="col-sm-6"> 1012 <h4 class="margin-top-0">@Translate("SmartPage:Product.ContainedIn", "Indgår i")</h4> 1013 <ul class="list-unstyled margin-bottom-0"> 1014 @foreach (var item in handbookContainedLoop) 1015 { 1016 var toolTip = isDanish ? item.GetValue("SmartPage:Product.DanishTitle") : item.GetValue("SmartPage:Product.EnglishTitle"); 1017 <li> 1018 <a href="/Default.aspx?ID=@Pageview.Area.Item["ProductPageId"]&amp;ProductID=@item.GetValue("SmartPage:Product.ProductId")" data-toggle="tooltip" title='@toolTip'> 1019 @item.GetValue("SmartPage:Product.ProductName") 1020 </a> 1021 </li> 1022 } 1023 </ul> 1024 </div> 1025 } 1026 @if (handbookContainsLoop.Any()) 1027 { 1028 <div class="col-sm-6"> 1029 <h4 class="margin-top-0">@Translate("SmartPage:Product.HandbookContains", "Håndbogen indeholder")</h4> 1030 <ul class="list-unstyled margin-bottom-0"> 1031 @foreach (var item in handbookContainsLoop) 1032 { 1033 <li> 1034 @if (item.GetString("SmartPage:Product.ProductStatus.Code") == DanskStandard.Domain.Enum.StatusCode.Withdrawn.ToString()) 1035 { 1036 if (isDanish) 1037 { 1038 <a class="repealed" href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@Translate("SmartPage:Product.Withdrawn", "Tilbagetrukket"): @item.GetValue("Ecom:Product:Field.AX:InventTable.DanishTitle")"> 1039 @item.GetValue("Ecom:Product.Name") 1040 </a> 1041 } 1042 else 1043 { 1044 <a class="repealed" href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@Translate("SmartPage:Product.Withdrawn", "Tilbagetrukket"): @item.GetValue("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE")"> 1045 @item.GetValue("Ecom:Product.Name") 1046 </a> 1047 } 1048 } 1049 else 1050 { 1051 if (isDanish) 1052 { 1053 <a href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@HttpContext.Current.Server.HtmlEncode(item.GetString("Ecom:Product:Field.AX:InventTable.DanishTitle"))"> 1054 @item.GetValue("Ecom:Product.Name") 1055 </a> 1056 } 1057 else 1058 { 1059 <a href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title="@HttpContext.Current.Server.HtmlEncode(item.GetString("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE"))"> 1060 @item.GetValue("Ecom:Product.Name") 1061 </a> 1062 } 1063 } 1064 </li> 1065 } 1066 </ul> 1067 </div> 1068 } 1069 @if (shadowProductsLoop.Any() || shadowProductsFromProductId.Any()) 1070 { 1071 1072 1073 if (shadowProductsLoop.Any() && GetString("SmartPage:Product.MisType") == "PartOf") 1074 { 1075 <div class="col-sm-6"> 1076 <h4 class="margin-top-0">@Translate("SmartPage:Product.ShadowProducts.Standards", "omhandler")</h4> 1077 <ul class="list-unstyled margin-bottom-0"> 1078 @foreach (var item in shadowProductsLoop) 1079 { 1080 <li> 1081 <a href="/Default.aspx?ID=@Pageview.Area.Item["ProductPageId"]&amp;ProductID=@item.GetValue("SmartPage:Product.ProductId")"> 1082 @item.GetValue("SmartPage:Product.ProductName") 1083 </a> 1084 </li> 1085 } 1086 </ul> 1087 </div> 1088 } 1089 else if (shadowProductsFromProductId.Any() && GetString("SmartPage:Product.MisType") == "Standard") 1090 { 1091 <div class="col-sm-6"> 1092 <h4 class="margin-top-0">@Translate("SmartPage:Product.ShadowProducts.Handbooks", "Guides og vejledninger")</h4> 1093 <ul class="list-unstyled margin-bottom-0"> 1094 @foreach (var item in shadowProductsFromProductId) 1095 { 1096 <li> 1097 <a href="/Default.aspx?ID=@Pageview.Area.Item["ProductPageId"]&amp;ProductID=@item.GetValue("Smartpage:RelatedProductId")"> 1098 @item.GetValue("Smartpage:ProductName") @item.GetValue("Smartpage:ProductTitle") 1099 </a> 1100 </li> 1101 } 1102 </ul> 1103 </div> 1104 } 1105 1106 } 1107 </div> 1108 } 1109 } 1110 1111 1112 1113 <hr class="product-divider margin-top-20 margin-bottom-30" /> 1114 1115 <div class="row"> 1116 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AX:EGMIS.TECHNICALCOMMITTEE")) || comitteeLoop.Any()) 1117 { 1118 <div class="col-sm-6"> 1119 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Details.ComitteeSectionTitle", "Udvalgte og komite")</h4> 1120 <div class="row"> 1121 @renderComitteeLoopSingle(comitteeLoop) 1122 @renderSComitteeSingle() 1123 </div> 1124 </div> 1125 } 1126 1127 1128 @if (GetInteger("eCom:Related.CustomersWhoSawThisAlsoSaw.Count") > 0) 1129 { 1130 var customersWhoSawThisAlsoSaw = GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").Take(3); 1131 <div class="col-sm-6"> 1132 <h4 class="margin-top-0">@Translate("Smartpage:ProductList.Details.OthersAlsoSaw", "Andre kigger også på")</h4> 1133 <ul class="list-unstyled"> 1134 @foreach (var item in customersWhoSawThisAlsoSaw.Where(ssp => ssp.GetString("Ecom:Product:Field.AX:EGMIS.MISType") != "100" && ssp.GetString("Ecom:Product:Field.AX:EGMIS.MISType") != "101" && ssp.GetString("Ecom:Product:Field.AX:EGMIS.MISType") != "102")) 1135 { 1136 var tooltipinfo = Pageview.Page.ID != 1 ? item.GetValue("Ecom:Product:Field.AX:InventTable.DanishTitle") : item.GetValue("Ecom:Product:Field.AX:InventTable.ENGLISHTITLE"); 1137 <li> 1138 <a href="@item.GetValue("Ecom:Product.Link.Clean")" data-toggle="tooltip" title='@tooltipinfo'> 1139 @item.GetValue("Ecom:Product.Name") 1140 </a> 1141 </li> 1142 } 1143 </ul> 1144 </div> 1145 } 1146 </div> 1147 </div> 1148 </div> 1149 1150 </div> 1151 </div> 1152 </div> 1153 </div> 1154 </div> 1155 1156 <div class="container header-container"> 1157 <div id="spp_productlist"> 1158 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1159 1160 <div class="modal fade js-spp-productslist-modal js-close-after-adding-to-cart" id="OpenSPProductsList" tabindex="-1" role="dialog"> 1161 <div class="modal-dialog large js-spp-modal-size"> 1162 <div class="modal-content js-service-product-informations"> 1163 <div class="modal-header"> 1164 <div class="js-no-recommendation-wrapper"> 1165 <div class="spp-header js-spp-modal-productlist-header"> 1166 @Translate("SmartPage:Product.Modal.SPPProductlistHeader", "Standardplus liste overskrift") 1167 </div> 1168 <div class="spp-header js-spp-modal-header-productname"> 1169 </div> 1170 </div> 1171 <div class="js-recommendation-wrapper hide"> 1172 <div class="spp-header"> 1173 @Translate("SmartPage:Product.Modal.SPPProductlistHeader.Recommendation", "Relevante kurser og rådgivning") 1174 </div> 1175 </div> 1176 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 1177 </div> 1178 <div class="modal-body"> 1179 <div class="row"> 1180 <a href="#" class="js-spp-modal-back col-sm-12"><i class="glyphicon glyphicon-backward"></i> @Translate("SmartPage:Product.Modal.Back", "Gå til listevisning")</a> 1181 </div> 1182 <div class="row"> 1183 <div class="js-spp-modal-content spp-modal-content col-sm-12"><!-- ajax indhold --></div> 1184 </div> 1185 @*<div class="spp-productlist js-spp-modal-original-content row"></div>*@ 1186 @*<div class="js-spp-contactme-content row">*@<!-- ajax indhold -->@*</div>*@ 1187 </div> 1188 <div class="modal-footer"> 1189 <div class="standard-plus-disturb pull-left js-standard-plus-disturb hide"> 1190 <div class="checkbox"> 1191 <label> 1192 <input class="js-standard-plus-checkbox" type="checkbox"> 1193 @Translate("SmartPage:DoNotDistrub", "Vis ikke denne igen") 1194 </label> 1195 </div> 1196 </div> 1197 <div class="center-btns"> 1198 <button class="btn btn-default js-spp-close-btn-modal" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1199 </div> 1200 </div> 1201 </div> 1202 </div> 1203 </div> 1204 </div> 1205 </div> 1206 1207 @helper renderHasCoursesSingle(bool hasCourses) 1208 { 1209 if (hasCourses) 1210 { 1211 var cssClass = GetBoolean("SmartPage:Product.ValidToBuy") ? "" : "pull-right"; 1212 var standardPlusProductLink = Converter.ToString(Pageview.Area.Item["StandardPlusPage"]) + "&ProductId=" + GetString("Ecom:Product.ID"); 1213 <a href="@standardPlusProductLink" data-product-id='@GetValue("Ecom:Product.ID")' class="btn margin-bottom-0 btn-default width-45percent js-spp-productlist-btn @cssClass" style="margin-right:10px" data-product-name='@GetValue("Ecom:Product.Name")' data-toggle="tooltip" 1214 title='@Translate("SmartPage:Product.SeeServiceProductsCourceAndAdviceTooltip", "Kursus og rådgivning tooltip")'>@Translate("SmartPage:ProductList.Courses", "Kurser")</a> 1215 } 1216 } 1217 1218 1219 @helper renderUnderRevisionSingle(List<LoopItem> revisionLoop, string className, bool isDanish) 1220 { 1221 <ul class='@className'> 1222 @foreach (var item in revisionLoop) 1223 { 1224 var toolTip = !isDanish ? item.GetValue("SmartPage:Product.EnglishTitle") : item.GetValue("SmartPage:Product.DanishTitle"); 1225 <li> 1226 <a href="/Default.aspx?ID=@Pageview.Area.Item["ProductPageId"]&amp;ProductID=@item.GetValue("SmartPage:Product.ProductId")" data-toggle="tooltip" title='@toolTip'>@item.GetValue("SmartPage:Product.ProductName")</a> 1227 </li> 1228 } 1229 </ul> 1230 } 1231 1232 @helper renderSComitteeSingle() 1233 { 1234 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AX:EGMIS.TECHNICALCOMMITTEE"))) 1235 { 1236 var techLink = "http://www.ds.dk/" + GetString("Ecom:Product:Field.AX:EGMIS.TECHNICALCOMMITTEE").Replace("DS/", ""); 1237 <div class="col-sm-6"> 1238 <p class="small-title">@Translate("Smartpage:ProductList.Details.TechnicalComittee", "Dansk udvalg")</p> 1239 <a href="@techLink" target="_blank">@GetString("Ecom:Product:Field.AX:EGMIS.TECHNICALCOMMITTEE")</a> 1240 </div> 1241 } 1242 } 1243 1244 @helper renderComitteeLoopSingle(List<LoopItem> comitteeLoop) 1245 { 1246 if (comitteeLoop.Any()) 1247 { 1248 <div class="col-sm-6"> 1249 <p class="small-title">@Translate("SmartPage:ProductList.Details.Comittee", "Komite")</p> 1250 <ul class="list-unstyled"> 1251 @foreach (var i in comitteeLoop) 1252 { 1253 //var productLink = "/Default.aspx?ID=" + Dynamicweb.Base.ChkString(Pageview.Area.Item["ProductPageId"]) + "&amp;ProductID=" + i.GetString("SmartPage:Product.ProductId"); 1254 <li>@i.GetValue("SmartPage:Product.ProductName")</li> 1255 } 1256 </ul> 1257 </div> 1258 } 1259 } 1260 1261 @helper renderGeneralDetailsSingle() 1262 { 1263 var associatedGroups = GetLoop("AssociatedGroups"); 1264 DateTime publishDate = GetDate("Ecom:Product:Field.AX:InventTable.ItemPublished"); 1265 DateTime acceptedDate = GetDate("Ecom:Product:Field.AX:EGMIS.DSPUBACCEPTDATE"); 1266 DateTime withdrawnDate = GetDate("Ecom:Product:Field.AX:EGMIS.WITHDRAWDATE"); 1267 DateTime sqlNullDate = Convert.ToDateTime("1/1/1901 00:00:00 AM");@* to avoid empty date in sql, that does not match DateTime.MinValue *@ 1268 <p><strong>@Translate("Smartpage:ProductList.Details.NoOfPages", "Antal sider"):</strong> @GetValue("Ecom:Product:Field.AX:InventTable.NumberOfPages")</p> 1269 if (publishDate != DateTime.MinValue && DateTime.Compare(sqlNullDate, publishDate) != 0) 1270 { 1271 <p><strong>@Translate("Smartpage:ProductList.Details.Published", "Udgivet"):</strong> @publishDate.ToString("yyyy-MM-dd")</p> 1272 } 1273 if (acceptedDate != DateTime.MinValue && DateTime.Compare(sqlNullDate, acceptedDate) != 0) 1274 { 1275 <p><strong>@Translate("Smartpage:ProductList.Details.AcceptanceDate", "Godkendelsesdato"):</strong> @acceptedDate.ToString("yyyy-MM-dd")</p> 1276 } 1277 if (withdrawnDate != DateTime.MinValue && DateTime.Compare(sqlNullDate, withdrawnDate) != 0) 1278 { 1279 <p><strong>@Translate("SmartPage:Ecom.RevokedDate", "Ophævelsesdato"):</strong> @withdrawnDate.ToString("yyyy-MM-dd")</p> 1280 } 1281 1282 var standardRelations = GetLoop("SmartPage:Product.StandardRelation"); 1283 if (standardRelations.Any()) 1284 { 1285 var isFirst = true; 1286 <p> 1287 <strong>@Translate("SmartPage:Product.StandardRelation", "Standard relation"): </strong> 1288 @foreach (var relation in standardRelations) 1289 { 1290 if (!isFirst) 1291 { 1292 <br /> 1293 } 1294 if (!string.IsNullOrEmpty(relation.GetString("SmartPage:Product.EuroPub.ProductName"))) 1295 { 1296 <span>@relation.GetValue("SmartPage:Product.EuroPub.ProductName")</span> 1297 } 1298 if (!string.IsNullOrEmpty(relation.GetString("SmartPage:Product.InternatPub.ProductName"))) 1299 { 1300 <span>@relation.GetValue("SmartPage:Product.InternatPub.ProductName")</span> 1301 } 1302 isFirst = false; 1303 1304 } 1305 </p> 1306 } 1307 if (associatedGroups.Where(g => System.Text.RegularExpressions.Regex.IsMatch(g.GetString("Ecom:Group.Name"), @"^\d+")).Any()) 1308 { 1309 <p> 1310 <strong>@Translate("Smartpage:ProductList.Details.ICS", "ICS"):</strong> 1311 @foreach (var item in associatedGroups.Where(g => System.Text.RegularExpressions.Regex.IsMatch(g.GetString("Ecom:Group.Name"), @"^\d+"))) 1312 { 1313 <span> 1314 <a href="@item.GetValue("Ecom:Group.Link.Clean")"> 1315 @item.GetValue("Ecom:Group.Name") 1316 </a> 1317 </span> 1318 } 1319 </p> 1320 } 1321 <p><strong>@Translate("SmartPage: Product.ItemNumber", "Varenummer"):</strong> @GetValue("Ecom:Product.Number")</p> 1322 1323 if (GetBoolean("SmartPage.ExpectedRevokedDate.Show")) 1324 { 1325 <p><strong>@Translate("SmartPage:Ecom.ExpectedRevokedDate", "Forventes ophævet"): </strong>@GetString("Ecom:Product:Field.AX:EGMIS.LATESTDATETOWITHDRAW").Replace(" 00:00", "")</p> 1326 } 1327 1328 } 1329 1330 @helper renderReplaceBySingle() 1331 { 1332 var replacedBy = GetLoop("SmartPage:Product.ReplacedBy"); 1333 if (replacedBy.Any()) 1334 { 1335 <div class="product-details-list"> 1336 <div class="prefix">@Translate("SmartPage:Product.ReplacedBy", "Erstattet af"):</div> 1337 <div class="list-content"> 1338 <ul class="list-unstyled margin-bottom-0 margin-top-0"> 1339 @foreach (var item in replacedBy) 1340 { 1341 var itemLink = "/Default.aspx?ID=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&amp;ProductID=" + @item.GetString("SmartPage:Product.ProductId"); 1342 var toolTip = Pageview.Page.AreaId == 3 ? item.GetValue("SmartPage:Product.DanishTitle") : item.GetValue("SmartPage:Product.EnglishTitle"); 1343 <li> 1344 <a href="@itemLink" data-toggle="tooltip" title='@toolTip'>@item.GetValue("SmartPage:Product.ProductName")</a> 1345 </li> 1346 } 1347 </ul> 1348 </div> 1349 </div> 1350 } 1351 } 1352 1353 1354 @helper renderHarmonizingSingle() 1355 { 1356 var isHarmonized = false; 1357 <p class="harmony-links"> 1358 @if (GetBoolean("SmartPage:Product.DirectiveCE.Show")) 1359 { 1360 isHarmonized = true; 1361 <span class="badge badge-harmony" data-toggle="tooltip" title='@Translate("SmartPage:Product.ToolTip.CE", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")'>@Translate("Smartpage.ProductList.Harmony.CE", "CE")</span> 1362 } 1363 @if (GetBoolean("SmartPage:Product.DirectiveHarmonized.Show")) 1364 { 1365 isHarmonized = true; 1366 <span class="badge badge-harmony" data-toggle="tooltip" title='@Translate("SmartPage:Product.ToolTip.Harmonized", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")'>@Translate("Smartpage.ProductList.Harmony.Harmonized", "Harmonizeret")</span> 1367 } 1368 1369 @foreach (var brId in GetLoop("SmartPage:Product.BrIds")) 1370 { 1371 var br = brId.GetString("SmartPage:Product.BrId"); 1372 <span class="badge badge-harmony" data-toggle="tooltip" title="@Translate("SmartPage.Product.ToolTip." + br, "Bygningsreglementet " + br)">@Translate("Smartpage.ProductList.Harmony." + br, br)</span> 1373 } 1374 1375 @*@if (GetBoolean("Ecom:Product:Field.AxMISBR.Value")) 1376 { 1377 <span class="badge badge-harmony" data-toggle="tooltip" title="@Translate("SmartPage.Product.ToolTip.BR15", "Bygningsreglementet 2015")">@Translate("Smartpage.ProductList.Harmony.BR15", "BR15")</span> 1378 } 1379 @if (GetBoolean("Ecom:Product:Field.AxMISBRInstruction.Value")) 1380 { 1381 <span class="badge badge-harmony" data-toggle="tooltip" title="@Translate("SmartPage.Product.ToolTip.BR15Instruction", "Bygningsreglementet 2015")">@Translate("Smartpage.ProductList.Harmony.BR15Instruction", "BR15Instruction")</span> 1382 }*@ 1383 </p> 1384 1385 var replacing = GetLoop("SmartPage:Product.Replacing").Where(p => p.GetInteger("SmartPage:Product.ProductLevel") == 0); 1386 1387 if (GetBoolean("SmartPage:Product.MotherIsHarmonizedCE")) 1388 { 1389 1390 1391 var replacingLoop = GetLoop("SmartPage:Product.Replacing").Where(r => r.GetBoolean("SmartPage:Product.HasDirectiveCE")); 1392 if (replacingLoop.Any()) 1393 { 1394 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 1395 sb.Append("<ul class='list-unstyled margin-top-0'>"); 1396 foreach (var item in replacingLoop) 1397 { 1398 var link = "/default.aspx?Id=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + item.GetString("SmartPage:Product.ProductId"); 1399 sb.Append("<li>"); 1400 sb.Append(" <a href=\"" + link + "\">" + item.GetString("SmartPage:Product.ProductName") + "</a>"); 1401 sb.Append("</li>"); 1402 } 1403 sb.Append("</ul>"); 1404 1405 1406 <text> 1407 @string.Format(Converter.ToString(Pageview.Area.Item["HarmonizedAndCEApproved"]), sb.ToString()) 1408 </text> 1409 } 1410 } 1411 1412 else if (!isHarmonized && (GetBoolean("Ecom:Product:Field.AxMotherHarmonized") || GetBoolean("SmartPage:Product.MotherIsHarmonized"))) 1413 { 1414 var replacingLoop = GetLoop("SmartPage:Product.Replacing").Where(r => r.GetBoolean("SmartPage:Product.HasDirectives") && (r.GetString("SmartPage:Product.ProductStatus.Code") == "Extended" || r.GetString("SmartPage:Product.ProductStatus.Code") == "Withdrawn")); 1415 if (replacingLoop.Any()) 1416 { 1417 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 1418 sb.Append("<ul class='list-unstyled margin-top-0'>"); 1419 foreach (var item in replacingLoop) 1420 { 1421 var link = "/default.aspx?Id=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + item.GetString("SmartPage:Product.ProductId"); 1422 sb.Append("<li>"); 1423 sb.Append(" <a href=\"" + link + "\">" + item.GetString("SmartPage:Product.ProductName") + "</a>"); 1424 sb.Append("</li>"); 1425 } 1426 sb.Append("</ul>"); 1427 1428 <text> 1429 @string.Format(Converter.ToString(Pageview.Area.Item["MotherHarmonized"]), sb.ToString()) 1430 </text> 1431 /* 1432 foreach(var replacing in replacingLoop.Where(r => r.GetString("SmartPage:Product.ProductStatus.Code") == "Extended" || r.GetString("SmartPage:Product.ProductStatus.Code") == "Withdrawn")) 1433 { 1434 var link = "/default.aspx?Id=" + Dynamicweb.Base.ChkString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + replacing.GetString("SmartPage:Product.ProductId"); 1435 <a href="@link">@replacing.GetString("SmartPage:Product.ProductName")</a> 1436 } 1437 */ 1438 } 1439 } 1440 } 1441 @helper renderProductTypeSingle() 1442 { 1443 switch (GetString("SmartPage:Product.MisType")) 1444 { 1445 case "Course": 1446 @:@Translate("Smartpage:Product.MisType.Course", "Kurser") 1447 break; 1448 case "Workshop": 1449 @:@Translate("Smartpage:Product.MisType.Workshop", "Workshop") 1450 break; 1451 case "Advice": 1452 @:@Translate("Smartpage:Product.MisType.Advice", "Rådvigning") 1453 break; 1454 case "Standard": 1455 @:@Translate("SmartPage:Product.MisType.Standard", "Standard") 1456 break; 1457 case "PartOf": 1458 @:@Translate("SmartPage:Product.MisType.PartOf", "Håndbog") 1459 break; 1460 case "Supplementary": 1461 @:@Translate("SmartPage:Product.MisType.Supplementary", "Tillæg") 1462 break; 1463 case "CorrectionSheet": 1464 @:@Translate("SmartPage:Product.MisType.CorrectionSheet", "Rettelsesblad") 1465 break; 1466 case "Appendix": 1467 @:@Translate("SmartPage:Product.MisType.Appendix", "Bilag") 1468 break; 1469 } 1470 } 1471 @helper renderStatusCodeSingle() 1472 { 1473 DanskStandard.Domain.Enum.StatusCode statusCode; 1474 if (Enum.TryParse(GetString("SmartPage:Product.ProductStatus.Code"), out statusCode)) 1475 { 1476 switch (statusCode) 1477 { 1478 case StatusCode.Current: 1479 @:@Translate("SmartPage:Product.StatusCode.Current", "Gældende") 1480 break; 1481 case StatusCode.Draft: 1482 @:@Translate("SmartPage:Product.StatusCode.Draft", "Forslag") 1483 break; 1484 case StatusCode.Extended: 1485 @:@Translate("SmartPage:Product.StatusCode.Extended", "Forlænget") 1486 break; 1487 case StatusCode.Withdrawn: 1488 @:@Translate("SmartPage:Product.StatusCode.Withdrawn", "Tilbagetrukket") 1489 break; 1490 } 1491 } 1492 } 1493 1494 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1495 <!-- Modal --> 1496 <div class="modal fade js-subscription-not-loggedin" tabindex="-1" role="dialog"> 1497 <div class="modal-dialog"> 1498 <div class="modal-content"> 1499 <div class="modal-header"> 1500 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1501 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.NotLoggedIn", "Du er ikke logget ind")</h4> 1502 </div> 1503 <div class="modal-body"> 1504 <p class="js-monitoring hide">@Translate("SmartPage:Product.Modal.Text.NotLoggedIn.Monitoring", "Du skal være logget ind for at kunne melde til overvågning")</p> 1505 <p class="js-subscription hide">@Translate("SmartPage:Product.Modal.Header.NotLoggedIn.Subscription", "Du skal være logget ind for at kunne melde til abonnement")</p> 1506 </div> 1507 <div class="modal-footer"> 1508 <div class="center-btns"> 1509 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1510 <button class="btn btn-info js-close" aria-hidden="true">@Translate("SmartPage:Product.Modal.Login", "Login")</button> 1511 </div> 1512 </div> 1513 </div> 1514 <!-- /.modal-content --> 1515 </div> 1516 <!-- /.modal-dialog --> 1517 </div> 1518 <!-- /.modal --> 1519 <!-- Modal --> 1520 <div class="modal fade js-subscription-no-access" tabindex="-1" role="dialog"> 1521 <div class="modal-dialog"> 1522 <div class="modal-content"> 1523 <div class="modal-header"> 1524 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1525 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.Problems", "Ingen adgang")</h4> 1526 </div> 1527 <div class="modal-body"> 1528 <p class="js-monitoring hide">@Translate("SmartPage:Product.Modal.Text.Problems.Monitoring", "Der er problemer med at føje til overvågning - forsøg venligst igen senere")</p> 1529 <p class="js-subscription hide">@Translate("SmartPage:Product.Modal.Text.Problems.Subscription", "Der er problemer med at føje til abonnement - forsøg venligst igen senere")</p> 1530 </div> 1531 <div class="modal-footer"> 1532 <div class="center-btns"> 1533 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1534 </div> 1535 </div> 1536 </div> 1537 <!-- /.modal-content --> 1538 </div> 1539 <!-- /.modal-dialog --> 1540 </div> 1541 <!-- /.modal --> 1542 <!-- Modal --> 1543 <div class="modal fade js-subscription-exists" tabindex="-1" role="dialog"> 1544 <div class="modal-dialog"> 1545 <div class="modal-content"> 1546 <div class="modal-header"> 1547 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1548 <h4 class="modal-title"> 1549 <span class="js-monitoring">@Translate("SmartPage:Product.Modal.Header.MonitoringExists", "Overvågning")</span> 1550 <span class="js-subscription">@Translate("SmartPage:Product.Modal.Header.SubscriptionExists", "Abonnement")</span> 1551 </h4> 1552 </div> 1553 <div class="modal-body"> 1554 <div class="js-monitoring hide"> 1555 <div class="js-exists"> 1556 <div class="js-subject"> 1557 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringExistsSubject", "Du overvåger allerede dette emne")</p> 1558 </div> 1559 <div class="js-standard"> 1560 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringExistsStandard", "Du overvåger allerede denne standard")</p> 1561 </div> 1562 </div> 1563 <div class="js-not-exists"> 1564 <div class="js-subject"> 1565 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringNotExistsSubject", "Er du sikker på at du vil overvåge dette emne?")</p> 1566 </div> 1567 <div class="js-standard"> 1568 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringNotExistsStandard", "Er du sikker på at du vil overvåge denne standard?")</p> 1569 </div> 1570 </div> 1571 </div> 1572 <div class="js-subscription hide"> 1573 <div class="js-exists"> 1574 <div class="js-subject"> 1575 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionExistsSubject", "Du abonnerer allerede dette emne")</p> 1576 </div> 1577 <div class="js-standard"> 1578 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionExistsStandard", "Du abonnerer allerede denne standard")</p> 1579 </div> 1580 </div> 1581 <div class="js-not-exists"> 1582 <div class="js-subject"> 1583 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionNotExistsSubject", "Er du sikker på at du vil abonnere på dette emne?")</p> 1584 </div> 1585 <div class="js-standard"> 1586 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionNotExistsStandard", "Er du sikker på at du vil abonnere på denne standard?")</p> 1587 </div> 1588 </div> 1589 </div> 1590 </div> 1591 <div class="modal-footer"> 1592 <div class="center-btns"> 1593 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1594 <button class="btn btn-primary js-not-exists js-confirm-subscription js-monitoring" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Button.Monitoring", "Overvåg")</button> 1595 <button class="btn btn-primary js-not-exists js-confirm-subscription js-subscription" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Button.Subscription", "Abonnér")</button> 1596 </div> 1597 </div> 1598 </div> 1599 <!-- /.modal-content --> 1600 </div> 1601 <!-- /.modal-dialog --> 1602 </div> 1603 <!-- /.modal --> 1604 <!-- Modal --> 1605 <div class="modal fade js-subscription-confirmation" tabindex="-1" role="dialog"> 1606 <div class="modal-dialog"> 1607 <div class="modal-content"> 1608 <div class="modal-header"> 1609 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1610 <h4 class="modal-title js-subscription">@Translate("SmartPage:Product.Modal.Header.SubscriptionConfirm", "Bekræftelse af abonnement")</h4> 1611 <h4 class="modal-title js-monitoring">@Translate("SmartPage:Product.Modal.Header.MonitoringConfirm", "Bekræftelse af overvågning")</h4> 1612 </div> 1613 <div class="modal-body"> 1614 <div class="js-subscription"> 1615 <div class="js-success "> 1616 <div class="js-success-subject"> 1617 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionSuccessSubject", "Du abonnerer nu på dette emne!")</p> 1618 </div> 1619 <div class="js-success-standard"> 1620 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionSuccessStandard", "Du abonnerer nu på denne standard!")</p> 1621 </div> 1622 </div> 1623 <div class="js-failure"> 1624 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionFailure", "Det lykkedes ikke aktivere abonnementet - prøv venligst igen senere eller kontakt os")</p> 1625 </div> 1626 </div> 1627 <div class="js-monitoring"> 1628 <div class="js-success"> 1629 <div class="js-success-subject"> 1630 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringSuccessSubject", "Du overvåger nu dette emne!")</p> 1631 </div> 1632 <div class="js-success-standard"> 1633 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringSuccessStandard", "Du overvåger nu denne standard!")</p> 1634 </div> 1635 1636 </div> 1637 <div class="js-failure"> 1638 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringFailure", "Det lykkedes ikke at melde til overvågning - prøv venligst igen senere eller kontakt os")</p> 1639 </div> 1640 </div> 1641 </div> 1642 <div class="modal-footer"> 1643 <div class="center-btns"> 1644 <button class="btn btn-primary js-monitoring" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1645 <a href="@GetValue("SmartPage:Subscriptions.Link.Subscribe")" class="btn btn-primary js-subscription">@Translate("SmartPage:Product.Modal.Close", "Luk")</a> 1646 </div> 1647 </div> 1648 </div> 1649 <!-- /.modal-content --> 1650 </div> 1651 <!-- /.modal-dialog --> 1652 </div> 1653 <!-- /.modal --> 1654 <!-- Modal --> 1655 <div id="delete-subscription" class="modal fade" tabindex="-1" role="dialog"> 1656 <div class="modal-dialog"> 1657 <div class="modal-content"> 1658 <div class="modal-header"> 1659 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1660 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.Unsubscribe", "Afmeld")</h4> 1661 </div> 1662 <div class="modal-body"> 1663 <div class="js-monitoring hide"> 1664 <p>@Translate("SmartPage:Product.Text.Header.MonitoringUnsubscribe", "Er du sikker på at du vil afmelde overvågning?")</p> 1665 </div> 1666 <div class="js-subscription hide"> 1667 <p>@Translate("SmartPage:Product.Modal.Header.SubscriptionUnsubscribe", "Er du sikker på at du vil afmelde abonnementet?")</p> 1668 </div> 1669 </div> 1670 <div class="modal-footer"> 1671 <div class="center-btns"> 1672 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Button.Dismiss", "Fortryd")</button> 1673 <button class="btn btn-primary js-btn-delete-subscription">@Translate("SmartPage:Product.Modal.Button.Unsubscribe", "Afmeld")</button> 1674 </div> 1675 </div> 1676 </div> 1677 </div> 1678 </div> 1679 1680 <!-- Modal --> 1681 <div id="unsubscribe-error" class="modal fade" tabindex="-1" role="dialog"> 1682 <div class="modal-dialog"> 1683 <div class="modal-content"> 1684 <div class="modal-header"> 1685 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1686 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.UnsubscriptionFailure", "Afmelding fejlet")</h4> 1687 </div> 1688 <div class="modal-body"> 1689 <p>@Translate("SmartPage:Product.Modal.Text.UnsubscriptionFailure", "Det var ikke muligt at afmelde - prøv venligst igen senere eller tag kontakt til Dansk Standard")</p> 1690 <p>@Translate("SmartPage:Product.Modal.Text.CheckLoggedIn", "Vær sikker på at du er logget ind")</p> 1691 </div> 1692 <div class="modal-footer"> 1693 <div class="center-btns"> 1694 <button class="btn btn-info" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1695 </div> 1696 </div> 1697 </div> 1698 </div> 1699 </div> 1700 1701 @SnippetStart("JavaScript") 1702 <script type="text/javascript"> 1703 var item, subscriptionType; 1704 1705 function showNeededText(result) { 1706 if (result.d.SubscriptionExists) { 1707 $(".js-subscription-exists .js-exists").show(); 1708 $(".js-subscription-exists .js-not-exists").hide(); 1709 1710 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1711 if (item.subscriptionType == "Dia2") { 1712 $(".js-standard").show(); 1713 $(".js-subject").hide(); 1714 } 1715 else if (item.subscriptionType == "Emne2") { 1716 $(".js-standard").hide(); 1717 $(".js-subject").show(); 1718 } 1719 } 1720 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1721 if (item.subscriptionType == "Dia1") { 1722 $(".js-standard").show(); 1723 $(".js-subject").hide(); 1724 } 1725 else if (item.subscriptionType == "Emne1") { 1726 $(".js-standard").hide(); 1727 $(".js-subject").show(); 1728 } 1729 } 1730 1731 } else { 1732 $(".js-subscription-exists .js-exists").hide(); 1733 $(".js-subscription-exists .js-not-exists").show(); 1734 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1735 if (item.subscriptionType == "Dia2") { 1736 $(".js-standard").show(); 1737 $(".js-subject").hide(); 1738 } 1739 else if (item.subscriptionType == "Emne2") { 1740 $(".js-standard").hide(); 1741 $(".js-subject").show(); 1742 } 1743 } 1744 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1745 if (item.subscriptionType == "Dia1") { 1746 $(".js-standard").show(); 1747 $(".js-subject").hide(); 1748 } 1749 else if (item.subscriptionType == "Emne1") { 1750 $(".js-standard").hide(); 1751 $(".js-subject").show(); 1752 } 1753 } 1754 } 1755 $(".js-subscription-exists").modal('show'); 1756 } 1757 $(document).ready(function () { 1758 $(".js-btn-subscription").click(function (event) { 1759 subscriptionType = $(this).attr("data-type"); 1760 item = { 1761 id: $(this).attr("data-id"), 1762 subscriptionType: subscriptionType 1763 }; 1764 1765 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1766 $(".modal .js-monitoring").removeClass("hide"); 1767 $(".modal .js-subscription").addClass("hide"); 1768 } else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1769 $(".modal .js-monitoring").addClass("hide"); 1770 $(".modal .js-subscription").removeClass("hide"); 1771 } 1772 }); 1773 1774 $(".js-subscription-create").click(function () { 1775 var productContainer = $(this).closest(".js-product-informations"); 1776 subscriptionType = $(this).attr("data-type"); 1777 itemObj = { 1778 id: $(this).attr("data-id"), 1779 subscriptionType: subscriptionType 1780 }; 1781 1782 if (itemObj.subscriptionType == "Dia2" || itemObj.subscriptionType == "Emne2") { 1783 $(".modal .js-monitoring").removeClass("hide"); 1784 $(".modal .js-subscription").addClass("hide"); 1785 } else if (itemObj.subscriptionType == "Dia1" || itemObj.subscriptionType == "Emne1") { 1786 $(".modal .js-monitoring").addClass("hide"); 1787 $(".modal .js-subscription").removeClass("hide"); 1788 } 1789 1790 item = { 1791 productId: $("input[name=ProductID]", productContainer).val(), 1792 variantId: $("input[name=VariantID]", productContainer).val(), 1793 subscriptionType: subscriptionType 1794 }; 1795 1796 $.ajax({ 1797 type: 'POST', 1798 url: '/Services/SubscriptionService.asmx/SubscriptionExists', 1799 data: JSON.stringify(item), 1800 contentType: "application/json; charset=utf-8", 1801 dataType: 'json', 1802 processdata: true, 1803 beforeSend: function () { startLoading(); }, 1804 complete: function (jqXHR, status) { endLoading(); }, 1805 success: function (result) { 1806 1807 if (result.d.Success) { 1808 showNeededText(result); 1809 } else if (!result.d.IsLoggedIn) { 1810 $(".js-subscription-not-loggedin").modal('show'); 1811 } else { 1812 $(".js-subscription-no-access").modal('show'); 1813 } 1814 } 1815 }); 1816 return false; 1817 }); 1818 1819 $(".js-group-subscription-create").click(function () { 1820 1821 $.ajax({ 1822 type: 'POST', 1823 url: '/Services/SubscriptionService.asmx/SubscriptionGroupExists', 1824 data: JSON.stringify(item), 1825 contentType: "application/json; charset=utf-8", 1826 dataType: 'json', 1827 processdata: true, 1828 beforeSend: function () { startLoading(); }, 1829 complete: function (jqXHR, status) { endLoading(); }, 1830 success: function (result) { 1831 1832 if (result.d.Success) { 1833 showNeededText(result); 1834 1835 } else if (!result.d.IsLoggedIn) { 1836 $(".js-subscription-not-loggedin").modal('show'); 1837 } else { 1838 $(".js-subscription-no-access").modal('show'); 1839 } 1840 } 1841 }); 1842 1843 return false; 1844 }); 1845 1846 $(".js-btn-delete-subscription").click(function (event) { 1847 console.log(item); 1848 $.ajax({ 1849 type: 'POST', 1850 url: '/Services/SubscriptionService.asmx/DeleteSubscription', 1851 data: JSON.stringify(item), 1852 contentType: "application/json; charset=utf-8", 1853 dataType: 'json', 1854 processdata: true, 1855 beforeSend: function () { startLoading(); }, 1856 complete: function (jqXHR, status) { endLoading(); }, 1857 success: function (result) { 1858 1859 if (result.d.Success) { 1860 window.location.href = "@GetValue("SmartPage:Subscriptions.Link.Remove")"; 1861 } else { 1862 $('#delete-subscription').modal('hide'); 1863 $('#unsubscribe-error').modal('show'); 1864 } 1865 } 1866 }); 1867 }); 1868 1869 $(".js-confirm-subscription").click(function () { 1870 $(".js-subscription-exists").modal("hide"); 1871 1872 var url; 1873 if (item.hasOwnProperty("productId")) { 1874 url = '/Services/SubscriptionService.asmx/CreateSubscription'; 1875 } else { 1876 item.languageId = _languageId; 1877 url = '/Services/SubscriptionService.asmx/CreateGroupSubscription'; 1878 } 1879 1880 $.ajax({ 1881 type: 'POST', 1882 url: url, 1883 data: JSON.stringify(item), 1884 contentType: "application/json; charset=utf-8", 1885 dataType: 'json', 1886 processdata: true, 1887 beforeSend: function () { startLoading(); }, 1888 complete: function (jqXHR, status) { endLoading(); }, 1889 success: function (result) { 1890 1891 if (result.d.Success) { 1892 $(".js-subscription-confirmation .js-success").removeClass("hide"); 1893 $(".js-subscription-confirmation .js-failure").addClass("hide"); 1894 1895 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1896 if (item.subscriptionType == "Dia2") { 1897 $(".js-success-standard").show(); 1898 $(".js-success-subject").hide(); 1899 } 1900 else if (item.subscriptionType == "Emne2") { 1901 $(".js-success-standard").hide(); 1902 $(".js-success-subject").show(); 1903 } 1904 } 1905 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1906 if (item.subscriptionType == "Dia1") { 1907 $(".js-success-standard").show(); 1908 $(".js-success-subject").hide(); 1909 } 1910 else if (item.subscriptionType == "Emne1") { 1911 $(".js-success-standard").hide(); 1912 $(".js-success-subject").show(); 1913 } 1914 } 1915 } else { 1916 $(".js-subscription-confirmation .js-success").addClass("hide"); 1917 $(".js-subscription-confirmation .js-failure").removeClass("hide"); 1918 } 1919 $(".js-subscription-confirmation").modal('show'); 1920 } 1921 }); 1922 1923 return false; 1924 }); 1925 1926 $(".js-subscription-not-loggedin .js-close").click(function () { 1927 $(".js-subscription-not-loggedin").modal('hide'); 1928 $("#LoginBox").modal('show'); 1929 }); 1930 }); 1931 </script> 1932 @SnippetEnd("JavaScript") 1933 1934 @SnippetStart("JavaScript") 1935 <script src='@GetValue("Template:DesignBaseUrl")/assets/plugins/pdf.js/minified/compatibility.js'></script> 1936 <script src='@GetValue("Template:DesignBaseUrl")/assets/plugins/pdf.js/minified/pdf.js'></script> 1937 @SnippetEnd("JavaScript") 1938