Please choose at least one filter


Published from

Time limit for review from

Withdrawn from

Released from

Reset
Error executing template "Designs/DS2016/eCom/ProductCatalog/ProductList2016.cshtml"
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at CompiledRazorTemplates.Dynamic.RazorEngine_bfee3df292cc40de88a76d8596259b20.Execute() in D:\INETPUB\wwwroot\Files\Templates\Designs\DS2016\eCom\ProductCatalog\ProductList2016.cshtml:line 224
   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 @inherits ViewModelTemplate<ProductListViewModel> 2 @using Dynamicweb.Rendering; 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using System; 5 @using DanskStandard.Domain.Enum; 6 @using Dynamicweb; 7 @using Dynamicweb.Core; 8 @using Dynamicweb.Environment; 9 @using System.Linq; 10 @using System.Web; 11 @using Smartpage.ProductInformation; 12 @using Smartpage.ProductInformation.Helpers; 13 14 @inherits ViewModelTemplate<ProductListViewModel> 15 @using DanskStandard.BusinessLayer.Provider; 16 @using SmartPage.Dynamicweb.Extension; 17 @using Dynamicweb.Rendering; 18 @using Dynamicweb.Ecommerce.ProductCatalog; 19 @using Dynamicweb; 20 @using Dynamicweb.Environment; 21 @using System.Linq; 22 23 @{ 24 string currentQuery = "/Default.aspx?" + System.Web.HttpContext.Current.Request.QueryString.ToString(); 25 var queryString = "?" + System.Web.HttpContext.Current.Request.QueryString.ToString(); 26 string currentUrl = "/Default.aspx?ID=" + Pageview.Page.ID; 27 string formLink = currentUrl; 28 } 29 30 @helper RenderFacets() 31 { 32 <form class="form-filters js-form-filters" method="get" action="/Default.aspx"> 33 <input type="hidden" name="ID" value="@Pageview.Page.ID" /> 34 35 @{ 36 string[] formRequests = { 37 "SortBy", 38 "SortOrder", 39 "GroupID", 40 "q", 41 "tech-comittee", 42 "ecom-origin-id", 43 "tech-group-id", 44 "parent-group-id" 45 }; 46 47 if (!string.IsNullOrEmpty(Context.Current.Request.GetString("parent-group-id"))) 48 { 49 formRequests = formRequests.Where(i => i != "tech-comittee" && i != "tech-group-id" && i!= "ecom-origin-id").ToArray(); @* exclude tech comittee if parent group id is present *@ 50 } 51 } 52 53 @foreach (string name in formRequests) 54 { 55 string requestValue = Context.Current.Request.GetString(name); 56 if (!string.IsNullOrEmpty(requestValue)) 57 { 58 <input type="hidden" name="@name" value='@requestValue' /> 59 } 60 } 61 62 <div class="filters-ajax"> 63 @foreach (var i in Model.FacetGroups) 64 { 65 foreach (var j in i.Facets.OrderByDescending(g => g.QueryParameter == "prefix").ThenByDescending(g => g.QueryParameter == "publication")) 66 { 67 var facetOptions = j.Options; 68 if (facetOptions.Any()) 69 { 70 var translateKey = j.QueryParameter.ToUpperFirstLetter(); 71 72 var isGroupSorting = j.QueryParameter == "groupid"; 73 74 if (j.QueryParameter == "prefix") 75 { 76 facetOptions = facetOptions.OrderBy(f => WebPrefixProvider.GetPrefixSortOrder(f.Value)).ToList(); 77 } 78 else 79 { 80 facetOptions = facetOptions.OrderBy(f => f.Sort).ToList(); 81 } 82 <ul class="list-unstyled filter-container"> 83 <li><h4 class="filter-title" data-translate-key="@translateKey">@Translate(translateKey, "")</h4></li> 84 @foreach (var k in facetOptions) 85 { 86 var facetId = "filter-" + j.QueryParameter + "-" + k.Value; 87 var label = k.Name; 88 if (j.QueryParameter == "prefix") 89 { 90 label = label.ToUpper(); 91 } 92 <li> 93 <input type="checkbox" id="@facetId" name="@j.QueryParameter" value="@k.Value" class="filter-option-value js-select-filter-option" checked="@k.Selected" /> 94 <label for="@facetId">@label&nbsp;<span>(@k.Count)</span></label> 95 </li> 96 } 97 98 </ul> 99 } 100 } 101 } 102 </div> 103 </form> 104 } 105 106 107 @{ 108 var categoryIDQuery = Dynamicweb.Context.Current.Request.GetString("groupid"); 109 string ecomOriginIDValue = Dynamicweb.Context.Current.Request.GetString("ecom-origin-id"); 110 string ecomGroupID = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.GetString("parent-group-id")) ? Dynamicweb.Context.Current.Request.GetString("parent-group-id") : string.Empty; 111 bool isActiveSearch = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.GetString("q")); 112 var categoryName = string.Empty; 113 string designURL = "/Files/Templates/Designs/" + Pageview.Layout.Design.Name.TrimEnd('/'); 114 int searchPageID = Converter.ToInt32(Pageview.Area.Item["SearchPageId"]); 115 int productPageID = Converter.ToInt32(Pageview.Area.Item["ProductPageId"]); 116 int productCatalogLink = Pageview.Page.ID == searchPageID ? searchPageID : productPageID; 117 bool isDanish = Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.Name == "da-DK"; 118 119 var products = Model.Products; 120 List<string> productIds = new List<string>(); 121 122 var productInformationService = new ProductInformationService(); 123 } 124 125 @SnippetStart("NumberOfProducts") 126 127 <div class="product-count-nav margin-top-5 margin-bottom-15 hidden-print pull-left"> 128 <span class="productcount">@Model.TotalProductsCount @Translate("SmartPage:Product.Paging.ProductsFound", "produkter fundet")</span> 129 </div> 130 131 @SnippetEnd("NumberOfProducts") 132 133 <div class="container visible-print"> 134 <div class="row"> 135 <div class="print-header-content"> 136 <div class="col-sm-12 logo-print-header"> 137 <img src='@Converter.ToString(Pageview.Area.Item["Logo"])' alt='@Converter.ToString(Pageview.Area.Item["LogoText"])' title='@Converter.ToString(Pageview.Area.Item["LogoText"])' /> 138 </div> 139 </div> 140 141 </div> 142 <div class="row"> 143 <div class="print-header-content"> 144 145 <div class="col-sm-12"> 146 <br /> 147 @RenderNavigation(new 148 { 149 template = "TopBreadCrumbs.xslt", 150 startLevel = 2, 151 expandmode = "pathonly" 152 }) 153 </div> 154 155 </div> 156 </div> 157 158 </div> 159 160 <div class="top-breadcrumbs-container hidden-print"> 161 <div class="container"> 162 <div class="row"> 163 <div class="col-sm-8"> 164 @RenderNavigation(new 165 { 166 template = "TopBreadCrumbs.xslt", 167 startLevel = 2, 168 expandmode = "pathonly" 169 }) 170 </div> 171 <div class="col-sm-4"> 172 @{ 173 string query = Converter.ToString(System.Web.HttpContext.Current.Request.QueryString); 174 string currentURL = "/Default.aspx?" + query; 175 string printLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(currentURL, "pagesize", "100"); 176 printLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(printLink, "print", "true"); 177 string xmlLink = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(currentURL, "xml", "true"); 178 string onlyShowHundredProductsInXML = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(xmlLink, "pagesize", "100"); 179 } 180 <div class="print-btns hidden-xs pull-right" data-query="@currentURL"> 181 182 @{ 183 if (query.Contains("print=true")) 184 { 185 <script type="text/javascript"> 186 window.onload = function () { 187 window.print(); 188 } 189 </script> 190 } 191 else 192 { 193 <a href="@printLink" class="hidden-print" target="_blank"> 194 <i class="custom-icon-print"></i> 195 </a> 196 } 197 } 198 <a href="@onlyShowHundredProductsInXML" class="hidden-print" target="_blank"> 199 <i class="custom-icon-xml"></i> 200 </a> 201 </div> 202 </div> 203 </div> 204 </div> 205 </div> 206 <div class="container"> 207 <div class="row"> 208 <div class="col-xs-12 col-sm-3 top-filters-container margin-top-15 hidden-print"> 209 @RenderFacets() 210 </div> 211 <div class="col-xs-12 col-sm-9"> 212 <div id="productlist"> 213 @foreach (var product in products) 214 { 215 var productInformation = productInformationService.GetProductInformation(product.Id, product.VariantId, product.LanguageId); 216 217 var previewHtmlExists = Converter.ToBoolean(Helper.GetFieldValue("SpHasPreview", product.ProductFields)); 218 var previewPdfExists = Converter.ToBoolean(Helper.GetFieldValue("SpHasPdfPreview", product.ProductFields)); 219 var productIDSelector = product.Id; 220 var productAjaxLink = "/Default.aspx?ID=" + Converter.ToString(Pageview.Area.Item["AjaxProductPageLink"]) + "&amp;productid=" + productIDSelector; 221 var priceAjaxLink = "/Default.aspx?ID=" + Converter.ToString(Pageview.Area.Item["AjaxPricePage"]) + "&amp;productid=" + productIDSelector; 222 string currentPageLink = "/Default.aspx?ID=" + Pageview.Page.ID; 223 var relations = Dynamicweb.Ecommerce.Services.ProductGroups.GetProductGroupRelations(product.Id); 224 string productPrimaryGroupId = relations.First().GroupId; 225 string productLink = currentPageLink + "&amp;GroupId=" + productPrimaryGroupId + "&amp;ProductID=" + product.Id; 226 string descriptionTextOverlay = isDanish ? Converter.ToString(Helper.GetFieldValue("ENGLISHTITLE", product.ProductFields)) : string.Empty; 227 string descriptionText = isDanish ? Converter.ToString(Helper.GetFieldValue("DanishTitle", product.ProductFields)) : Converter.ToString(Helper.GetFieldValue("ENGLISHTITLE", product.ProductFields)); 228 bool descriptionIsEmpty = string.IsNullOrWhiteSpace(descriptionText); 229 bool harmonizingExists = productInformation.ShowDirectiveCE || productInformation.ShowDirectiveHarmonized || productInformation.HasBrIds || Converter.ToBoolean(Helper.GetFieldValue("AxMotherHarmonized", product.ProductFields)) || productInformation.MotherIsHarmonized; 230 string titleCSSClass = descriptionIsEmpty ? "col-sm-9" : "col-sm-12"; 231 string generalCSSClass = harmonizingExists ? "col-sm-6" : "col-sm-9"; 232 var underRevision = productInformation.UnderRevision; 233 bool showRevision = underRevision.Any() && productInformation.UnderRevisionCount > 0; 234 bool hasCourses = productInformation.HasSPServiceProductsRelated && isDanish; 235 var extendedBtnClass = hasCourses ? "has-ext-btns" : ""; 236 var isServicePlus = productInformation.MisType == "Course" || productInformation.MisType == "Workshop" || productInformation.MisType == "Advice"; 237 var productImage = string.Empty; 238 foreach (var image in product.ImagePatternImages) 239 { 240 if (image.Name == "ImagePattern.Big") 241 { 242 productImage = image.Value; 243 } 244 } 245 246 var productImageExists = !string.IsNullOrEmpty(productImage); 247 var serviceplusType = isServicePlus ? "serviceplus" : "standard"; 248 var cssClassSppImage = productImageExists ? "col-sm-offset-6" : ""; 249 var productTitle = product.Name; 250 251 var standardLanguages = string.Empty; 252 var variantGroups = Dynamicweb.Ecommerce.Services.VariantGroups.GetVariantGroups(Dynamicweb.Ecommerce.Common.Context.LanguageID, product.Id); 253 var variantLanguages = variantGroups.SingleOrDefault(v => v.Id == "1616"); 254 if (variantLanguages != null) 255 { 256 standardLanguages = string.Join(" / ", variantLanguages.GetVariantOptions(product.Id).Select(o => o.Name)).ToUpper(); 257 } 258 259 productIds.Add(Converter.ToString(productIDSelector)); 260 261 var previewPath = string.Format("/Default.aspx?ID={0}&product={1}&disablestatistics=true", Converter.ToString(Pageview.Area.Item["SpPreviewPage"]), productIDSelector); 262 263 string priceFormatted = product.Price.PriceWithoutVat.ToString("N"); 264 string currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 265 266 <div class="js-product-informations product-informations margin-bottom-30" data-type="@serviceplusType"> 267 <div class="arrow-container"> 268 <i class="productlist-arrow-mob arrow-right productlist-align-arrow-right"></i> 269 </div> 270 <div class="modal fade js-modal-buy-ajax hidden-print" tabindex="-1" role="dialog" id="js-modal-buy-@productIDSelector" data-ajax-url="@productAjaxLink" data-ajax-price-url="@priceAjaxLink"> 271 <div class="modal-dialog modal-buy"> 272 @{ 273 //NavigationTag for Ajax Page 274 Dynamicweb.Content.PageService a = new Dynamicweb.Content.PageService(); 275 var pageID = 0; 276 277 var page = a.GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, "SpAjaxProductDetailsnavigationTag"); 278 279 if (page != null) 280 { 281 pageID = page.ID; 282 } 283 284 string getpricesformobileAjaxLink = "/Default.aspx?ID=" + pageID + "&amp;productid=" + productIDSelector; 285 } 286 287 <div class="show-mobile" data-getprices-formobile="@getpricesformobileAjaxLink"> 288 <div class="modal-content"> 289 290 <div class="modal-header"> 291 <h3 class="modal-title"> 292 @productTitle 293 </h3> 294 <div class="margin-top-0 remove-bold-and-add-line-h-1 pad-left-18"> 295 @HttpContext.Current.Server.HtmlEncode(descriptionText) 296 </div> 297 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 298 </div> 299 300 <div class="modal-body modal-body-ajax-buy"> 301 <div class="js-ajax-buy-table-content"> 302 <!-- ajax content --> 303 </div> 304 </div> 305 </div> 306 </div> 307 308 <div class="show-desktop"> 309 <div class="modal-content"> 310 <div class="modal-header"> 311 <h3 class="modal-title"> 312 @productTitle 313 </h3> 314 <div class="margin-top-0 remove-bold-and-add-line-h-1 pad-left-18"> 315 @HttpContext.Current.Server.HtmlEncode(descriptionText) 316 </div> 317 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 318 </div> 319 320 <div class="modal-body modal-body-ajax-buy"> 321 <div style="border-bottom: 6px solid #E1E1E1"></div> 322 <div class="table table-condensed" id="js-table-@productIDSelector"> 323 <div class="js-ajax-buy-table-content"> 324 <!-- ajax content --> 325 </div> 326 </div> 327 328 </div> 329 <div class="modal-footer"> 330 <div class="center-btns"> 331 <button type="button" class="btn btn-primary js-modal-footer-buttons" data-dismiss="modal" style="opacity: 0;">@Translate("Smartpage:ProductList.Buy.ContinueShopping", "Fortsæt med at handle")</button> 332 <a href="/Default.aspx?ID=@GetPageIdByNavigationTag("CartPage")" class="btn btn-default js-modal-footer-buttons" style="opacity: 0;">@Translate("Smartpage:ProductList.Buy.GoToCheckout", "Gå til checkout")</a> 333 </div> 334 </div> 335 </div><!-- /.modal-content --> 336 </div> 337 </div><!-- /.modal-dialog --> 338 </div><!-- /.modal --> 339 @if (previewHtmlExists) 340 { 341 <div class="hidden-print modal fade js-modal-preview-html" tabindex="-1" role="dialog" id="js-preview-modal-@productIDSelector" data-preview-path="@previewPath"> 342 <div class="modal-dialog modal-preview-box"> 343 <div class="modal-content"> 344 <div class="modal-header"> 345 <a href="javascript:void(0);" class="pull-right close-preview" data-dismiss="modal">@Translate("Smartpage:ProductList.Modal.ClosePreview", "Luk preview") <span class="close-icon">&times;</span></a> 346 </div> 347 <div class="modal-body"></div> 348 </div><!-- /.modal-content --> 349 </div><!-- /.modal-dialog --> 350 </div><!-- /.modal --> 351 } 352 @if (previewPdfExists) 353 { 354 <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"> 355 <div class="modal-dialog modal-preview-box"> 356 <div class="modal-content"> 357 <div class="modal-header"> 358 <div class="btn-group" role="group" aria-label="..."> 359 <button type="button" class="js-prev-btn btn btn-default">@Translate("Smartpage:Modal.Prev", "Prev")</button> 360 <button type="button" class="js-current-page btn btn-default">1</button> 361 <button type="button" class="js-next-btn btn btn-default">@Translate("Smartpage:Modal.Next", "Next")</button> 362 </div> 363 <a href="javascript:void(0);" class="pull-right close-preview" data-dismiss="modal">@Translate("Smartpage:ProductList.Modal.ClosePreview", "Luk preview") <span class="close-icon">&times;</span></a> 364 </div> 365 <div class="modal-body"> 366 <canvas id="js-canvas-@productIDSelector" class="img-responsive"></canvas> 367 </div> 368 </div><!-- /.modal-content --> 369 </div><!-- /.modal-dialog --> 370 </div> 371 } 372 <div class="productlist-content-titles"> 373 374 <ul class="nav nav-tabs hidden-print productlist-content-ul-mob" role="tablist"> 375 <li class="active js-tab-li" role="presentation"> 376 <a href='#js-start-@productIDSelector' aria-controls="profile" role="tab" data-toggle="tab">@RenderProductType(productInformation.MisType)</a> 377 </li> 378 379 @if (previewHtmlExists) 380 { 381 <li role="presentation" class="js-tab-li"> 382 <a href="javascript:void(0);" class="preview-button" data-toggle="modal" data-target="#js-preview-modal-@productIDSelector"> 383 @Translate("Smartpage:ProductList.Detail.PreviewHtml", "Preview HTML") 384 </a> 385 </li> 386 } 387 @if (previewPdfExists) 388 { 389 <li role="presentation" class="js-tab-li"> 390 <a href="javascript:void(0);" class="preview-button" data-toggle="modal" data-target="#js-pdf-preview-modal-@productIDSelector"> 391 @Translate("Smartpage:ProductList.Detail.PreviewPdf", "Preview PDF") 392 </a> 393 </li> 394 } 395 @if (harmonizingExists) 396 { 397 <li role="presentation" class="js-tab-li"> 398 <a href="#js-law-@productIDSelector" data-href-pane="#js-law-@productIDSelector" data-ajax-type="law" data-ajax-url="@productAjaxLink" role="tab" class="js-toggle-ajax-pane"> 399 @Translate("Smartpage:ProductList.Detail.Law", "Lovgivgning") 400 </a> 401 </li> 402 } 403 @if (!isServicePlus) 404 { 405 <li role="presentation" class="js-tab-li"> 406 <a href="#js-details-@productIDSelector" data-href-pane="#js-details-@productIDSelector" data-ajax-type="details" data-ajax-url="@productAjaxLink" role="tab" class="js-toggle-ajax-pane">@Translate("Smartpage:ProductList.Details.Title", "Detaljer")</a> 407 </li> 408 } 409 <li class="watch-line pull-right js-tab-li show-checkbox-on-mobile"> 410 @{ 411 var cart = Dynamicweb.Ecommerce.Common.Context.Cart; 412 bool cartComplete = false; 413 414 if (cart != null && cart.Complete) 415 { 416 cartComplete = true; 417 } 418 419 if (!cartComplete && productInformation.ProductStatus.WebMonitor) 420 { 421 <div class="checkbox-inline"> 422 <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")'> 423 @Translate("SmartPage:Product.Monitor", "Overvåg") 424 <input type="checkbox" id="js-watch-@productIDSelector" class="checkbox-style-custom checkbox-input js-checkbox-watch"> 425 <span class="checkbox-checkmark"></span> 426 427 </label> 428 </div> 429 } 430 } 431 </li> 432 </ul> 433 </div> 434 <!-- end general info --> 435 <div class="pre-content"> 436 <form class="col-sm-12 col-md-12 padding-10"> 437 <input type="hidden" class="js-sel-product-id" name="ProductID" value="@product.Id" /> 438 <input type="hidden" class="js-sel-variant-id" name="VariantID" value="@product.VariantId" /> 439 <div class="row"> 440 @{ 441 titleCSSClass = "col-sm-12 col-md-12"; 442 } 443 <h2 class="@titleCSSClass product-title"> 444 @if (!isServicePlus) 445 { 446 <a href='@productLink'>@productTitle</a> 447 } 448 else 449 { 450 <span>@productTitle</span> 451 } 452 453 @{ 454 DanskStandard.Domain.Enum.StatusCode statusCode; 455 if (Enum.TryParse(productInformation.ProductStatus.Code, out statusCode)) 456 { 457 if (statusCode != StatusCode.Current) 458 { 459 <span class="display-block-xs status-title">(@RenderStatusCode(productInformation.ProductStatus.Code))</span> 460 } 461 } 462 } 463 464 </h2> 465 @if (!isServicePlus) 466 { 467 468 if (descriptionIsEmpty) 469 { 470 <div class="col-sm-3 col-md-3 add-to-no-description @extendedBtnClass"> 471 @*@RenderHasCourses(product, hasCourses, productInformation.ValidToBuy)*@ 472 @if (productInformation.ValidToBuy) 473 { 474 <button class="btn btn-primary pull-right hidden-print" data-toggle="modal" data-target="#js-modal-buy-@productIDSelector"> 475 @Translate("SmartPage:Product.Buy", "Læg i kurv") 476 </button> 477 } 478 </div> 479 } 480 else 481 { 482 var cssDescriptionClass = productImageExists ? "col-sm-5 col-md-6 width-full-left" : "col-sm-7 col-md-8"; 483 if (productImageExists) 484 { 485 <div class="col-sm-2 col-md-2"> 486 <img class="img-responsive hidden-print" src="@productImage" alt="@productTitle" /> 487 </div> 488 } 489 <div class="product-info-text @cssDescriptionClass"> 490 @if (!string.IsNullOrEmpty(descriptionTextOverlay)) 491 { 492 <p class="margin-top-0 margin-bottom-0" data-toggle="tooltip" title="@HttpContext.Current.Server.HtmlEncode(descriptionTextOverlay)">@HttpContext.Current.Server.HtmlEncode(descriptionText)</p> 493 } 494 else 495 { 496 <p class="margin-top-0 margin-bottom-0">@HttpContext.Current.Server.HtmlEncode(descriptionText)</p> 497 } 498 </div> 499 <div class="margin-top-10-mobile hidden-print col-sm-5 col-md-4 @extendedBtnClass"> 500 <div class="row"> 501 @{ 502 if (productInformation.HasSPServiceProductsRelated && isDanish) 503 { 504 @*<div style="width: 40%; float: left;"> 505 @RenderHasCourses(product, hasCourses, productInformation.ValidToBuy) 506 </div>*@ 507 <div> 508 @if (productInformation.ValidToBuy) 509 { 510 <button style="margin-left: 5px; margin-right: 5px;" class="margin-bottom-0 btn btn-primary pull-right hidden-print add-to-cart" data-toggle="modal" data-target="#js-modal-buy-@productIDSelector"> 511 @Translate("SmartPage:Product.Buy", "Læg i kurv") 512 <i class="new-basket-icon"></i> 513 </button> 514 } 515 </div> 516 } 517 else 518 { 519 <div style="width: 100%; float: left;"> 520 @if (productInformation.ValidToBuy) 521 { 522 <button style="margin-left: 5px; margin-right: 5px;" class="btn-50 margin-bottom-0 btn btn-primary pull-right hidden-print add-to-cart" data-toggle="modal" data-target="#js-modal-buy-@productIDSelector"> 523 @Translate("SmartPage:Product.Buy", "Læg i kurv") 524 <i class="new-basket-icon"></i> 525 </button> 526 } 527 </div> 528 } 529 } 530 </div> 531 </div> 532 } 533 } 534 </div> 535 536 537 @if (!isServicePlus) 538 { 539 <hr class="hidden-print product-separator margin-bottom-30 margin-top-30" /> 540 <div class="row hidden-print"> 541 <div class="col-sm-3"> 542 <div class="product-details-list"> 543 <div class="prefix">@Translate("Smartpage:ProductList.StatusCodeText", "Status"):</div> 544 <div class="list-content regular"> 545 @RenderStatusCode(productInformation.ProductStatus.Code) 546 </div> 547 </div> 548 <div class="product-details-list"> 549 <div class="prefix">@Translate("Smartpage:ProductList.Type", "Type"):</div> 550 <div class="list-content regular"> 551 @RenderProductType(productInformation.MisType) 552 </div> 553 </div> 554 <div class="product-details-list"> 555 <div class="prefix">@Translate("Smartpage:ProductList.Language", "Sprog"):</div> 556 <div class="list-content"> 557 @standardLanguages 558 </div> 559 </div> 560 </div> 561 <div class="@generalCSSClass"> 562 @{ 563 var productGroupRelations = Dynamicweb.Ecommerce.Services.ProductGroups.GetProductGroupRelations(product.Id); 564 var associatedGroups = Dynamicweb.Ecommerce.Services.ProductGroups.GetRelatedGroups(productGroupRelations); 565 566 if (associatedGroups.Where(i => i.Id.Contains("COMMITTEEDS")).Any()) 567 { 568 <div class="product-details-list"> 569 <div class="prefix">@Translate("Smartpage:ProductList.Category", "Kategori"):</div> 570 <div class="list-content"> 571 572 @foreach (var group in associatedGroups.Where(i => i.Id.Contains("COMMITTEEDS"))) 573 { 574 if (!string.IsNullOrWhiteSpace(group.Id)) 575 { 576 var currentGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(group.Id); 577 var groupIsNull = currentGroup == null; 578 579 if (!groupIsNull) 580 { 581 var parentLanguageIsNull = currentGroup.ParentGroupsDefaultLanguage == null; 582 if (!parentLanguageIsNull) 583 { 584 if (currentGroup.ParentGroupsDefaultLanguage.Count > 0) 585 { 586 if (currentGroup.ParentGroupsDefaultLanguage != null) 587 { 588 if (currentGroup.ParentGroupsDefaultLanguage.FirstOrDefault() != null) 589 { 590 string parentId = currentGroup.ParentGroupsDefaultLanguage.FirstOrDefault().Id; 591 if (parentId != null) 592 { 593 Dynamicweb.Ecommerce.Products.Group parent = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(parentId); 594 if (parent != null) 595 { 596 //20161026: new custom name 597 var customName = Converter.ToString(parent.ProductGroupFieldValues.GetProductGroupFieldValue("CustomName").Value); 598 var newName = string.IsNullOrEmpty(customName) ? parent.Name : customName; 599 <a href="/Default.aspx?ID=@productCatalogLink&amp;groupid=@parent.Id"> 600 @newName 601 </a> 602 } 603 } 604 } 605 else 606 { 607 @Translate("Smartpage:ProductList.ParentGroup", "Parent group not found") 608 } 609 } 610 } 611 } 612 613 } 614 } 615 } 616 617 </div> 618 </div> 619 } 620 } 621 @if (showRevision) 622 { 623 <div class="product-details-list"> 624 <div class="prefix">@Translate("Smartpage:ProductList.Revision", "Revision"):</div> 625 <div class="list-content"> 626 @RenderUnderRevision(underRevision, "list-unstyled list-inline", productCatalogLink, isDanish) 627 </div> 628 </div> 629 } 630 @if (productInformation.RevisionOf.Any()) 631 { 632 <div class="product-details-list"> 633 <div class="prefix">@Translate("SmartPage:Product.RevisionOf", "Revision af"):</div> 634 <div class="list-content"> 635 <ul class="list-unstyled margin-bottom-0 margin-top-0"> 636 @foreach (var related in productInformation.RevisionOf) 637 { 638 var extraInfo = Pageview.Page.ID != 1 ? related.DanishTitle : related.EnglishTitle; 639 var productRevisionLink = "/Default.aspx?ID=" + productCatalogLink + "&amp;ProductID=" + related.ProductId; 640 <li> 641 <a data-original-title="@extraInfo" data-toggle="tooltip" href='@productRevisionLink'> 642 @related.ProductName 643 </a> 644 </li> 645 } 646 </ul> 647 </div> 648 </div> 649 } 650 651 652 @RenderReplaceBy(productInformation, productCatalogLink, isDanish) 653 @if (productInformation.ValidToBuy) 654 { 655 <div class="product-details-list"> 656 <div class="prefix">@Translate("Smartpage:ProductList.Price", "Pris"):</div> 657 <div class="list-content"> 658 @currencySymbol @priceFormatted 659 </div> 660 </div> 661 } 662 </div> 663 @if (harmonizingExists) 664 { 665 <div class="col-sm-3"> 666 <strong class="product-detail-list-title">@Translate("Smartpage:ProductList.Harmony.Text", "Harmonisering"):</strong> 667 @RenderHarmonizing(productInformation, Converter.ToBoolean(Helper.GetFieldValue("AxMotherHarmonized", product.ProductFields))) 668 </div> 669 } 670 671 672 </div> 673 } 674 else 675 { 676 677 <div class="row margin-bottom-10 hidden-print"> 678 @if (productImageExists) 679 { 680 <div class="col-sm-2"> 681 <img class="img-responsive hidden-print" src="@productImage" alt="@productTitle" /> 682 </div> 683 } 684 <div class="col-sm-6"> 685 @{ 686 CategoryFieldViewModel sPPCategory = new CategoryFieldViewModel(); 687 product.ProductCategories.TryGetValue("SPPCategory", out sPPCategory); 688 689 string categoryFieldShortDescription = string.Empty; 690 string categoryFieldRegistrationLink = string.Empty; 691 692 if (sPPCategory != null) 693 { 694 foreach (var field in sPPCategory.Fields) 695 { 696 if (field.Key == "SPP_ShortDescription") 697 { 698 categoryFieldShortDescription = Converter.ToString(field.Value.Value); 699 } 700 if (field.Key == "SPP_RegistrationLink") 701 { 702 categoryFieldRegistrationLink = Converter.ToString(field.Value.Value); 703 } 704 } 705 } 706 707 708 if (!string.IsNullOrEmpty(categoryFieldShortDescription)) 709 { 710 @: @categoryFieldShortDescription 711 } 712 else 713 { 714 @: @Translate("Smartpage:ProductList.NoDescriptionFound", "Ingen beskrivelse fundet") 715 } 716 } 717 </div> 718 @{ 719 bool registrationLinkExists = !string.IsNullOrEmpty(categoryFieldRegistrationLink); 720 bool isAdviceType = productInformation.MisType == "Advice"; 721 var hasMultipleBtns = isAdviceType || registrationLinkExists ? "has-ext-btns" : ""; 722 string seMoreLink = Converter.ToString(Pageview.Area.Item["StandardPlusPageProduct"]); 723 seMoreLink += seMoreLink.Contains("?") ? "&" : "?"; 724 seMoreLink += "productid=" + product.Id; 725 } 726 <div class="col-sm-4 @hasMultipleBtns"> 727 <a class="btn btn-default btn-50 js-ext-service-plus-btn" href="@seMoreLink" data-no-results="@Translate("Smartpage:ProductList.Modal.NoResults", "Ingen beskrivelse fundet")" data-product-name="@productTitle">@Translate("Smartpage:ProductList.SeMore", "Se mere")</a> 728 @if (isAdviceType) 729 { 730 <button class="btn-50 btn btn-primary js-add-to-basket pull-right hidden-print"> 731 @Translate("SmartPage:Product.Buy", "Læg i kurv") 732 </button> 733 } 734 else if (registrationLinkExists) 735 { 736 <a href="@categoryFieldRegistrationLink" target="_blank" class="btn-50 btn btn-primary hidden-print"> 737 @Translate("SmartPage:Ecom.SPP_Signup", "Tilmeld") 738 </a> 739 } 740 </div> 741 </div> 742 743 <hr class="hidden-print product-separator margin-bottom-30 margin-top-30" /> 744 745 <div class="row hidden-print"> 746 <div class="col-sm-3"> 747 <div class="product-details-list"> 748 <div class="prefix">@Translate("Smartpage:ProductList.Language", "Sprog"):</div> 749 <div class="list-content"> 750 @Translate("Smartpage:ProductList.Language.DK", "DK") 751 </div> 752 </div> 753 </div> 754 </div> 755 756 } 757 <div class="print-price visible-print margin-top-10"> 758 <strong>@Translate("Smartpage:ProductList.Price", "Pris") @currencySymbol @priceFormatted</strong> 759 </div> 760 <hr class="visible-print product-separator margin-bottom-0 margin-top-30" /> 761 </form> 762 </div> 763 <!-- end general info --> 764 <div class="tab-content"> 765 <div class="tab-pane active" role="tabpanel" id='js-start-@productIDSelector'> 766 <!-- general info --> 767 </div> 768 @if (harmonizingExists) 769 { 770 <div class="tab-pane details-pane js-ajax-target-pane" role="tabpanel" id="js-law-@productIDSelector"> 771 <!-- ajax content --> 772 </div> 773 } 774 <div class="tab-pane details-pane js-ajax-target-pane" role="tabpanel" id='js-details-@productIDSelector'> 775 <!-- details --> 776 <!-- ajax -content --> 777 </div> 778 </div> 779 </div> 780 } 781 </div> 782 </div> 783 </div> 784 <div class="row hidden-print"> 785 <div class="col-sm-12"> 786 <span class="page-navigation pull-right"> 787 788 @{ 789 string currentPageNumber = string.IsNullOrWhiteSpace(Dynamicweb.Context.Current.Request["PageNum"]) ? "1": Dynamicweb.Context.Current.Request["PageNum"]; 790 791 if (Converter.ToInt32(currentPageNumber) <= Model.PageCount && Converter.ToInt32(currentPageNumber) != 1) 792 { 793 string previousPageUrl = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(Dynamicweb.Context.Current.Request.Url.PathAndQuery, "PageNum", Converter.ToString(Converter.ToInt32(currentPageNumber) -1)); 794 <a class="btn btn-xs" href="@previousPageUrl">@Translate("SmartPage:Product.Paging.Previous", "Forrige")</a> 795 } 796 797 <span class="current-page"> 798 @currentPageNumber 799 </span> 800 801 if (Converter.ToInt32(currentPageNumber) < Model.PageCount) 802 { 803 string nextPageUrl = Dynamicweb.Environment.Helpers.LinkHelper.ReplaceQueryString(Dynamicweb.Context.Current.Request.Url.PathAndQuery, "PageNum", Converter.ToString(Converter.ToInt32(currentPageNumber) + 1)); 804 <a class="btn btn-xs" href="@nextPageUrl">@Translate("SmartPage:Product.Paging.Next", "Næste")</a> 805 } 806 } 807 808 </span> 809 </div> 810 </div> 811 </div> 812 <div class="container header-container"> 813 <div id="spp_productlist"> 814 <div class="modal fade js-spp-productslist-modal js-close-after-adding-to-cart" id="OpenSPProductsList" tabindex="-1" role="dialog"> 815 <div class="modal-dialog large js-spp-modal-size"> 816 <div class="modal-content js-service-product-informations"> 817 <div class="modal-header"> 818 <div class="js-no-recommendation-wrapper"> 819 <div class="spp-header js-spp-modal-productlist-header"> 820 @Translate("SmartPage:Product.Modal.SPPProductlistHeader", "Standardplus liste overskrift") 821 </div> 822 <div class="spp-header js-spp-modal-header-productname"> 823 </div> 824 </div> 825 <div class="js-recommendation-wrapper hide"> 826 <div class="spp-header"> 827 @Translate("SmartPage:Product.Modal.SPPProductlistHeader.Recommendation", "Relevante kurser og rådgivning") 828 </div> 829 </div> 830 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 831 </div> 832 <div class="modal-body"> 833 <div class="row"> 834 <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> 835 </div> 836 <div class="row"> 837 <div class="js-spp-modal-content spp-modal-content col-sm-12"><!-- ajax indhold --></div> 838 </div> 839 @*<div class="spp-productlist js-spp-modal-original-content row"></div>*@ 840 @*<div class="js-spp-contactme-content row">*@<!-- ajax indhold -->@*</div>*@ 841 </div> 842 <div class="modal-footer"> 843 <div class="standard-plus-disturb pull-left js-standard-plus-disturb hide"> 844 <div class="checkbox"> 845 <label> 846 <input class="js-standard-plus-checkbox" type="checkbox"> 847 @Translate("SmartPage:DoNotDistrub", "Vis ikke denne igen") 848 </label> 849 </div> 850 </div> 851 <div class="center-btns"> 852 <button class="btn btn-default js-spp-close-btn-modal" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 853 </div> 854 </div> 855 </div> 856 </div> 857 </div> 858 </div> 859 </div> 860 861 862 <div class="modal fade" tabindex="-1" role="dialog" id="js-modal-ext-service-plus"> 863 <div class="modal-dialog large"> 864 <div class="modal-content"> 865 <div class="modal-header"> 866 <h1 class="modal-title">@Translate("Smartpage:ProductList.SeMore", "Se mere")</h1> 867 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 868 </div> 869 <div class="modal-body"> 870 <div class="row"> 871 <div class="col-sm-12 js-modal-body"> 872 873 </div> 874 </div> 875 </div> 876 <div class="modal-footer"> 877 <div class="center-btns"> 878 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 879 </div> 880 </div> 881 </div><!-- /.modal-content --> 882 </div><!-- /.modal-dialog --> 883 </div><!-- /.modal --> 884 885 @helper RenderHasCourses(ProductViewModel product, bool hasCourses, bool validToBuy) 886 { 887 var cssClass = validToBuy ? "" : "pull-right"; 888 if (hasCourses) 889 { 890 var standardPlusProductLink = Converter.ToString(Pageview.Area.Item["StandardPlusPage"]) + "&ProductId=" + product.Id; 891 <a href="@standardPlusProductLink" data-product-id='@product.Id' class="margin-bottom-0 btn btn-default js-spp-productlist-btn @cssClass" style="margin-right:10px; width: 100%; margin-left:5px;" data-product-name='@product.Name' data-toggle="tooltip" 892 title='@Translate("SmartPage:Product.SeeServiceProductsCourceAndAdviceTooltip", "Kursus og rådgivning tooltip")'>@Translate("SmartPage:ProductList.Courses", "Kurser")</a> 893 } 894 } 895 896 @helper RenderUnderRevision(List<Smartpage.ProductInformation.Model.Replacing> revisionLoop, string className, int productPageID, bool isDanish) 897 { 898 <ul class='@className'> 899 @foreach (var item in revisionLoop) 900 { 901 var toolTip = !isDanish ? item.EnglishTitle : item.DanishTitle; 902 <li> 903 <a href="/Default.aspx?ID=@productPageID&amp;ProductID=@item.ProductId" data-toggle="tooltip" title='@toolTip'>@item.ProductName</a> 904 </li> 905 } 906 </ul> 907 } 908 909 @*Not used in template so no reason to rewrite*@ 910 @*@helper renderGeneralDetails(LoopItem product) 911 { 912 var associatedGroups = product.GetLoop("AssociatedGroups"); 913 var standardRelations = product.GetLoop("SmartPage:Product.StandardRelation"); 914 <p><strong>@Translate("Smartpage:ProductList.Details.NoOfPages", "Antal sider"):</strong> @product.GetValue("Ecom:Product:Field.AX:InventTable.NumberOfPages")</p> 915 <p><strong>@Translate("Smartpage:ProductList.Details.Published", "Udgivet"):</strong> @product.GetDate("Ecom:Product:Field.AX:InventTable.ItemPublished").ToString("yyyy-MM-dd")</p> 916 <p><strong>@Translate("Smartpage:ProductList.Details.AcceptanceDate", "Godkendelsesdato"):</strong> @product.GetDate("Ecom:Product:Field.AX:EGMIS.DSPUBACCEPTDATE").ToString("yyyy-MM-dd")</p> 917 918 if (standardRelations.Any()) 919 { 920 <p> 921 <strong>@Translate("Smartpage:ProductList.Details.Relations", "Relationer"): </strong> 922 @foreach (var relation in standardRelations) 923 { 924 <span>@relation.GetValue("SmartPage:Product.InternatPub.ProductName")</span> 925 } 926 </p> 927 928 } 929 if (associatedGroups.Any()) 930 { 931 <p> 932 <strong>@Translate("Smartpage:ProductList.Details.ICS", "ICS"):</strong> 933 @foreach (var item in associatedGroups.Where(g => System.Text.RegularExpressions.Regex.IsMatch(g.GetString("Ecom:Group.Name"), @"^\d+"))) 934 { 935 <span> 936 <a href="@item.GetValue("Ecom:Group.Link.Clean")"> 937 @item.GetValue("Ecom:Group.Name") 938 </a> 939 </span> 940 } 941 </p> 942 } 943 }*@ 944 945 @helper RenderReplaceBy(Smartpage.ProductInformation.Model.ProductInformation product, int catalogLink, bool isDanish) 946 { 947 var replacedBy = product.ReplacedBy; 948 if (replacedBy.Any()) 949 { 950 <div class="product-details-list"> 951 <div class="prefix">@Translate("SmartPage:Product.ReplacedBy", "Replaced By"):</div> 952 <div class="list-content"> 953 <ul class="list-unstyled margin-bottom-0 margin-top-0"> 954 @foreach (var item in replacedBy) 955 { 956 var itemLink = "/Default.aspx?ID=" + catalogLink + "&amp;ProductID=" + item.ProductId; 957 var toolTip = !isDanish ? item.EnglishTitle : item.DanishTitle; 958 <li> 959 <a href="@itemLink" data-toggle="tooltip" title='@toolTip'>@item.ProductName</a> 960 </li> 961 } 962 </ul> 963 </div> 964 </div> 965 } 966 } 967 968 @helper RenderHarmonizing(Smartpage.ProductInformation.Model.ProductInformation product, bool aXMotherHarmonized) 969 { 970 var isHarmonized = false; 971 <p class="harmony-links"> 972 973 @if (product.ShowDirectiveCE) 974 { 975 isHarmonized = true; 976 <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> 977 } 978 979 @if (product.ShowDirectiveHarmonized) 980 { 981 isHarmonized = true; 982 <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> 983 } 984 985 @foreach (var brId in product.BrIds) 986 { 987 <span class="badge badge-harmony" data-toggle="tooltip" title="@Translate("SmartPage.Product.ToolTip." + brId, "Bygningsreglementet " + brId)">@Translate("Smartpage.ProductList.Harmony." + brId, brId)</span> 988 } 989 </p> 990 991 if (product.MotherIsHarmonizedCE) 992 { 993 var replacingLoop = product.Replacings.Where(r => r.HasDirectiveCE); 994 if (replacingLoop != null && replacingLoop.Any()) 995 { 996 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 997 sb.Append("<ul class='list-unstyled margin-top-0'>"); 998 foreach (var item in replacingLoop) 999 { 1000 var link = "/default.aspx?Id=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + item.ProductId; 1001 sb.Append("<li>"); 1002 sb.Append(" <a href=\"" + link + "\">" + item.ProductName + "</a>"); 1003 sb.Append("</li>"); 1004 } 1005 sb.Append("</ul>"); 1006 1007 1008 <text> 1009 @string.Format(Converter.ToString(Pageview.Area.Item["HarmonizedAndCEApproved"]), sb.ToString()) 1010 </text> 1011 } 1012 } 1013 else if (product.Replacings != null && !isHarmonized && (aXMotherHarmonized || product.MotherIsHarmonized)) 1014 { 1015 1016 var replacingLoop = product.Replacings.Where(r => r.HasDirectives && (r.ProductStatusCode == "Extended" || r.ProductStatusCode == "Withdrawn")); 1017 1018 if (replacingLoop != null && replacingLoop.Any()) 1019 { 1020 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 1021 sb.Append("<ul class='list-unstyled margin-top-0'>"); 1022 foreach (var item in replacingLoop.Where(r => r.HasDirectives && (r.ProductStatusCode == "Extended" || r.ProductStatusCode == "Withdrawn"))) 1023 { 1024 var link = "/default.aspx?Id=" + Converter.ToString(Pageview.Area.Item["ProductPageId"]) + "&ProductId=" + item.ProductId; 1025 sb.Append("<li>"); 1026 sb.Append(" <a href=\"" + link + "\">" + item.ProductName + "</a>"); 1027 sb.Append("</li>"); 1028 } 1029 sb.Append("</ul>"); 1030 1031 <text> 1032 @String.Format(Converter.ToString(Pageview.Area.Item["MotherHarmonized"]), sb.ToString()) 1033 </text> 1034 } 1035 } 1036 1037 } 1038 1039 @helper RenderProductType(string type) 1040 { 1041 switch (type) 1042 { 1043 case "Course": 1044 @:@Translate("Smartpage:Product.MisType.Course", "Kurser") 1045 break; 1046 case "Workshop": 1047 @:@Translate("Smartpage:Product.MisType.Workshop", "Workshop") 1048 break; 1049 case "Advice": 1050 @:@Translate("Smartpage:Product.MisType.Advice", "Rådvigning") 1051 break; 1052 case "Standard": 1053 @:@Translate("SmartPage:Product.MisType.Standard", "Standard") 1054 break; 1055 case "PartOf": 1056 @:@Translate("SmartPage:Product.MisType.PartOf", "Håndbog") 1057 break; 1058 case "Supplementary": 1059 @:@Translate("SmartPage:Product.MisType.Supplementary", "Tillæg") 1060 break; 1061 case "CorrectionSheet": 1062 @:@Translate("SmartPage:Product.MisType.CorrectionSheet", "Rettelsesblad") 1063 break; 1064 case "Appendix": 1065 @:@Translate("SmartPage:Product.MisType.Appendix", "Bilag") 1066 break; 1067 } 1068 } 1069 1070 @helper RenderStatusCode(string code) 1071 { 1072 DanskStandard.Domain.Enum.StatusCode statusCode; 1073 if (Enum.TryParse(code, out statusCode)) 1074 { 1075 switch (statusCode) 1076 { 1077 case StatusCode.Current: 1078 @:@Translate("SmartPage:Product.StatusCode.Current", "Gældende") 1079 break; 1080 case StatusCode.Draft: 1081 @:@Translate("SmartPage:Product.StatusCode.Draft", "Forslag") 1082 break; 1083 case StatusCode.Extended: 1084 @:@Translate("SmartPage:Product.StatusCode.Extended", "Forlænget") 1085 break; 1086 case StatusCode.Withdrawn: 1087 @:@Translate("SmartPage:Product.StatusCode.Withdrawn", "Tilbagetrukket") 1088 break; 1089 } 1090 } 1091 } 1092 1093 @using Dynamicweb.Rendering; 1094 @using Dynamicweb.Ecommerce.ProductCatalog; 1095 @using Dynamicweb; 1096 @using SmartPage.Dynamicweb.Helper; 1097 1098 @{ 1099 string removeLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(base.Pageview.ID); 1100 } 1101 1102 <!-- Modal --> 1103 <div class="modal fade js-subscription-not-loggedin" tabindex="-1" role="dialog"> 1104 <div class="modal-dialog"> 1105 <div class="modal-content"> 1106 <div class="modal-header"> 1107 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1108 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.NotLoggedIn", "Du er ikke logget ind")</h4> 1109 </div> 1110 <div class="modal-body"> 1111 <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> 1112 <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> 1113 </div> 1114 <div class="modal-footer"> 1115 <div class="center-btns"> 1116 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1117 <button class="btn btn-info js-close" aria-hidden="true">@Translate("SmartPage:Product.Modal.Login", "Login")</button> 1118 </div> 1119 </div> 1120 </div> 1121 <!-- /.modal-content --> 1122 </div> 1123 <!-- /.modal-dialog --> 1124 </div> 1125 <!-- /.modal --> 1126 <!-- Modal --> 1127 <div class="modal fade js-subscription-no-access" tabindex="-1" role="dialog"> 1128 <div class="modal-dialog"> 1129 <div class="modal-content"> 1130 <div class="modal-header"> 1131 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1132 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.Problems", "Ingen adgang")</h4> 1133 </div> 1134 <div class="modal-body"> 1135 <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> 1136 <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> 1137 </div> 1138 <div class="modal-footer"> 1139 <div class="center-btns"> 1140 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1141 </div> 1142 </div> 1143 </div> 1144 <!-- /.modal-content --> 1145 </div> 1146 <!-- /.modal-dialog --> 1147 </div> 1148 <!-- /.modal --> 1149 <!-- Modal --> 1150 <div class="modal fade js-subscription-exists" tabindex="-1" role="dialog"> 1151 <div class="modal-dialog"> 1152 <div class="modal-content"> 1153 <div class="modal-header"> 1154 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1155 <h4 class="modal-title"> 1156 <span class="js-monitoring">@Translate("SmartPage:Product.Modal.Header.MonitoringExists", "Overvågning")</span> 1157 <span class="js-subscription">@Translate("SmartPage:Product.Modal.Header.SubscriptionExists", "Abonnement")</span> 1158 </h4> 1159 </div> 1160 <div class="modal-body"> 1161 <div class="js-monitoring hide"> 1162 <div class="js-exists"> 1163 <div class="js-subject"> 1164 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringExistsSubject", "Du overvåger allerede dette emne")</p> 1165 </div> 1166 <div class="js-standard"> 1167 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringExistsStandard", "Du overvåger allerede denne standard")</p> 1168 </div> 1169 </div> 1170 <div class="js-not-exists"> 1171 <div class="js-subject"> 1172 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringNotExistsSubject", "Er du sikker på at du vil overvåge dette emne?")</p> 1173 </div> 1174 <div class="js-standard"> 1175 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringNotExistsStandard", "Er du sikker på at du vil overvåge denne standard?")</p> 1176 </div> 1177 </div> 1178 </div> 1179 <div class="js-subscription hide"> 1180 <div class="js-exists"> 1181 <div class="js-subject"> 1182 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionExistsSubject", "Du abonnerer allerede dette emne")</p> 1183 </div> 1184 <div class="js-standard"> 1185 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionExistsStandard", "Du abonnerer allerede denne standard")</p> 1186 </div> 1187 </div> 1188 <div class="js-not-exists"> 1189 <div class="js-subject"> 1190 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionNotExistsSubject", "Er du sikker på at du vil abonnere på dette emne?")</p> 1191 </div> 1192 <div class="js-standard"> 1193 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionNotExistsStandard", "Er du sikker på at du vil abonnere på denne standard?")</p> 1194 </div> 1195 </div> 1196 </div> 1197 </div> 1198 <div class="modal-footer"> 1199 <div class="center-btns"> 1200 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1201 <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> 1202 <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> 1203 </div> 1204 </div> 1205 </div> 1206 <!-- /.modal-content --> 1207 </div> 1208 <!-- /.modal-dialog --> 1209 </div> 1210 <!-- /.modal --> 1211 <!-- Modal --> 1212 <div class="modal fade js-subscription-confirmation" tabindex="-1" role="dialog"> 1213 <div class="modal-dialog"> 1214 <div class="modal-content"> 1215 <div class="modal-header"> 1216 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1217 <h4 class="modal-title js-subscription">@Translate("SmartPage:Product.Modal.Header.SubscriptionConfirm", "Bekræftelse af abonnement")</h4> 1218 <h4 class="modal-title js-monitoring">@Translate("SmartPage:Product.Modal.Header.MonitoringConfirm", "Bekræftelse af overvågning")</h4> 1219 </div> 1220 <div class="modal-body"> 1221 <div class="js-subscription"> 1222 <div class="js-success "> 1223 <div class="js-success-subject"> 1224 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionSuccessSubject", "Du abonnerer nu på dette emne!")</p> 1225 </div> 1226 <div class="js-success-standard"> 1227 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionSuccessStandard", "Du abonnerer nu på denne standard!")</p> 1228 </div> 1229 </div> 1230 <div class="js-failure"> 1231 <p>@Translate("SmartPage:Product.Modal.Text.SubscriptionFailure", "Det lykkedes ikke aktivere abonnementet - prøv venligst igen senere eller kontakt os")</p> 1232 </div> 1233 </div> 1234 <div class="js-monitoring"> 1235 <div class="js-success"> 1236 <div class="js-success-subject"> 1237 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringSuccessSubject", "Du overvåger nu dette emne!")</p> 1238 </div> 1239 <div class="js-success-standard"> 1240 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringSuccessStandard", "Du overvåger nu denne standard!")</p> 1241 </div> 1242 1243 </div> 1244 <div class="js-failure"> 1245 <p>@Translate("SmartPage:Product.Modal.Text.MonitoringFailure", "Det lykkedes ikke at melde til overvågning - prøv venligst igen senere eller kontakt os")</p> 1246 </div> 1247 </div> 1248 </div> 1249 <div class="modal-footer"> 1250 <div class="center-btns"> 1251 <button class="btn btn-primary js-monitoring" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1252 <a href="@QueryHelper.ReplaceQueryStringParam(removeLink, "action", "subscribe")" class="btn btn-primary js-subscription">@Translate("SmartPage:Product.Modal.Close", "Luk")</a> 1253 </div> 1254 </div> 1255 </div> 1256 <!-- /.modal-content --> 1257 </div> 1258 <!-- /.modal-dialog --> 1259 </div> 1260 <!-- /.modal --> 1261 <!-- Modal --> 1262 <div id="delete-subscription" class="modal fade" tabindex="-1" role="dialog"> 1263 <div class="modal-dialog"> 1264 <div class="modal-content"> 1265 <div class="modal-header"> 1266 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1267 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.Unsubscribe", "Afmeld")</h4> 1268 </div> 1269 <div class="modal-body"> 1270 <div class="js-monitoring hide"> 1271 <p>@Translate("SmartPage:Product.Text.Header.MonitoringUnsubscribe", "Er du sikker på at du vil afmelde overvågning?")</p> 1272 </div> 1273 <div class="js-subscription hide"> 1274 <p>@Translate("SmartPage:Product.Modal.Header.SubscriptionUnsubscribe", "Er du sikker på at du vil afmelde abonnementet?")</p> 1275 </div> 1276 </div> 1277 <div class="modal-footer"> 1278 <div class="center-btns"> 1279 <button class="btn" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Button.Dismiss", "Fortryd")</button> 1280 <button class="btn btn-primary js-btn-delete-subscription">@Translate("SmartPage:Product.Modal.Button.Unsubscribe", "Afmeld")</button> 1281 </div> 1282 </div> 1283 </div> 1284 </div> 1285 </div> 1286 1287 <!-- Modal --> 1288 <div id="unsubscribe-error" class="modal fade" tabindex="-1" role="dialog"> 1289 <div class="modal-dialog"> 1290 <div class="modal-content"> 1291 <div class="modal-header"> 1292 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 1293 <h4 class="modal-title">@Translate("SmartPage:Product.Modal.Header.UnsubscriptionFailure", "Afmelding fejlet")</h4> 1294 </div> 1295 <div class="modal-body"> 1296 <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> 1297 <p>@Translate("SmartPage:Product.Modal.Text.CheckLoggedIn", "Vær sikker på at du er logget ind")</p> 1298 </div> 1299 <div class="modal-footer"> 1300 <div class="center-btns"> 1301 <button class="btn btn-info" data-dismiss="modal" aria-hidden="true">@Translate("SmartPage:Product.Modal.Close", "Luk")</button> 1302 </div> 1303 </div> 1304 </div> 1305 </div> 1306 </div> 1307 1308 @SnippetStart("JavaScript") 1309 <script type="text/javascript"> 1310 var item, subscriptionType; 1311 1312 function showNeededText(result) { 1313 if (result.d.SubscriptionExists) { 1314 $(".js-subscription-exists .js-exists").show(); 1315 $(".js-subscription-exists .js-not-exists").hide(); 1316 1317 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1318 if (item.subscriptionType == "Dia2") { 1319 $(".js-standard").show(); 1320 $(".js-subject").hide(); 1321 } 1322 else if (item.subscriptionType == "Emne2") { 1323 $(".js-standard").hide(); 1324 $(".js-subject").show(); 1325 } 1326 } 1327 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1328 if (item.subscriptionType == "Dia1") { 1329 $(".js-standard").show(); 1330 $(".js-subject").hide(); 1331 } 1332 else if (item.subscriptionType == "Emne1") { 1333 $(".js-standard").hide(); 1334 $(".js-subject").show(); 1335 } 1336 } 1337 1338 } else { 1339 $(".js-subscription-exists .js-exists").hide(); 1340 $(".js-subscription-exists .js-not-exists").show(); 1341 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1342 if (item.subscriptionType == "Dia2") { 1343 $(".js-standard").show(); 1344 $(".js-subject").hide(); 1345 } 1346 else if (item.subscriptionType == "Emne2") { 1347 $(".js-standard").hide(); 1348 $(".js-subject").show(); 1349 } 1350 } 1351 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1352 if (item.subscriptionType == "Dia1") { 1353 $(".js-standard").show(); 1354 $(".js-subject").hide(); 1355 } 1356 else if (item.subscriptionType == "Emne1") { 1357 $(".js-standard").hide(); 1358 $(".js-subject").show(); 1359 } 1360 } 1361 } 1362 $(".js-subscription-exists").modal('show'); 1363 } 1364 $(document).ready(function () { 1365 $(".js-btn-subscription").click(function (event) { 1366 subscriptionType = $(this).attr("data-type"); 1367 item = { 1368 id: $(this).attr("data-id"), 1369 subscriptionType: subscriptionType 1370 }; 1371 1372 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1373 $(".modal .js-monitoring").removeClass("hide"); 1374 $(".modal .js-subscription").addClass("hide"); 1375 } else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1376 $(".modal .js-monitoring").addClass("hide"); 1377 $(".modal .js-subscription").removeClass("hide"); 1378 } 1379 }); 1380 1381 $(".js-subscription-create").click(function () { 1382 var productContainer = $(this).closest(".js-product-informations"); 1383 subscriptionType = $(this).attr("data-type"); 1384 itemObj = { 1385 id: $(this).attr("data-id"), 1386 subscriptionType: subscriptionType 1387 }; 1388 1389 if (itemObj.subscriptionType == "Dia2" || itemObj.subscriptionType == "Emne2") { 1390 $(".modal .js-monitoring").removeClass("hide"); 1391 $(".modal .js-subscription").addClass("hide"); 1392 } else if (itemObj.subscriptionType == "Dia1" || itemObj.subscriptionType == "Emne1") { 1393 $(".modal .js-monitoring").addClass("hide"); 1394 $(".modal .js-subscription").removeClass("hide"); 1395 } 1396 1397 item = { 1398 productId: $("input[name=ProductID]", productContainer).val(), 1399 variantId: $("input[name=VariantID]", productContainer).val(), 1400 subscriptionType: subscriptionType 1401 }; 1402 1403 $.ajax({ 1404 type: 'POST', 1405 url: '/Services/SubscriptionService.asmx/SubscriptionExists', 1406 data: JSON.stringify(item), 1407 contentType: "application/json; charset=utf-8", 1408 dataType: 'json', 1409 processdata: true, 1410 beforeSend: function () { startLoading(); }, 1411 complete: function (jqXHR, status) { endLoading(); }, 1412 success: function (result) { 1413 1414 if (result.d.Success) { 1415 showNeededText(result); 1416 } else if (!result.d.IsLoggedIn) { 1417 $(".js-subscription-not-loggedin").modal('show'); 1418 } else { 1419 $(".js-subscription-no-access").modal('show'); 1420 } 1421 } 1422 }); 1423 return false; 1424 }); 1425 1426 $(".js-group-subscription-create").click(function () { 1427 1428 $.ajax({ 1429 type: 'POST', 1430 url: '/Services/SubscriptionService.asmx/SubscriptionGroupExists', 1431 data: JSON.stringify(item), 1432 contentType: "application/json; charset=utf-8", 1433 dataType: 'json', 1434 processdata: true, 1435 beforeSend: function () { startLoading(); }, 1436 complete: function (jqXHR, status) { endLoading(); }, 1437 success: function (result) { 1438 1439 if (result.d.Success) { 1440 showNeededText(result); 1441 1442 } else if (!result.d.IsLoggedIn) { 1443 $(".js-subscription-not-loggedin").modal('show'); 1444 } else { 1445 $(".js-subscription-no-access").modal('show'); 1446 } 1447 } 1448 }); 1449 1450 return false; 1451 }); 1452 1453 $(".js-btn-delete-subscription").click(function (event) { 1454 console.log(item); 1455 $.ajax({ 1456 type: 'POST', 1457 url: '/Services/SubscriptionService.asmx/DeleteSubscription', 1458 data: JSON.stringify(item), 1459 contentType: "application/json; charset=utf-8", 1460 dataType: 'json', 1461 processdata: true, 1462 beforeSend: function () { startLoading(); }, 1463 complete: function (jqXHR, status) { endLoading(); }, 1464 success: function (result) { 1465 1466 if (result.d.Success) { 1467 window.location.href = "@QueryHelper.ReplaceQueryStringParam(removeLink, "action", "remove")"; 1468 } else { 1469 $('#delete-subscription').modal('hide'); 1470 $('#unsubscribe-error').modal('show'); 1471 } 1472 } 1473 }); 1474 }); 1475 1476 $(".js-confirm-subscription").click(function () { 1477 $(".js-subscription-exists").modal("hide"); 1478 1479 var url; 1480 if (item.hasOwnProperty("productId")) { 1481 url = '/Services/SubscriptionService.asmx/CreateSubscription'; 1482 } else { 1483 item.languageId = _languageId; 1484 url = '/Services/SubscriptionService.asmx/CreateGroupSubscription'; 1485 } 1486 1487 $.ajax({ 1488 type: 'POST', 1489 url: url, 1490 data: JSON.stringify(item), 1491 contentType: "application/json; charset=utf-8", 1492 dataType: 'json', 1493 processdata: true, 1494 beforeSend: function () { startLoading(); }, 1495 complete: function (jqXHR, status) { endLoading(); }, 1496 success: function (result) { 1497 1498 if (result.d.Success) { 1499 $(".js-subscription-confirmation .js-success").removeClass("hide"); 1500 $(".js-subscription-confirmation .js-failure").addClass("hide"); 1501 1502 if (item.subscriptionType == "Dia2" || item.subscriptionType == "Emne2") { 1503 if (item.subscriptionType == "Dia2") { 1504 $(".js-success-standard").show(); 1505 $(".js-success-subject").hide(); 1506 } 1507 else if (item.subscriptionType == "Emne2") { 1508 $(".js-success-standard").hide(); 1509 $(".js-success-subject").show(); 1510 } 1511 } 1512 else if (item.subscriptionType == "Dia1" || item.subscriptionType == "Emne1") { 1513 if (item.subscriptionType == "Dia1") { 1514 $(".js-success-standard").show(); 1515 $(".js-success-subject").hide(); 1516 } 1517 else if (item.subscriptionType == "Emne1") { 1518 $(".js-success-standard").hide(); 1519 $(".js-success-subject").show(); 1520 } 1521 } 1522 } else { 1523 $(".js-subscription-confirmation .js-success").addClass("hide"); 1524 $(".js-subscription-confirmation .js-failure").removeClass("hide"); 1525 } 1526 $(".js-subscription-confirmation").modal('show'); 1527 } 1528 }); 1529 1530 return false; 1531 }); 1532 1533 $(".js-subscription-not-loggedin .js-close").click(function () { 1534 $(".js-subscription-not-loggedin").modal('hide'); 1535 $("#LoginBox").modal('show'); 1536 }); 1537 }); 1538 </script> 1539 @SnippetEnd("JavaScript") 1540 1541 1542 @SnippetStart("StyleSheet") 1543 <link href="@designURL/Assets/plugins/select2/select2.css" rel="stylesheet" /> 1544 @SnippetEnd("StyleSheet") 1545 1546 @SnippetStart("JavaScript") 1547 <script src='@designURL/assets/plugins/pdf.js/minified/compatibility.js'></script> 1548 <script src='@designURL/assets/plugins/pdf.js/minified/pdf.js'></script> 1549 <script src="@designURL/Assets/plugins/select2/select2.min.js"></script> 1550 <script> 1551 var listWorkers = function () { 1552 $(".js-select2-box").select2("destroy"); 1553 $(".js-select2-box").select2(); 1554 1555 $(".js-search-bar-form").on("submit", function (e) { 1556 var $advancedSubmitBtn = $(".js-advanced-form-submit"); 1557 if ($(".js-search-input").val().length) { 1558 if ($advancedSubmitBtn.length) { 1559 if (typeof formAnalyzer.count != "undefined") { 1560 if ($advancedSubmitBtn.is(":visible") && formAnalyzer.count > 0) { 1561 $advancedSubmitBtn.trigger("click"); 1562 return false; 1563 } 1564 } 1565 } 1566 } 1567 return true; 1568 }); 1569 1570 } 1571 $(document).ready(listWorkers); 1572 1573 $("body").on("eCom:PageChanged", listWorkers); 1574 1575 $("body").on("eCom:PageChange", function (evt, link, params) { 1576 1577 if (link) { 1578 startLoading(); // show loader 1579 $.ajax(link) 1580 .done(function (response) { 1581 var responseHTML = $(response).find(".js-ecom-page"); 1582 $(".js-ecom-page-container").html(responseHTML); 1583 $(".selectize-dropdown.js-manufacturers").remove(); // clear select2 states before reload 1584 var currentState = null | history.state; 1585 History.pushState(currentState, document.title, link); // logs {}, '', "?state=4" 1586 if (eCommerce) { 1587 eCommerce.Overlay.hide(); 1588 } 1589 $("body").trigger("eCom:PageChanged"); 1590 endLoading(); 1591 }); 1592 } 1593 }); 1594 </script> 1595 @SnippetEnd("JavaScript") 1596 1597