Error executing template "Designs/DS2016/eCom/ProductCatalog/Product2016.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at Dynamicweb.Data.Database.CreateDataReader(IDbCommand command, CommandBehavior behavior)
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, CommandBehavior behavior, Int32 commandTimeout)
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Ecommerce.Products.ProductRepository.GetProductById(String productId, String productVariantId, String productLanguageId)
   at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId, Boolean useAssortments)
   at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId)
   at Dynamicweb.Ecommerce.Variants.VariantCombination.GetProduct()
   at CompiledRazorTemplates.Dynamic.RazorEngine_765a2146b75544da82d32120cb9bac06.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in D:\INETPUB\wwwroot\Files\Templates\Designs\DS2016\eCom\ProductCatalog\Product2016.cshtml:line 100
   at CompiledRazorTemplates.Dynamic.RazorEngine_765a2146b75544da82d32120cb9bac06.Execute() in D:\INETPUB\wwwroot\Files\Templates\Designs\DS2016\eCom\ProductCatalog\Product2016.cshtml:line 473
   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()
ClientConnectionId:b4079492-60a8-42b6-aea9-d6300fd5380e
Error Number:-2,State:0,Class:11

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