Error executing template "Designs/Rapido/_parsed/ContentPage.parsed.cshtml"
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   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.FetchMissingProductsInternal(IProductRepository repo, IEnumerable`1 keys)
   at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
   at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
   at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId, User user, Boolean showUntranslated)
   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 CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<CustomRenderMasterMetadata>b__294_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 12273
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass9_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 379
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass8_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 289
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<RenderMasterHead>b__315_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 13300
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass9_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 379
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass8_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 289
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass9_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 412
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.<>c__DisplayClass8_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 289
   at CompiledRazorTemplates.Dynamic.RazorEngine_194dcdf47d114cca9a6d87f2808b238f.Execute() in D:\dynamicweb.net\Solutions\Philipson Wine\Files\Templates\Designs\Rapido\_parsed\ContentPage.parsed.cshtml:line 13289
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:53,State:0,Class:20

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @functions { 3 int globalCacheTime = 600; 4 string globalCachePrefix = "GlobalCacheKey"; 5 6 IList<ItemViewModel> GetCacheItems(ItemViewModel item, string itemName, string cachePrefix = "PW-") 7 { 8 var cacheKey = globalCachePrefix + "|" + cachePrefix + "|" + itemName + "|" + item.Id; 9 var itemValue = Dynamicweb.Caching.Cache.Current.Get(cacheKey) as IList<ItemViewModel>; 10 if (itemValue == null) 11 { 12 itemValue = item?.GetItems(itemName); 13 if (itemValue == null) 14 { 15 PageView.Current().Execution.Add($"GetCacheItems: Value is null for item.GetItems({itemName})"); 16 itemValue = new List<ItemViewModel>(); 17 } 18 19 PageView.Current().Execution.Add($"GetCacheItems: Adding value to cache item.GetItems({itemName})"); 20 Dynamicweb.Caching.Cache.Current.Set(cacheKey, itemValue, new Dynamicweb.Caching.CacheItemPolicy() { AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddSeconds(globalCacheTime)) }); 21 } 22 else 23 { 24 PageView.Current().Execution.Add($"GetCacheItems: Getting value from cache item.GetItems({itemName})"); 25 } 26 return itemValue; 27 } 28 29 ListViewModel GetCacheListViewModel(ItemViewModel item, string itemName, string cachePrefix = "PW-") 30 { 31 var cacheKey = globalCachePrefix + "|" + cachePrefix + "|" + itemName + "|" + item.Id; 32 var itemValue = Dynamicweb.Caching.Cache.Current.Get(cacheKey) as ListViewModel; 33 if (itemValue == null) 34 { 35 itemValue = item?.GetValue(itemName) as Dynamicweb.Frontend.ListViewModel; 36 37 PageView.Current().Execution.Add($"GetCacheListViewModel: Adding value to cache item.GetItems({itemName})"); 38 Dynamicweb.Caching.Cache.Current.Set(cacheKey, itemValue, new Dynamicweb.Caching.CacheItemPolicy() { AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddSeconds(globalCacheTime)) }); 39 } 40 else 41 { 42 PageView.Current().Execution.Add($"GetCacheListViewModel: Getting value from cache item.GetItems({itemName})"); 43 } 44 return itemValue; 45 } 46 47 ItemViewModel GetCacheItemViewModel(ItemViewModel item, string itemName, string cachePrefix = "PW-") 48 { 49 var cacheKey = globalCachePrefix + "|" + cachePrefix + "|" + itemName + "|" + item.Id; 50 51 var itemValue = Dynamicweb.Caching.Cache.Current.Get(cacheKey) as ItemViewModel; 52 if (itemValue == null) 53 { 54 itemValue = item.GetItem(itemName); 55 56 if (itemValue == null) 57 { 58 PageView.Current().Execution.Add($"GetCacheItemViewModel: Value is null for item.GetItem({itemName})"); 59 return null; 60 } 61 62 PageView.Current().Execution.Add($"GetCacheItemViewModel: Adding value to cache item.GetItem({itemName}): {itemValue}"); 63 if (itemValue != null) 64 { 65 Dynamicweb.Caching.Cache.Current.Set(cacheKey, itemValue, new Dynamicweb.Caching.CacheItemPolicy() { AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddSeconds(globalCacheTime)) }); 66 } 67 } 68 else 69 { 70 PageView.Current().Execution.Add($"GetCacheItemViewModel: Getting value from cache item.GetItem({itemName}): {itemValue}"); 71 } 72 return itemValue; 73 } 74 75 T GetCacheItemValue<T>(ItemViewModel item, string itemName, string itemKey, string cachePrefix = "PW-") 76 { 77 var cacheKey = globalCachePrefix + "|" + cachePrefix + "|" + itemName + "|" + item.Id + "|" + itemKey; 78 79 var itemValue = Dynamicweb.Caching.Cache.Current.Get(cacheKey) as object; 80 if (itemValue == null) 81 { 82 itemValue = item.GetItem(itemName).GetValue(itemKey); 83 84 if (itemValue == null) 85 { 86 PageView.Current().Execution.Add($"GetCacheItemValue: Value is null for item.GetItem({itemName}).GetValue({itemKey})"); 87 itemValue = string.Empty; 88 } 89 90 PageView.Current().Execution.Add($"GetCacheItemValue: Adding value to cache item.GetItem({itemName}).GetValue({itemKey}): {itemValue}"); 91 if (itemValue != null) 92 { 93 Dynamicweb.Caching.Cache.Current.Set(cacheKey, itemValue, new Dynamicweb.Caching.CacheItemPolicy() { AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddSeconds(globalCacheTime)) }); 94 } 95 } 96 else 97 { 98 PageView.Current().Execution.Add($"GetCacheItemValue: Getting value from cache item.GetItem({itemName}).GetValue({itemKey}): {itemValue}"); 99 } 100 return (T)Convert.ChangeType(itemValue, typeof(T)); 101 } 102 } 103 104 @using System.Web; 105 @using Dynamicweb 106 @using Dynamicweb.Frontend 107 @using Dynamicweb.Frontend.Devices 108 @using Dynamicweb.Extensibility 109 @using Dynamicweb.Content 110 @using Dynamicweb.Security 111 @using Dynamicweb.Core 112 @using System 113 @using System.Web 114 @using System.IO 115 @using System.Text.RegularExpressions; 116 @using Dynamicweb.Rapido.Blocks 117 @using System.Net 118 @using Dynamicweb.Logging 119 @using Dynamicweb.Environment; 120 121 122 @functions { 123 BlocksPage masterPage = BlocksPage.GetBlockPage("Master"); 124 125 string getFontFamily(params string[] items) 126 { 127 var itemParent = Pageview.AreaSettings; 128 foreach (var item in items) 129 { 130 itemParent = GetCacheItemViewModel(itemParent, item); //itemParent.GetItem(item); 131 if (itemParent == null) 132 { 133 return null; 134 } 135 } 136 137 var googleFont = itemParent.GetGoogleFont("FontFamily"); 138 if (googleFont == null) 139 { 140 return null; 141 } 142 return googleFont.Family.Replace(" ", "+"); 143 } 144 145 } 146 147 @{ 148 Block root = new Block 149 { 150 Id = "Root", 151 SortId = 10, 152 BlocksList = new List<Block> 153 { 154 new Block { 155 Id = "Head", 156 SortId = 10, 157 SkipRenderBlocksList = true, 158 Template = RenderMasterHead(), 159 BlocksList = new List<Block> 160 { 161 new Block { 162 Id = "HeadMetadata", 163 SortId = 10, 164 Template = CustomRenderMasterMetadata(), 165 }, 166 new Block { 167 Id = "HeadCss", 168 SortId = 20, 169 Template = RenderMasterCss(), 170 }, 171 new Block { 172 Id = "HeadManifest", 173 SortId = 30, 174 Template = RenderMasterManifest(), 175 } 176 } 177 }, 178 new Block { 179 Id = "Body", 180 SortId = 20, 181 SkipRenderBlocksList = true, 182 Template = RenderMasterBody(), 183 BlocksList = new List<Block> 184 { 185 new Block() 186 { 187 Id = "Master", 188 SortId = 10, 189 BlocksList = new List<Block> { 190 new Block { 191 Id = "MasterTopSnippets", 192 SortId = 10 193 }, 194 new Block { 195 Id = "MasterMain", 196 SortId = 20, 197 Template = RenderMain(), 198 SkipRenderBlocksList = true, 199 BlocksList = new List<Block> { 200 new Block { 201 Id = "MasterHeader", 202 SortId = 10, 203 Template = RenderMasterHeader(), 204 SkipRenderBlocksList = true 205 }, 206 new Block { 207 Id = "MasterPageContent", 208 SortId = 20, 209 Template = RenderPageContent() 210 }, 211 new Block { 212 Id = "MasterPageOverlay", 213 SortId = 30, 214 Template = RenderOverlay() 215 } 216 } 217 }, 218 new Block { 219 Id = "MasterFooter", 220 SortId = 30 221 }, 222 new Block { 223 Id = "MasterReferences", 224 SortId = 40 225 }, 226 new Block { 227 Id = "MasterBottomSnippets", 228 SortId = 50 229 } 230 } 231 } 232 } 233 } 234 } 235 }; 236 237 masterPage.Add(root); 238 } 239 240 @{ 241 bool isHeaderHidden = Model.PropertyItem.GetBoolean("HideHeader"); 242 bool isFooterHidden = Model.PropertyItem.GetBoolean("HideFooter"); 243 string fileVersion = Converter.ToString(System.Web.HttpContext.Current.Cache["FileVersion"]); 244 if (string.IsNullOrEmpty(fileVersion)) 245 { 246 try 247 { 248 var assembly = System.Reflection.Assembly.Load("Application"); 249 if (assembly != null) 250 { 251 fileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location).FileVersion; 252 System.Web.HttpContext.Current.Cache["FileVersion"] = fileVersion; 253 } 254 } 255 catch (Exception ex) 256 { 257 LogManager.Current.GetLogger("Smartpage/Assemblies").Error("Error while loading Application assembly: ", ex); 258 } 259 } 260 } 261 262 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 263 @using System.Text.RegularExpressions 264 @using System.Collections.Generic 265 @using System.Reflection 266 @using System.Web 267 @using System.Web.UI.HtmlControls 268 @using Dynamicweb.Rapido.Blocks.Components 269 @using Dynamicweb.Rapido.Blocks.Components.Articles 270 @using Dynamicweb.Rapido.Blocks.Components.Documentation 271 @using Dynamicweb.Rapido.Blocks 272 273 274 @*--- START: Base block renderers ---*@ 275 276 @helper RenderBlockList(List<Block> blocks) 277 { 278 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 279 blocks = blocks.OrderBy(item => item.SortId).ToList(); 280 281 foreach (Block item in blocks) 282 { 283 if (debug) { 284 <!-- Block START: @item.Id --> 285 } 286 287 if (item.Design == null) 288 { 289 @RenderBlock(item) 290 } 291 else if (item.Design.RenderType == RenderType.None) { 292 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 293 294 <div class="@cssClass dw-mod"> 295 @RenderBlock(item) 296 </div> 297 } 298 else if (item.Design.RenderType != RenderType.Hide) 299 { 300 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 301 302 if (!item.SkipRenderBlocksList) { 303 if (item.Design.RenderType == RenderType.Row) 304 { 305 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 306 @RenderBlock(item) 307 </div> 308 } 309 310 if (item.Design.RenderType == RenderType.Column) 311 { 312 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 313 string size = item.Design.Size ?? "12"; 314 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 315 316 <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 317 @RenderBlock(item) 318 </div> 319 } 320 321 if (item.Design.RenderType == RenderType.Table) 322 { 323 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 324 @RenderBlock(item) 325 </table> 326 } 327 328 if (item.Design.RenderType == RenderType.TableRow) 329 { 330 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 331 @RenderBlock(item) 332 </tr> 333 } 334 335 if (item.Design.RenderType == RenderType.TableColumn) 336 { 337 <td class="@cssClass dw-mod" id="Block__@item.Id"> 338 @RenderBlock(item) 339 </td> 340 } 341 342 if (item.Design.RenderType == RenderType.CardHeader) 343 { 344 <div class="card-header @cssClass dw-mod"> 345 @RenderBlock(item) 346 </div> 347 } 348 349 if (item.Design.RenderType == RenderType.CardBody) 350 { 351 <div class="card @cssClass dw-mod"> 352 @RenderBlock(item) 353 </div> 354 } 355 356 if (item.Design.RenderType == RenderType.CardFooter) 357 { 358 <div class="card-footer @cssClass dw-mod"> 359 @RenderBlock(item) 360 </div> 361 } 362 } 363 else 364 { 365 @RenderBlock(item) 366 } 367 } 368 369 if (debug) { 370 <!-- Block END: @item.Id --> 371 } 372 } 373 } 374 375 @helper RenderBlock(Block item) 376 { 377 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 378 379 if (item.Template != null) 380 { 381 @BlocksPage.RenderTemplate(item.Template) 382 } 383 384 if (item.Component != null) 385 { 386 string customSufix = "Custom"; 387 string methodName = item.Component.HelperName; 388 389 ComponentBase[] methodParameters = new ComponentBase[1]; 390 methodParameters[0] = item.Component; 391 Type methodType = this.GetType(); 392 393 MethodInfo customMethod = methodType.GetMethod(methodName + customSufix); 394 MethodInfo generalMethod = methodType.GetMethod(methodName); 395 396 try { 397 if (debug) { 398 <!-- Component: @methodName.Replace("Render", "") --> 399 } 400 @customMethod.Invoke(this, methodParameters).ToString(); 401 } catch { 402 try { 403 @generalMethod.Invoke(this, methodParameters).ToString(); 404 } catch(Exception ex) { 405 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked", ex); 406 } 407 } 408 } 409 410 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 411 { 412 @RenderBlockList(item.BlocksList) 413 } 414 } 415 416 @*--- END: Base block renderers ---*@ 417 418 419 @* Include the components *@ 420 @using Dynamicweb.Rapido.Blocks.Components 421 @using Dynamicweb.Rapido.Blocks.Components.General 422 @using Dynamicweb.Rapido.Blocks 423 @using System.IO 424 425 @* Required *@ 426 @using Dynamicweb.Rapido.Blocks.Components 427 @using Dynamicweb.Rapido.Blocks.Components.General 428 @using Dynamicweb.Rapido.Blocks 429 430 431 @helper Render(ComponentBase component) 432 { 433 if (component != null) 434 { 435 @component.Render(this) 436 } 437 } 438 439 @* Components *@ 440 @using System.Reflection 441 @using Dynamicweb.Rapido.Blocks.Components.General 442 443 444 @* Component *@ 445 446 @helper RenderIcon(Icon settings) 447 { 448 if (settings != null) 449 { 450 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 451 452 if (settings.Name != null) 453 { 454 if (string.IsNullOrEmpty(settings.Label)) 455 { 456 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 457 } 458 else 459 { 460 if (settings.LabelPosition == IconLabelPosition.Before) 461 { 462 <span>@settings.Label <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i></span> 463 } 464 else 465 { 466 <span><i class="@settings.Prefix @settings.Name u-margin-right--lg @settings.CssClass u-w20px" @color></i>@settings.Label</span> 467 } 468 } 469 } 470 else if (!string.IsNullOrEmpty(settings.Label)) 471 { 472 @settings.Label 473 } 474 } 475 } 476 @using System.Reflection 477 @using Dynamicweb.Rapido.Blocks.Components.General 478 @using Dynamicweb.Rapido.Blocks.Components 479 @using Dynamicweb.Core 480 481 @* Component *@ 482 483 @helper RenderButton(Button settings) 484 { 485 if (settings != null && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 486 { 487 Dictionary<string, string> attributes = new Dictionary<string, string>(); 488 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 489 if (settings.Disabled) 490 { 491 attributes.Add("disabled", "true"); 492 classList.Add("disabled"); 493 } 494 495 if (!string.IsNullOrEmpty(settings.ConfirmText) || !string.IsNullOrEmpty(settings.ConfirmTitle)) 496 { 497 settings.Id = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 498 @RenderConfirmDialog(settings); 499 settings.OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = true"; 500 } 501 502 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 503 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 504 if (!string.IsNullOrEmpty(settings.AltText)) 505 { 506 attributes.Add("title", settings.AltText); 507 } 508 else if (!string.IsNullOrEmpty(settings.Title)) 509 { 510 attributes.Add("title", settings.Title); 511 } 512 513 var onClickEvents = new List<string>(); 514 if (!string.IsNullOrEmpty(settings.OnClick)) 515 { 516 onClickEvents.Add(settings.OnClick); 517 } 518 if (!string.IsNullOrEmpty(settings.Href)) 519 { 520 onClickEvents.Add("location.href='" + settings.Href + "'"); 521 } 522 if (onClickEvents.Count > 0) 523 { 524 attributes.Add("onClick", string.Join(";", onClickEvents)); 525 } 526 527 if (settings.ButtonLayout != ButtonLayout.None) 528 { 529 classList.Add("btn"); 530 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 531 if (btnLayout == "linkclean") 532 { 533 btnLayout = "link-clean"; //fix 534 } 535 classList.Add("btn--" + btnLayout); 536 } 537 538 if (settings.Icon == null) 539 { 540 settings.Icon = new Icon(); 541 } 542 settings.Icon.Label = settings.Title; 543 544 attributes.Add("type", Enum.GetName(typeof(ButtonType), settings.ButtonType).ToLower()); 545 546 547 //If link is a paragraph, go to that paragraph 548 if (!string.IsNullOrEmpty(settings.Href) && settings.Href.Contains("#")) 549 { 550 int pageId = Dynamicweb.Environment.Helpers.LinkHelper.GetInternalPageId(settings.Href); 551 string[] hrefSplit = settings.Href.Trim().Split('#'); 552 string idToScrollTo = "paragraph_" + hrefSplit[1].Trim(); 553 554 if (Pageview.ID == pageId) 555 { 556 attributes.Remove("onClick"); 557 attributes.Add("onClick", "document.getElementById('" + idToScrollTo + "').scrollIntoView({behavior: 'smooth'})"); 558 }else if (pageId != 0) 559 { 560 settings.Href = hrefSplit[0].Trim() + "#paragraph_" + hrefSplit[1].Trim(); 561 attributes.Remove("onClick"); 562 attributes.Add("onClick", "location.href='" + settings.Href + "'"); 563 } 564 } 565 <button class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</button> 566 } 567 } 568 569 @helper RenderConfirmDialog(Button settings) 570 { 571 Modal confirmDialog = new Modal 572 { 573 Id = settings.Id, 574 Width = ModalWidth.Sm, 575 Heading = new Heading 576 { 577 Level = 2, 578 Title = settings.ConfirmTitle 579 }, 580 BodyText = settings.ConfirmText 581 }; 582 583 confirmDialog.AddAction(new Button { Title = Translate("Cancel"), ButtonLayout = ButtonLayout.Secondary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false"}); 584 confirmDialog.AddAction(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false;" + settings.OnClick }); 585 586 @Render(confirmDialog) 587 } 588 @using Dynamicweb.Rapido.Blocks.Components.General 589 @using Dynamicweb.Rapido.Blocks.Components 590 @using Dynamicweb.Core 591 592 @helper RenderDashboard(Dashboard settings) 593 { 594 var widgets = settings.GetWidgets(); 595 596 if (!string.IsNullOrEmpty(settings.WidgetsBaseBackgroundColor)) 597 { 598 //set bg color for them 599 600 System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml(settings.WidgetsBaseBackgroundColor); 601 int r = Convert.ToInt16(color.R); 602 int g = Convert.ToInt16(color.G); 603 int b = Convert.ToInt16(color.B); 604 605 var count = widgets.Length; 606 var max = Math.Max(r, Math.Max(g, b)); 607 double step = 255.0 / (max * count); 608 var i = 0; 609 foreach (var widget in widgets) 610 { 611 i++; 612 613 var shade = "rgb(" + Converter.ToString(r * step * i).Replace(",", ".") + ", " + Converter.ToString(g * step * i).Replace(",", ".") + ", " + Converter.ToString(b * step * i).Replace(",", ".") + ")"; 614 widget.BackgroundColor = shade; 615 } 616 } 617 618 <div class="dashboard @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 619 @foreach (var widget in widgets) 620 { 621 <div class="dashboard__widget"> 622 @Render(widget) 623 </div> 624 } 625 </div> 626 } 627 @using Dynamicweb.Rapido.Blocks.Components.General 628 @using Dynamicweb.Rapido.Blocks.Components 629 630 @helper RenderDashboardWidgetLink(DashboardWidgetLink settings) 631 { 632 if (!string.IsNullOrEmpty(settings.Link)) 633 { 634 var backgroundStyles = ""; 635 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 636 { 637 backgroundStyles = "style=\"background-color:" + settings.BackgroundColor + "\""; 638 } 639 640 <a href="@settings.Link" class="widget widget--link @settings.CssClass dw-mod" @backgroundStyles title="@settings.Title" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 641 <div class="u-center-middle u-color-light"> 642 @if (settings.Icon != null) 643 { 644 settings.Icon.CssClass += "widget__icon"; 645 @Render(settings.Icon) 646 } 647 <div class="widget__title">@settings.Title</div> 648 </div> 649 </a> 650 } 651 } 652 @using Dynamicweb.Rapido.Blocks.Components.General 653 @using Dynamicweb.Rapido.Blocks.Components 654 655 @helper RenderDashboardWidgetCounter(DashboardWidgetCounter settings) 656 { 657 var backgroundStyles = ""; 658 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 659 { 660 backgroundStyles = "style='background-color:" + settings.BackgroundColor + "'"; 661 } 662 663 <div class="widget @settings.CssClass dw-mod" @backgroundStyles @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 664 <div class="u-center-middle u-color-light"> 665 @if (settings.Icon != null) 666 { 667 settings.Icon.CssClass += "widget__icon"; 668 @Render(settings.Icon) 669 } 670 <div class="widget__counter">@settings.Count</div> 671 <div class="widget__title">@settings.Title</div> 672 </div> 673 </div> 674 } 675 @using System.Reflection 676 @using Dynamicweb.Rapido.Blocks.Components.General 677 @using Dynamicweb.Rapido.Blocks.Components 678 @using Dynamicweb.Core 679 680 @* Component *@ 681 682 @helper RenderLink(Link settings) 683 { 684 if (settings != null && !string.IsNullOrEmpty(settings.Href) && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 685 { 686 Dictionary<string, string> attributes = new Dictionary<string, string>(); 687 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 688 if (settings.Disabled) 689 { 690 attributes.Add("disabled", "true"); 691 classList.Add("disabled"); 692 } 693 694 if (!string.IsNullOrEmpty(settings.AltText)) 695 { 696 attributes.Add("title", settings.AltText); 697 } 698 else if (!string.IsNullOrEmpty(settings.Title)) 699 { 700 attributes.Add("title", settings.Title); 701 } 702 703 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 704 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 705 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onClick", settings.OnClick); } 706 attributes.Add("href", settings.Href); 707 708 if (settings.ButtonLayout != ButtonLayout.None) 709 { 710 classList.Add("btn"); 711 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 712 if (btnLayout == "linkclean") 713 { 714 btnLayout = "link-clean"; //fix 715 } 716 classList.Add("btn--" + btnLayout); 717 } 718 719 if (settings.Icon == null) 720 { 721 settings.Icon = new Icon(); 722 } 723 settings.Icon.Label = settings.Title; 724 725 if (settings.Target == LinkTargetType.Blank && settings.Rel == LinkRelType.None) 726 { 727 settings.Rel = LinkRelType.Noopener; 728 } 729 if (settings.Target != LinkTargetType.None) 730 { 731 attributes.Add("target", "_" + Enum.GetName(typeof(LinkTargetType), settings.Target).ToLower()); 732 } 733 if (settings.Download) 734 { 735 attributes.Add("download", "true"); 736 } 737 if (settings.Rel != LinkRelType.None) 738 { 739 attributes.Add("rel", Enum.GetName(typeof(LinkRelType), settings.Rel).ToLower()); 740 } 741 742 <a class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</a> 743 } 744 } 745 @using System.Reflection 746 @using Dynamicweb.Rapido.Blocks.Components 747 @using Dynamicweb.Rapido.Blocks.Components.General 748 @using Dynamicweb.Rapido.Blocks 749 750 751 @* Component *@ 752 753 @helper RenderRating(Rating settings) 754 { 755 if (settings.Score > 0) 756 { 757 int rating = settings.Score; 758 string iconType = "fa-star"; 759 760 switch (settings.Type.ToString()) { 761 case "Stars": 762 iconType = "fa-star"; 763 break; 764 case "Hearts": 765 iconType = "fa-heart"; 766 break; 767 case "Lemons": 768 iconType = "fa-lemon"; 769 break; 770 case "Bombs": 771 iconType = "fa-bomb"; 772 break; 773 } 774 775 <div class="u-ta-right"> 776 @for (int i = 0; i < settings.OutOf; i++) 777 { 778 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 779 } 780 </div> 781 } 782 } 783 @using System.Reflection 784 @using Dynamicweb.Rapido.Blocks.Components.General 785 @using Dynamicweb.Rapido.Blocks.Components 786 787 788 @* Component *@ 789 790 @helper RenderSelectFieldOption(SelectFieldOption settings) 791 { 792 Dictionary<string, string> attributes = new Dictionary<string, string>(); 793 if (settings.Checked) { attributes.Add("selected", "true"); } 794 if (settings.Disabled) { attributes.Add("disabled", "true"); } 795 if (settings.Value != null) { attributes.Add("value", settings.Value); } 796 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 797 798 <option @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Label</option> 799 } 800 @using System.Reflection 801 @using Dynamicweb.Rapido.Blocks.Components.General 802 @using Dynamicweb.Rapido.Blocks.Components 803 804 805 @* Component *@ 806 807 @helper RenderNavigation(Navigation settings) { 808 @RenderNavigation(new 809 { 810 id = settings.Id, 811 cssclass = settings.CssClass, 812 startLevel = settings.StartLevel, 813 endlevel = settings.EndLevel, 814 expandmode = settings.Expandmode, 815 sitemapmode = settings.SitemapMode, 816 template = settings.Template 817 }) 818 } 819 @using Dynamicweb.Rapido.Blocks.Components.General 820 @using Dynamicweb.Rapido.Blocks.Components 821 822 823 @* Component *@ 824 825 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 826 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 827 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 828 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 829 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 830 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 831 settings.SitemapMode = false; 832 833 @RenderNavigation(settings) 834 } 835 @using Dynamicweb.Rapido.Blocks.Components.General 836 @using Dynamicweb.Rapido.Blocks.Components 837 838 839 @* Component *@ 840 841 @helper RenderLeftNavigation(LeftNavigation settings) { 842 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 843 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 844 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 845 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 846 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 847 848 <div class="grid__cell"> 849 @RenderNavigation(settings) 850 </div> 851 } 852 @using System.Reflection 853 @using Dynamicweb.Rapido.Blocks.Components.General 854 @using Dynamicweb.Core 855 856 @* Component *@ 857 858 @helper RenderHeading(Heading settings) 859 { 860 if (settings != null && !string.IsNullOrEmpty(settings.Title)) 861 { 862 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 863 string tagName = settings.Level != 0 ? "h" + settings.Level.ToString() : "div"; 864 865 @("<" + tagName + " class=\"" + settings.CssClass + " dw-mod\" " + color + ">") 866 if (!string.IsNullOrEmpty(settings.Link)) 867 { 868 @Render(new Link { Href = settings.Link, Icon = settings.Icon, Title = settings.Title, ButtonLayout = ButtonLayout.None }) 869 } 870 else 871 { 872 if (settings.Icon == null) 873 { 874 settings.Icon = new Icon(); 875 } 876 settings.Icon.Label = settings.Title; 877 @Render(settings.Icon) 878 } 879 @("</" + tagName + ">"); 880 } 881 } 882 @using Dynamicweb.Rapido.Blocks.Components 883 @using Dynamicweb.Rapido.Blocks.Components.General 884 @using Dynamicweb.Rapido.Blocks 885 886 887 @* Component *@ 888 889 @helper RenderImage(Image settings) 890 { 891 string cleanImagePath = string.Empty; 892 if (settings.Path is string) 893 { 894 cleanImagePath = settings.Path; 895 } 896 int index = cleanImagePath.IndexOf("&x"); 897 if (index >= 0) 898 { 899 cleanImagePath = cleanImagePath.Substring(0, index); 900 } 901 902 if (settings.FilterPrimary != ImageFilter.None || settings.FilterSecondary != ImageFilter.None) 903 { 904 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 905 if (!string.IsNullOrEmpty(settings.FilterColor)) { optionalAttributes.Add("style", "background-color: " + settings.FilterColor); } 906 907 if (settings.Caption != null) 908 { 909 @:<div> 910 } 911 912 var primaryFilterClass = settings.FilterPrimary.ToString().ToLower(); 913 var secondaryFilterClass = settings.FilterSecondary.ToString().ToLower(); 914 915 <div class="image-filter image-filter--@primaryFilterClass u-position-relative dw-mod" @ComponentMethods.AddAttributes(optionalAttributes)> 916 <div class="image-filter image-filter--@secondaryFilterClass dw-mod"> 917 @if (settings.Link != null) 918 { 919 <a href="@settings.Link"> 920 @RenderTheImage(settings, cleanImagePath) 921 </a> 922 } 923 else 924 { 925 @RenderTheImage(settings, cleanImagePath) 926 } 927 </div> 928 </div> 929 930 if (settings.Caption != null) 931 { 932 <span class="image-caption dw-mod">@settings.Caption</span> 933 @:</div> 934 } 935 } 936 else 937 { 938 if (settings.Caption != null) 939 { 940 @:<div> 941 } 942 if (!string.IsNullOrEmpty(settings.Link)) 943 { 944 <a href="@settings.Link"> 945 @RenderTheImage(settings, cleanImagePath) 946 </a> 947 } 948 else 949 { 950 @RenderTheImage(settings, cleanImagePath) 951 } 952 953 if (settings.Caption != null) 954 { 955 <span class="image-caption dw-mod">@settings.Caption</span> 956 @:</div> 957 } 958 } 959 } 960 961 @helper RenderTheImage(Image settings, string cleanImagePath) 962 { 963 if (settings != null) 964 { 965 string placeholderImage = "/Files/Images/placeholder.gif"; 966 string imageEngine = "/Admin/Public/GetImage.ashx?"; 967 968 // CDN 969 var cdnUrl = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetString("CDNUrl"); 970 bool cdnActivate = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("CDNActivate"); 971 if (!string.IsNullOrWhiteSpace(cdnUrl) && cdnActivate) 972 { 973 imageEngine = cdnUrl + imageEngine; 974 } 975 976 string imageStyle = ""; 977 978 switch (settings.Style) 979 { 980 case ImageStyle.Ball: 981 imageStyle = "grid__cell-img--ball"; 982 break; 983 984 case ImageStyle.Triangle: 985 imageStyle = "grid__cell-img--triangle"; 986 break; 987 } 988 989 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle || settings.Style == ImageStyle.Triangle) 990 { 991 settings.ImageDefault.Crop = settings.ImageDefault.Crop == 5 ? settings.ImageDefault.Crop = 0 : settings.ImageDefault.Crop; 992 993 if (settings.ImageDefault != null) 994 { 995 settings.ImageDefault.Height = settings.ImageDefault.Width; 996 } 997 if (settings.ImageMedium != null) 998 { 999 settings.ImageMedium.Height = settings.ImageMedium.Width; 1000 } 1001 if (settings.ImageSmall != null) 1002 { 1003 settings.ImageSmall.Height = settings.ImageSmall.Width; 1004 } 1005 } 1006 1007 string defaultImage = imageEngine; 1008 string imageSmall = ""; 1009 string imageMedium = ""; 1010 1011 if (settings.DisableImageEngine) 1012 { 1013 defaultImage = settings.Path; 1014 } 1015 else 1016 { 1017 if (settings.ImageDefault != null) 1018 { 1019 defaultImage += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageDefault); 1020 1021 if (settings.Path.GetType() != typeof(string)) 1022 { 1023 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1024 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1025 } 1026 else 1027 { 1028 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 1029 } 1030 } 1031 1032 if (settings.ImageSmall != null) 1033 { 1034 imageSmall = "data-src-small=\"" + imageEngine; 1035 imageSmall += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageSmall); 1036 1037 if (settings.Path.GetType() != typeof(string)) 1038 { 1039 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1040 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1041 } 1042 else 1043 { 1044 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 1045 } 1046 1047 imageSmall += "\""; 1048 } 1049 1050 if (settings.ImageMedium != null) 1051 { 1052 imageMedium = "data-src-medium=\"" + imageEngine; 1053 imageMedium += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageMedium); 1054 1055 if (settings.Path.GetType() != typeof(string)) 1056 { 1057 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1058 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1059 } 1060 else 1061 { 1062 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 1063 } 1064 1065 imageMedium += "\""; 1066 } 1067 } 1068 1069 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 1070 if (cleanImagePath != null) 1071 { 1072 Dynamicweb.Content.Files.Metadata.Meta metadata = Dynamicweb.Content.Files.Metadata.EditorFactory.GetMetadataForFile(cleanImagePath); 1073 if (metadata != null) 1074 { 1075 string metaDataAlt = metadata.GetValue("alt"); 1076 optionalAttributes.Add("alt", metaDataAlt); 1077 } 1078 } 1079 if (!string.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 1080 if (!string.IsNullOrEmpty(settings.Title)) 1081 { 1082 optionalAttributes.Add("alt", settings.Title); 1083 optionalAttributes.Add("title", settings.Title); 1084 } 1085 1086 if (settings.DisableLazyLoad) 1087 { 1088 <img id="@settings.Id" class="@imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1089 } 1090 else 1091 { 1092 <img id="@settings.Id" class="b-lazy @imageStyle @settings.CssClass dw-mod" src="@placeholderImage" data-src="@defaultImage" @imageSmall @imageMedium @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1093 } 1094 } 1095 } 1096 @using System.Reflection 1097 @using Dynamicweb.Rapido.Blocks.Components.General 1098 @using Dynamicweb.Rapido.Blocks.Components 1099 1100 @* Component *@ 1101 1102 @helper RenderFileField(FileField settings) 1103 { 1104 var attributes = new Dictionary<string, string>(); 1105 if (string.IsNullOrEmpty(settings.Id)) 1106 { 1107 settings.Id = Guid.NewGuid().ToString("N"); 1108 } 1109 1110 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1111 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1112 if (settings.Required) { attributes.Add("required", "true"); } 1113 if (settings.Multiple) { attributes.Add("multiple", "true"); } 1114 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1115 if (string.IsNullOrEmpty(settings.ChooseFileText)) 1116 { 1117 settings.ChooseFileText = Translate("Choose file"); 1118 } 1119 if (string.IsNullOrEmpty(settings.NoFilesChosenText)) 1120 { 1121 settings.NoFilesChosenText = Translate("No files chosen..."); 1122 } 1123 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1124 1125 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1126 1127 string setValueToFakeInput = "FileUpload.setValueToFakeInput(this)"; 1128 attributes.Add("onchange", setValueToFakeInput + (!string.IsNullOrEmpty(settings.OnChange) ? settings.OnChange : "")); 1129 1130 attributes.Add("type", "file"); 1131 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1132 settings.CssClass = "u-full-width " + settings.CssClass; 1133 1134 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1135 1136 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1137 @if (!string.IsNullOrEmpty(settings.Label)) 1138 { 1139 <label for="@settings.Id">@settings.Label</label> 1140 } 1141 @if (!string.IsNullOrEmpty(settings.HelpText)) 1142 { 1143 <small class="form__help-text">@settings.HelpText</small> 1144 } 1145 1146 <div class="form__field-combi file-input u-no-margin dw-mod"> 1147 <input @ComponentMethods.AddAttributes(resultAttributes) class="file-input__real-input" data-no-files-text="@settings.NoFilesChosenText" data-many-files-text="@Translate("files")" /> 1148 <label for="@settings.Id" class="file-input__btn btn--secondary btn dw-mod">@settings.ChooseFileText</label> 1149 <label for="@settings.Id" class="@settings.CssClass file-input__fake-input js-fake-input dw-mod">@settings.NoFilesChosenText</label> 1150 @if (settings.UploadButton != null) 1151 { 1152 settings.UploadButton.CssClass += " btn--condensed u-no-margin"; 1153 @Render(settings.UploadButton) 1154 } 1155 </div> 1156 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1157 </div> 1158 } 1159 @using System.Reflection 1160 @using Dynamicweb.Rapido.Blocks.Components.General 1161 @using Dynamicweb.Rapido.Blocks.Components 1162 @using Dynamicweb.Core 1163 @using System.Linq 1164 1165 @* Component *@ 1166 1167 @helper RenderDateTimeField(DateTimeField settings) 1168 { 1169 if (string.IsNullOrEmpty(settings.Id)) 1170 { 1171 settings.Id = Guid.NewGuid().ToString("N"); 1172 } 1173 1174 var textField = new TextField { 1175 Name = settings.Name, 1176 Id = settings.Id, 1177 Label = settings.Label, 1178 HelpText = settings.HelpText, 1179 Value = settings.Value, 1180 Disabled = settings.Disabled, 1181 Required = settings.Required, 1182 ErrorMessage = settings.ErrorMessage, 1183 CssClass = settings.CssClass, 1184 WrapperCssClass = settings.WrapperCssClass, 1185 OnChange = settings.OnChange, 1186 OnClick = settings.OnClick, 1187 ExtraAttributes = settings.ExtraAttributes, 1188 // 1189 Placeholder = settings.Placeholder 1190 }; 1191 1192 @Render(textField) 1193 1194 List<string> jsAttributes = new List<string>(); 1195 1196 jsAttributes.Add("mode: '" + Enum.GetName(typeof(DateTimeFieldMode), settings.Mode).ToLower() + "'"); 1197 1198 if (!string.IsNullOrEmpty(settings.DateFormat)) 1199 { 1200 jsAttributes.Add("dateFormat: '" + settings.DateFormat + "'"); 1201 } 1202 if (!string.IsNullOrEmpty(settings.MinDate)) 1203 { 1204 jsAttributes.Add("minDate: '" + settings.MinDate + "'"); 1205 } 1206 if (!string.IsNullOrEmpty(settings.MaxDate)) 1207 { 1208 jsAttributes.Add("maxDate: '" + settings.MaxDate + "'"); 1209 } 1210 if (settings.IsInline) 1211 { 1212 jsAttributes.Add("inline: " + Converter.ToString(settings.IsInline).ToLower()); 1213 } 1214 if (settings.EnableTime) 1215 { 1216 jsAttributes.Add("enableTime: " + Converter.ToString(settings.EnableTime).ToLower()); 1217 } 1218 if (settings.EnableWeekNumbers) 1219 { 1220 jsAttributes.Add("weekNumbers: " + Converter.ToString(settings.EnableWeekNumbers).ToLower()); 1221 } 1222 1223 jsAttributes.AddRange(settings.GetFlatPickrOptions().Select(x => x.Key + ": " + x.Value)); 1224 1225 <script> 1226 document.addEventListener("DOMContentLoaded", function () { 1227 flatpickr("#@textField.Id", { 1228 @string.Join(",", jsAttributes) 1229 }); 1230 }); 1231 </script> 1232 } 1233 @using System.Reflection 1234 @using Dynamicweb.Rapido.Blocks.Components.General 1235 @using Dynamicweb.Rapido.Blocks.Components 1236 1237 @* Component *@ 1238 1239 @helper RenderTextField(TextField settings) 1240 { 1241 var attributes = new Dictionary<string, string>(); 1242 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1243 { 1244 settings.Id = Guid.NewGuid().ToString("N"); 1245 } 1246 1247 /*base settings*/ 1248 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1249 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1250 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1251 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1252 if (settings.Required) { attributes.Add("required", "true"); } 1253 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1254 /*end*/ 1255 1256 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1257 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1258 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1259 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1260 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 1261 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 1262 attributes.Add("type", Enum.GetName(typeof(TextFieldType), settings.Type).ToLower()); 1263 if (settings.Type == TextFieldType.Password) { attributes.Add("autocomplete", "off"); }; 1264 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1265 1266 settings.CssClass = "u-full-width " + settings.CssClass; 1267 1268 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1269 1270 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1271 1272 string noMargin = "u-no-margin"; 1273 if (!settings.ReadOnly) { 1274 noMargin = ""; 1275 } 1276 1277 <div class="form__field-group u-full-width @noMargin @settings.WrapperCssClass dw-mod"> 1278 @if (!string.IsNullOrEmpty(settings.Label)) 1279 { 1280 <label for="@settings.Id">@settings.Label</label> 1281 } 1282 @if (!string.IsNullOrEmpty(settings.HelpText)) 1283 { 1284 <small class="form__help-text">@settings.HelpText</small> 1285 } 1286 1287 @if (settings.ActionButton != null) 1288 { 1289 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1290 <div class="form__field-combi u-no-margin dw-mod"> 1291 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1292 @Render(settings.ActionButton) 1293 </div> 1294 } 1295 else 1296 { 1297 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1298 } 1299 1300 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1301 </div> 1302 } 1303 @using System.Reflection 1304 @using Dynamicweb.Rapido.Blocks.Components.General 1305 @using Dynamicweb.Rapido.Blocks.Components 1306 1307 @* Component *@ 1308 1309 @helper RenderNumberField(NumberField settings) 1310 { 1311 var attributes = new Dictionary<string, string>(); 1312 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1313 { 1314 settings.Id = Guid.NewGuid().ToString("N"); 1315 } 1316 1317 /*base settings*/ 1318 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1319 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1320 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1321 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1322 if (settings.Required) { attributes.Add("required", "true"); } 1323 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1324 /*end*/ 1325 1326 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1327 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1328 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1329 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1330 if (settings.Max != null) { attributes.Add("max", settings.Max.ToString()); } 1331 if (settings.Min != null) { attributes.Add("min", settings.Min.ToString()); } 1332 if (settings.Step != 0) { attributes.Add("step", settings.Step.ToString()); } 1333 if (settings.Value != null && !string.IsNullOrEmpty(settings.Value.ToString())) { attributes.Add("value", settings.Value.ToString()); } 1334 attributes.Add("type", "number"); 1335 1336 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1337 1338 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1339 @if (!string.IsNullOrEmpty(settings.Label)) 1340 { 1341 <label for="@settings.Id">@settings.Label</label> 1342 } 1343 @if (!string.IsNullOrEmpty(settings.HelpText)) 1344 { 1345 <small class="form__help-text">@settings.HelpText</small> 1346 } 1347 1348 @if (settings.ActionButton != null) 1349 { 1350 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1351 <div class="form__field-combi u-no-margin dw-mod"> 1352 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1353 @Render(settings.ActionButton) 1354 </div> 1355 } 1356 else 1357 { 1358 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1359 } 1360 1361 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1362 </div> 1363 } 1364 @using System.Reflection 1365 @using Dynamicweb.Rapido.Blocks.Components.General 1366 @using Dynamicweb.Rapido.Blocks.Components 1367 1368 1369 @* Component *@ 1370 1371 @helper RenderTextareaField(TextareaField settings) 1372 { 1373 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1374 string id = settings.Id; 1375 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(id)) 1376 { 1377 id = Guid.NewGuid().ToString("N"); 1378 } 1379 1380 if (!string.IsNullOrEmpty(id)) { attributes.Add("id", id); } 1381 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1382 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1383 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1384 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1385 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1386 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 1387 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1388 if (settings.Required) { attributes.Add("required", "true"); } 1389 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1390 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 1391 if (settings.Rows != 0) { attributes.Add("rows", settings.Rows.ToString()); } 1392 attributes.Add("name", settings.Name); 1393 1394 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1395 1396 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1397 @if (!string.IsNullOrEmpty(settings.Label)) 1398 { 1399 <label for="@id">@settings.Label</label> 1400 } 1401 @if (!string.IsNullOrEmpty(settings.HelpText)) 1402 { 1403 <small class="form__help-text">@settings.HelpText</small> 1404 } 1405 1406 <textarea class="u-full-width @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Value</textarea> 1407 1408 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1409 </div> 1410 } 1411 @using System.Reflection 1412 @using Dynamicweb.Rapido.Blocks.Components.General 1413 @using Dynamicweb.Rapido.Blocks.Components 1414 1415 1416 @* Component *@ 1417 1418 @helper RenderHiddenField(HiddenField settings) { 1419 var attributes = new Dictionary<string, string>(); 1420 attributes.Add("type", "hidden"); 1421 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1422 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1423 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1424 1425 <input @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 1426 } 1427 @using System.Reflection 1428 @using Dynamicweb.Rapido.Blocks.Components.General 1429 @using Dynamicweb.Rapido.Blocks.Components 1430 1431 @* Component *@ 1432 1433 @helper RenderCheckboxField(CheckboxField settings) 1434 { 1435 var attributes = new Dictionary<string, string>(); 1436 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1437 { 1438 settings.Id = Guid.NewGuid().ToString("N"); 1439 } 1440 1441 /*base settings*/ 1442 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1443 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1444 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1445 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1446 if (settings.Required) { attributes.Add("required", "true"); } 1447 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1448 /*end*/ 1449 1450 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1451 1452 attributes.Add("type", "checkbox"); 1453 if (settings.Checked) { attributes.Add("checked", "true"); } 1454 settings.CssClass = "form__control " + settings.CssClass; 1455 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1456 1457 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1458 1459 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1460 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1461 @if (!string.IsNullOrEmpty(settings.Label)) 1462 { 1463 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1464 } 1465 @if (!string.IsNullOrEmpty(settings.HelpText)) 1466 { 1467 <small class="form__help-text">@settings.HelpText</small> 1468 } 1469 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1470 </div> 1471 } 1472 @using System.Reflection 1473 @using Dynamicweb.Rapido.Blocks.Components.General 1474 @using Dynamicweb.Rapido.Blocks.Components 1475 1476 1477 @* Component *@ 1478 1479 @helper RenderCheckboxListField(CheckboxListField settings) 1480 { 1481 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1482 @if (!string.IsNullOrEmpty(settings.Label)) 1483 { 1484 <label>@settings.Label</label> 1485 } 1486 @if (!string.IsNullOrEmpty(settings.HelpText)) 1487 { 1488 <small class="form__help-text">@settings.HelpText</small> 1489 } 1490 1491 @foreach (var item in settings.Options) 1492 { 1493 if (settings.Required) 1494 { 1495 item.Required = true; 1496 } 1497 if (settings.Disabled) 1498 { 1499 item.Disabled = true; 1500 } 1501 if (!string.IsNullOrEmpty(settings.Name)) 1502 { 1503 item.Name = settings.Name; 1504 } 1505 if (!string.IsNullOrEmpty(settings.CssClass)) 1506 { 1507 item.CssClass += settings.CssClass; 1508 } 1509 1510 /* value is not supported */ 1511 1512 if (!string.IsNullOrEmpty(settings.OnClick)) 1513 { 1514 item.OnClick += settings.OnClick; 1515 } 1516 if (!string.IsNullOrEmpty(settings.OnChange)) 1517 { 1518 item.OnChange += settings.OnChange; 1519 } 1520 @Render(item) 1521 } 1522 1523 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1524 </div> 1525 } 1526 @using Dynamicweb.Rapido.Blocks.Components.General 1527 1528 @* Component *@ 1529 1530 @helper RenderSearch(Search settings) 1531 { 1532 var searchValue = HttpContext.Current.Request.QueryString.Get(settings.SearchParameter) ?? ""; 1533 var groupValue = HttpContext.Current.Request.QueryString.Get(settings.GroupsParameter) ?? ""; 1534 1535 if (string.IsNullOrEmpty(settings.Id)) 1536 { 1537 settings.Id = Guid.NewGuid().ToString("N"); 1538 } 1539 1540 var resultAttributes = new Dictionary<string, string>(); 1541 1542 if (settings.PageSize != 0) 1543 { 1544 resultAttributes.Add("data-page-size", settings.PageSize.ToString()); 1545 } 1546 if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1547 { 1548 resultAttributes.Add("data-groups-feed-url", settings.GroupItemsFeedUrl); 1549 if (!string.IsNullOrEmpty(groupValue)) 1550 { 1551 resultAttributes.Add("data-selected-group", groupValue); 1552 } 1553 if (!string.IsNullOrEmpty(settings.GroupsParameter)) 1554 { 1555 resultAttributes.Add("data-groups-parameter", settings.GroupsParameter); 1556 } 1557 } 1558 resultAttributes.Add("data-force-init", "true"); 1559 if (settings.GoToFirstSearchResultOnEnter) 1560 { 1561 resultAttributes.Add("data-go-to-first-search-result-on-enter", settings.GoToFirstSearchResultOnEnter.ToString().ToLower()); 1562 } 1563 if (!string.IsNullOrEmpty(settings.SearchParameter)) 1564 { 1565 resultAttributes.Add("data-search-parameter", settings.SearchParameter); 1566 } 1567 resultAttributes.Add("data-search-feed-url", settings.SearchData.SearchFeedUrl); 1568 resultAttributes.Add("data-results-template-id", settings.SearchData.ResultsTemplateId); 1569 1570 if (settings.SecondSearchData != null) 1571 { 1572 resultAttributes.Add("data-second-search-feed-url", settings.SecondSearchData.SearchFeedUrl); 1573 resultAttributes.Add("data-second-results-template-id", settings.SecondSearchData.ResultsTemplateId); 1574 } 1575 if (!string.IsNullOrEmpty(settings.ResultsPageUrl)) 1576 { 1577 resultAttributes.Add("data-results-page-url", settings.ResultsPageUrl); 1578 } 1579 1580 resultAttributes = resultAttributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1581 1582 string searchFieldCss = (settings.SearchButton == null) ? "search--with-icon" : ""; 1583 1584 <div class="search @settings.CssClass @searchFieldCss js-search-data-source dw-mod" id="@settings.Id" @ComponentMethods.AddAttributes(resultAttributes)> 1585 @if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1586 { 1587 <button type="button" class="search__groups-btn dw-mod js-search-groups-btn">@Translate("All")</button> 1588 <ul class="dropdown dropdown--absolute-position dw-mod search__groups-results js-search-groups-list"></ul> 1589 } 1590 1591 <input type="text" class="search__field dw-mod js-search-field" placeholder="@settings.Placeholder" value="@searchValue"> 1592 1593 <div class="dropdown dropdown--absolute-position search__results dw-mod js-search-results @(settings.SecondSearchData != null ? "search__results--combined" : "")"> 1594 @if (settings.SecondSearchData != null) 1595 { 1596 <div class="search__column search__column--products dw-mod"> 1597 <div class="search__column-header dw-mod">@Translate("Products")</div> 1598 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1599 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1600 { 1601 @Render(new Link { 1602 Title = Translate("View all"), 1603 CssClass = "js-view-all-button u-margin", 1604 Href = settings.SearchData.ResultsPageUrl 1605 }); 1606 } 1607 </div> 1608 <div class="search__column search__column--pages dw-mod"> 1609 <div class="search__column-header">@Translate("Pages")</div> 1610 <ul class="search__results-list dw-mod js-search-results-second-list" id="@(settings.Id)_SecondResultsList"></ul> 1611 @if (!string.IsNullOrEmpty(settings.SecondSearchData.ResultsPageUrl)) 1612 { 1613 @Render(new Link 1614 { 1615 Title = Translate("View all"), 1616 CssClass = "js-view-all-button u-margin", 1617 Href = settings.SecondSearchData.ResultsPageUrl 1618 }); 1619 } 1620 </div> 1621 } 1622 else 1623 { 1624 <div class="search__column search__column--only dw-mod"> 1625 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1626 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1627 { 1628 @Render(new Link { 1629 Title = Translate("View all"), 1630 CssClass = "js-view-all-button u-margin", 1631 Href = settings.SearchData.ResultsPageUrl 1632 }); 1633 } 1634 </div> 1635 } 1636 </div> 1637 1638 @if (settings.SearchButton != null) 1639 { 1640 settings.SearchButton.CssClass += " search__btn js-search-btn"; 1641 if (settings.RenderDefaultSearchIcon) 1642 { 1643 settings.SearchButton.Icon = new Icon { Name = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue }; 1644 } 1645 @Render(settings.SearchButton); 1646 } 1647 </div> 1648 } 1649 @using System.Reflection 1650 @using Dynamicweb.Rapido.Blocks.Components.General 1651 @using Dynamicweb.Rapido.Blocks.Components 1652 1653 1654 @* Component *@ 1655 1656 @helper RenderSelectField(SelectField settings) 1657 { 1658 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1659 { 1660 settings.Id = Guid.NewGuid().ToString("N"); 1661 } 1662 1663 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1664 @if (!string.IsNullOrEmpty(settings.Label)) 1665 { 1666 <label for="@settings.Id">@settings.Label</label> 1667 } 1668 @if (!string.IsNullOrEmpty(settings.HelpText)) 1669 { 1670 <small class="form__help-text">@settings.HelpText</small> 1671 } 1672 1673 @if (settings.ActionButton != null) 1674 { 1675 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1676 <div class="form__field-combi u-no-margin dw-mod"> 1677 @RenderSelectBase(settings) 1678 @Render(settings.ActionButton) 1679 </div> 1680 } 1681 else 1682 { 1683 @RenderSelectBase(settings) 1684 } 1685 1686 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1687 </div> 1688 } 1689 1690 @helper RenderSelectBase(SelectField settings) 1691 { 1692 var attributes = new Dictionary<string, string>(); 1693 1694 /*base settings*/ 1695 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1696 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1697 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1698 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1699 if (settings.Required) { attributes.Add("required", "true"); } 1700 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1701 /*end*/ 1702 1703 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1704 1705 <select @ComponentMethods.AddAttributes(resultAttributes) class="u-full-width @settings.CssClass dw-mod"> 1706 @if (settings.Default != null) 1707 { 1708 @Render(settings.Default) 1709 } 1710 1711 @foreach (var item in settings.Options) 1712 { 1713 if (settings.Value != null) { 1714 item.Checked = item.Value == settings.Value; 1715 } 1716 @Render(item) 1717 } 1718 </select> 1719 } 1720 @using System.Reflection 1721 @using Dynamicweb.Rapido.Blocks.Components.General 1722 @using Dynamicweb.Rapido.Blocks.Components 1723 1724 @* Component *@ 1725 1726 @helper RenderRadioButtonField(RadioButtonField settings) 1727 { 1728 var attributes = new Dictionary<string, string>(); 1729 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1730 { 1731 settings.Id = Guid.NewGuid().ToString("N"); 1732 } 1733 1734 /*base settings*/ 1735 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1736 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1737 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1738 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1739 if (settings.Required) { attributes.Add("required", "true"); } 1740 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1741 /*end*/ 1742 1743 attributes.Add("type", "radio"); 1744 if (settings.Checked) { attributes.Add("checked", "true"); } 1745 settings.CssClass = "form__control " + settings.CssClass; 1746 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1747 1748 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1749 1750 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1751 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1752 @if (!string.IsNullOrEmpty(settings.Label)) 1753 { 1754 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1755 } 1756 @if (!string.IsNullOrEmpty(settings.HelpText)) 1757 { 1758 <small class="form__help-text">@settings.HelpText</small> 1759 } 1760 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1761 </div> 1762 } 1763 @using System.Reflection 1764 @using Dynamicweb.Rapido.Blocks.Components.General 1765 @using Dynamicweb.Rapido.Blocks.Components 1766 1767 1768 @* Component *@ 1769 1770 @helper RenderRadioButtonListField(RadioButtonListField settings) 1771 { 1772 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1773 1774 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1775 @if (!string.IsNullOrEmpty(settings.Label)) 1776 { 1777 <label>@settings.Label</label> 1778 } 1779 @if (!string.IsNullOrEmpty(settings.HelpText)) 1780 { 1781 <small class="form__help-text">@settings.HelpText</small> 1782 } 1783 1784 @foreach (var item in settings.Options) 1785 { 1786 if (settings.Required) 1787 { 1788 item.Required = true; 1789 } 1790 if (settings.Disabled) 1791 { 1792 item.Disabled = true; 1793 } 1794 if (!string.IsNullOrEmpty(settings.Name)) 1795 { 1796 item.Name = settings.Name; 1797 } 1798 if (settings.Value != null && settings.Value == item.Value) 1799 { 1800 item.Checked = true; 1801 } 1802 if (!string.IsNullOrEmpty(settings.OnClick)) 1803 { 1804 item.OnClick += settings.OnClick; 1805 } 1806 if (!string.IsNullOrEmpty(settings.OnChange)) 1807 { 1808 item.OnChange += settings.OnChange; 1809 } 1810 if (!string.IsNullOrEmpty(settings.CssClass)) 1811 { 1812 item.CssClass += settings.CssClass; 1813 } 1814 @Render(item) 1815 } 1816 1817 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1818 </div> 1819 } 1820 @using System.Reflection 1821 @using Dynamicweb.Rapido.Blocks.Components.General 1822 @using Dynamicweb.Rapido.Blocks.Components 1823 1824 1825 @* Component *@ 1826 1827 @helper RenderNotificationMessage(NotificationMessage settings) 1828 { 1829 if (!string.IsNullOrEmpty(settings.Message)) 1830 { 1831 var attributes = new Dictionary<string, string>(); 1832 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1833 1834 string messageTypeClass = Enum.GetName(typeof(NotificationMessageType), settings.MessageType).ToLower(); 1835 <div class="field-@messageTypeClass @settings.CssClass u-full-width dw-mod" @ComponentMethods.AddAttributes(attributes)>@settings.Message</div> 1836 } 1837 } 1838 @using Dynamicweb.Rapido.Blocks.Components.General 1839 1840 1841 @* Component *@ 1842 1843 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1844 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1845 1846 <div class="@settings.CssClass dw-mod js-handlebars-root" id="@settings.Id" data-template="@settings.ScriptTemplate" data-json-feed="@settings.FeedUrl" data-init-onload="@settings.InitOnLoad.ToString()" data-preloader="@settings.Preloader" @preRender> 1847 @if (settings.SubBlocks != null) { 1848 @RenderBlockList(settings.SubBlocks) 1849 } 1850 </div> 1851 } 1852 @using System.Reflection 1853 @using Dynamicweb.Rapido.Blocks.Components.General 1854 @using Dynamicweb.Rapido.Blocks.Components 1855 @using System.Text.RegularExpressions 1856 1857 1858 @* Component *@ 1859 1860 @helper RenderSticker(Sticker settings) { 1861 if (!String.IsNullOrEmpty(settings.Title)) { 1862 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1863 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1864 1865 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1866 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1867 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1868 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1869 optionalAttributes.Add("style", styleTag); 1870 } 1871 1872 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1873 } 1874 } 1875 1876 @using System.Reflection 1877 @using Dynamicweb.Rapido.Blocks.Components.General 1878 @using Dynamicweb.Rapido.Blocks.Components 1879 1880 1881 @* Component *@ 1882 1883 @helper RenderStickersCollection(StickersCollection settings) 1884 { 1885 if (settings.Stickers.Count > 0) 1886 { 1887 string position = "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower(); 1888 1889 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1890 @foreach (Sticker sticker in settings.Stickers) 1891 { 1892 @Render(sticker) 1893 } 1894 </div> 1895 } 1896 } 1897 1898 @using Dynamicweb.Rapido.Blocks.Components.General 1899 1900 1901 @* Component *@ 1902 1903 @helper RenderForm(Form settings) { 1904 if (settings != null) 1905 { 1906 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 1907 if (!string.IsNullOrEmpty(settings.Action)) { optionalAttributes.Add("action", settings.Action); }; 1908 if (!string.IsNullOrEmpty(settings.Name)) { optionalAttributes.Add("name", settings.Name); }; 1909 if (!string.IsNullOrEmpty(settings.OnSubmit)) { optionalAttributes.Add("onsubmit", settings.OnSubmit); }; 1910 var enctypes = new Dictionary<string, string> 1911 { 1912 { "multipart", "multipart/form-data" }, 1913 { "text", "text/plain" }, 1914 { "application", "application/x-www-form-urlencoded" } 1915 }; 1916 if (settings.Enctype != FormEnctype.none) { optionalAttributes.Add("enctype", enctypes[Enum.GetName(typeof(FormEnctype), settings.Enctype).ToLower()]); }; 1917 optionalAttributes.Add("method", settings.Method.ToString()); 1918 1919 if (!string.IsNullOrEmpty(settings.FormStartMarkup)) 1920 { 1921 @settings.FormStartMarkup 1922 } 1923 else 1924 { 1925 @:<form class="@settings.CssClass u-no-margin dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1926 } 1927 1928 foreach (var field in settings.GetFields()) 1929 { 1930 @Render(field) 1931 } 1932 1933 @:</form> 1934 } 1935 } 1936 @using System.Reflection 1937 @using Dynamicweb.Rapido.Blocks.Components.General 1938 @using Dynamicweb.Rapido.Blocks.Components 1939 1940 1941 @* Component *@ 1942 1943 @helper RenderText(Text settings) 1944 { 1945 @settings.Content 1946 } 1947 @using System.Reflection 1948 @using Dynamicweb.Rapido.Blocks.Components.General 1949 @using Dynamicweb.Rapido.Blocks.Components 1950 1951 1952 @* Component *@ 1953 1954 @helper RenderContentModule(ContentModule settings) { 1955 if (!string.IsNullOrEmpty(settings.Content)) 1956 { 1957 @settings.Content 1958 } 1959 } 1960 @using System.Reflection 1961 @using Dynamicweb.Rapido.Blocks.Components.General 1962 @using Dynamicweb.Rapido.Blocks.Components 1963 1964 1965 @* Component *@ 1966 1967 @helper RenderModal(Modal settings) { 1968 if (settings != null) 1969 { 1970 string modalId = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 1971 1972 string onchange = !string.IsNullOrEmpty(settings.OnClose) ? "onchange=\"if(!this.checked){" + settings.OnClose + "}\"" : ""; 1973 1974 <input type="checkbox" id="@(modalId)ModalTrigger" class="modal-trigger" @onchange /> 1975 1976 <div class="modal-container"> 1977 @if (!settings.DisableDarkOverlay) 1978 { 1979 <label for="@(modalId)ModalTrigger" id="@(modalId)ModalOverlay" class="modal-overlay"></label> 1980 } 1981 <div class="modal modal--@settings.Width.ToString().ToLower() modal-height--@settings.Height.ToString().ToLower()" id="@(modalId)Modal"> 1982 @if (settings.Heading != null) 1983 { 1984 if (!string.IsNullOrEmpty(settings.Heading.Title)) 1985 { 1986 <div class="modal__header"> 1987 @Render(settings.Heading) 1988 </div> 1989 } 1990 } 1991 <div class="modal__body @(settings.Width.ToString().ToLower() == "full" ? "modal__body--full" : "")"> 1992 @if (!string.IsNullOrEmpty(settings.BodyText)) 1993 { 1994 @settings.BodyText 1995 } 1996 @if (settings.BodyTemplate != null) 1997 { 1998 @settings.BodyTemplate 1999 } 2000 @{ 2001 var actions = settings.GetActions(); 2002 } 2003 </div> 2004 @if (actions.Length > 0) 2005 { 2006 <div class="modal__footer"> 2007 @foreach (var action in actions) 2008 { 2009 if (Pageview.Device.ToString() != "Mobile") { 2010 action.CssClass += " u-no-margin"; 2011 } else { 2012 action.CssClass += " u-full-width u-margin-bottom"; 2013 } 2014 2015 @Render(action) 2016 } 2017 </div> 2018 } 2019 <label class="modal__close-btn js-modal-close-btn" for="@(modalId)ModalTrigger"></label> 2020 </div> 2021 </div> 2022 } 2023 } 2024 @using Dynamicweb.Rapido.Blocks.Components.General 2025 2026 @* Component *@ 2027 2028 @helper RenderMediaListItem(MediaListItem settings) 2029 { 2030 <div class="media-list-item @settings.CssClass dw-mod" @(!string.IsNullOrEmpty(settings.Id) ? "id=\"" + settings.Id + "\"" : "")> 2031 @if (!string.IsNullOrEmpty(settings.Label)) 2032 { 2033 if (!string.IsNullOrEmpty(settings.Link)) 2034 { 2035 @Render(new Link 2036 { 2037 Href = settings.Link, 2038 CssClass = "media-list-item__sticker dw-mod", 2039 ButtonLayout = ButtonLayout.None, 2040 Title = settings.Label, 2041 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 2042 }) 2043 } 2044 else if (!string.IsNullOrEmpty(settings.OnClick)) 2045 { 2046 <span class="media-list-item__sticker dw-mod" onclick="@(settings.OnClick)"> 2047 <span class="u-uppercase">@settings.Label</span> 2048 </span> 2049 } 2050 else 2051 { 2052 <span class="media-list-item__sticker media-list-item__sticker--no-link dw-mod"> 2053 <span class="u-uppercase">@settings.Label</span> 2054 </span> 2055 } 2056 } 2057 <div class="media-list-item__wrap"> 2058 <div class="media-list-item__info dw-mod"> 2059 <div class="media-list-item__header dw-mod"> 2060 @if (!string.IsNullOrEmpty(settings.Title)) 2061 { 2062 if (!string.IsNullOrEmpty(settings.Link)) 2063 { 2064 @Render(new Link 2065 { 2066 Href = settings.Link, 2067 CssClass = "media-list-item__name dw-mod", 2068 ButtonLayout = ButtonLayout.None, 2069 Title = settings.Title, 2070 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 2071 }) 2072 } 2073 else if (!string.IsNullOrEmpty(settings.OnClick)) 2074 { 2075 <span class="media-list-item__name dw-mod" onclick="@(settings.OnClick)">@settings.Title</span> 2076 } 2077 else 2078 { 2079 <span class="media-list-item__name media-list-item__name--no-link dw-mod">@settings.Title</span> 2080 } 2081 } 2082 2083 @if (!string.IsNullOrEmpty(settings.Status)) 2084 { 2085 <div class="media-list-item__state dw-mod">@settings.Status</div> 2086 } 2087 </div> 2088 @{ 2089 settings.InfoTable.CssClass += " media-list-item__parameters-table"; 2090 } 2091 2092 @Render(settings.InfoTable) 2093 </div> 2094 <div class="media-list-item__actions dw-mod"> 2095 <div class="media-list-item__actions-list dw-mod"> 2096 @{ 2097 var actions = settings.GetActions(); 2098 2099 foreach (ButtonBase action in actions) 2100 { 2101 action.ButtonLayout = ButtonLayout.None; 2102 action.CssClass += " media-list-item__action link"; 2103 2104 @Render(action) 2105 } 2106 } 2107 </div> 2108 2109 @if (settings.SelectButton != null && !string.IsNullOrEmpty(settings.SelectButton.Title)) 2110 { 2111 settings.SelectButton.CssClass += " u-no-margin"; 2112 2113 <div class="media-list-item__action-button"> 2114 @Render(settings.SelectButton) 2115 </div> 2116 } 2117 </div> 2118 </div> 2119 </div> 2120 } 2121 @using Dynamicweb.Rapido.Blocks.Components.General 2122 @using Dynamicweb.Rapido.Blocks.Components 2123 2124 @helper RenderTable(Table settings) 2125 { 2126 Dictionary<string, string> attributes = new Dictionary<string, string>(); 2127 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 2128 2129 var enumToClasses = new Dictionary<TableDesign, string> 2130 { 2131 { TableDesign.Clean, "table--clean" }, 2132 { TableDesign.Bordered, "table--bordered" }, 2133 { TableDesign.Striped, "table--striped" }, 2134 { TableDesign.Hover, "table--hover" }, 2135 { TableDesign.Compact, "table--compact" }, 2136 { TableDesign.Condensed, "table--condensed" }, 2137 { TableDesign.NoTopBorder, "table--no-top-border" } 2138 }; 2139 string tableDesignClass = ""; 2140 if (settings.Design != TableDesign.None) 2141 { 2142 tableDesignClass = enumToClasses[settings.Design]; 2143 } 2144 2145 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableDesign.None) { attributes.Add("class", "table " + tableDesignClass + " " + settings.CssClass + " dw-mod"); } 2146 2147 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2148 2149 <table @ComponentMethods.AddAttributes(resultAttributes)> 2150 @if (settings.Header != null) 2151 { 2152 <thead> 2153 @Render(settings.Header) 2154 </thead> 2155 } 2156 <tbody> 2157 @foreach (var row in settings.Rows) 2158 { 2159 @Render(row) 2160 } 2161 </tbody> 2162 @if (settings.Footer != null) 2163 { 2164 <tfoot> 2165 @Render(settings.Footer) 2166 </tfoot> 2167 } 2168 </table> 2169 } 2170 @using Dynamicweb.Rapido.Blocks.Components.General 2171 @using Dynamicweb.Rapido.Blocks.Components 2172 2173 @helper RenderTableRow(TableRow settings) 2174 { 2175 Dictionary<string, string> attributes = new Dictionary<string, string>(); 2176 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 2177 2178 var enumToClasses = new Dictionary<TableRowDesign, string> 2179 { 2180 { TableRowDesign.NoBorder, "table__row--no-border" }, 2181 { TableRowDesign.Border, "table__row--border" }, 2182 { TableRowDesign.TopBorder, "table__row--top-line" }, 2183 { TableRowDesign.BottomBorder, "table__row--bottom-line" }, 2184 { TableRowDesign.Solid, "table__row--solid" } 2185 }; 2186 2187 string tableRowDesignClass = ""; 2188 if (settings.Design != TableRowDesign.None) 2189 { 2190 tableRowDesignClass = enumToClasses[settings.Design]; 2191 } 2192 2193 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableRowDesign.None) { attributes.Add("class", "table__row " + tableRowDesignClass + " " + settings.CssClass + " dw-mod"); } 2194 2195 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2196 2197 <tr @ComponentMethods.AddAttributes(resultAttributes)> 2198 @foreach (var cell in settings.Cells) 2199 { 2200 if (settings.IsHeaderRow) 2201 { 2202 cell.IsHeader = true; 2203 } 2204 @Render(cell) 2205 } 2206 </tr> 2207 } 2208 @using Dynamicweb.Rapido.Blocks.Components.General 2209 @using Dynamicweb.Rapido.Blocks.Components 2210 @using Dynamicweb.Core 2211 2212 @helper RenderTableCell(TableCell settings) 2213 { 2214 Dictionary<string, string> attributes = new Dictionary<string, string>(); 2215 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 2216 if (settings.Colspan != 0) { attributes.Add("colspan", Converter.ToString(settings.Colspan)); } 2217 if (settings.Rowspan != 0) { attributes.Add("rowspan", Converter.ToString(settings.Rowspan)); } 2218 if (!string.IsNullOrEmpty(settings.CssClass)) { attributes.Add("class", settings.CssClass + " dw-mod"); } 2219 2220 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2221 2222 string tagName = settings.IsHeader ? "th" : "td"; 2223 2224 @("<" + tagName + " " + ComponentMethods.AddAttributes(resultAttributes) + ">") 2225 @settings.Content 2226 @("</" + tagName + ">"); 2227 } 2228 @using System.Linq 2229 @using Dynamicweb.Rapido.Blocks.Components.General 2230 2231 @* Component *@ 2232 2233 @helper RenderPagination(Dynamicweb.Rapido.Blocks.Components.General.Pagination settings) 2234 { 2235 var pageNumberQueryStringName = Dynamicweb.Rapido.Services.Pagination.GetPageNumberQueryStringName(settings); // Get the proper 'page number' query string parameter 2236 var queryParameters = Dynamicweb.Rapido.Services.Url.GetQueryParameters(pageNumberQueryStringName); // Get the NameValueCollection from the querystring 2237 2238 if (settings.NumberOfPages > 1) 2239 { 2240 string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/Default.aspx"; 2241 string ariaLabel = !string.IsNullOrWhiteSpace(settings.AriaLabel) ? settings.AriaLabel : Translate("Page navigation"); 2242 Dictionary<string, int> startAndEndPageNumber = Dynamicweb.Rapido.Services.Pagination.GetStartAndEndPageNumber(settings); 2243 2244 <div class="pager u-margin-top dw-mod @settings.CssClass" aria-label="@ariaLabel"> 2245 @if (settings.ShowPagingInfo) 2246 { 2247 <div class="pager__info dw-mod"> 2248 @Translate("Page") @settings.CurrentPageNumber @Translate("of") @settings.NumberOfPages 2249 </div> 2250 } 2251 <ul class="pager__list dw-mod"> 2252 @if (!string.IsNullOrWhiteSpace(settings.FirstPageUrl) && settings.ShowFirstAndLastControls) 2253 { 2254 @Render(new PaginationItem { Link = settings.FirstPageUrl, Icon = settings.FirstIcon }) 2255 } 2256 @if (!string.IsNullOrWhiteSpace(settings.PreviousPageUrl) && settings.ShowNextAndPrevControls) 2257 { 2258 @Render(new PaginationItem { Link = settings.PreviousPageUrl, Icon = settings.PrevIcon }) 2259 } 2260 @if (settings.GetPages().Any()) 2261 { 2262 foreach (var page in settings.GetPages()) 2263 { 2264 @Render(page) 2265 } 2266 } 2267 else 2268 { 2269 for (var page = startAndEndPageNumber["StartPage"]; page <= startAndEndPageNumber["EndPage"]; page++) 2270 { 2271 queryParameters = Dynamicweb.Rapido.Services.Url.UpdateQueryStringParameter(queryParameters, pageNumberQueryStringName, page.ToString()); 2272 @Render(new PaginationItem { Label = page.ToString(), Link = Dynamicweb.Rapido.Services.Url.BuildUri(url, queryParameters).PathAndQuery, IsActive = (settings.CurrentPageNumber == page) }); 2273 } 2274 } 2275 @if (!string.IsNullOrWhiteSpace(settings.NextPageUrl) && settings.ShowNextAndPrevControls) 2276 { 2277 @Render(new PaginationItem { Link = settings.NextPageUrl, Icon = settings.NextIcon }) 2278 } 2279 @if (!string.IsNullOrWhiteSpace(settings.LastPageUrl) && settings.ShowFirstAndLastControls) 2280 { 2281 @Render(new PaginationItem { Link = settings.LastPageUrl, Icon = settings.LastIcon }) 2282 } 2283 </ul> 2284 </div> 2285 } 2286 } 2287 2288 @helper RenderPaginationItem(PaginationItem settings) 2289 { 2290 if (settings.Icon == null) 2291 { 2292 settings.Icon = new Icon(); 2293 } 2294 2295 settings.Icon.Label = settings.Label; 2296 <li class="pager__btn dw-mod"> 2297 @if (settings.IsActive) 2298 { 2299 <span class="pager__num pager__num--current dw-mod"> 2300 @Render(settings.Icon) 2301 </span> 2302 } 2303 else 2304 { 2305 <a href="@settings.Link" class="pager__num dw-mod"> 2306 @Render(settings.Icon) 2307 </a> 2308 } 2309 </li> 2310 } 2311 2312 2313 @using Dynamicweb.Rapido.Blocks.Components.General 2314 @using Dynamicweb.Rapido.Blocks.Components.Ecommerce 2315 2316 2317 @using Dynamicweb.Frontend 2318 @using System.Reflection 2319 @using Dynamicweb.Content.Items 2320 @using System.Web.UI.HtmlControls 2321 @using Dynamicweb.Rapido.Blocks.Components 2322 @using Dynamicweb.Rapido.Blocks 2323 @using Dynamicweb.Rapido.Blocks.Components.Articles 2324 2325 @* Components for the articles *@ 2326 @using System.Reflection 2327 @using Dynamicweb.Rapido.Blocks.Components.Articles 2328 2329 2330 @* Component for the articles *@ 2331 2332 @helper RenderArticleBanner(dynamic settings) { 2333 string filterClasses = "image-filter image-filter--darken"; 2334 settings.Layout = ArticleHeaderLayout.Banner; 2335 2336 if (settings.Image != null) 2337 { 2338 if (settings.Image.Path != null) 2339 { 2340 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2341 <div class="background-image @filterClasses dw-mod"> 2342 <div class="background-image__wrapper @filterClasses dw-mod"> 2343 @{ 2344 settings.Image.CssClass += "background-image__cover dw-mod"; 2345 } 2346 @Render(settings.Image) 2347 </div> 2348 </div> 2349 <div class="center-container dw-mod"> 2350 <div class="grid"> 2351 <div class="grid__col-md-8 grid__col-xs-12 paragraph-container paragraph-container--height-lg"> 2352 <div class="u-left-middle"> 2353 <div> 2354 @if (!String.IsNullOrEmpty(settings.Heading)) 2355 { 2356 <h1 class="article__header article__header--giant dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 2357 } 2358 @if (!String.IsNullOrEmpty(settings.Subheading)) 2359 { 2360 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 2361 } 2362 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2363 { 2364 <small class="article__post-info u-margin-bottom--lg dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 2365 } 2366 @if (!String.IsNullOrEmpty(settings.Link)) { 2367 <div class="grid__cell"> 2368 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2369 </div> 2370 } 2371 </div> 2372 </div> 2373 </div> 2374 @if (settings.ExternalParagraphId != 0) 2375 { 2376 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod"> 2377 <div class="u-color-light-gray--bg u-color-dark dw-mod"> 2378 @RenderParagraphContent(settings.ExternalParagraphId) 2379 </div> 2380 </div> 2381 } 2382 2383 </div> 2384 </div> 2385 </section> 2386 if (!String.IsNullOrEmpty(settings.Image.Caption)) { 2387 <div class="image-caption dw-mod">@settings.Image.Caption</div> 2388 } 2389 } 2390 else 2391 { 2392 settings.Layout = ArticleHeaderLayout.Clean; 2393 @RenderArticleCleanHeader(settings); 2394 } 2395 } 2396 else 2397 { 2398 settings.Layout = ArticleHeaderLayout.Clean; 2399 @RenderArticleCleanHeader(settings); 2400 } 2401 } 2402 @using System.Reflection 2403 @using Dynamicweb.Rapido.Blocks.Components 2404 @using Dynamicweb.Rapido.Blocks.Components.General 2405 @using Dynamicweb.Rapido.Blocks.Components.Articles 2406 @using Dynamicweb.Rapido.Blocks 2407 2408 2409 @* Component for the articles *@ 2410 2411 @helper RenderArticleHeader(ArticleHeader settings) { 2412 dynamic[] methodParameters = new dynamic[1]; 2413 methodParameters[0] = settings; 2414 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleHeaderCustom"); 2415 2416 if (customMethod != null) 2417 { 2418 @customMethod.Invoke(this, methodParameters).ToString(); 2419 } else { 2420 switch (settings.Layout) 2421 { 2422 case ArticleHeaderLayout.Clean: 2423 @RenderArticleCleanHeader(settings); 2424 break; 2425 case ArticleHeaderLayout.Split: 2426 @RenderArticleSplitHeader(settings); 2427 break; 2428 case ArticleHeaderLayout.Banner: 2429 @RenderArticleBannerHeader(settings); 2430 break; 2431 case ArticleHeaderLayout.Overlay: 2432 @RenderArticleOverlayHeader(settings); 2433 break; 2434 default: 2435 @RenderArticleCleanHeader(settings); 2436 break; 2437 } 2438 } 2439 } 2440 2441 @helper RenderArticleCleanHeader(ArticleHeader settings) { 2442 dynamic[] methodParameters = new dynamic[1]; 2443 methodParameters[0] = settings; 2444 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleCleanHeaderCustom"); 2445 2446 if (customMethod != null) 2447 { 2448 @customMethod.Invoke(this, methodParameters).ToString(); 2449 } 2450 else 2451 { 2452 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2453 2454 <div class="grid grid--align-content-start grid--justify-start"> 2455 <div class="grid__col-md-@contentColumns grid__col-sm-12 u-padding--lg dw-mod"> 2456 @if (!String.IsNullOrEmpty(settings.Category) || !String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date) || settings.RatingOutOf != 0) 2457 { 2458 <div class="u-border-bottom u-padding-bottom"> 2459 @if (!String.IsNullOrEmpty(settings.Category)) 2460 { 2461 <div class="u-pull--left"> 2462 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 2463 </div> 2464 } 2465 <div class="u-pull--right"> 2466 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2467 { 2468 <small class="article__post-info dw-mod">@settings.Author @settings.Date</small> 2469 } 2470 @if (settings.RatingOutOf != 0) 2471 { 2472 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2473 } 2474 </div> 2475 </div> 2476 } 2477 2478 <div class="grid__cell"> 2479 @if (!String.IsNullOrEmpty(settings.Heading)) 2480 { 2481 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 2482 } 2483 @if (settings.Image != null) 2484 { 2485 if (settings.Image.Path != null) 2486 { 2487 <div class="u-padding-bottom--lg"> 2488 @Render(settings.Image) 2489 </div> 2490 } 2491 } 2492 @if (!String.IsNullOrEmpty(settings.Subheading)) 2493 { 2494 <div class="article__leadtext dw-mod">@settings.Subheading</div> 2495 } 2496 @if (!String.IsNullOrEmpty(settings.Link)) 2497 { 2498 <div class="grid__cell"> 2499 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2500 </div> 2501 } 2502 </div> 2503 </div> 2504 @if (settings.ExternalParagraphId != 0) 2505 { 2506 <div class="grid__col-md-4 grid__col-sm-12 u-padding--lg u-color-light-gray--bg dw-mod"> 2507 @RenderParagraphContent(settings.ExternalParagraphId) 2508 </div> 2509 } 2510 </div> 2511 } 2512 } 2513 2514 @helper RenderArticleSplitHeader(ArticleHeader settings) { 2515 dynamic[] methodParameters = new dynamic[1]; 2516 methodParameters[0] = settings; 2517 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSplitHeaderCustom"); 2518 2519 if (customMethod != null) 2520 { 2521 @customMethod.Invoke(this, methodParameters).ToString(); 2522 } 2523 else 2524 { 2525 string headerColumnWidth = settings.ExternalParagraphId != 0 ? "4" : "6"; 2526 2527 if (settings.Image != null) 2528 { 2529 if (settings.Image.Path != null) 2530 { 2531 <section class="multiple-paragraphs-container paragraph-container--full-width"> 2532 <div class="grid"> 2533 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-xl dw-mod"> 2534 <div class="u-left-middle u-padding--lg"> 2535 <div> 2536 @if (!String.IsNullOrEmpty(settings.Category)) 2537 { 2538 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 2539 } 2540 @if (!String.IsNullOrEmpty(settings.Heading)) 2541 { 2542 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 2543 } 2544 @if (!String.IsNullOrEmpty(settings.Subheading)) 2545 { 2546 <div class="article__leadtext dw-mod">@settings.Subheading</div> 2547 } 2548 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2549 { 2550 <small class="article__post-info u-pull--left dw-mod">@settings.Author @settings.Date</small> 2551 } 2552 @if (settings.RatingOutOf != 0) 2553 { 2554 <div class="u-pull--right"> 2555 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2556 </div> 2557 } 2558 @if (!String.IsNullOrEmpty(settings.Link)) { 2559 <div class="u-full-width u-pull--left u-margin-top"> 2560 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2561 </div> 2562 } 2563 </div> 2564 </div> 2565 </div> 2566 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod" style="background-image:url(/Admin/Public/GetImage.ashx?width=1800&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=@settings.Image.Path); background-position: center center; background-size: cover;"></div> 2567 @if (settings.ExternalParagraphId != 0) 2568 { 2569 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto u-color-light-gray--bg dw-mod"> 2570 @RenderParagraphContent(settings.ExternalParagraphId) 2571 </div> 2572 } 2573 </div> 2574 </section> 2575 } 2576 } 2577 else 2578 { 2579 @RenderArticleCleanHeader(settings); 2580 } 2581 } 2582 } 2583 2584 @helper RenderArticleOverlayHeader(ArticleHeader settings) { 2585 dynamic[] methodParameters = new dynamic[1]; 2586 methodParameters[0] = settings; 2587 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleOverlayHeaderCustom"); 2588 2589 if (customMethod != null) 2590 { 2591 @customMethod.Invoke(this, methodParameters).ToString(); 2592 } 2593 else 2594 { 2595 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2596 string contentAlignment = settings.TextLayout == ArticleHeaderTextLayout.Center ? "grid--justify-center" : ""; 2597 2598 if (settings.Image != null) 2599 { 2600 if (settings.Image.Path != null) 2601 { 2602 if (settings.ExternalParagraphId == 0) 2603 { 2604 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2605 <div class="background-image image-filter image-filter--darken dw-mod"> 2606 <div class="background-image__wrapper image-filter image-filter--darken dw-mod"> 2607 @{ 2608 settings.Image.CssClass += "background-image__cover dw-mod"; 2609 } 2610 @Render(settings.Image) 2611 </div> 2612 </div> 2613 <div class="center-container dw-mod"> 2614 <div class="grid @contentAlignment"> 2615 <div class="grid__col-md-@contentColumns grid__col-xs-12 paragraph-container paragraph-container--height-xl u-no-padding dw-mod"> 2616 @if (!String.IsNullOrEmpty(settings.Heading)) 2617 { 2618 <h1 class="article__header article__header--giant u-padding-top--lg dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 2619 } 2620 @if (!String.IsNullOrEmpty(settings.Subheading)) 2621 { 2622 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 2623 } 2624 <div class="u-margin-top"> 2625 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2626 { 2627 <small class="article__post-info u-pull--left dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 2628 } 2629 @if (settings.RatingOutOf != 0) 2630 { 2631 <div class="u-pull--right"> 2632 @Render(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2633 </div> 2634 } 2635 </div> 2636 @if (!String.IsNullOrEmpty(settings.Link)) 2637 { 2638 <div class="grid__cell"> 2639 @Render(new Link { Href = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2640 </div> 2641 } 2642 </div> 2643 </div> 2644 </div> 2645 </section> 2646 } 2647 else 2648 { 2649 @RenderArticleBanner(settings); 2650 } 2651 } 2652 } 2653 else 2654 { 2655 @RenderArticleCleanHeader(settings); 2656 } 2657 } 2658 } 2659 2660 @helper RenderArticleBannerHeader(dynamic settings) { 2661 dynamic[] methodParameters = new dynamic[1]; 2662 methodParameters[0] = settings; 2663 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerHeaderCustom"); 2664 2665 if (customMethod != null) 2666 { 2667 @customMethod.Invoke(this, methodParameters).ToString(); 2668 } 2669 else 2670 { 2671 @RenderArticleBanner(settings); 2672 } 2673 } 2674 @using System.Reflection 2675 @using System.Text.RegularExpressions; 2676 @using Dynamicweb.Frontend 2677 @using Dynamicweb.Content.Items 2678 @using Dynamicweb.Rapido.Blocks.Components 2679 @using Dynamicweb.Rapido.Blocks.Components.Articles 2680 @using Dynamicweb.Rapido.Blocks 2681 2682 @using Dynamicweb.Content.Items; 2683 @using Dynamicweb.Core 2684 2685 @functions { 2686 public class Author 2687 { 2688 public string Name; 2689 public string Image; 2690 public string Description; 2691 public string Date; 2692 } 2693 2694 public Author GetAuthor(Item item = null) 2695 { 2696 var author = new Author(); 2697 2698 var pageView = Dynamicweb.Frontend.PageView.Current(); 2699 var currPageItem = Dynamicweb.Services.Pages.GetPage(pageView.ID)?.Item; 2700 2701 if (currPageItem == null) return null; 2702 2703 var authorItem = item ?? Item.GetItemById("AuthorItem", Converter.ToString(currPageItem["SpAuthor"])); 2704 2705 if (authorItem == null || authorItem["Author"] == null) return null; 2706 2707 var authorUrl = Converter.ToString(authorItem["Author"]); 2708 var authorDate = Converter.ToDateTime(authorItem["Date"]); 2709 2710 if (string.IsNullOrWhiteSpace(authorUrl)) return null; 2711 2712 var authorPageId = authorUrl.Contains("=") ? Converter.ToInt32(authorUrl.Substring(authorUrl.LastIndexOf('=') + 1)) : Converter.ToInt32(authorUrl); 2713 var authorPage = Dynamicweb.Services.Pages.GetPage(authorPageId); 2714 2715 if (authorPage == null) return null; 2716 2717 var imgPrefix = "/Admin/Public/GetImage.ashx?width=200&height=200&Compression=99&Quality=99&Format=Webp&Crop=5&image="; 2718 2719 author.Name = authorPage.GetDisplayName(); 2720 author.Image = imgPrefix + Converter.ToString(authorPage.Item["Image"]); 2721 author.Description = Converter.ToString(authorPage.Item["Description"]); 2722 2723 if (string.IsNullOrWhiteSpace(Converter.ToString(authorItem["Date"]))) return author; 2724 2725 var month = pageView.Area.CultureInfo.DateTimeFormat.GetMonthName(authorDate.Month); 2726 author.Date = $"{authorDate.Day}. {month} {authorDate.Year}"; 2727 2728 return author; 2729 } 2730 } 2731 2732 @* Component for the articles *@ 2733 2734 @helper RenderArticleBodyRow(ArticleBodyRow settings) 2735 { 2736 string position = settings.TopLayout == "overlay" ? "article__overlay-offset" : ""; 2737 string contentAlignment = settings.TextLayout == "center" ? "grid--justify-center" : ""; 2738 var author = GetAuthor(); 2739 2740 if (author != null) 2741 { 2742 <div class="author-container"> 2743 <div class="author"> 2744 <p class="author-desc">@author.Description</p> 2745 <div class="author-wrapper"> 2746 <img src="@author.Image" class="author-img" alt="@HttpUtility.HtmlAttributeEncode(author.Name)" /> 2747 <div class="author-info"> 2748 <span class="author-name">@author.Name</span> 2749 <span class="author-divider @(string.IsNullOrWhiteSpace(author.Date) ? "u-hidden" : "")">|</span> 2750 <span class="author-date">@author.Date</span> 2751 </div> 2752 </div> 2753 </div> 2754 </div> 2755 } 2756 2757 <div class="grid grid--align-content-start @contentAlignment @position dw-mod"> 2758 @RenderBlockList(settings.SubBlocks) 2759 </div> 2760 } 2761 @using System.Reflection 2762 @using Dynamicweb.Rapido.Blocks.Components 2763 @using Dynamicweb.Rapido.Blocks.Components.General 2764 @using Dynamicweb.Rapido.Blocks.Components.Articles 2765 @using Dynamicweb.Rapido.Blocks 2766 2767 @* Component for the articles *@ 2768 2769 @helper RenderArticleImage(ArticleImage settings) 2770 { 2771 if (settings.Image != null) 2772 { 2773 if (settings.Image.Path != null) 2774 { 2775 <div class="u-margin-bottom--lg"> 2776 @Render(settings.Image) 2777 </div> 2778 } 2779 } 2780 } 2781 @using System.Reflection 2782 @using Dynamicweb.Rapido.Blocks.Components 2783 @using Dynamicweb.Rapido.Blocks.Components.Articles 2784 2785 2786 @* Component for the articles *@ 2787 2788 @helper RenderArticleSubHeader(ArticleSubHeader settings) 2789 { 2790 if (!String.IsNullOrEmpty(settings.Title)) 2791 { 2792 <h2 class="article__header">@settings.Title</h2> 2793 } 2794 } 2795 @using System.Reflection 2796 @using Dynamicweb.Rapido.Blocks.Components 2797 @using Dynamicweb.Rapido.Blocks.Components.Articles 2798 @using Dynamicweb.Rapido.Blocks 2799 2800 2801 @* Component for the articles *@ 2802 2803 @helper RenderArticleText(ArticleText settings) 2804 { 2805 if (!String.IsNullOrEmpty(settings.Text)) 2806 { 2807 string greatTextClass = settings.EnableLargeText == true ? "article__paragraph--great-text" : ""; 2808 2809 <div class="article__paragraph @greatTextClass"> 2810 @settings.Text 2811 </div> 2812 } 2813 } 2814 @using System.Reflection 2815 @using Dynamicweb.Rapido.Blocks.Components 2816 @using Dynamicweb.Rapido.Blocks.Components.Articles 2817 @using Dynamicweb.Rapido.Blocks 2818 2819 2820 @* Component for the articles *@ 2821 2822 @helper RenderArticleQuote(ArticleQuote settings) 2823 { 2824 string text = Regex.Replace(settings.Text, "<.*?>", String.Empty); 2825 2826 <div class="grid u-padding-bottom--lg"> 2827 @if (settings.Image != null) 2828 { 2829 if (settings.Image.Path != null) { 2830 <div class="grid__col-3"> 2831 <div class="grid__cell-img"> 2832 @{ 2833 settings.Image.Title = !String.IsNullOrEmpty(settings.Image.Title) ? settings.Image.Title : settings.Author; 2834 settings.Image.CssClass += " article__image article__image--ball"; 2835 settings.Image.ImageDefault.Width = 200; 2836 settings.Image.ImageDefault.Height = 200; 2837 } 2838 @Render(settings.Image) 2839 </div> 2840 </div> 2841 } 2842 } 2843 <div class="grid__col-auto"> 2844 @if (!String.IsNullOrEmpty(settings.Text)) 2845 { 2846 <div class="article__quote dw-mod"> 2847 <i class="fas fa-quote-right u-margin-bottom--lg"></i> 2848 @settings.Text 2849 <i class="fas fa-quote-right"></i> 2850 </div> 2851 } 2852 @if (!String.IsNullOrEmpty(settings.Author)) 2853 { 2854 <div class="article__quote-author dw-mod"> 2855 - @settings.Author 2856 </div> 2857 } 2858 </div> 2859 </div> 2860 } 2861 @using System.Reflection 2862 @using Dynamicweb.Rapido.Blocks.Components 2863 @using Dynamicweb.Rapido.Blocks.Components.Articles 2864 @using Dynamicweb.Rapido.Blocks 2865 2866 @* Component for the articles *@ 2867 2868 @helper RenderArticleInfoTable(ArticleInfoTable settings) 2869 { 2870 <table class="table table--clean"> 2871 @foreach (var row in settings.Rows) 2872 { 2873 string iconColor = row.IconColor != null ? row.IconColor : "u-brand-color-two"; 2874 2875 <tr> 2876 @if (!String.IsNullOrEmpty(row.Icon)) 2877 { 2878 <td class="u-w32px"><i class="@row.Icon fa-2x @row.IconColor"></i></td> 2879 } 2880 <td class="u-no-margin-on-p-elements"> 2881 <div class="u-bold">@row.Title</div> 2882 @if (!String.IsNullOrEmpty(row.SubTitle)) 2883 { 2884 if (row.Link == null) 2885 { 2886 <div>@row.SubTitle</div> 2887 } 2888 else 2889 { 2890 <a href="@row.Link" class="u-color-inherit">@row.SubTitle</a> 2891 } 2892 } 2893 </td> 2894 </tr> 2895 } 2896 </table> 2897 } 2898 @using System.Reflection 2899 @using Dynamicweb.Rapido.Blocks.Components 2900 @using Dynamicweb.Rapido.Blocks.Components.General 2901 @using Dynamicweb.Rapido.Blocks.Components.Articles 2902 @using Dynamicweb.Rapido.Blocks 2903 2904 @* Component for the articles *@ 2905 2906 @helper RenderArticleGalleryModal(ArticleGalleryModal settings) 2907 { 2908 Modal galleryModal = new Modal 2909 { 2910 Id = "ParagraphGallery", 2911 Width = ModalWidth.Full, 2912 BodyTemplate = RenderArticleGalleryModalContent() 2913 }; 2914 2915 @Render(galleryModal) 2916 } 2917 2918 @helper RenderArticleGalleryModalContent() { 2919 <div class="modal__image-min-size-wrapper"> 2920 @Render(new Image { 2921 Id = "ParagraphGallery", 2922 Path = "#", 2923 CssClass = "modal--full__img", 2924 DisableLazyLoad = true, 2925 DisableImageEngine = true 2926 }) 2927 </div> 2928 2929 <div class="modal__images-counter" id="ParagraphGallery_counter"></div> 2930 2931 @Render(new Button { 2932 Id = "ParagraphGallery_prev", 2933 ButtonType = ButtonType.Button, 2934 ButtonLayout = ButtonLayout.None, 2935 CssClass = "modal__prev-btn", 2936 Icon = new Icon { Prefix = "far", Name = "fa-angle-left", LabelPosition = IconLabelPosition.After }, 2937 OnClick = "Gallery.prevImage('ParagraphGallery')" 2938 }) 2939 2940 @Render(new Button { 2941 Id = "ParagraphGallery_next", 2942 ButtonType = ButtonType.Button, 2943 ButtonLayout = ButtonLayout.None, 2944 CssClass = "modal__next-btn", 2945 Icon = new Icon { Prefix = "far", Name = "fa-angle-right", LabelPosition = IconLabelPosition.After }, 2946 OnClick = "Gallery.nextImage('ParagraphGallery')" 2947 }) 2948 } 2949 @using System.Reflection 2950 @using Dynamicweb.Rapido.Blocks.Components 2951 @using Dynamicweb.Rapido.Blocks.Components.Articles 2952 @using Dynamicweb.Rapido.Blocks 2953 2954 2955 @* Component for the articles *@ 2956 2957 @helper RenderArticleRelated(ArticleRelated settings) 2958 { 2959 string cardClass = Pageview.Device.ToString() != "Tablet" ? "card u-color-light--bg u-full-height" : ""; 2960 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "card-footer u-color-light--bg" : ""; 2961 2962 <section class="multiple-paragraphs-container u-color-light-gray--bg paragraph-container--full-width"> 2963 <div class="center-container dw-mod"> 2964 <div class="grid u-padding"> 2965 <div class="grid__col-md-12 grid__col-xs-12"> 2966 <h2 class="article__header u-no-margin u-margin-top">@settings.Title</h2> 2967 </div> 2968 </div> 2969 2970 <div class="js-handlebars-root u-padding" id="@settings.Title.Replace(" ", String.Empty)" data-template="RelatedSimpleTemplate" data-json-feed="/Default.aspx?ID=@settings.FeedPageId&@settings.Query&ExcludeItemID=@settings.CurrentPageId&PageSize=@settings.PageSize"></div> 2971 2972 <script id="RelatedSimpleTemplate" type="text/x-template"> 2973 {{#.}} 2974 <div class="grid u-padding-bottom--lg"> 2975 {{#Cases}} 2976 <div class="grid__col-lg-3 grid__col-sm-6 image-hover--zoom dw-mod"> 2977 <a href="{{link}}" class="u-full-height u-color-light--bg"> 2978 {{#if image}} 2979 <div class="u-color-light--bg u-no-padding dw-mod"> 2980 <div class="flex-img image-hover__wrapper"> 2981 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image={{image}}" alt="{{title}}" /> 2982 </div> 2983 </div> 2984 {{/if}} 2985 2986 <div class="card u-color-light--bg dw-mod"> 2987 <h3 class="article-list__item-header u-truncate-text dw-mod">{{title}}</h3> 2988 <p class="article__short-summary dw-mod">{{summary}}</p> 2989 </div> 2990 </a> 2991 </div> 2992 {{/Cases}} 2993 </div> 2994 {{/.}} 2995 </script> 2996 </div> 2997 </section> 2998 } 2999 @using System.Reflection 3000 @using Dynamicweb.Rapido.Blocks.Components 3001 @using Dynamicweb.Rapido.Blocks.Components.Articles 3002 @using Dynamicweb.Rapido.Blocks 3003 3004 3005 @* Component for the articles *@ 3006 3007 @helper RenderArticleMenu(ArticleMenu settings) 3008 { 3009 if (!String.IsNullOrEmpty(settings.Title)) { 3010 <div class="u-margin u-border-bottom"> 3011 <h3 class="u-no-margin">@settings.Title</h3> 3012 </div> 3013 } 3014 3015 <ul class="menu-left u-margin-bottom dw-mod"> 3016 @foreach (var item in settings.Items) 3017 { 3018 @Render(item) 3019 } 3020 </ul> 3021 } 3022 3023 @helper RenderArticleMenuItem(ArticleMenuItem settings) 3024 { 3025 string link = !String.IsNullOrEmpty(settings.Link) ? settings.Link : "#"; 3026 3027 if (!String.IsNullOrEmpty(settings.Title)) { 3028 <li class="menu-left__item dw-mod"> 3029 <a href="@link" onclick="@settings.OnClick" class="menu-left__link dw-mod">@settings.Title</a> 3030 </li> 3031 } 3032 } 3033 @using System.Reflection 3034 @using Dynamicweb.Rapido.Blocks.Components 3035 @using Dynamicweb.Rapido.Blocks.Components.Articles 3036 @using Dynamicweb.Rapido.Blocks 3037 3038 @* Component for the articles *@ 3039 3040 @helper RenderArticleList(ArticleList settings) 3041 { 3042 if (Pageview != null) 3043 { 3044 bool isParagraph = Pageview.CurrentParagraph != null ? true : false; 3045 string[] sortArticlesListBy = new string[2]; 3046 3047 if (isParagraph) { 3048 sortArticlesListBy = Pageview.CurrentParagraph.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString()) ? Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 3049 } 3050 else { 3051 sortArticlesListBy = Pageview.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.Item["SortArticlesListBy"].ToString()) ? Pageview.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 3052 } 3053 3054 string sourcePage = settings.SourcePage != null ? settings.SourcePage : Pageview.ID.ToString(); 3055 3056 if (!settings.DisablePagination) { 3057 @RenderItemList(new 3058 { 3059 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 3060 ListSourceType = settings.SourceType, 3061 ListSourcePage = sourcePage, 3062 ItemFieldsList = "*", 3063 Filter = settings.Filter, 3064 ListOrderBy = sortArticlesListBy[0], 3065 ListOrderByDirection = sortArticlesListBy[1], 3066 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 3067 ListSecondOrderByDirection = "ASC", 3068 IncludeAllChildItems = true, 3069 ListTemplate = settings.Template, 3070 ListPageSize = settings.PageSize.ToString() 3071 }); 3072 } else { 3073 @RenderItemList(new 3074 { 3075 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 3076 ListSourceType = settings.SourceType, 3077 ListSourcePage = sourcePage, 3078 ItemFieldsList = "*", 3079 Filter = settings.Filter, 3080 ListOrderBy = sortArticlesListBy[0], 3081 ListOrderByDirection = sortArticlesListBy[1], 3082 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 3083 ListSecondOrderByDirection = "ASC", 3084 IncludeAllChildItems = true, 3085 ListTemplate = settings.Template, 3086 ListPageSize = settings.PageSize.ToString(), 3087 ListViewMode = "Partial", 3088 ListShowTo = settings.PageSize + 1 3089 }); 3090 } 3091 } 3092 } 3093 @using System.Reflection 3094 @using Dynamicweb.Rapido.Blocks.Components.Articles 3095 3096 3097 @* Component for the articles *@ 3098 3099 @helper RenderArticleSummary(ArticleSummary settings) 3100 { 3101 if (!String.IsNullOrEmpty(settings.Text)) 3102 { 3103 <div class="article__summary dw-mod">@settings.Text</div> 3104 } 3105 } 3106 @using System.Reflection 3107 @using Dynamicweb.Rapido.Blocks.Components 3108 @using Dynamicweb.Rapido.Blocks.Components.Articles 3109 @using Dynamicweb.Rapido.Blocks 3110 3111 @* Component for the articles *@ 3112 3113 @helper RenderArticleListCategoryFilter(ArticleListCategoryFilter settings) 3114 { 3115 string pageId = Pageview.ID.ToString(); 3116 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("sourcePage")) ? HttpContext.Current.Request.QueryString.Get("sourcePage") : Translate("All"); 3117 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 3118 3119 foreach (var option in settings.Categories) 3120 { 3121 selectedFilter = selectedFilter == option.Value ? option.Key : selectedFilter; 3122 } 3123 3124 if (selectedFilter == pageId) 3125 { 3126 selectedFilter = Translate("All"); 3127 } 3128 3129 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3130 { 3131 <div class="u-pull--right u-margin-left"> 3132 <div class="collection u-no-margin"> 3133 <h5>@Translate("Category")</h5> 3134 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 3135 <div class="dropdown u-w180px dw-mod"> 3136 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 3137 <div class="dropdown__content dw-mod"> 3138 @foreach (var option in settings.Categories) 3139 { 3140 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 3141 } 3142 </div> 3143 <label class="dropdown-trigger-off" for="CategorySelector"></label> 3144 </div> 3145 </div> 3146 </div> 3147 } 3148 else 3149 { 3150 <div class="u-full-width u-margin-bottom"> 3151 <h5 class="u-no-margin">@Translate("Category")</h5> 3152 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 3153 <div class="dropdown u-full-width dw-mod"> 3154 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 3155 <div class="dropdown__content dw-mod"> 3156 @foreach (var option in settings.Categories) 3157 { 3158 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 3159 } 3160 </div> 3161 <label class="dropdown-trigger-off" for="CategorySelector"></label> 3162 </div> 3163 </div> 3164 } 3165 } 3166 @using System.Reflection 3167 @using Dynamicweb.Rapido.Blocks.Components 3168 @using Dynamicweb.Rapido.Blocks.Components.Articles 3169 @using Dynamicweb.Rapido.Blocks 3170 @using System.Collections.Generic 3171 3172 @* Component for the articles *@ 3173 3174 @helper RenderArticleListFilter(ArticleListFilter settings) 3175 { 3176 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get(settings.SystemName)) ? HttpContext.Current.Request.QueryString.Get(settings.SystemName) : Translate("All"); 3177 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 3178 3179 if (settings.Options != null) 3180 { 3181 if (settings.Options is IEnumerable<dynamic>) 3182 { 3183 var options = (IEnumerable<dynamic>) settings.Options; 3184 settings.Options = options.OrderBy(item => item.Name); 3185 } 3186 3187 foreach (var option in settings.Options) 3188 { 3189 selectedFilter = selectedFilter == option.Value ? option.Name : selectedFilter; 3190 } 3191 3192 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3193 { 3194 <div class="u-pull--right u-margin-left"> 3195 <div class="collection u-no-margin"> 3196 <h5>@settings.Label</h5> 3197 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 3198 <div class="dropdown u-w180px dw-mod"> 3199 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 3200 <div class="dropdown__content dw-mod"> 3201 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 3202 @foreach (var option in settings.Options) 3203 { 3204 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 3205 } 3206 </div> 3207 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 3208 </div> 3209 </div> 3210 </div> 3211 } 3212 else 3213 { 3214 <div class="u-full-width u-margin-bottom"> 3215 <h5 class="u-no-margin">@settings.Label</h5> 3216 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 3217 <div class="dropdown u-full-width w-mod"> 3218 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 3219 <div class="dropdown__content dw-mod"> 3220 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 3221 @foreach (var option in settings.Options) 3222 { 3223 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 3224 } 3225 </div> 3226 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 3227 </div> 3228 </div> 3229 } 3230 } 3231 } 3232 @using System.Reflection 3233 @using Dynamicweb.Rapido.Blocks.Components 3234 @using Dynamicweb.Rapido.Blocks.Components.Articles 3235 @using Dynamicweb.Rapido.Blocks 3236 3237 @* Component for the articles *@ 3238 3239 @helper RenderArticleListSearch(ArticleListSearch settings) 3240 { 3241 string searchParameter = !string.IsNullOrEmpty(settings.SearchParameter) ? settings.SearchParameter : "Title"; 3242 string searchWord = HttpContext.Current.Request.QueryString.Get(searchParameter); 3243 string searchString = !string.IsNullOrEmpty(searchWord) ? searchWord.Trim('*') : ""; 3244 string className = "u-w340px u-pull--right u-margin-left"; 3245 3246 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 3247 { 3248 className = "u-full-width"; 3249 } 3250 3251 <div class="typeahead u-color-inherit u-margin-bottom dw-mod @className"> 3252 <input type="text" class="typeahead-search-field u-no-margin dw-mod" placeholder="@Translate("Search in list")" value="@searchString" id="ArticleListSearchInput" onchange="QueryArray.setParameterInCurrentURL('@searchParameter', '*' + document.getElementById('ArticleListSearchInput').value + '*')"> 3253 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod"><i class="fas fa-search"></i></button> 3254 </div> 3255 } 3256 @using System.Reflection 3257 @using Dynamicweb.Rapido.Blocks.Components 3258 @using Dynamicweb.Rapido.Blocks.Components.Articles 3259 @using Dynamicweb.Rapido.Blocks 3260 3261 @* Component for the articles *@ 3262 3263 @helper RenderArticleListNoResultsInfo(ArticleListNoResultsInfo settings) 3264 { 3265 <div class="u-margin-top--lg u-bold u-ta-center u-bold">@Translate(settings.Message)</div> 3266 } 3267 @using System.Reflection 3268 @using Dynamicweb.Rapido.Blocks.Components 3269 @using Dynamicweb.Rapido.Blocks.Components.General 3270 @using Dynamicweb.Rapido.Blocks.Components.Articles 3271 @using Dynamicweb.Rapido.Blocks 3272 @using System.Text.RegularExpressions 3273 3274 @* Component for the articles *@ 3275 3276 @helper RenderArticleListItem(ArticleListItem settings) 3277 { 3278 switch (settings.Type) { 3279 case ArticleListItemType.Card: 3280 @RenderArticleListItemCard(settings); 3281 break; 3282 case ArticleListItemType.List: 3283 @RenderArticleListItemList(settings); 3284 break; 3285 case ArticleListItemType.Simple: 3286 @RenderArticleListItemSimple(settings); 3287 break; 3288 default: 3289 @RenderArticleListItemCard(settings); 3290 break; 3291 } 3292 } 3293 3294 @helper RenderArticleListItemCard(ArticleListItem settings) { 3295 <a href="@settings.Link" class="u-full-height u-color-light--bg"> 3296 <div class="u-color-light--bg u-no-padding dw-mod"> 3297 @if (settings.Logo != null) 3298 { 3299 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 3300 settings.Logo.ImageDefault.Crop = 5; 3301 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 3302 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 3303 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 3304 @if (settings.Stickers != null) 3305 { 3306 if (settings.Stickers.Position != StickersListPosition.Custom) 3307 { 3308 @Render(settings.Stickers); 3309 } 3310 } 3311 @RenderImage(settings.Logo) 3312 </div> 3313 } else if (settings.Image != null) 3314 { 3315 <div class="flex-img image-hover__wrapper u-position-relative dw-mod"> 3316 @if (settings.Stickers != null) 3317 { 3318 if (settings.Stickers.Position != StickersListPosition.Custom) 3319 { 3320 @Render(settings.Stickers); 3321 } 3322 } 3323 @Render(settings.Image) 3324 </div> 3325 } 3326 </div> 3327 3328 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3329 { 3330 <div class="card u-color-light--bg dw-mod"> 3331 @if (settings.Stickers != null) 3332 { 3333 if (settings.Stickers.Position == StickersListPosition.Custom) 3334 { 3335 @Render(settings.Stickers); 3336 } 3337 } 3338 @if (!String.IsNullOrEmpty(settings.Title)) 3339 { 3340 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3341 } 3342 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3343 { 3344 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3345 } 3346 @if (!String.IsNullOrEmpty(settings.Summary)) 3347 { 3348 <p class="article__short-summary dw-mod">@settings.Summary</p> 3349 } 3350 </div> 3351 } 3352 </a> 3353 } 3354 3355 @helper RenderArticleListItemList(ArticleListItem settings) { 3356 <a href="@settings.Link"> 3357 <div class="grid u-color-light--bg u-no-padding dw-mod"> 3358 <div class="grid__col-md-3"> 3359 <div class="u-color-light--bg u-no-padding dw-mod"> 3360 @if (settings.Logo != null) 3361 { 3362 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 3363 settings.Logo.ImageDefault.Crop = 5; 3364 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 3365 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 3366 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 3367 @if (settings.Stickers != null) 3368 { 3369 if (settings.Stickers.Position != StickersListPosition.Custom) 3370 { 3371 @Render(settings.Stickers); 3372 } 3373 } 3374 @RenderImage(settings.Logo) 3375 </div> 3376 } else if (settings.Image != null) 3377 { 3378 <div class="flex-img image-hover__wrapper dw-mod"> 3379 @if (settings.Stickers != null) 3380 { 3381 if (settings.Stickers.Position != StickersListPosition.Custom) 3382 { 3383 @Render(settings.Stickers); 3384 } 3385 } 3386 @Render(settings.Image) 3387 </div> 3388 } 3389 </div> 3390 </div> 3391 3392 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3393 { 3394 <div class="grid__col-md-9"> 3395 @if (!String.IsNullOrEmpty(settings.Title)) 3396 { 3397 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3398 } 3399 @if (settings.Stickers != null) 3400 { 3401 if (settings.Stickers.Position == StickersListPosition.Custom) 3402 { 3403 @Render(settings.Stickers); 3404 } 3405 } 3406 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3407 { 3408 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3409 } 3410 @if (!String.IsNullOrEmpty(settings.Summary)) 3411 { 3412 <p class="article__short-summary dw-mod">@settings.Summary</p> 3413 } 3414 </div> 3415 } 3416 </div> 3417 </a> 3418 } 3419 3420 @helper RenderArticleListItemSimple(ArticleListItem settings) { 3421 <a href="@settings.Link" class="u-color-inherit"> 3422 <div class="grid u-color-light--bg u-no-padding dw-mod"> 3423 <div class="grid__col-md-12"> 3424 @if (!String.IsNullOrEmpty(settings.Title)) 3425 { 3426 <div class="article-list-item__header u-truncate-text u-no-margin dw-mod">@settings.Title</div> 3427 } 3428 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3429 { 3430 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3431 } 3432 </div> 3433 </div> 3434 </a> 3435 } 3436 @using System.Reflection 3437 @using Dynamicweb.Rapido.Blocks.Components.Articles 3438 3439 3440 @* Component for the articles *@ 3441 3442 @helper RenderArticleAuthorAndDate(ArticleAuthorAndDate settings) 3443 { 3444 <small class="article__subscription"> 3445 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3446 { 3447 <text>@Translate("Written")</text> 3448 } 3449 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3450 { 3451 <text>@Translate("by") @settings.Author</text> 3452 } 3453 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3454 { 3455 <text>@Translate("on") @settings.Date</text> 3456 } 3457 </small> 3458 } 3459 @using System.Reflection 3460 @using Dynamicweb.Rapido.Blocks.Components.Articles 3461 @using Dynamicweb.Rapido.Blocks.Components.General 3462 3463 3464 @* Component for the articles *@ 3465 3466 @helper RenderArticleLink(ArticleLink settings) 3467 { 3468 if (!string.IsNullOrEmpty(settings.Title)) 3469 { 3470 Button link = new Button { 3471 ConfirmText = settings.ConfirmText, 3472 ConfirmTitle = settings.ConfirmTitle, 3473 ButtonType = settings.ButtonType, 3474 Id = settings.Id, 3475 Title = settings.Title, 3476 AltText = settings.AltText, 3477 OnClick = settings.OnClick, 3478 CssClass = settings.CssClass, 3479 Disabled = settings.Disabled, 3480 Icon = settings.Icon, 3481 Name = settings.Name, 3482 Href = settings.Href, 3483 ButtonLayout = settings.ButtonLayout, 3484 ExtraAttributes = settings.ExtraAttributes 3485 }; 3486 <div class="grid__cell"> 3487 @Render(link) 3488 </div> 3489 } 3490 } 3491 @using System.Reflection 3492 @using Dynamicweb.Rapido.Blocks 3493 @using Dynamicweb.Rapido.Blocks.Components.Articles 3494 @using Dynamicweb.Rapido.Blocks.Components.General 3495 3496 3497 @* Component for the articles *@ 3498 3499 @helper RenderArticleCarousel(ArticleCarousel settings) 3500 { 3501 <div class="grid"> 3502 <div class="grid__col-12"> 3503 <div class="carousel" id="carousel_@settings.Id"> 3504 <div class="carousel__container js-carousel-slides dw-mod"> 3505 @RenderBlockList(settings.SubBlocks) 3506 </div> 3507 </div> 3508 </div> 3509 </div> 3510 3511 <script> 3512 document.addEventListener("DOMContentLoaded", function () { 3513 new CarouselModule("#carousel_@settings.Id", { 3514 slideTime: 0, 3515 dots: true 3516 }); 3517 }); 3518 </script> 3519 } 3520 3521 @helper RenderArticleCarouselSlide(ArticleCarouselSlide settings) 3522 { 3523 string imageEngine = "/Admin/Public/GetImage.ashx?"; 3524 3525 string defaultImage = settings.ImageSettings != null ? imageEngine : settings.Image; 3526 if (settings.ImageSettings != null) 3527 { 3528 defaultImage += settings.ImageSettings.Width != 0 ? "Width=" + settings.ImageSettings.Width + "&" : ""; 3529 defaultImage += settings.ImageSettings.Height != 0 ? "Height=" + settings.ImageSettings.Height + "&" : ""; 3530 defaultImage += "Crop=" + settings.ImageSettings.Crop + "&"; 3531 defaultImage += "Compression=" + settings.ImageSettings.Compression + "&"; 3532 defaultImage += "DoNotUpscale=" + settings.ImageSettings.DoNotUpscale.ToString() + "&"; 3533 defaultImage += "FillCanvas=" + settings.ImageSettings.FillCanvas.ToString() + "&"; 3534 defaultImage += "format=webp&"; 3535 } 3536 defaultImage += "&Image=" + settings.Image; 3537 3538 <div class="carousel__slide u-min-h300px u-flex dw-mod" style="background-size:cover; background-image:url('@defaultImage')"> 3539 <a class="article-carousel-item__wrap" href="@settings.Link" title="@settings.Title"> 3540 <h2 class="article-list__item-header u-truncate-text u-color-light dw-mod">@settings.Title</h2> 3541 <div class="article-list__item-info"> 3542 @if (settings.Stickers != null) 3543 { 3544 settings.Stickers.Position = StickersListPosition.Custom; 3545 @Render(settings.Stickers); 3546 } 3547 3548 <small class="u-margin-top--lg u-color-light"> 3549 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3550 { 3551 <text>@Translate("Written")</text> 3552 } 3553 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3554 { 3555 <text>@Translate("by") @settings.Author</text> 3556 } 3557 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3558 { 3559 <text>@Translate("on") @settings.Date</text> 3560 } 3561 </small> 3562 </div> 3563 3564 <h3 class="article__short-summary u-color-light">@settings.Summary</h3> 3565 </a> 3566 @if (settings.UseFilters == true) 3567 { 3568 <div class="background-image image-filter image-filter--darken dw-mod"></div> 3569 } 3570 </div> 3571 } 3572 @using System.Text.RegularExpressions 3573 @using Dynamicweb.Rapido.Blocks.Components 3574 @using Dynamicweb.Rapido.Blocks.Components.General 3575 @using Dynamicweb.Rapido.Blocks.Components.Articles 3576 @using Dynamicweb.Rapido.Blocks 3577 3578 @* Component for the articles *@ 3579 3580 @helper RenderArticleVideo(ArticleVideo settings) 3581 { 3582 if (settings.Url != null) 3583 { 3584 //getting video ID from youtube URL 3585 string videoCode = settings.Url; 3586 Regex regex = new Regex(@".be\/(.[^?]*)"); 3587 Match match = regex.Match(videoCode); 3588 string videoId = ""; 3589 if (match.Success) 3590 { 3591 videoId = match.Groups[1].Value; 3592 } 3593 else 3594 { 3595 regex = new Regex(@"v=([^&]+)"); 3596 match = regex.Match(videoCode); 3597 if (match.Success) 3598 { 3599 videoId = match.Groups[1].Value; 3600 } 3601 } 3602 3603 int autoPlay = settings.AutoPlay == "true" ? 1 : 0; 3604 3605 <div class="video-wrapper"> 3606 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Guid.NewGuid().ToString("N"))" data-auto-play="@autoPlay" data-enable-controls="1"></div> 3607 </div> 3608 } 3609 } 3610 3611 3612 3613 @* Simple helpers *@ 3614 3615 @*Requires the Gallery ItemType that comes with Rapido*@ 3616 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) { 3617 if (gallery != null && gallery.Count > 0) 3618 { 3619 int count = 1; 3620 3621 foreach (var item in gallery) 3622 { 3623 if (item.GetFile("ImagePath") != null) 3624 { 3625 string image = item.GetFile("ImagePath").PathUrlEncoded; 3626 string imagePrefix = "/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image="; 3627 int imagesCount = gallery.Count; 3628 3629 if (count == 1) 3630 { 3631 <label class="gallery" for="ParagraphGalleryModalTrigger" onclick="Gallery.openImage(this.querySelector('.js-gallery'))"> 3632 <span class="gallery__main-image"> 3633 <img src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" class="b-lazy flex-img js-gallery" alt="" data-for="ParagraphGallery" data-image="@imagePrefix@image" /> 3634 </span> 3635 <span class="gallery__image-counter"> 3636 <i class="fas fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 3637 <span class="gallery__image-counter__text">@Translate("See all") <i class="fas fa-angle-right"></i></span> 3638 </span> 3639 </label> 3640 } 3641 else 3642 { 3643 <div class="u-hidden js-gallery" data-for="ParagraphGallery" data-image="@imagePrefix@image"></div> 3644 } 3645 3646 count++; 3647 } 3648 } 3649 3650 @Render(new ArticleGalleryModal()) 3651 } 3652 } 3653 3654 @helper RenderMobileFilters(List<Block> subBlocks) 3655 { 3656 if (subBlocks.Count > 0) 3657 { 3658 <div class="grid__col-12"> 3659 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 3660 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 3661 @RenderBlockList(subBlocks) 3662 </div> 3663 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 3664 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label> 3665 </div> 3666 } 3667 } 3668 3669 3670 @* Include the Blocks for the page *@ 3671 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3672 3673 @using System 3674 @using System.Web 3675 @using System.Collections.Generic 3676 @using Dynamicweb.Environment 3677 @using Dynamicweb.Rapido.Blocks.Extensibility 3678 @using Dynamicweb.Rapido.Blocks 3679 @using Dynamicweb.Core 3680 3681 @functions { 3682 string GoogleTagManagerID = ""; 3683 string GoogleAnalyticsID = ""; 3684 } 3685 3686 @{ 3687 GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 3688 GoogleAnalyticsID = Model.Area.Item.GetItem("Settings").GetString("GoogleAnalyticsTrackingID"); 3689 string trustpilotFreeWidget = Model.Area.Item.GetItem("Custom").GetString("FooterTrustpilotFreeWidget"); 3690 3691 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 3692 3693 3694 Block cookieInformation = new Block() 3695 { 3696 Id = "CookieInformation", 3697 SortId = 25, 3698 Template = RenderCookieInformation() 3699 }; 3700 topSnippetsBlocksPage.Add("Head", cookieInformation); 3701 3702 Block googleConsentModeBlock = new Block() 3703 { 3704 Id = "GoogleConsentMode", 3705 // MUST be rendered before GA 3706 SortId = 9, 3707 Template = RenderGoogleConsentMode() 3708 }; 3709 topSnippetsBlocksPage.Add("Head", googleConsentModeBlock); 3710 3711 if (!string.IsNullOrWhiteSpace(GoogleAnalyticsID)) 3712 { 3713 Block tagManager = new Block() 3714 { 3715 Id = "GoogleAnalytics", 3716 SortId = 10, 3717 Template = RenderGoogleAnalyticsSnippet() 3718 }; 3719 topSnippetsBlocksPage.Add("Head", tagManager); 3720 } 3721 3722 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 3723 { 3724 Block GTMDataLayer = new Block() 3725 { 3726 Id = "GTMDataLayer", 3727 SortId = 0, 3728 Template = RenderGTMDataLayer() 3729 }; 3730 topSnippetsBlocksPage.Add("Head", GTMDataLayer); 3731 Block tagManager = new Block() 3732 { 3733 Id = "TagManager", 3734 SortId = 20, 3735 Template = RenderGoogleTagManager() 3736 }; 3737 topSnippetsBlocksPage.Add("Head", tagManager); 3738 3739 Block tagManagerBodySnippet = new Block() 3740 { 3741 Id = "TagManagerBodySnippet", 3742 SortId = 20, 3743 Template = RenderGoogleTagManagerBodySnippet() 3744 }; 3745 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManagerBodySnippet); 3746 } 3747 3748 Block facebookPixel = new Block() 3749 { 3750 Id = "FacebookPixel", 3751 SortId = 30, 3752 Template = RenderFacebookPixel() 3753 }; 3754 3755 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 3756 3757 Block facebookPixelProductPage = new Block() 3758 { 3759 Id = "FacebookPixelProductPage", 3760 SortId = 31, 3761 Template = RenderFacebookPixelProductPage() 3762 }; 3763 3764 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixelProductPage); 3765 3766 Block oneSignalBlock = new Block() 3767 { 3768 Id = "OneSignal", 3769 SortId = 50, 3770 Template = RenderOneSignalScript() 3771 }; 3772 3773 topSnippetsBlocksPage.Add("Head", oneSignalBlock); 3774 3775 Block openSearchBlock = new Block() 3776 { 3777 Id = "OpenSearch", 3778 SortId = 50, 3779 Template = RenderOpenSearchReference() 3780 }; 3781 3782 topSnippetsBlocksPage.Add("Head", openSearchBlock); 3783 3784 if (!string.IsNullOrEmpty(trustpilotFreeWidget)) 3785 { 3786 Block trustpilotScriptBlock = new Block() 3787 { 3788 Id = "TrustpilotScript", 3789 SortId = 70, 3790 Template = TrustpilotScript() 3791 }; 3792 3793 topSnippetsBlocksPage.Add("Head", trustpilotScriptBlock); 3794 } 3795 3796 string simplifyId = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetString("SimplifyId"); 3797 3798 if (!string.IsNullOrEmpty(simplifyId)) 3799 { 3800 Block simplifyScriptBlock = new Block() 3801 { 3802 Id = "SimplifyScript", 3803 SortId = 5, 3804 Template = RenderSimplifyScript(simplifyId) 3805 }; 3806 3807 topSnippetsBlocksPage.Add("Head", simplifyScriptBlock); 3808 } 3809 3810 string vwoUrl = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetRawValueString("VWOUrl"); 3811 string vwoId = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetRawValueString("VWOId"); 3812 3813 if (!string.IsNullOrEmpty(vwoId) && !string.IsNullOrEmpty(vwoUrl)) 3814 { 3815 Block vwoScriptBlock = new Block() 3816 { 3817 Id = "VWOScript", 3818 SortId = 5, 3819 Template = RenderVWOScript(vwoId, vwoUrl) 3820 }; 3821 3822 topSnippetsBlocksPage.Add("Head", vwoScriptBlock); 3823 } 3824 } 3825 3826 @helper RenderCookieInformation() 3827 { 3828 <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName.ToUpper()" data-gcm-version="2.0" type="text/javascript"></script> 3829 3830 <script type="text/javascript"> 3831 window.addEventListener('CookieInformationConsentGiven', function (event) { 3832 if (!CookieInformation.getConsentGivenFor('cookie_cat_marketing')) { 3833 var allFrames = document.querySelectorAll("iframe"); 3834 3835 //Start - Content replacing iframes 3836 for (i = 0; i < allFrames.length; i++) { 3837 var frame = allFrames[i]; 3838 if (frame.src.indexOf('youtu') !== -1 || frame.src.indexOf('vimeo') !== -1) { 3839 frame.insertAdjacentHTML("beforebegin", '<div class="consent-placeholder u-brand-color-two" data-category="cookie_cat_marketing" onClick="CookieConsent.renew()">@Translate("Smartpage:Cookieinformation.Renew", "Renew or change your cookie consent to see this content")</div>'); 3840 frame.parentNode.removeChild(frame); 3841 } 3842 } 3843 } 3844 // Google Consent mode implementation 3845 if (CookieInformation.getConsentGivenFor('cookie_cat_statistic') && window.gtag != undefined) { 3846 gtag('consent', 'update', { 'analytics_storage': 'granted' }); 3847 } 3848 if (CookieInformation.getConsentGivenFor('cookie_cat_marketing') && window.gtag != undefined) { 3849 gtag('consent', 'update', { 'ad_storage': 'granted' }); 3850 } 3851 3852 window.dataLayer = window.dataLayer || []; 3853 window.dataLayer.push({ 'event': 'consent_decision_made' }); 3854 }, false); 3855 3856 </script> 3857 } 3858 3859 @helper RenderSimplifyScript(string id) 3860 { 3861 <script type="text/javascript"> 3862 window.addEventListener('CookieInformationConsentGiven', function (event) { 3863 if (CookieInformation.getConsentGivenFor('cookie_cat_statistic')) { 3864 var script = document.createElement('script'); 3865 script.setAttribute('type', 'text/javascript'); 3866 script.setAttribute('src', 'https://cdn-sitegainer.com/@id/es6/index.bundle.js'); 3867 document.head.appendChild(script); 3868 } 3869 }, false); 3870 </script> 3871 } 3872 3873 @helper RenderVWOScript(string vwoId, string vwoUrl) 3874 { 3875 <link rel="preconnect" href="@vwoUrl" /> 3876 <script type='text/javascript' id='vwoCode'> 3877 window._vwo_code || (function () { 3878 var account_id = @vwoId, 3879 version = 2.1, 3880 settings_tolerance = 2000, 3881 hide_element = 'body', 3882 hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important', 3883 f = false, w = window, d = document, v = d.querySelector('#vwoCode'), cK = '_vwo_' + account_id + '_settings', cc = {}; try { var c = JSON.parse(localStorage.getItem('_vwo_' + account_id + '_config')); cc = c && typeof c === 'object' ? c : {} } catch (e) { } var stT = cc.stT === 'session' ? w.sessionStorage : w.localStorage; code = { use_existing_jquery: function () { return typeof use_existing_jquery !== 'undefined' ? use_existing_jquery : undefined }, library_tolerance: function () { return typeof library_tolerance !== 'undefined' ? library_tolerance : undefined }, settings_tolerance: function () { return cc.sT || settings_tolerance }, hide_element_style: function () { return '{' + (cc.hES || hide_element_style) + '}' }, hide_element: function () { if (performance.getEntriesByName('first-contentful-paint')[0]) { return '' } return typeof cc.hE === 'string' ? cc.hE : hide_element }, getVersion: function () { return version }, finish: function (e) { if (!f) { f = true; var t = d.getElementById('_vis_opt_path_hides'); if (t) t.parentNode.removeChild(t); if (e) (new Image).src = '@vwoUrl/ee.gif?a=' + account_id + e } }, finished: function () { return f }, addScript: function (e) { var t = d.createElement('script'); t.type = 'text/javascript'; if (e.src) { t.src = e.src } else { t.text = e.text } d.getElementsByTagName('head')[0].appendChild(t) }, load: function (e, t) { var i = this.getSettings(), n = d.createElement('script'), r = this; t = t || {}; if (i) { n.textContent = i; d.getElementsByTagName('head')[0].appendChild(n); if (!w.VWO || VWO.caE) { stT.removeItem(cK); r.load(e) } } else { var o = new XMLHttpRequest; o.open('GET', e, true); o.withCredentials = !t.dSC; o.responseType = t.responseType || 'text'; o.onload = function () { if (t.onloadCb) { return t.onloadCb(o, e) } if (o.status === 200) { _vwo_code.addScript({ text: o.responseText }) } else { _vwo_code.finish('&e=loading_failure:' + e) } }; o.onerror = function () { if (t.onerrorCb) { return t.onerrorCb(e) } _vwo_code.finish('&e=loading_failure:' + e) }; o.send() } }, getSettings: function () { try { var e = stT.getItem(cK); if (!e) { return } e = JSON.parse(e); if (Date.now() > e.e) { stT.removeItem(cK); return } return e.s } catch (e) { return } }, init: function () { if (d.URL.indexOf('__vwo_disable__') > -1) return; var e = this.settings_tolerance(); w._vwo_settings_timer = setTimeout(function () { _vwo_code.finish(); stT.removeItem(cK) }, e); var t; if (this.hide_element() !== 'body') { t = d.createElement('style'); var i = this.hide_element(), n = i ? i + this.hide_element_style() : '', r = d.getElementsByTagName('head')[0]; t.setAttribute('id', '_vis_opt_path_hides'); v && t.setAttribute('nonce', v.nonce); t.setAttribute('type', 'text/css'); if (t.styleSheet) t.styleSheet.cssText = n; else t.appendChild(d.createTextNode(n)); r.appendChild(t) } else { t = d.getElementsByTagName('head')[0]; var n = d.createElement('div'); n.style.cssText = 'z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;'; n.setAttribute('id', '_vis_opt_path_hides'); n.classList.add('_vis_hide_layer'); t.parentNode.insertBefore(n, t.nextSibling) } var o = '@vwoUrl/j.php?a=' + account_id + '&u=' + encodeURIComponent(d.URL) + '&vn=' + version; if (w.location.search.indexOf('_vwo_xhr') !== -1) { this.addScript({ src: o }) } else { this.load(o + '&x=true') } } }; w._vwo_code = code; code.init(); 3884 })(); 3885 </script> 3886 } 3887 3888 @helper RenderGoogleConsentMode() 3889 { 3890 <script> 3891 window.dataLayer = window.dataLayer || []; 3892 function gtag() { dataLayer.push(arguments); } 3893 gtag('consent', 'default', { 3894 'ad_storage': 'denied', 3895 'ad_user_data': 'denied', 3896 'ad_personalization': 'denied', 3897 'analytics_storage': 'denied', 3898 'wait_for_update': 500 3899 }); 3900 gtag('set', 'ads_data_redaction', true); 3901 </script> 3902 } 3903 3904 @helper RenderGoogleAnalyticsSnippet() 3905 { 3906 <!-- Global site tag (gtag.js) - Google Analytics --> 3907 <script async src="https://www.googletagmanager.com/gtag/js?id=@GoogleAnalyticsID"></script> 3908 <script> 3909 window.dataLayer = window.dataLayer || []; 3910 function gtag(){dataLayer.push(arguments);} 3911 gtag('js', new Date()); 3912 3913 gtag('config', '@GoogleAnalyticsID'); 3914 </script> 3915 } 3916 3917 @helper RenderGTMDataLayer() 3918 { 3919 string anonymousId = HttpContext.Current.Request.Cookies["ajs_anonymous_id"] != null ? Dynamicweb.Context.Current.Request.Cookies["ajs_anonymous_id"].Value : "undefined"; 3920 var currentUser = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 3921 if (currentUser != null) 3922 { 3923 <script> 3924 window.dataLayer = window.dataLayer || []; 3925 window.dataLayer = [{ 3926 'event': 'Active on site', 3927 'attributes': { 3928 'properties': { 3929 'userStatus': 'loggedIn', 3930 'userId': '@currentUser.ID', 3931 'customerType': '@Converter.ToString(currentUser.CustomFieldValues.FirstOrDefault(x => x.CustomField.SystemName == "AccessUser_SpBcCustomerType")?.Value)', 3932 'customerName': '@currentUser.Name', 3933 'email': '@currentUser.Email', 3934 'mobile': '@currentUser.Phone', 3935 'bcId': '@currentUser.CustomerNumber', 3936 'customerCountry': '@currentUser.CountryCode', 3937 'page': '@(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.RawUrl)', 3938 'deviceCategory': '@Convert.ToString(Pageview.Device)', 3939 'address': { 3940 'country': '@currentUser.CountryCode', 3941 'city': '@currentUser.City', 3942 'postalCode': '@currentUser.Zip', 3943 'street': '@HttpUtility.JavaScriptStringEncode(currentUser.Address)' 3944 } 3945 }, 3946 'time': '@DateTime.Now.ToString("G", System.Globalization.CultureInfo.InvariantCulture)', 3947 'uniqueId': '@Guid.NewGuid().ToString("N")', 3948 'shopId': '@Pageview.Area.EcomShopId', 3949 'areaId': '@Converter.ToString(Pageview.AreaID)', 3950 'ajsAnonymousID': '@anonymousId' 3951 } 3952 }] 3953 </script> 3954 } 3955 else 3956 { 3957 <script> 3958 window.dataLayer = window.dataLayer || []; 3959 window.dataLayer = [{ 3960 'userStatus': 'notLoggedIn', 3961 'userId': undefined, 3962 'customerType': undefined, 3963 'shopId': '@Pageview.Area.EcomShopId', 3964 'areaId': '@Converter.ToString(Pageview.AreaID)', 3965 'ajsAnonymousID': '@anonymousId' 3966 }] 3967 </script> 3968 } 3969 } 3970 3971 @helper RenderGoogleTagManager() 3972 { 3973 string googleTagManagerSource = "https://gtm.philipsonwine.com"; 3974 if (!string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("SpGoogleTagManagerSource"))) 3975 { 3976 googleTagManagerSource = Model.Area.Item.GetItem("Settings").GetString("SpGoogleTagManagerSource"); 3977 } 3978 <script> 3979 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 3980 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 3981 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 3982 '@googleTagManagerSource?id='+i+dl;f.parentNode.insertBefore(j,f); 3983 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 3984 </script> 3985 } 3986 3987 3988 3989 @helper RenderGoogleTagManagerBodySnippet() 3990 { 3991 string source = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("SpGoogleTagManagerBodySnippetSource")) ? Model.Area.Item.GetItem("Settings").GetString("SpGoogleTagManagerBodySnippetSource") : "https://www.googletagmanager.com/ns.html"; 3992 <!-- Google Tag Manager (noscript) --> 3993 <noscript> 3994 <iframe src="@source?id=@GoogleTagManagerID" 3995 height="0" width="0" style="display:none;visibility:hidden"></iframe> 3996 </noscript> 3997 <!-- End Google Tag Manager (noscript) --> 3998 } 3999 4000 @helper RenderFacebookPixel() 4001 { 4002 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 4003 4004 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 4005 { 4006 <!-- Facebook Pixel Code --> 4007 <script> 4008 !function(f,b,e,v,n,t,s) 4009 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 4010 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 4011 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 4012 n.queue=[];t=b.createElement(e);t.async=!0; 4013 t.src=v;s=b.getElementsByTagName(e)[0]; 4014 s.parentNode.insertBefore(t,s)}(window, document,'script', 4015 'https://connect.facebook.net/en_US/fbevents.js'); 4016 fbq('init', '@FacebookPixelID'); 4017 fbq('track', 'PageView'); 4018 </script> 4019 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 4020 } 4021 } 4022 4023 4024 @helper RenderFacebookPixelProductPage() 4025 { 4026 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 4027 string productId = Dynamicweb.Context.Current.Request["ProductId"]; 4028 bool isProductPage = !string.IsNullOrEmpty(productId); 4029 4030 if (!string.IsNullOrWhiteSpace(FacebookPixelID) && isProductPage) 4031 { 4032 var product = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, string.Empty, true); 4033 if (product != null) 4034 { 4035 <!-- Facebook Pixel Code --> 4036 <script> 4037 fbq('track', 'ViewContent', { 4038 content_ids: '@product.Id', 4039 content_type: 'product', 4040 value: '@product.UnformattedPrice.ToString().Replace(',','.')', 4041 currency: '@Dynamicweb.Ecommerce.Common.Context.Currency.Symbol.Trim()', 4042 content_category: '@Converter.ToString(product.ProductFieldValues.GetProductFieldValue("SpWineDescription")?.Value)' 4043 }); 4044 </script> 4045 } 4046 } 4047 } 4048 4049 @helper RenderOneSignalScript() 4050 { 4051 string oneSignalAppId = Model.Area.Item.GetItem("Settings").GetString("SpOneSignalAppId"); 4052 if (!string.IsNullOrEmpty(oneSignalAppId)) 4053 { 4054 <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script> 4055 <script> 4056 window.OneSignal = window.OneSignal || []; 4057 OneSignal.push(function() { 4058 OneSignal.init({ 4059 appId: "@oneSignalAppId", 4060 }); 4061 }); 4062 </script> 4063 } 4064 } 4065 4066 @helper RenderOpenSearchReference() 4067 { 4068 <link type="application/opensearchdescription+xml" rel="search" href="https://philipsonwine.com/Files/opensearch.xml" /> 4069 } 4070 4071 @helper TrustpilotScript() 4072 { 4073 <script type="text/javascript" src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async></script> 4074 } 4075 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4076 4077 @using System 4078 @using System.Web 4079 @using System.Collections.Generic 4080 @using Dynamicweb.Rapido.Blocks 4081 @using Dynamicweb.Rapido.Blocks.Extensibility 4082 @using Dynamicweb.Security.UserManagement 4083 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 4084 @using Dynamicweb.Rapido.Blocks.Components.General 4085 4086 @{ 4087 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 4088 4089 Block loginModal = new Block() 4090 { 4091 Id = "LoginModal", 4092 SortId = 10, 4093 Component = new Modal 4094 { 4095 Id = "SignIn", 4096 Heading = new Heading 4097 { 4098 Level = 0, 4099 Title = Translate("Sign in") 4100 }, 4101 Width = ModalWidth.Xs, 4102 BodyTemplate = RenderLoginForm() 4103 } 4104 }; 4105 4106 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 4107 } 4108 4109 @helper RenderLoginForm() 4110 { 4111 int pageId = Model.TopPage.ID; 4112 int currentPageId = Pageview.ID; 4113 string userSignedInErrorText = ""; 4114 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4115 int cartPageId = GetPageIdByNavigationTag("CartPage"); 4116 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 4117 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4118 bool showModalOnStart = pageId != GetPageIdByNavigationTag("CustomerCenter") && Model.LogOnFailed; 4119 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4120 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 4121 string buttonName = currentPageId == cartPageId ? "CartV2.GotoStep2" : ""; 4122 string cartLogin = currentPageId == cartPageId ? "True" : "False"; 4123 4124 if (Model.LogOnFailed) 4125 { 4126 switch (Model.LogOnFailedReason) 4127 { 4128 case LogOnFailedReason.PasswordLengthInvalid: 4129 userSignedInErrorText = Translate("Password length is invalid"); 4130 break; 4131 case LogOnFailedReason.IncorrectLogin: 4132 userSignedInErrorText = Translate("Invalid email or password"); 4133 break; 4134 case LogOnFailedReason.ExceededFailedLogOnLimit: 4135 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 4136 break; 4137 case LogOnFailedReason.LoginLocked: 4138 userSignedInErrorText = Translate("The user account is temporarily locked"); 4139 break; 4140 case LogOnFailedReason.PasswordExpired: 4141 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 4142 break; 4143 default: 4144 userSignedInErrorText = Translate("An unknown error occured"); 4145 break; 4146 } 4147 } 4148 4149 Form form = new Form { Method = FormMethod.Post, Name = "LoginModalForm", CssClass = "js-login-form" }; 4150 4151 form.Add(new HiddenField { Name = "ID", Value = Converter.ToString(pageId) }); 4152 form.Add(new HiddenField { Name = "DWExtranetUsernameRemember", Value = "True" }); 4153 form.Add(new HiddenField { Name = "DWExtranetPasswordRemember", Value = "True" }); 4154 form.Add(new HiddenField { Name = "LoginAction", Value = "Login" }); 4155 form.Add(new HiddenField { Name = "CartLogin", Value = cartLogin }); 4156 form.Add(new TextField { Id = "LoginUsername", Name = "username", Label = Translate("Email"), CssClass = "u-full-width", Required = true }); 4157 form.Add(new TextField { Id = "LoginPassword", Name = "password", Type = TextFieldType.Password, Label = Translate("Password"), CssClass = "u-full-width", Required = true }); 4158 form.Add(new NotificationMessage { Message = userSignedInErrorText, MessageType = NotificationMessageType.Error }); 4159 form.Add(new CheckboxField { Id = "LoginRememberMe", Value = "True", Name = "Autologin", Label = Translate("Remember me") }); 4160 form.Add(new Button { ButtonType = ButtonType.Submit, Name = buttonName, Title = Translate("Sign in"), CssClass = "btn--full", OnClick = "Buttons.LockButton(event)" }); 4161 4162 if (!hideCreateAccountLink) 4163 { 4164 form.Add(new Link { Href = "/default.aspx?ID=" + createAccountPageId, Title = Translate("Create account?"), ButtonLayout = ButtonLayout.None, CssClass = "u-block u-padding-bottom" }); 4165 } 4166 4167 if (!hideForgotPasswordLink) 4168 { 4169 form.Add(new Link { Href = forgotPasswordPageLink, Title = Translate("Forgot your password?"), ButtonLayout = ButtonLayout.None, CssClass = "u-block u-padding-bottom" }); 4170 } 4171 4172 @Render(form) 4173 4174 if(!string.IsNullOrWhiteSpace(userSignedInErrorText)) 4175 { 4176 <script> 4177 window.addEventListener("DOMContentLoaded", () => { 4178 setDatalayerLoginError('@userSignedInErrorText'); 4179 }) 4180 </script> 4181 } 4182 4183 if (showModalOnStart) 4184 { 4185 <script> 4186 document.getElementById("SignInModalTrigger").checked = true; 4187 </script> 4188 } 4189 } 4190 4191 @if (!isHeaderHidden) 4192 { 4193 if (Pageview.Device.ToString() == "Mobile") 4194 { 4195 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4196 @using System 4197 @using System.Web 4198 @using System.Collections.Generic 4199 @using Dynamicweb.Rapido.Blocks.Extensibility 4200 @using Dynamicweb.Rapido.Blocks 4201 @using Smartpage.PhilipsonWine.Ecommerce.CartInformation; 4202 @using Smartpage.PhilipsonWine.LiveShopper.Models; 4203 4204 @functions { 4205 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 4206 } 4207 4208 @{ 4209 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4210 bool mobileHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 4211 bool mobileHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart") || !Dynamicweb.Rapido.Services.User.IsBuyingAllowed(); 4212 4213 Block mobileHeader = new Block() 4214 { 4215 Id = "MobileTop", 4216 SortId = 10, 4217 Template = RenderMobileTop(), 4218 SkipRenderBlocksList = true 4219 }; 4220 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 4221 4222 Block mobileHeaderNavigation = new Block() 4223 { 4224 Id = "MobileHeaderNavigation", 4225 SortId = 10, 4226 Template = RenderMobileHeaderNavigation(), 4227 SkipRenderBlocksList = true 4228 }; 4229 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 4230 4231 Block mobileHeaderLogo = new Block() 4232 { 4233 Id = "MobileHeaderLogo", 4234 SortId = 20, 4235 Template = RenderMobileHeaderLogo(), 4236 SkipRenderBlocksList = true 4237 }; 4238 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 4239 4240 Block mobileHeaderActions = new Block() 4241 { 4242 Id = "MobileHeaderActions", 4243 SortId = 30, 4244 Template = RenderMobileTopActions(), 4245 SkipRenderBlocksList = true 4246 }; 4247 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 4248 4249 Block mobileHeaderNavigationTriggerBlock = new Block() 4250 { 4251 Id = "MobileHeaderNavigationTrigger", 4252 SortId = 10, 4253 Template = RenderMobileHeaderNavigationTrigger() 4254 }; 4255 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigationTriggerBlock); 4256 4257 Block mobileHeaderMiniCart; 4258 4259 if (!mobileHideCart) 4260 { 4261 mobileHeaderMiniCart = new Block 4262 { 4263 Id = "MobileHeaderMiniCart", 4264 SortId = 20, 4265 Template = RenderMobileTopMiniCart() 4266 }; 4267 4268 Block miniCartCounterScriptTemplate = new Block 4269 { 4270 Id = "MiniCartCounterScriptTemplate", 4271 Template = RenderMobileMiniCartCounterContent() 4272 }; 4273 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 4274 } 4275 else 4276 { 4277 mobileHeaderMiniCart = new Block 4278 { 4279 Id = "MobileHeaderMiniCart", 4280 SortId = 20 4281 }; 4282 } 4283 4284 Block mobileHeaderCustomerCenterBlock = new Block 4285 { 4286 Id = "MobileHeaderCustomerCenter", 4287 SortId = 10, 4288 Template = RenderMobileCustomerCenterAction() 4289 }; 4290 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderCustomerCenterBlock); 4291 4292 switch (mobileTopLayout) 4293 { 4294 case "nav-left": 4295 mobileHeaderNavigation.SortId = 10; 4296 mobileHeaderLogo.SortId = 20; 4297 mobileHeaderActions.SortId = 30; 4298 mobileHeaderNavigationTriggerBlock.SortId = 30; 4299 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 4300 break; 4301 case "nav-right": 4302 mobileHeaderLogo.SortId = 10; 4303 mobileHeaderActions.SortId = 20; 4304 mobileHeaderNavigation.SortId = 30; 4305 mobileHeaderNavigationTriggerBlock.SortId = 30; 4306 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 4307 break; 4308 case "nav-search-left": 4309 mobileHeaderNavigation.SortId = 10; 4310 mobileHeaderLogo.SortId = 20; 4311 mobileHeaderActions.SortId = 30; 4312 mobileHeaderNavigationTriggerBlock.SortId = 30; 4313 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 4314 break; 4315 case "search-left": 4316 mobileHeaderActions.SortId = 10; 4317 mobileHeaderLogo.SortId = 20; 4318 mobileHeaderNavigation.SortId = 30; 4319 mobileHeaderMiniCart.SortId = 0; 4320 mobileHeaderNavigationTriggerBlock.SortId = 30; 4321 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 4322 break; 4323 case "custom": 4324 mobileHeaderActions.SortId = 100; 4325 mobileHeaderLogo.SortId = 30; 4326 mobileHeaderNavigation.SortId = 20; 4327 mobileHeaderMiniCart.SortId = 50; 4328 mobileHeaderNavigationTriggerBlock.SortId = 10; 4329 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 4330 break; 4331 } 4332 4333 if (Pageview.Page.NavigationTag == "CartPage") 4334 { 4335 Block mobileCheckoutUsp = new Block 4336 { 4337 Id = "MobileCheckoutUsp", 4338 SortId = 50, 4339 Template = RenderMobileCheckoutUsp() 4340 }; 4341 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileCheckoutUsp); 4342 } 4343 } 4344 4345 4346 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4347 4348 @using System 4349 @using System.Web 4350 @using Dynamicweb.Rapido.Blocks.Extensibility 4351 @using Dynamicweb.Rapido.Blocks 4352 4353 @{ 4354 BlocksPage customMobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 4355 } 4356 4357 @helper RenderMobileTop() 4358 { 4359 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 4360 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4361 DateTime now = DateTime.Now; 4362 var upcomingEvent = Dynamicweb.Context.Current.Application["SpLiveShopperEvent"] as Event; 4363 bool isEventLive = upcomingEvent != null && upcomingEvent.Start > now && upcomingEvent.End < now; 4364 4365 <nav class="main-navigation-mobile dw-mod js-navigation-mobile js-main-navigation-mobile @mobileTopLayout" data-use-retractable-menu="@Model.Area.Item.GetItem("Custom").GetBoolean("RetractableMenu")"> 4366 <div class="center-container top-container__center-container dw-mod"> 4367 <div class="grid grid--align-center"> 4368 @RenderBlockList(subBlocks) 4369 </div> 4370 </div> 4371 <div class="navigation-search-container"> 4372 <div class="mobile-navigation-search-button header js-open-search"> 4373 <i class="far fa-search"></i> 4374 <p>@Translate("Smartpage:MobilMenu.SearchButtonText", "Søg efter produkter eller indhold")</p> 4375 </div> 4376 </div> 4377 @if (upcomingEvent != null && isEventLive) 4378 { 4379 <div class="liveshopping-mobile"> 4380 <div class="pulsating-circle"></div> 4381 <a href="Default.aspx?ID=@GetPageIdByNavigationTag("LiveshoppingPage")"> 4382 @Translate("Smartpage:Header.LiveshoppingTextMobile", "Vi sender LIVE nu!") 4383 </a> 4384 </div> 4385 } 4386 </nav> 4387 } 4388 4389 @helper RenderMobileHeaderNavigation() 4390 { 4391 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 4392 if (subBlocks.Any()) 4393 { 4394 <div class="grid__col-auto-width"> 4395 <ul class="menu dw-mod"> 4396 @RenderBlockList(subBlocks) 4397 </ul> 4398 </div> 4399 } 4400 } 4401 4402 @helper RenderMobileHeaderNavigationTrigger() 4403 { 4404 <li class="mobile-navigation-trigger js-mobile-navigation-trigger"> 4405 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod"></label> 4406 </li> 4407 } 4408 4409 @helper RenderMobileHeaderLogo() 4410 { 4411 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 4412 4413 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4414 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 4415 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 4416 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 4417 4418 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 4419 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 4420 { 4421 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 4422 } 4423 4424 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 4425 { 4426 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;width=100&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 4427 } 4428 else 4429 { 4430 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 4431 } 4432 4433 if (mobileTopLayout == "custom") 4434 { 4435 centeredLogo = "u-flex"; 4436 } 4437 4438 <div class="grid__col-auto grid__col--bleed"> 4439 <div class="grid__cell @centeredLogo"> 4440 <a href="/Default.aspx?ID=@firstPageId" class="logo logo--mobile u-inline-block dw-mod"> 4441 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 4442 </a> 4443 </div> 4444 4445 @RenderBlockList(subBlocks) 4446 </div> 4447 } 4448 4449 @helper RenderMobileTopActions() 4450 { 4451 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 4452 4453 <div class="u-no-padding grid__col-6"> 4454 <ul class="grid mobile-top-actions"> 4455 @RenderBlockList(subBlocks) 4456 </ul> 4457 </div> 4458 } 4459 4460 @helper RenderMobileCustomerCenterAction() 4461 { 4462 var user = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 4463 4464 if (user != null) 4465 { 4466 string customerDashboardLink = "Default.aspx?Id=" + GetPageIdByNavigationTag("CustomerDashboard"); 4467 <li class="grid__col-auto mobile-top-actions__action"> 4468 <a href="@customerDashboardLink" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 4469 @RenderProfileIcon() 4470 <span class="menu__link__text">@Translate("Smartpage:MobileHeader.Profile", "Profil")</span> 4471 </a> 4472 </li> 4473 } 4474 else 4475 { 4476 <li class="grid__col-auto mobile-top-actions__action"> 4477 <label for="SignInModalTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 4478 @RenderProfileIcon() 4479 <span class="menu__link__text">@Translate("Smartpage:MobileHeader.Login", "Login")</span> 4480 </label> 4481 </li> 4482 } 4483 4484 } 4485 4486 @helper RenderProfileIcon() 4487 { 4488 <?xml version="1.0" encoding="UTF-8" ?> 4489 4490 <svg width="16px" height="20px" viewBox="0 0 16 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 4491 <title>60DACE7C-4BF5-4F9F-93C4-F806A7E060C8</title> 4492 <g id="Philipson-Wine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 4493 <g id="Mobil---ny-header" transform="translate(-228.000000, -11.000000)" fill="#2A4A3A" fill-rule="nonzero"> 4494 <g id="Login-mobile" transform="translate(228.000000, 11.000000)"> 4495 <path d="M7.87692308,0 C5.4726297,0 3.52629696,1.94633274 3.52629696,4.35062612 C3.52629696,6.7549195 5.4726297,8.70125224 7.87692308,8.70125224 C10.2812165,8.70125224 12.2275492,6.7549195 12.2275492,4.35062612 C12.2275492,1.94633274 10.2812165,0 7.87692308,0 Z" id="Path"></path> 4496 <path d="M9.57137746,10.6003578 L6.18246869,10.6003578 C2.7706619,10.6003578 0,13.3710197 0,16.7828265 L0,19.30161 C0,19.6908766 0.297674419,19.988551 0.686940966,19.988551 L15.0669052,19.988551 C15.4561717,19.988551 15.7538462,19.6908766 15.7538462,19.30161 L15.7538462,16.7828265 C15.7538462,13.3710197 12.9831843,10.6003578 9.57137746,10.6003578 Z" id="Path"></path> 4497 </g> 4498 </g> 4499 </g> 4500 </svg> 4501 } 4502 4503 @helper RenderMobileTopMiniCart() 4504 { 4505 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4506 int cartPageId = GetPageIdByNavigationTag("CartPage"); 4507 double cartProductsCount = 0; 4508 string totalPrice = 0.ToString("N2"); 4509 string showCounterClass = "u-hidden"; 4510 4511 if (Model != null && Model.Cart != null && Model.Cart.CartOrderlines != null) 4512 { 4513 CartInformation cartInformation = new CartInformation(Model.Cart); 4514 4515 cartProductsCount = cartInformation.OrderLineCount; 4516 totalPrice = Model.Cart.TotalPrice.Price.Formatted; 4517 showCounterClass = string.Empty; 4518 } 4519 4520 <li class="grid__col-auto mobile-top-actions__action mobile-top-actions__action--mini-cart" id="miniCartWrapper"> 4521 <div class="mini-cart dw-mod"> 4522 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="menu__link menu__link--icon menu__link--mobile dw-mod js-mini-cart-button"> 4523 <div class="u-inline u-position-relative"> 4524 <?xml version="1.0" encoding="UTF-8" ?> 4525 <svg width="27px" height="23px" viewBox="0 0 27 23" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 4526 <title>684ADC2E-E513-4391-ABAF-ED9723E87695</title> 4527 <g id="Philipson-Wine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 4528 <g id="Mobil---ny-header" transform="translate(-327.000000, -8.000000)" fill="#2A4A3A"> 4529 <path d="M350.342987,22.2387411 L353.077072,12.1651775 C353.114836,11.998797 353.074565,11.8242713 352.967708,11.6912695 C352.856522,11.5719381 352.704894,11.4982887 352.542387,11.4846752 L332.273764,11.4846752 L330.888495,8.44182719 C330.844749,8.16203921 330.586037,7.96803313 330.305223,8.00437367 L327,8.00437367 L327,9.11013998 L329.952811,9.11013998 L331.301626,12.152988 L334.035711,22.2387411 L334.10862,22.4331459 L335.056436,25.8841871 C334.161821,26.361 333.611928,27.3009555 333.634712,28.3145034 L333.634712,28.8734529 L333.695488,28.8734529 C333.939334,30.1096578 335.023741,31.0005706 336.283755,31.000055 C337.775597,31.0066653 338.992321,29.8062883 339.005707,28.3144465 C338.990442,27.744162 338.799454,27.1924465 338.45889,26.7347722 L345.907732,26.7347722 C345.571497,27.1939275 345.384839,27.7454721 345.373048,28.3144465 C345.386434,29.8062883 346.603101,31.0066653 348.095,31.000055 C349.355014,31.0005137 350.439421,30.1096008 350.683267,28.8734529 L350.744043,28.8734529 L350.744043,28.3145034 C350.757486,26.8448191 349.576931,25.6425624 348.107303,25.6291198 C348.099158,25.6290628 348.091013,25.6290059 348.082868,25.6290059 L336.283755,25.6290059 L336.101483,25.6290059 L335.639707,23.9035137 C335.84727,23.9723785 336.065085,24.0052445 336.283755,24.0007446 L348.082811,24.0007446 C349.149161,23.9955043 350.077781,23.2715984 350.342987,22.2387411 Z M348.0103,26.6991721 C348.889252,26.6791222 349.617999,27.3754024 349.637992,28.2543536 C349.638448,28.2744035 349.638505,28.2944535 349.63822,28.3145034 C349.638448,29.1728921 348.953161,29.8744126 348.095,29.8941777 L348.082868,29.8820452 C347.203916,29.9020952 346.475169,29.205815 346.455176,28.3268638 C346.435069,27.4479126 347.131349,26.7191651 348.0103,26.6991721 Z M336.332684,26.6987164 C337.211578,26.712216 337.913155,27.4356092 337.899884,28.3145034 C337.907004,29.180183 337.211008,29.8877982 336.345329,29.8949182 C336.324823,29.8950891 336.304261,29.8948613 336.283755,29.8942347 L336.283755,29.8821022 C335.40469,29.8686027 334.703055,29.1449816 334.716612,28.2659734 C334.730168,27.3869653 335.453675,26.6851599 336.332684,26.6987164 Z" id="Cart-mobile"></path> 4530 </g> 4531 </g> 4532 </svg> 4533 <div class="mini-cart__counter dw-mod @showCounterClass"> 4534 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 4535 <div class="js-mini-cart-counter-content u-ta-center" data-count="@cartProductsCount"> 4536 @cartProductsCount 4537 </div> 4538 </div> 4539 </div> 4540 </div> 4541 </a> 4542 <div class="js-handlebars-root js-mini-cart-counter u-ta-center" id="cartCounterPrice" data-template="MiniCartCounterPrice" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 4543 <span class="menu__link__text js-mini-cart-total-price">@totalPrice</span> 4544 </div> 4545 </div> 4546 </li> 4547 } 4548 4549 @helper RenderMobileMiniCartCounterContent() 4550 { 4551 <script id="MiniCartCounterContent" type="text/x-template"> 4552 {{#.}} 4553 <div class="js-mini-cart-counter-content dw-mod" data-count="{{numberofproducts}}"> 4554 {{numberofproducts}} 4555 </div> 4556 {{/.}} 4557 </script> 4558 4559 <script id="MiniCartCounterPrice" type="text/x-template"> 4560 {{#.}} 4561 <span class="menu__link__text js-mini-cart-total-price">{{totalprice}}</span> 4562 {{/.}} 4563 </script> 4564 } 4565 4566 @helper RenderMobileCheckoutUsp() 4567 { 4568 <div class="custom__checkout__headerusp usp-swiper-container"> 4569 <div class="swiper-wrapper"> 4570 @RenderMobileUsp("help", Translate("Smartpage:Checkout.Brug for hælp?", "Brug for hælp?"), Translate("Smartpage:Checkout.Tel: 70 22 68 88", "Tel: 70 22 68 88")) 4571 @RenderMobileUsp("Secure", Translate("Smartpage:Checkout.Sikker betaling", "Sikker betaling"), Translate("Smartpage:Checkout.Krypteret betaling", "Krypteret betaling")) 4572 @RenderMobileUsp("delivery", Translate("Smartpage:Checkout.Hurtig levering", "Hurtig levering"), Translate("Smartpage:Checkout.1-2 dages levering", "1-2 dages levering")) 4573 @RenderMobileUsp("tilfredshed", Translate("Smartpage:Checkout.100% tilfredshed!", "100% tilfredshed!"), Translate("Smartpage:Checkout.Du kan nemt sende retur", "Du kan nemt sende retur")) 4574 </div> 4575 </div> 4576 } 4577 4578 @helper RenderMobileUsp(string icon, string toptext, string bottomtext) 4579 { 4580 string svg = icon + ".svg"; 4581 4582 <div class="swiper-slide"> 4583 <div class="u-flex u-padding"> 4584 <div class="u-margin-right"> 4585 <img src="Files/Images/SvgIcons/@svg" height="28" width="28" /> 4586 </div> 4587 <div class="swiper-slide__text-section"> 4588 <div class="u-block"> 4589 <strong>@toptext</strong> 4590 </div> 4591 <div class="u-block"> 4592 @bottomtext 4593 </div> 4594 </div> 4595 </div> 4596 </div> 4597 } 4598 </text> 4599 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4600 @using System 4601 @using System.Web 4602 @using System.Collections.Generic 4603 @using Dynamicweb.Rapido.Blocks.Extensibility 4604 @using Dynamicweb.Rapido.Blocks 4605 @using System.Text.RegularExpressions 4606 @using Dynamicweb.Ecommerce.International 4607 @using Dynamicweb.Core 4608 4609 @functions { 4610 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 4611 } 4612 4613 @{ 4614 bool mobileNavigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4615 bool mobileHideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4616 bool mobileHideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4617 bool mobileHideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4618 bool mobileHideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4619 bool mobileHideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4620 bool mobileHideCustomerStockLink = false; 4621 4622 List<Currency> currencies = Dynamicweb.Ecommerce.Services.Currencies.GetCurrenciesForLanguage(Dynamicweb.Ecommerce.Common.Context.LanguageID).ToList(); 4623 4624 Block mobileNavigation = new Block() 4625 { 4626 Id = "MobileNavigation", 4627 SortId = 10, 4628 Template = MobileNavigation(currencies), 4629 SkipRenderBlocksList = true 4630 }; 4631 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 4632 4633 if (Model.CurrentUser.ID > 0 && !mobileHideMyProfileLink) 4634 { 4635 Block mobileNavigationSignIn = new Block 4636 { 4637 Id = "MobileNavigationSignIn", 4638 SortId = 10, 4639 Template = RenderMobileNavigationSignIn() 4640 }; 4641 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 4642 } 4643 4644 Block mobileNavigationMenu = new Block 4645 { 4646 Id = "MobileNavigationMenu", 4647 SortId = 20, 4648 Template = RenderMobileNavigationMenu() 4649 }; 4650 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 4651 4652 Block mobileNavigationActions = new Block 4653 { 4654 Id = "MobileNavigationActions", 4655 SortId = 40, 4656 Template = RenderMobileNavigationActions(), 4657 SkipRenderBlocksList = true 4658 }; 4659 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4660 4661 int newsletterSignupPageId = GetPageIdByNavigationTag("SignupForNewsletter"); 4662 if (newsletterSignupPageId > 0) 4663 { 4664 Block mobileNavigationNewsletterSignup = new Block 4665 { 4666 Id = "MobileNavigationNewsletterSignup", 4667 SortId = 30, 4668 Template = RenderMobileNavigationNewsletterSignup(newsletterSignupPageId), 4669 SkipRenderBlocksList = true 4670 }; 4671 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationNewsletterSignup); 4672 } 4673 4674 if (!mobileNavigationItemsHideSignIn) 4675 { 4676 if (Model.CurrentUser.ID <= 0) 4677 { 4678 Block mobileNavigationSignInAction = new Block 4679 { 4680 Id = "MobileNavigationSignInAction", 4681 SortId = 10, 4682 Template = RenderMobileNavigationSignInAction() 4683 }; 4684 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4685 4686 if (!mobileHideCreateAccountLink) 4687 { 4688 Block mobileNavigationCreateAccountAction = new Block 4689 { 4690 Id = "MobileNavigationCreateAccountAction", 4691 SortId = 20, 4692 Template = RenderMobileNavigationCreateAccountAction() 4693 }; 4694 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4695 } 4696 } 4697 else 4698 { 4699 if (!mobileHideMyOrdersLink) 4700 { 4701 Block mobileNavigationOrdersAction = new Block 4702 { 4703 Id = "MobileNavigationOrdersAction", 4704 SortId = 20, 4705 Template = RenderMobileNavigationOrdersAction() 4706 }; 4707 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4708 } 4709 if (!mobileHideMyFavoritesLink) 4710 { 4711 Block mobileNavigationFavoritesAction = new Block 4712 { 4713 Id = "MobileNavigationFavoritesAction", 4714 SortId = 30, 4715 Template = RenderMobileNavigationFavoritesAction() 4716 }; 4717 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4718 } 4719 if (!mobileHideMySavedCardsLink) 4720 { 4721 Block mobileNavigationSavedCardsAction = new Block 4722 { 4723 Id = "MobileNavigationFavoritesAction", 4724 SortId = 30, 4725 Template = RenderMobileNavigationSavedCardsAction() 4726 }; 4727 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4728 } 4729 4730 if (!mobileHideCustomerStockLink) 4731 { 4732 Block mobileNavigationCustomerStockAction = new Block 4733 { 4734 Id = "MobileNavigationCustomerStockAction", 4735 SortId = 31, 4736 Template = RenderMobileNavigationCustomerStockAction() 4737 }; 4738 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCustomerStockAction); 4739 } 4740 4741 Block mobileNavigationSignOutAction = new Block 4742 { 4743 Id = "MobileNavigationSignOutAction", 4744 SortId = 50, 4745 Template = RenderMobileNavigationSignOutAction() 4746 }; 4747 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4748 } 4749 } 4750 4751 var languages = Model.Languages.Where(l => Dynamicweb.Services.Areas.GetArea(l.ID).Published).ToList(); 4752 4753 if (languages.Count > 1) 4754 { 4755 Block mobileNavigationLanguagesAction = new Block 4756 { 4757 Id = "MobileNavigationLanguagesAction", 4758 SortId = 60, 4759 Template = RenderMobileNavigationLanguagesAction(languages) 4760 }; 4761 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 4762 } 4763 4764 if (currencies.Count > 1) 4765 { 4766 mobileNavigationBlocksPage.Add("MobileNavigationActions", new Block 4767 { 4768 Id = "MobileNavigationCurrenciesAction", 4769 SortId = 60, 4770 Template = RenderMobileNavigationCurrenciesAction(currencies) 4771 }); 4772 } 4773 } 4774 4775 4776 @helper MobileNavigation(List<Currency> currencies) 4777 { 4778 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4779 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4780 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4781 4782 <!-- Trigger for mobile navigation --> 4783 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 4784 4785 <!-- Mobile navigation --> 4786 <nav class="mobile-navigation mobile-navigation--@position dw-mod js-mobile-navigation"> 4787 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 4788 <div class="mobile-navigation-header"> 4789 <div class="mobile-navigation-header-topbar"> 4790 <p>@Translate("Smartpage:MobilMenu.headerText", "Brug for hjælp? +45 70 22 68 88")</p> 4791 @if (currencies.Count > 1) 4792 { 4793 bool languageSelectionFromCookie = Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection") != null && Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection").Value); 4794 <div class="mobile-navigation-header-currency"> 4795 <select onchange="javascript:location.href=this.value;"> 4796 <option disabled selected hidden>@string.Format(Translate("Smartpage:MobilMenu.Currency", "Valuta: {0}"), Dynamicweb.Ecommerce.Common.Context.Currency.Code)</option> 4797 @foreach (Currency currency in currencies) 4798 { 4799 var pageId = Pageview.Page.ID; 4800 4801 if (!languageSelectionFromCookie) 4802 { 4803 4804 var currencyLanguageMapping = Pageview.AreaSettings.GetItem("Custom").GetItems("CurrencyLanguageMapping")?.FirstOrDefault(m => m.GetRawValueString("Currency") == currency.Code); 4805 if (currencyLanguageMapping != null) 4806 { 4807 var language = Model.Languages.FirstOrDefault(l => l.ID == Dynamicweb.Core.Converter.ToInt32(currencyLanguageMapping.GetRawValueString("Language"))); 4808 4809 if (language != null) 4810 { 4811 pageId = language.Page.ID; 4812 } 4813 } 4814 } 4815 var qs = HttpUtility.ParseQueryString(Dynamicweb.Context.Current.Request.QueryString.ToString()); 4816 qs.Set("ID", Converter.ToString(pageId)); 4817 qs.Set("CurrencyCode", currency.Code); 4818 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + qs); 4819 4820 <option value="@url">@currency.Code</option> 4821 } 4822 </select> 4823 </div> 4824 } 4825 <div class="mobile-navigation-header-close js-navigation-close"> 4826 <div class="mobile-navigation-header-cross"> 4827 <span></span> 4828 <span></span> 4829 </div> 4830 </div> 4831 </div> 4832 <div class="mobile-navigation-search-button js-open-search"> 4833 <i class="far fa-search"></i> 4834 <p>@Translate("Smartpage:MobilMenu.NavigatioSearchButtonText", "Søg efter produkter eller indhold")</p> 4835 </div> 4836 </div> 4837 @RenderBlockList(subBlocks) 4838 </div> 4839 <div class="mobile-navigation-footer"> 4840 <ul> 4841 @foreach (var icon in Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetItems("HeaderUSP")) 4842 { 4843 <li> 4844 @if (!string.IsNullOrWhiteSpace(icon.GetString("Link"))) 4845 { 4846 <a href="@icon.GetString("Link")"><i class="fa fa-check"></i> @icon.GetString("Label")</a> 4847 } 4848 else 4849 { 4850 <i class="fa fa-check"></i> @icon.GetString("Label") 4851 } 4852 </li> 4853 } 4854 </ul> 4855 </div> 4856 </nav> 4857 4858 <div class="search-overlay-header js-overlay-search"> 4859 @RenderOverlaySearchBar() 4860 </div> 4861 4862 <label class="mobile-nav-trigger-off js-mobile-nav-trigger-off" for="MobileNavTrigger"></label> 4863 } 4864 4865 @helper RenderMobileNavigationSignIn() 4866 { 4867 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4868 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4869 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4870 string myProfilePageLink = linkStart + myProfilePageId; 4871 string userName = Model.CurrentUser.FirstName; 4872 string bonusFormatted = ""; 4873 4874 4875 //Dynamicweb.Ecommerce.Loyalty.LoyaltyService loyaltyService = new Dynamicweb.Ecommerce.Loyalty.LoyaltyService(); 4876 double bonus = Dynamicweb.Ecommerce.Services.Loyalty.GetPointsBalance(Dynamicweb.Security.UserManagement.User.GetUserByID(Model.CurrentUser.ID)); 4877 4878 if (Dynamicweb.Core.Converter.ToDouble(bonus) > 0.0) 4879 { 4880 bonusFormatted = Dynamicweb.Ecommerce.Services.Currencies.Format(Dynamicweb.Ecommerce.Common.Context.Currency, bonus); 4881 } 4882 4883 if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(Model.CurrentUser.LastName)) 4884 { 4885 userName += " " + Model.CurrentUser.LastName; 4886 } 4887 if (string.IsNullOrEmpty(userName)) 4888 { 4889 userName = Model.CurrentUser.Name; 4890 } 4891 if (string.IsNullOrEmpty(userName)) 4892 { 4893 userName = Model.CurrentUser.UserName; 4894 } 4895 if (string.IsNullOrEmpty(userName)) 4896 { 4897 userName = Model.CurrentUser.Email; 4898 } 4899 4900 <ul class="menu menu-mobile"> 4901 <li class="menu-mobile__item logged-in-mobile-item"> 4902 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod u-flex--column"> 4903 <span class="u-flex u-flex--row"> 4904 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> 4905 @userName 4906 </span> 4907 @if (!string.IsNullOrEmpty(bonusFormatted)) 4908 { 4909 <span class="mobile-navigation-description">@Translate("Bonus:") @bonusFormatted</span> 4910 } 4911 </a> 4912 </li> 4913 4914 </ul> 4915 } 4916 4917 @helper RenderMobileNavigationMenu() 4918 { 4919 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4920 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4921 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 4922 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4923 int startLevel = 0; 4924 4925 var navigationSettings = new Dynamicweb.Frontend.Navigation.NavigationSettings() 4926 { 4927 RootAreaId = 0, 4928 RootPageId = 0, 4929 RootNavigationTag = "main-menu", 4930 StartLevel = 1, 4931 StopLevel = 99, 4932 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 4933 }; 4934 4935 var navigationTemplate = "Navigation/SpViewModelNavigationMobile.cshtml"; 4936 @Navigation.RenderNavigation(navigationTemplate, navigationSettings) 4937 4938 4939 if (isSlidesDesign) 4940 { 4941 <script> 4942 function goToLevel(level) { 4943 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 4944 } 4945 4946 document.addEventListener('DOMContentLoaded', function () { 4947 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 4948 }); 4949 </script> 4950 } 4951 4952 if (renderPagesInToolBar) 4953 { 4954 @RenderNavigation(new 4955 { 4956 id = "topToolsMobileNavigation", 4957 cssclass = "menu menu-mobile dwnavigation", 4958 template = "ToolsMenuForMobile.xslt" 4959 }) 4960 } 4961 } 4962 4963 @helper RenderMobileNavigationActions() 4964 { 4965 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4966 4967 <ul class="menu menu-mobile menu-mobile-actions"> 4968 @RenderBlockList(subBlocks) 4969 </ul> 4970 } 4971 4972 @helper RenderMobileNavigationNewsletterSignup(int newsletterSignupPageId) 4973 { 4974 string placeholderName = Translate("Smartpage:SidemenuSignup.Name", "Skriv dit navn"); 4975 string placeholderEmail = Translate("Smartpage:SidemenuSignup.Email", "Skriv din email"); 4976 string url = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.RawUrl; 4977 string device = Pageview.Device.ToString() == "Mobile" ? "Mobile" : "Desktop"; 4978 string listId = Pageview.AreaSettings.GetItem("Custom").GetRawValueString("FooterSignupListId"); 4979 string actionUrl = "/Default?aspx?ID=" + newsletterSignupPageId; 4980 4981 <div class="mobile-sidemenu-newsletter-signup-container js-signup-form-container"> 4982 <form class="show-signup-form signup-form js-signup-form" method="post" action="@actionUrl"> 4983 <div class="signup-form-container"> 4984 <div> 4985 <p class="header-title">@Translate("Smartpage:SidemenuSignup.HeaderTitle", "Gå ikke glip af de bedste tilbud!")</p> 4986 <p class="header-text">@Translate("Smartpage:SidemenuSignup.HeaderText", "Tilmeld dig vores nyhedsbrev")</p> 4987 </div> 4988 <input required name="name" type="text" placeholder="@placeholderName" aria-label="@placeholderName" autocomplete="given-name" /> 4989 <input required name="email" type="email" placeholder="@placeholderEmail" aria-label="@placeholderEmail" autocomplete="email" /> 4990 <input name="origin" type="hidden" value="WebsiteSidemenuSignup" /> 4991 <input name="url" type="hidden" value=@url /> 4992 <input name="device" type="hidden" value=@device /> 4993 <input name="listId" type="hidden" value=@listId /> 4994 <input class="js-newsletter-signup-page-id" name="pageId" type="hidden" value=@newsletterSignupPageId /> 4995 </div> 4996 <button>@Translate("Smartpage:SidemenuSignup.Button", "Tilmeld")</button> 4997 </form> 4998 <div class="hide-signup-form submitted-form-message js-submitted-form-message"> 4999 <div> 5000 <p class="header-title">@Translate("Smartpage:SidemenuSignup.Submitted.HeaderTitle", "Tak for din tilmelding!")</p> 5001 <p class="header-text">@Translate("Smartpage:SidemenuSignup.Submitted.HeaderText", "Du er nu tilmeldt vores nyhedsbrev og er en af de første til at modtage vores nye og spændende vintilbud.")</p> 5002 </div> 5003 <div class="submitted-form-message-links"> 5004 <a href="Default.aspx?ID=@Dynamicweb.Content.Services.Pages.GetFirstPageForArea(Pageview.AreaID).ID">@Translate("Smartpage:SidemenuSignup.Submitted.FrontPage", "Gå til forsiden")</a> 5005 <a href="Default.aspx?ID=@GetPageIdByNavigationTag("OffersPage")">@Translate("Smartpage:SidemenuSignup.Submitted.AllOffers", "Se alle tilbud")</a> 5006 </div> 5007 </div> 5008 </div> 5009 } 5010 5011 @helper RenderMobileNavigationSignInAction() 5012 { 5013 <li class="menu-mobile__item mobile-navigation-login"> 5014 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign in")</label> 5015 </li> 5016 } 5017 5018 @helper RenderMobileNavigationCreateAccountAction() 5019 { 5020 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 5021 5022 <li class="menu-mobile__item mobile-navigation-create-account"> 5023 <h3>@Translate("Smartpage:MobilMenu.CreateAccountHeading", "Opret bruger og få 100 DKK i opstartsbonus")</h3> 5024 <p>@Translate("Smartpage:MobilMenu.CreateAccountText", "(Gælder på dit næste køb)")</p> 5025 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Create account")</a> 5026 </li> 5027 } 5028 5029 @helper RenderMobileNavigationCustomerStockAction() 5030 { 5031 int customerStockPageId = GetPageIdByNavigationTag("CustomerStockPage"); 5032 5033 <li class="menu-mobile__item logged-in-mobile-item"> 5034 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@customerStockPageId"><i class="fal fa-clipboard-list menu-mobile__link-icon"></i> @Translate("Smartpage:SignInActions.CustomerStock", "Mit kundelager")</a> 5035 </li> 5036 } 5037 5038 @helper RenderMobileNavigationProfileAction() 5039 { 5040 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 5041 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 5042 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 5043 string myProfilePageLink = linkStart + myProfilePageId; 5044 5045 <li class="menu-mobile__item logged-in-mobile-item"> 5046 <a href="@myProfilePageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 5047 </li> 5048 } 5049 5050 @helper RenderMobileNavigationOrdersAction() 5051 { 5052 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 5053 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 5054 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 5055 string myOrdersPageLink = linkStart + myOrdersPageId; 5056 string ordersIcon = "fas fa-list"; 5057 5058 <li class="menu-mobile__item logged-in-mobile-item"> 5059 <a href="@myOrdersPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@ordersIcon menu-mobile__link-icon"></i> @Translate("My Orders")</a> 5060 </li> 5061 } 5062 5063 @helper RenderMobileNavigationFavoritesAction() 5064 { 5065 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 5066 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 5067 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 5068 string myFavoritesPageLink = linkStart + myFavoritesPageId; 5069 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 5070 5071 5072 <li class="menu-mobile__item logged-in-mobile-item"> 5073 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 5074 </li> 5075 } 5076 5077 @helper RenderMobileNavigationSavedCardsAction() 5078 { 5079 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 5080 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 5081 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 5082 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 5083 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 5084 5085 <li class="menu-mobile__item logged-in-mobile-item"> 5086 <a href="@mySavedCardsPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 5087 </li> 5088 } 5089 5090 @helper RenderMobileNavigationSignOutAction() 5091 { 5092 int pageId = Model.TopPage.ID; 5093 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 5094 5095 <li class="menu-mobile__item logged-in-mobile-item"> 5096 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" onclick="RememberState.SetCookie('useAnotherAddress', false)"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 5097 </li> 5098 } 5099 5100 @helper RenderMobileNavigationLanguagesAction(List<Dynamicweb.Frontend.PageLanguageViewModel> languages) 5101 { 5102 <li class="menu-mobile__item mobile-navigation-language-selector"> 5103 <div class="h3">@Translate("Smartpage:MobileLanguageSelector.Language", "Sprog")</div> 5104 <ul class="menu-mobile u-margin-top"> 5105 @foreach (var lang in languages) 5106 { 5107 var area = Dynamicweb.Services.Areas.GetArea(lang.ID); 5108 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 5109 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 5110 string selectedClass = lang.IsCurrent ? "u-underline" : string.Empty; 5111 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl($"Default.aspx?Id={lang.Page.ID}&CurrencyCode={area.EcomCurrencyId}&ActiveLanguageSelection=True"); 5112 5113 string primaryDomain = area.DomainLock; 5114 if (!string.IsNullOrEmpty(primaryDomain)) 5115 { 5116 url = HttpContext.Current.Request.Url.Scheme + "://" + primaryDomain + url; 5117 } 5118 5119 <li class="u-ta-center"> 5120 <a class="mobile-navigation-language-selector__link @selectedClass" href="@url">@cultureName</a> 5121 </li> 5122 } 5123 </ul> 5124 </li> 5125 } 5126 5127 @helper RenderMobileNavigationCurrenciesAction(List<Currency> currencies) 5128 { 5129 bool languageSelectionFromCookie = Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection") != null && Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection").Value); 5130 <li class="menu-mobile__item mobile-navigation-currency-selector"> 5131 <div class="h3">@Translate("Smartpage:MobileCurrencySelector.Currency", "Valuta")</div> 5132 <ul class="menu-mobile u-margin-top"> 5133 @foreach (Currency currency in currencies) 5134 { 5135 var pageId = Pageview.Page.ID; 5136 5137 if (!languageSelectionFromCookie) 5138 { 5139 5140 var currencyLanguageMapping = Pageview.AreaSettings.GetItem("Custom").GetItems("CurrencyLanguageMapping")?.FirstOrDefault(m => m.GetRawValueString("Currency") == currency.Code); 5141 if (currencyLanguageMapping != null) 5142 { 5143 var language = Model.Languages.FirstOrDefault(l => l.ID == Dynamicweb.Core.Converter.ToInt32(currencyLanguageMapping.GetRawValueString("Language"))); 5144 5145 if (language != null) 5146 { 5147 pageId = language.Page.ID; 5148 } 5149 } 5150 } 5151 5152 var qs = HttpUtility.ParseQueryString(Dynamicweb.Context.Current.Request.QueryString.ToString()); 5153 qs.Set("ID", Converter.ToString(pageId)); 5154 qs.Set("CurrencyCode", currency.Code); 5155 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + qs); 5156 5157 var activeClass = currency.Code == Dynamicweb.Ecommerce.Common.Context.Currency.Code ? "u-underline" : string.Empty; 5158 5159 <li class="u-ta-center"> 5160 <a href="@(url)" class="mobile-navigation-currency-selector__link @(activeClass)">@currency.Code</a> 5161 </li> 5162 5163 } 5164 </ul> 5165 </li> 5166 } 5167 5168 @helper RenderOverlaySearchBar() 5169 { 5170 string searchFeedId = string.Empty; 5171 string searchSecondFeedId = string.Empty; 5172 int groupsFeedId; 5173 string productsSearchId = Converter.ToString(GetPageIdByNavigationTag("ProductSearchFeed")); 5174 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 5175 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 5176 string resultPageLink; 5177 string searchPlaceholder; 5178 string searchType = "product-search"; 5179 string searchTemplate; 5180 string searchContentTemplate = ""; 5181 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 5182 bool showGroups = true; 5183 string beforeSearchTemplate = Pageview.AreaSettings.GetItem("Custom").GetString("MobileBeforeSearchRecommendationsTemplate"); 5184 5185 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 5186 { 5187 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 5188 resultPageLink = contentSearchPageLink; 5189 searchPlaceholder = Translate("Search page"); 5190 groupsFeedId = 0; 5191 searchType = "content-search"; 5192 searchTemplate = "SearchPagesTemplate"; 5193 showGroups = false; 5194 } 5195 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 5196 { 5197 searchFeedId = productsSearchId + "&feed=true"; 5198 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 5199 resultPageLink = Converter.ToString(productsPageId); 5200 searchPlaceholder = Translate("Search products or pages"); 5201 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 5202 searchType = "combined-search"; 5203 searchTemplate = "SearchProductsTemplateWrap"; 5204 searchContentTemplate = "SearchPagesTemplateWrap"; 5205 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 5206 } 5207 else 5208 { 5209 resultPageLink = Converter.ToString(productsPageId); 5210 searchFeedId = productsSearchId + "&feed=true"; 5211 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 5212 searchPlaceholder = Translate("Search products"); 5213 searchTemplate = "SearchResultsTypeAheadMobile"; 5214 searchType = "product-search"; 5215 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 5216 } 5217 5218 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 5219 5220 <div class="main-navigation-mobile typeahead-mobile dw-mod overlay-search"> 5221 <div class="center-container top-container__center-container u-no-padding dw-mod"> 5222 <div class="grid"> 5223 <div class="grid__col-11 u-margin-top u-padding-right"> 5224 <div class="typeahead-mobile__search-field dw-mod u-no-padding-x js-typeahead" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageLink" data-search-type="@searchType"> 5225 <form class="u-full-width" action="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(productsPageId)" id="SearchSubmitForm"> 5226 <input type="text" class="typeahead-autocomplete js-typeahead-autocomplete u-no-margin" disabled /> 5227 <input id="TypeaheadSearchFieldMobile" type="text" class="js-typeahead-search-field u-no-margin typeahead-input-field" data-shop-id="@Pageview.Area.EcomShopId" data-area-id="@Dynamicweb.Core.Converter.ToString(Pageview.AreaID)" placeholder="@HttpUtility.HtmlAttributeEncode(searchPlaceholder)" value="@HttpUtility.HtmlAttributeEncode(searchValue)" /> 5228 <button type="button" class="u-hidden js-typeahead-enter-btn"></button> 5229 <div class="mobile-clear-search-input js-mobile-clear-search-input">@Translate("Smartpage:MobilMenu.clearSearch", "Ryd")</div> 5230 </form> 5231 <span class="typeahead-search-overlay typeahead-search-container js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></span> 5232 </div> 5233 </div> 5234 <div class="search-overlay-header-close js-search-overlay-close grid__col-1 u-margin-top u-justify-content--center"> 5235 <div class="search-overlay-header-cross"> 5236 <span></span> 5237 <span></span> 5238 </div> 5239 <p class="u-no-margin--bottom">@Translate("Smartpage:MobilMenu.CloseText", "Luk")</p> 5240 </div> 5241 </div> 5242 </div> 5243 </div> 5244 }</text> 5245 } 5246 else 5247 { 5248 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5249 5250 @using System 5251 @using System.Web 5252 @using System.Collections.Generic 5253 @using Dynamicweb.Rapido.Blocks.Extensibility 5254 @using Dynamicweb.Rapido.Blocks 5255 @using Smartpage.PhilipsonWine.Ecommerce.CartInformation; 5256 5257 @functions { 5258 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 5259 } 5260 5261 @{ 5262 Block masterTools = new Block() 5263 { 5264 Id = "MasterDesktopTools", 5265 SortId = 10, 5266 Template = RenderDesktopTools(), 5267 SkipRenderBlocksList = true, 5268 BlocksList = new List<Block> 5269 { 5270 new Block { 5271 Id = "MasterDesktopToolsText", 5272 SortId = 10, 5273 Template = RenderDesktopToolsText(), 5274 Design = new Design 5275 { 5276 Size = "auto", 5277 HidePadding = true, 5278 RenderType = RenderType.Column 5279 } 5280 }, 5281 new Block { 5282 Id = "MasterDesktopToolsNavigation", 5283 SortId = 20, 5284 Template = RenderDesktopToolsNavigation(), 5285 Design = new Design 5286 { 5287 Size = "auto-width", 5288 HidePadding = true, 5289 RenderType = RenderType.Column 5290 } 5291 } 5292 } 5293 }; 5294 headerBlocksPage.Add("MasterHeader", masterTools); 5295 5296 Block masterDesktopExtra = new Block() 5297 { 5298 Id = "MasterDesktopExtra", 5299 SortId = 10, 5300 Template = RenderDesktopExtra(), 5301 SkipRenderBlocksList = true 5302 }; 5303 headerBlocksPage.Add("MasterHeader", masterDesktopExtra); 5304 5305 Block masterDesktopNavigation = new Block() 5306 { 5307 Id = "MasterDesktopNavigation", 5308 SortId = 20, 5309 Template = RenderDesktopNavigation(), 5310 SkipRenderBlocksList = true 5311 }; 5312 headerBlocksPage.Add("MasterHeader", masterDesktopNavigation); 5313 5314 5315 } 5316 5317 @* Include the Blocks for the page *@ 5318 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5319 @using Dynamicweb.Rapido.Blocks 5320 5321 @{ 5322 bool isSidemenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetRawValueString("NavigationMegaMenu") == "sidemenu" : false; 5323 if (isSidemenu && Pageview.Device.ToString() == "Desktop") 5324 { 5325 Block masterDesktopBurgerMenuBlock = new Block 5326 { 5327 Id = "MasterDesktopBurgerMenu", 5328 SortId = 10, 5329 Template = RenderDesktopBurgerMenu() 5330 }; 5331 5332 BlocksPage.GetBlockPage("Master").Add("MasterDesktopExtra", masterDesktopBurgerMenuBlock); 5333 } 5334 } 5335 5336 @helper RenderDesktopBurgerMenu() 5337 { 5338 <div class="grid__col-lg-auto-width grid__col-md-auto-width grid__col-sm-12 grid__col-xs-12 u-no-padding grid--align-self-center dw-mod desktop-burger-menu js-desktop-burger-menu"> 5339 @RenderDesktopBurgerMenuIcon() 5340 </div> 5341 } 5342 5343 @helper RenderDesktopBurgerMenuIcon() 5344 { 5345 <svg class="btn" xmlns="http://www.w3.org/2000/svg" width="95" height="43" viewBox="0 0 95 43"> 5346 <g id="Group_121" data-name="Group 121" transform="translate(0 -3)"> 5347 <g id="Rectangle_3" data-name="Rectangle 3" transform="translate(0 3)" fill="none" stroke="#fff" stroke-width="1"> 5348 <rect width="95" height="43" rx="8" stroke="none" /> 5349 <rect x="0.5" y="0.5" width="94" height="42" rx="7.5" fill="none" /> 5350 </g> 5351 <rect id="Rectangle_5" data-name="Rectangle 5" width="15" height="2" rx="1" transform="translate(14.5 18.8)" fill="#dedede" /> 5352 <rect id="Rectangle_6" data-name="Rectangle 6" width="11" height="2" rx="1" transform="translate(14.5 23.8)" fill="#dedede" /> 5353 <rect id="Rectangle_7" data-name="Rectangle 7" width="15" height="2" rx="1" transform="translate(14.5 28.8)" fill="#dedede" /> 5354 <text id="Menu" transform="translate(38.5 30.5)" fill="#fff" font-size="16" font-family="Mulish-Bold, Mulish" font-weight="700"><tspan x="0" y="0">@Translate("Smartpage:Desktop.Sidemenu.BurgerButton.Text", "Menu")</tspan></text> 5355 </g> 5356 </svg> 5357 } 5358 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5359 5360 @using System 5361 @using System.Web 5362 @using Dynamicweb.Rapido.Blocks.Extensibility 5363 @using Dynamicweb.Rapido.Blocks 5364 5365 @{ 5366 Block masterDesktopLogo = new Block 5367 { 5368 Id = "MasterDesktopLogo", 5369 SortId = 10, 5370 Template = RenderDesktopLogo(), 5371 Design = new Design 5372 { 5373 Size = "auto-width", 5374 HidePadding = true, 5375 RenderType = RenderType.Column, 5376 CssClass = "grid--align-self-center" 5377 } 5378 }; 5379 5380 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopLogo); 5381 } 5382 5383 5384 @helper RenderDesktopLogo() 5385 { 5386 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 5387 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5388 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 5389 alignClass = topLayout == "splitted-center" ? "u-middle" : alignClass; 5390 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 5391 if (Path.GetExtension(logo).ToLower() != ".svg") 5392 { 5393 int logoHeight = Model.Area.Item.GetItem("Layout").GetInt32("LogoHeight"); 5394 logoHeight = logoHeight > 0 && Pageview.Device.ToString() != "Mobile" ? logoHeight : 40; 5395 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(logoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 5396 } 5397 else 5398 { 5399 logo = HttpUtility.UrlDecode(logo); 5400 } 5401 5402 <div class="logo @alignClass dw-mod"> 5403 <a href="/Default.aspx?ID=@firstPageId" class="logo__img dw-mod u-block"> 5404 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@Translate("Logo")" /> 5405 </a> 5406 </div> 5407 } 5408 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5409 5410 @using System 5411 @using System.Web 5412 @using Dynamicweb.Rapido.Blocks.Extensibility 5413 @using Dynamicweb.Rapido.Blocks 5414 5415 @functions { 5416 string menuType; 5417 } 5418 5419 @{ 5420 menuType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetRawValueString("NavigationMegaMenu") : "dropdown"; 5421 Block masterDesktopMenu = new Block 5422 { 5423 Id = "MasterDesktopMenu", 5424 SortId = 10, 5425 Template = RenderDesktopMenu(), 5426 Design = new Design 5427 { 5428 Size = "auto", 5429 HidePadding = true, 5430 RenderType = RenderType.Column 5431 } 5432 }; 5433 5434 if (menuType == "megamenu") 5435 { 5436 masterDesktopMenu.Design.CssClass = "u-reset-position"; 5437 } 5438 5439 if (menuType == "sidemenu") 5440 { 5441 masterDesktopMenu.Design.CssClass = "u-reset-position full-size"; 5442 } 5443 5444 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopMenu); 5445 } 5446 5447 @helper RenderDesktopMenu() 5448 { 5449 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5450 string menuAlignment = topLayout == "minimal-right" ? "grid--align-self-end" : ""; 5451 menuAlignment = topLayout == "minimal-center" ? "grid--align-self-center" : topLayout; 5452 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 5453 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 5454 bool showOnlyHeaders = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowOnlyHeaders"); 5455 int startLevel = renderPagesInToolBar ? 1 : 0; 5456 5457 string promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"); 5458 5459 <div class="grid__cell u-flex @(menuType == "sidemenu" ? "sidemenu-container js-sidemenu-container" : "") @(menuType == "megamenu" ? "u-reset-position" : "") @menuAlignment"> 5460 @if (Pageview.Page.NavigationTag == "CartPage" && menuType != "sidemenu") 5461 { 5462 <div class="custom__checkout__headerusp grid"> 5463 @RenderUsps("help", Translate("Smartpage:Checkout.Brug for hælp?", "Brug for hælp?"), Translate("Smartpage:Checkout.Tel: 70 22 68 88", "Tel: 70 22 68 88")) 5464 @RenderUsps("Secure", Translate("Smartpage:Checkout.Sikker betaling", "Sikker betaling"), Translate("Smartpage:Checkout.Krypteret betaling", "Krypteret betaling")) 5465 @RenderUsps("delivery", Translate("Smartpage:Checkout.Hurtig levering", "Hurtig levering"), Translate("Smartpage:Checkout.1-2 dages levering", "1-2 dages levering")) 5466 @RenderUsps("tilfredshed", Translate("Smartpage:Checkout.100% tilfredshed!", "100% tilfredshed!"), Translate("Smartpage:Checkout.Du kan nemt sende retur", "Du kan nemt sende retur")) 5467 </div> 5468 } 5469 else 5470 { 5471 var navigationSettings = new Dynamicweb.Frontend.Navigation.NavigationSettings() 5472 { 5473 RootAreaId = 0, 5474 RootPageId = 0, 5475 RootNavigationTag = "main-menu", 5476 StartLevel = 1, 5477 StopLevel = 99, 5478 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 5479 }; 5480 5481 var navigationTemplate = "Navigation/SpViewModelNavigation.cshtml"; 5482 5483 @Navigation.RenderNavigation(navigationTemplate, navigationSettings) 5484 } 5485 </div> 5486 } 5487 5488 @helper RenderUsps(string icon, string toptext, string bottomtext) 5489 { 5490 var svg = icon + ".svg"; 5491 5492 <div class="grid__col-12 grid__col-md-3"> 5493 <div class="grid grid--align-center u-justify-content--center border-right"> 5494 <div class="grid__col-2"> 5495 <img src="Files/Images/SvgIcons/@svg" height="35" width="35" /> 5496 </div> 5497 <div class="grid__col-8"> 5498 <div class="u-block"> 5499 <strong>@toptext</strong> 5500 </div> 5501 <div class="u-block"> 5502 @bottomtext 5503 </div> 5504 </div> 5505 </div> 5506 </div> 5507 } 5508 5509 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5510 5511 @using System 5512 @using System.Web 5513 @using Dynamicweb.Rapido.Blocks.Extensibility 5514 @using Dynamicweb.Rapido.Blocks 5515 5516 @{ 5517 Block masterDesktopActionsMenu = new Block 5518 { 5519 Id = "MasterDesktopActionsMenu", 5520 SortId = 10, 5521 Template = RenderDesktopActionsMenu(), 5522 Design = new Design 5523 { 5524 CssClass = "u-flex" 5525 }, 5526 SkipRenderBlocksList = true 5527 5528 }; 5529 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopActionsMenu); 5530 5531 if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"))) 5532 { 5533 Block masterDesktopActionsHeaderButton = new Block 5534 { 5535 Id = "MasterDesktopActionsHeaderButton", 5536 SortId = 60, 5537 Template = RenderHeaderButton() 5538 }; 5539 masterDesktopActionsMenu.Add(masterDesktopActionsHeaderButton); 5540 } 5541 } 5542 5543 @helper RenderDesktopActionsMenu() 5544 { 5545 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 5546 5547 <ul class="menu u-flex dw-mod"> 5548 @RenderBlockList(subBlocks) 5549 </ul> 5550 } 5551 5552 @helper RenderHeaderButton() 5553 { 5554 string headerButtonText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonText"); 5555 string headerButtonLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"); 5556 string headerButtonType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType") != null ? "btn--" + Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType").SelectedName.ToLower() : ""; 5557 5558 <li class="menu__item menu__item--horizontal menu--clean dw-mod"> 5559 <a class="btn @headerButtonType dw-mod u-no-margin u-margin-top u-margin-left" href="@headerButtonLink">@headerButtonText</a> 5560 </li> 5561 } 5562 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5563 5564 @using System 5565 @using System.Web 5566 @using Dynamicweb.Core; 5567 @using System.Text.RegularExpressions 5568 @using Dynamicweb.Rapido.Blocks.Extensibility 5569 @using Dynamicweb.Rapido.Blocks 5570 5571 @{ 5572 Block masterDesktopActionsMenuLanguageSelector = new Block 5573 { 5574 Id = "MasterDesktopActionsMenuLanguageSelector", 5575 SortId = 40, 5576 Template = RenderLanguageSelector() 5577 }; 5578 5579 @*BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuLanguageSelector);*@ 5580 } 5581 5582 @helper RenderLanguageSelector() 5583 { 5584 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5585 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 5586 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5587 string languageViewType = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue) ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue.ToLower() : ""; 5588 5589 var languages = Model.Languages.Where(l => Dynamicweb.Services.Areas.GetArea(l.ID).Published).ToList(); 5590 5591 if (languages.Count > 1) 5592 { 5593 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon is-dropdown is-dropdown--no-icon dw-mod"> 5594 <div class="header-menu__link header-menu__link--icon dw-mod"> 5595 <div class="custom__header__icon"> 5596 <div class="custom__header__icon__icon" title="@HttpUtility.HtmlAttributeEncode(Translate("Language"))"> 5597 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue fa-2_5x"></i> 5598 </div> 5599 <div class="custom__header__icon__text"> 5600 @Translate("Smartpage:LanguageSelector.Language", "Sprog") 5601 </div> 5602 </div> 5603 </div> 5604 <div class="menu menu--dropdown menu--dropdown-right languages-dropdown dw-mod grid__cell"> 5605 @foreach (var lang in languages) 5606 { 5607 var area = Dynamicweb.Services.Areas.GetArea(lang.ID); 5608 var qs = HttpUtility.ParseQueryString(System.Web.HttpContext.Current.Request.QueryString.ToString()); 5609 qs.Set("ID", Converter.ToString(lang.Page.ID)); 5610 qs.Set("AreaID", Converter.ToString(area.ID)); 5611 qs.Set("CurrencyCode", area.EcomCurrencyId); 5612 qs.Set("ActiveLanguageSelection", "True"); 5613 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + qs); 5614 string widthClass = "menu__item--fixed-width"; 5615 string langInfo = "<span class=\"flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 5616 string cultureName = Regex.Replace(area.CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 5617 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 5618 string activeClass = Dynamicweb.Ecommerce.Common.Context.LanguageID == area.EcomLanguageId ? "u-bold" : string.Empty; 5619 5620 if (languageViewType == "flag-culture") 5621 { 5622 langInfo = "<span class=\"flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " \"></span> " + cultureName; 5623 } 5624 5625 if (languageViewType == "flag") 5626 { 5627 langInfo = "<span class=\"flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " \"></span>"; 5628 widthClass = ""; 5629 } 5630 5631 if (languageViewType == "name") 5632 { 5633 langInfo = lang.Name; 5634 } 5635 5636 if (languageViewType == "culture") 5637 { 5638 langInfo = cultureName; 5639 widthClass = ""; 5640 } 5641 5642 <div class="menu__item dw-mod @widthClass"> 5643 <a href="@url" class="menu-dropdown__link dw-mod @activeClass">@langInfo</a> 5644 </div> 5645 } 5646 </div> 5647 </li> 5648 } 5649 } 5650 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5651 @using Dynamicweb.Core; 5652 @using Dynamicweb.Rapido.Blocks 5653 @using Smartpage.PhilipsonWine.LoyaltyProgram.Helpers 5654 5655 @{ 5656 Block masterDesktopActionsMenuSignIn = new Block 5657 { 5658 Id = "MasterDesktopActionsMenuSignIn", 5659 SortId = 20, 5660 Template = RenderSignIn() 5661 }; 5662 5663 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuSignIn); 5664 } 5665 5666 @helper RenderSignIn() 5667 { 5668 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 5669 string userInitials = ""; 5670 int pageId = Model.Area.FirstPage.ID; 5671 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 5672 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 5673 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 5674 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 5675 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 5676 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 5677 int myOrderDraftsPageId = GetPageIdByNavigationTag("OrderDraft"); 5678 int customerStockPageId = GetPageIdByNavigationTag("CustomerStockPage"); 5679 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 5680 int mySubscriptionsPageId = GetPageIdByNavigationTag("MySubscriptionsPage"); 5681 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 5682 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 5683 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 5684 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 5685 bool hideMyOrderDraftsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrderDrafts"); 5686 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 5687 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 5688 // Should check on the user if the user has customer stock 5689 bool hideCustomerStock = false; 5690 5691 string linkStart = "/Default.aspx?ID="; 5692 if (Model.CurrentUser.ID <= 0) 5693 { 5694 linkStart += signInProfilePageId + "&RedirectPageId="; 5695 } 5696 5697 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 5698 string myDashboardPageLink = linkStart + myDashboardPageId; 5699 string myProfilePageLink = linkStart + myProfilePageId; 5700 string myOrdersPageLink = linkStart + myOrdersPageId; 5701 string myFavoritesPageLink = linkStart + myFavoritesPageId; 5702 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 5703 string myOrderDraftsLink = linkStart + myOrderDraftsPageId; 5704 string customerStockLink = linkStart + customerStockPageId; 5705 string mySubscriptionsLink = linkStart + mySubscriptionsPageId; 5706 5707 string profileIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue : "fa fa-user"; 5708 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 5709 string orderDraftsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("DraftIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("DraftIcon").SelectedValue : "fa fa-clipboard"; 5710 5711 if (Model.CurrentUser.ID != 0) 5712 { 5713 userInitials = Dynamicweb.Rapido.Services.User.GetInitials(Model.CurrentUser.Name, Model.CurrentUser.FirstName, Model.CurrentUser.LastName, Model.CurrentUser.Email, Model.CurrentUser.UserName); 5714 } 5715 5716 bool businessContactImpersonation = false; 5717 5718 if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 5719 { 5720 businessContactImpersonation = Converter.ToBoolean(Model.CurrentSecondaryUser.CustomFields.Values.FirstOrDefault(x => x.SystemName == "AccessUser_SpBcImpersonator")?.Value); 5721 } 5722 5723 if (!navigationItemsHideSignIn) 5724 { 5725 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5726 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu__item--clean"; 5727 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5728 bool hasPricePook = false; 5729 5730 <li class="menu__item menu__item--horizontal menu__item menu__item--icon @liClasses is-dropdown is-dropdown--no-icon dw-mod"> 5731 <div class="@menuLinkClass dw-mod"> 5732 @if (Model.CurrentUser.ID <= 0) 5733 { 5734 5735 <div class="custom__header__icon"> 5736 <div class="custom__header__icon__icon"> 5737 <svg width="23px" height="40px" viewBox="0 0 23 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 5738 <title>Group 4</title> 5739 <g id="Header" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 5740 <g transform="translate(-1392.000000, -66.000000)" fill="#FFFFFF" id="Header---2022---Dec"> 5741 <g transform="translate(-1.000000, 0.000000)"> 5742 <g id="Profil" transform="translate(1357.000000, 66.194216)"> 5743 <g id="Group-4" transform="translate(36.000000, 0.000000)"> 5744 <path d="M21.9976173,23.9160939 C22.7572186,23.7577881 23.209611,22.9629324 22.8321614,22.2850013 C22.0000535,20.7904769 20.6891658,19.4771996 19.0122125,18.4763775 C16.8524643,17.187417 14.2062291,16.4887568 11.4839257,16.4887568 C8.76162096,16.4887568 6.11538574,17.1874142 3.95563616,18.476372 C2.27868151,19.4771941 0.967790992,20.7904714 0.135684508,22.2849958 C-0.241767867,22.9629242 0.210623159,23.7577826 0.970225832,23.916087 L0.970225832,23.916087 C7.90485829,25.3613018 15.0629821,25.3613046 21.9976173,23.9160939 L21.9976173,23.9160939 Z" id="Fill-936"></path> 5745 <path d="M18.354274,6.87031532 C18.354274,10.664686 15.2783294,13.7406306 11.4839587,13.7406306 C7.68958795,13.7406306 4.61364336,10.664686 4.61364336,6.87031532 C4.61364336,3.0759446 7.68958795,0 11.4839587,0 C15.2783294,0 18.354274,3.0759446 18.354274,6.87031532 Z" id="Fill-937"></path> 5746 </g> 5747 </g> 5748 </g> 5749 </g> 5750 </g> 5751 </svg> 5752 </div> 5753 <div class="custom__header__icon__text"> 5754 @Translate("Smartpage:Header.IconsText.LoginOpret", "Log ind") 5755 <div class="custom__header__icon__text__subtext">@Translate("Smartpage:Header.IconsText.LoginOpret.SubText", "Opret og få bonus")</div> 5756 </div> 5757 </div> 5758 } 5759 else 5760 { 5761 5762 string bonusFormatted = ""; 5763 5764 //Dynamicweb.Ecommerce.Loyalty.LoyaltyService loyaltyService = new Dynamicweb.Ecommerce.Loyalty.LoyaltyService(); 5765 double bonus = Dynamicweb.Ecommerce.Services.Loyalty.GetPointsBalance(Dynamicweb.Security.UserManagement.User.GetUserByID(Model.CurrentUser.ID)); 5766 5767 if (Dynamicweb.Core.Converter.ToDouble(bonus) > 0.0) 5768 { 5769 bonusFormatted = Dynamicweb.Ecommerce.Services.Currencies.Format(Dynamicweb.Ecommerce.Common.Context.Currency, bonus); 5770 } 5771 5772 <a @(!businessContactImpersonation ? "href=\"" + myDashboardPageLink + "\"" : string.Empty)> 5773 <div class="custom__header__icon"> 5774 <div class="custom__header__icon__icon"> 5775 <svg width="23px" height="40px" viewBox="0 0 23 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 5776 <title></title> 5777 <g id="Header" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 5778 <g transform="translate(-1392.000000, -66.000000)" fill="#FFFFFF" id="Header---2022---Dec"> 5779 <g transform="translate(-1.000000, 0.000000)"> 5780 <g id="Profil" transform="translate(1357.000000, 66.194216)"> 5781 <g id="Group-4" transform="translate(36.000000, 0.000000)"> 5782 <path d="M21.9976173,23.9160939 C22.7572186,23.7577881 23.209611,22.9629324 22.8321614,22.2850013 C22.0000535,20.7904769 20.6891658,19.4771996 19.0122125,18.4763775 C16.8524643,17.187417 14.2062291,16.4887568 11.4839257,16.4887568 C8.76162096,16.4887568 6.11538574,17.1874142 3.95563616,18.476372 C2.27868151,19.4771941 0.967790992,20.7904714 0.135684508,22.2849958 C-0.241767867,22.9629242 0.210623159,23.7577826 0.970225832,23.916087 L0.970225832,23.916087 C7.90485829,25.3613018 15.0629821,25.3613046 21.9976173,23.9160939 L21.9976173,23.9160939 Z" id="Fill-936"></path> 5783 <path d="M18.354274,6.87031532 C18.354274,10.664686 15.2783294,13.7406306 11.4839587,13.7406306 C7.68958795,13.7406306 4.61364336,10.664686 4.61364336,6.87031532 C4.61364336,3.0759446 7.68958795,0 11.4839587,0 C15.2783294,0 18.354274,3.0759446 18.354274,6.87031532 Z" id="Fill-937"></path> 5784 </g> 5785 </g> 5786 </g> 5787 </g> 5788 </g> 5789 </svg> 5790 </div> 5791 <div class="custom__header__icon__text"> 5792 @{ 5793 5794 5795 string name = Translate("Smartpage:Header.IconsText.MinProfil", "Min profil"); 5796 int maxLength = 20; 5797 if (businessContactImpersonation) 5798 { 5799 if (Model.CurrentSecondaryUser.Name.Count() > maxLength) 5800 { 5801 name = Model.CurrentSecondaryUser.Name.Substring(0, maxLength - 3) + "..."; 5802 } 5803 else 5804 { 5805 name = Model.CurrentSecondaryUser.Name; 5806 } 5807 } 5808 else if (!string.IsNullOrWhiteSpace(Model.CurrentUser.FirstName)) 5809 { 5810 name = Model.CurrentUser.FirstName; 5811 } 5812 else if (!string.IsNullOrWhiteSpace(Model.CurrentUser.Name)) 5813 { 5814 if (Model.CurrentUser.Name.Count() > maxLength) 5815 { 5816 name = Model.CurrentUser.Name.Substring(0, maxLength - 3) + "..."; 5817 } 5818 else 5819 { 5820 name = Model.CurrentUser.Name; 5821 } 5822 } 5823 5824 @name 5825 if (!string.IsNullOrEmpty(bonusFormatted)) 5826 { 5827 var user = Dynamicweb.Security.UserManagement.User.GetCurrentFrontendUser(); 5828 <div class="custom__header__icon__text__subtext">@string.Format(Translate("Smartpage:SignInActions.Bonus", "Din {0}: {1}"), Helper.GetWelcomeBonus(user) != null ? "velkomstrabat" : "bonus", bonusFormatted)</div> 5829 } 5830 } 5831 </div> 5832 </div> 5833 </a> 5834 } 5835 </div> 5836 <div class="menu menu--dropdown menu--dropdown-right menu--sign-in grid__cell dw-mod"> 5837 <ul class="list list--clean dw-mod"> 5838 @if (Model.CurrentUser.ID <= 0) 5839 { 5840 <li> 5841 <label for="SignInModalTrigger" class="btn btn--primary btn--full u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> 5842 </li> 5843 5844 if (!hideCreateAccountLink) 5845 { 5846 @RenderListItem("/default.aspx?ID=" + createAccountPageId, Translate("Create account")); 5847 } 5848 if (!hideForgotPasswordLink) 5849 { 5850 @RenderListItem(forgotPasswordPageLink, Translate("Forgot your password?")) 5851 } 5852 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink || !hideCustomerStock) 5853 { 5854 @RenderSeparator() 5855 } 5856 } 5857 @if (!hideMyProfileLink && !businessContactImpersonation) 5858 { 5859 @RenderListItem(myProfilePageLink, Translate("My Profile"), profileIcon) 5860 } 5861 5862 @if (!businessContactImpersonation) 5863 { 5864 @RenderListItem(myDashboardPageLink, Translate("Smartpage:SignInActions.Dashboard", "Mit overblik"), "fas fa-th") 5865 } 5866 5867 @if (!hideMyOrdersLink && !businessContactImpersonation) 5868 { 5869 @RenderListItem(myOrdersPageLink, Translate("My Orders"), "fas fa-list") 5870 } 5871 @if (!hideMyFavoritesLink && !businessContactImpersonation) 5872 { 5873 @RenderListItem(myFavoritesPageLink, Translate("My Favorites"), favoritesIcon) 5874 } 5875 @if (!hideMySavedCardsLink && !businessContactImpersonation) 5876 { 5877 @RenderListItem(mySavedCardsPageLink, Translate("My Saved cards"), "fas fa-credit-card") 5878 } 5879 @if (!hideCustomerStock && !businessContactImpersonation) 5880 { 5881 @RenderListItem(customerStockLink, Translate("Smartpage:SignInActions.CustomerStock", "Mit kundelager"), "fal fa-clipboard-list") 5882 } 5883 5884 @if (Model.CurrentUser.ID > 0) 5885 { 5886 var priceBookList = Dynamicweb.Ecommerce.CustomerCenter.CustomerProductList.GetListByCustomerId(Converter.ToInt32(Model.CurrentUser.ID))?.FirstOrDefault(l => l.Type == "PriceBookList"); 5887 if (priceBookList != null) 5888 { 5889 string link = $"/Default.aspx?Id={GetPageIdByNavigationTag("ProductsPage")}&ListID={priceBookList.ID}&ListName={priceBookList.Name}"; 5890 @RenderListItem(link, Translate("Smartpage:SignInActions.PriceBookList", "Prisbog"), "fal fa-dollar-sign") 5891 5892 hasPricePook = true; 5893 } 5894 } 5895 5896 @if (mySubscriptionsPageId != 0 && !businessContactImpersonation) 5897 { 5898 @RenderListItem(mySubscriptionsLink, Translate("Smartpage:SignInActions.MySubscriptions", "Mine abonnementer"), "fal fa-clipboard-list") 5899 } 5900 5901 @if (!hideMyOrderDraftsLink && !businessContactImpersonation) 5902 { 5903 @RenderListItem(myOrderDraftsLink, Translate("My Order drafts"), orderDraftsIcon) 5904 } 5905 @if (Model.CurrentUser.ID > 0) 5906 { 5907 if ((!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) && (!businessContactImpersonation || hasPricePook)) 5908 { 5909 @RenderSeparator() 5910 } 5911 5912 //Check if impersonation is on 5913 if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 5914 { 5915 <li> 5916 <div class="list__link dw-mod" onclick="document.getElementById('StopImpersonationModalTrigger').checked = true;"> 5917 @Translate("Sign out") 5918 </div> 5919 </li> 5920 } 5921 else 5922 { 5923 @RenderListItem("/Admin/Public/ExtranetLogoff.aspx?ID=" + pageId, Translate("Sign out")) 5924 } 5925 } 5926 </ul> 5927 </div> 5928 </li> 5929 } 5930 } 5931 5932 @helper RenderListItem(string link, string text, string icon = null) 5933 { 5934 <li> 5935 <a href="@link" class="list__link dw-mod" onclick="RememberState.SetCookie('useAnotherAddress', false)"> 5936 @if (!string.IsNullOrEmpty(icon)) 5937 {<i class="@icon u-margin-right"></i>}@text 5938 </a> 5939 </li> 5940 } 5941 5942 @helper RenderSeparator() 5943 { 5944 <li class="list__seperator dw-mod"></li> 5945 } 5946 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5947 5948 @using System 5949 @using System.Web 5950 @using Dynamicweb.Rapido.Blocks.Extensibility 5951 @using Dynamicweb.Rapido.Blocks 5952 5953 @{ 5954 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 5955 5956 Block masterDesktopActionsMenuFavorites = new Block 5957 { 5958 Id = "MasterDesktopActionsMenuFavorites", 5959 SortId = 30, 5960 Template = RenderFavorites() 5961 }; 5962 5963 if (!hideMyFavoritesLink && Model.CurrentUser.ID > 0) 5964 { 5965 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuFavorites); 5966 } 5967 } 5968 5969 @helper RenderFavorites() 5970 { 5971 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 5972 string myFavoritesPageLink = "/Default.aspx?ID=" + myFavoritesPageId; 5973 5974 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5975 string liClasses = topLayout != "normal" && topLayout != "splitted-center" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 5976 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5977 5978 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 5979 <a href="@myFavoritesPageLink" class="@menuLinkClass dw-mod" title="@Translate("Favorites")"> 5980 <i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fa-1_5x"></i> 5981 </a> 5982 </li> 5983 } 5984 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5985 5986 @using System 5987 @using System.Web 5988 @using Dynamicweb.Rapido.Blocks.Extensibility 5989 @using Dynamicweb.Rapido.Blocks 5990 @using Dynamicweb.Rapido.Services 5991 @using Smartpage.PhilipsonWine.Ecommerce.CartInformation; 5992 5993 @{ 5994 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 5995 string miniCartLayout = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout").SelectedValue : "dropdown"; 5996 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 5997 5998 if (Dynamicweb.Rapido.Services.User.IsBuyingAllowed() && !hideCart) 5999 { 6000 Block masterDesktopActionsMenuMiniCart = new Block 6001 { 6002 Id = "MasterDesktopActionsMenuMiniCart", 6003 SortId = 60, 6004 Template = RenderMiniCart(miniCartLayout == "dropdown"), 6005 SkipRenderBlocksList = true, 6006 BlocksList = new List<Block>() 6007 }; 6008 6009 Block miniCartCounterScriptTemplate = new Block 6010 { 6011 Id = "MiniCartCounterScriptTemplate", 6012 Template = RenderMiniCartCounterContent() 6013 }; 6014 6015 Block miniCartFreightMeterScriptTemplate = new Block 6016 { 6017 Id = "MiniCartFreightMeterScriptTemplate", 6018 Template = RenderMiniCartFreightMeterScript() 6019 }; 6020 6021 //dropdown layout is default 6022 RazorEngine.Templating.TemplateWriter layoutTemplate; 6023 RazorEngine.Templating.TemplateWriter miniCartTriggerTemplate; 6024 switch (miniCartLayout) 6025 { 6026 case "dropdown": 6027 layoutTemplate = RenderMiniCartDropdownLayout(); 6028 miniCartTriggerTemplate = RenderMiniCartTriggerLink(); 6029 break; 6030 case "panel": 6031 layoutTemplate = RenderMiniCartPanelLayout(); 6032 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 6033 break; 6034 case "modal": 6035 layoutTemplate = RenderMiniCartModalLayout(); 6036 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 6037 break; 6038 case "none": 6039 default: 6040 layoutTemplate = RenderMiniCartDropdownLayout(); 6041 miniCartTriggerTemplate = RenderMiniCartTriggerLink(); 6042 break; 6043 } 6044 6045 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 6046 { 6047 Id = "MiniCartTrigger", 6048 Template = miniCartTriggerTemplate 6049 }); 6050 6051 if (Pageview.Device.ToString() != "Mobile") 6052 { 6053 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 6054 { 6055 Id = "MiniCartLayout", 6056 Template = layoutTemplate 6057 }); 6058 } 6059 6060 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuMiniCart); 6061 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 6062 if (activateFreightMeter) 6063 { 6064 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartFreightMeterScriptTemplate); 6065 } 6066 } 6067 6068 if (hideCart && Dynamicweb.Rapido.Services.User.IsBuyingAllowed()) 6069 { 6070 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", new Block 6071 { 6072 Id = "CartInitialization" 6073 }); 6074 } 6075 } 6076 6077 @helper RenderMiniCart(bool hasMouseEnterEvent) 6078 { 6079 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterDesktopActionsMenuMiniCart").OrderBy(item => item.SortId).ToList(); 6080 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6081 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 6082 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6083 string mouseEvent = ""; 6084 string id = "MiniCart"; 6085 if (hasMouseEnterEvent) 6086 { 6087 mouseEvent = "onmouseenter=\"Cart.UpdateMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '/Default.aspx?ID=" + miniCartFeedPageId + "&feedType=MiniCart')\""; 6088 id = "miniCartTrigger"; 6089 } 6090 <li class="menu__item menu__item--horizontal menu__item--icon @liClasses dw-mod" id="@id" @mouseEvent> 6091 @RenderBlockList(subBlocks) 6092 </li> 6093 } 6094 6095 @helper RenderMiniCartTriggerLabel() 6096 { 6097 int cartPageId = GetPageIdByNavigationTag("CartPage"); 6098 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 6099 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6100 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 6101 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6102 double freeFee = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetDouble("FreeShippingLimit"); 6103 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 6104 6105 <a class="@menuLinkClass dw-mod js-mini-cart-button u-flex u-flex--column mini-cart" href="/Default.aspx?ID=@cartPageId&Purge=True" title="@HttpUtility.HtmlAttributeEncode(Translate("Cart"))"> 6106 <div class="custom__header__icon mini-cart"> 6107 <div class="custom__header__icon__icon cart" title="@Translate("Cart")"> 6108 <object data="Files/Images/SvgIcons/basket.svg" type="image/svg+xml"> 6109 <span>Your browser doesn't support SVG images</span> 6110 </object> 6111 </div> 6112 @RenderMiniCartCounter(miniCartFeedPageId, freeFee) 6113 </div> 6114 @if (activateFreightMeter) 6115 { 6116 @RenderMiniCartFreightMeter(miniCartFeedPageId, freeFee) 6117 } 6118 </a> 6119 } 6120 6121 @helper RenderMiniCartTriggerLink() 6122 { 6123 int cartPageId = GetPageIdByNavigationTag("CartPage"); 6124 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 6125 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6126 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 6127 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6128 6129 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="@menuLinkClass menu__item--icon dw-mod js-mini-cart-button" title="@HttpUtility.HtmlAttributeEncode(Translate("Cart"))"> 6130 <div class="custom__header__icon"> 6131 <div class="custom__header__icon__icon" title="@HttpUtility.HtmlAttributeEncode(Translate("Cart"))"> 6132 <object data="Files/Images/SvgIcons/basket.svg" type="image/svg+xml"> 6133 <span>Your browser doesn't support SVG images</span> 6134 </object> 6135 </div> 6136 @RenderMiniCartCounter(miniCartFeedPageId) 6137 </div> 6138 </a> 6139 } 6140 6141 @helper RenderMiniCartCounter(int miniCartFeedPageId, double freeFee = 0.0) 6142 { 6143 double cartProductsCount = 0; 6144 bool cartContainsSubscriptionOrderLine = false; 6145 6146 if (Model != null && Model.Cart != null && Model.Cart.CartOrderlines != null) 6147 { 6148 CartInformation cartInformation = new CartInformation(Model.Cart); 6149 6150 cartProductsCount = cartInformation.OrderLineCount; 6151 cartContainsSubscriptionOrderLine = cartInformation.ContainsSubscriptionOrderLine; 6152 } 6153 6154 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 6155 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 6156 string cartProductsTotalPrice = (Model.Cart.TotalPrice != null) ? Model.Cart.TotalPrice.Price.Value.ToString("N2") : "0,00 "; 6157 double amountToFreeFreight = (Model.Cart.TotalPriceWithoutFees != null) ? freeFee - Model.Cart.TotalPriceWithoutFees.PriceWithVat.Value : freeFee; 6158 string amountToFreeFreightFormatted = amountToFreeFreight.ToString("N2"); 6159 string currencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 6160 bool isFreeFreight = amountToFreeFreight <= 0 || cartContainsSubscriptionOrderLine; 6161 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 6162 6163 <div class="js-handlebars-root js-mini-cart-counter u-flex u-justify-content--center u-align-end u-flex--column" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false"> 6164 <div class="custom__header__icon__counter"> 6165 <div class="mini-cart__counter dw-mod"> 6166 <span class="js-mini-cart-counter-content" data-count="@cartProductsCount"> 6167 @cartProductsCount 6168 </span> 6169 </div> 6170 </div> 6171 <div> 6172 <div class="u-flex u-flex--row"> 6173 <span class="custom__header__icon__text price u-flex"> 6174 @cartProductsTotalPrice 6175 </span> 6176 <span class="custom__header__icon__text currency u-flex">@currencyCode</span> 6177 </div> 6178 @if (activateFreightMeter) 6179 { 6180 <div class="custom__header__icon__freight-text"> 6181 @if (isFreeFreight) 6182 { 6183 <span class="custom__header__icon__freight-text__freight-bold success u-flex">@Translate("Smartpage:MiniCart.YouHaveFreeFreight", "Du har fri fragt!")</span> 6184 } 6185 else 6186 { 6187 @amountToFreeFreightFormatted @currencyCode @Translate("Smartpage:MiniCart.From", " fra") 6188 <span class="custom__header__icon__freight-text__freight-bold">@Translate("Smartpage:MiniCart.FreeFreight", "fri fragt")</span> 6189 } 6190 </div> 6191 } 6192 6193 </div> 6194 </div> 6195 6196 } 6197 6198 @helper RenderMiniCartFreightMeter(int miniCartFeedPageId, double freeFee) 6199 { 6200 string widthCss = "width: 0%"; 6201 6202 if (Dynamicweb.Ecommerce.Common.Context.Cart != null) 6203 { 6204 CartInformation cartInformation = new CartInformation(Model.Cart); 6205 if (cartInformation.ContainsSubscriptionOrderLine) 6206 { 6207 widthCss = $"width: 100%"; 6208 } 6209 else 6210 { 6211 double percentageFreeFreight = 100 - (((freeFee - Model.Cart.TotalPriceWithoutFees.PriceWithVat.Value ) / freeFee) * 100); 6212 percentageFreeFreight = Math.Ceiling(percentageFreeFreight); 6213 if (percentageFreeFreight > 100) 6214 { 6215 percentageFreeFreight = 100; 6216 } 6217 widthCss = $"width: {percentageFreeFreight}%"; 6218 } 6219 } 6220 6221 <div class="js-handlebars-root " id="miniCartFreightMeter" data-template="MiniCartFreightMeter" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId" data-init-onload="false" data-preloader="none"> 6222 <div class="progress-bar-container u-margin-left"> 6223 <div class="progress-bar-indicator" style="@widthCss"></div> 6224 </div> 6225 </div> 6226 } 6227 6228 @helper RenderMiniCartFreightMeterScript() 6229 { 6230 <script id="MiniCartFreightMeter" type="text/x-template"> 6231 {{#.}} 6232 <div class="progress-bar-container u-margin-left"> 6233 <div class="progress-bar-indicator" style="width:{{percentageFreeFreight}}%"></div> 6234 </div> 6235 {{/.}} 6236 </script> 6237 } 6238 6239 @helper RenderMiniCartCounterContent() 6240 { 6241 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 6242 <script id="MiniCartCounterContent" type="text/x-template"> 6243 {{#.}} 6244 <div class="custom__header__icon__counter"> 6245 <div class="mini-cart__counter dw-mod"> 6246 <span class="js-mini-cart-counter-content" data-count="{{numberofproducts}}"> 6247 {{numberofproducts}} 6248 </span> 6249 </div> 6250 </div> 6251 <div> 6252 <div class="u-flex u-flex--row"> 6253 <span class="custom__header__icon__text price u-flex"> 6254 {{totalpriceCleanFormatted}} 6255 </span> 6256 <span class="custom__header__icon__text currency u-flex">{{currencyCode}}</span> 6257 </div> 6258 @if (activateFreightMeter) 6259 { 6260 <div class="custom__header__icon__freight-text"> 6261 {{#if isFreeFreight}} 6262 <span class="custom__header__icon__freight-text__freight-bold success u-flex">@Translate("Smartpage:MiniCart.YouHaveFreeFreight", "Du har fri fragt!")</span> 6263 {{else}} 6264 {{amountToFreeFreightFormatted}} {{currencyCode}} @Translate("Smartpage:MiniCart.From", " fra") 6265 <span class="custom__header__icon__freight-text__freight-bold">@Translate("Smartpage:MiniCart.FreeFreight", "fri fragt")</span> 6266 {{/if}} 6267 </div> 6268 } 6269 </div> 6270 {{/.}} 6271 </script> 6272 } 6273 6274 6275 @helper RenderMiniCartDropdownLayout() 6276 { 6277 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6278 string cartPageLink = "Default.aspx?ID=" + GetPageIdByNavigationTag("CartPage"); 6279 6280 <div class="mini-cart mini-cart-dropdown js-mini-cart grid__cell dw-mod" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="dropdown" data-cart-page-link="@cartPageLink"> 6281 <div class="mini-cart-dropdown__inner dw-mod"> 6282 <h3 class="u-ta-center dw-mod">@Translate("Shopping cart")</h3> 6283 <div class="mini-cart-dropdown__body u-flex dw-mod"> 6284 <div class="js-handlebars-root u-flex grid--direction-column u-full-width dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 6285 </div> 6286 </div> 6287 </div> 6288 } 6289 6290 @helper RenderMiniCartPanelLayout() 6291 { 6292 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6293 string cartPageLink = "Default.aspx?ID=" + GetPageIdByNavigationTag("CartPage"); 6294 6295 <div class="mini-cart grid__cell dw-mod"> 6296 <input type="checkbox" id="miniCartTrigger" class="panel-trigger" /> 6297 <div class="panel panel--right panel--with-close-btn dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block" data-cart-page-link="@cartPageLink"> 6298 <label for="miniCartTrigger" class="panel__close-btn" title="@Translate("Close panel")"><i class="fas fa-times"></i></label> 6299 <div class="panel__content u-full-width dw-mod"> 6300 <h3 class="panel__header dw-mod u-margin-bottom u-ta-center">@Translate("Shopping cart")</h3> 6301 <div class="panel__content-body panel__content-body--cart dw-mod"> 6302 <div class="js-handlebars-root u-flex grid--direction-column u-full-height dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 6303 </div> 6304 </div> 6305 </div> 6306 </div> 6307 } 6308 6309 @helper RenderMiniCartModalLayout() 6310 { 6311 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6312 string cartPageLink = "Default.aspx?ID=" + GetPageIdByNavigationTag("CartPage"); 6313 6314 <div class="mini-cart grid__cell dw-mod"> 6315 <input type="checkbox" id="miniCartTrigger" class="modal-trigger" autocomplete="off" /> 6316 <div class="modal-container dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block" data-cart-page-link="@cartPageLink"> 6317 <label for="miniCartTrigger" class="modal-overlay"></label> 6318 <div class="modal modal--md modal--top-right dw-mod"> 6319 <div class="modal__body u-flex grid--direction-column dw-mod"> 6320 <h3 class="dw-mod u-ta-center">@Translate("Shopping cart")</h3> 6321 <div class="js-handlebars-root u-flex grid--direction-column dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 6322 </div> 6323 <label class="modal__close-btn modal__close-btn--clean dw-mod" for="miniCartTrigger" title="@Translate("Close modal")"></label> 6324 </div> 6325 </div> 6326 </div> 6327 } 6328 6329 6330 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6331 6332 @using System 6333 @using System.Web 6334 @using Dynamicweb.Rapido.Blocks.Extensibility 6335 @using Dynamicweb.Rapido.Blocks 6336 6337 @{ 6338 bool showOrderDraftLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowOrderDraftIcon"); 6339 6340 Block masterDesktopActionsMenuOrderDraft = new Block 6341 { 6342 Id = "MasterDesktopActionsMenuOrderDraft", 6343 SortId = 40, 6344 Template = RenderOrderDraft() 6345 }; 6346 6347 if (showOrderDraftLink && Model.CurrentUser.ID > 0) 6348 { 6349 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuOrderDraft); 6350 } 6351 } 6352 6353 @helper RenderOrderDraft() 6354 { 6355 int OrderDraftPageId = GetPageIdByNavigationTag("OrderDraft"); 6356 string OrderDraftPageLink = "/Default.aspx?ID=" + OrderDraftPageId; 6357 string draftIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("DraftIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("DraftIcon").SelectedValue : "fa fa-clipboard"; 6358 6359 6360 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6361 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 6362 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 6363 6364 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 6365 <a href="@OrderDraftPageLink" class="@menuLinkClass dw-mod" title="@Translate("My order drafts")"> 6366 <span class="u-inline u-position-relative"> 6367 <i class="@draftIcon fa-1_5x"></i> 6368 </span> 6369 </a> 6370 </li> 6371 } 6372 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6373 6374 @using System 6375 @using System.Web 6376 @using Dynamicweb.Rapido.Blocks.Extensibility 6377 @using Dynamicweb.Rapido.Blocks 6378 6379 @{ 6380 bool showDownloadCartLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart"); 6381 6382 Block masterDesktopActionsMenuDownloadCart = new Block 6383 { 6384 Id = "MasterDesktopActionsMenuDownloadCart", 6385 SortId = 50, 6386 Template = RenderDownloadCart() 6387 }; 6388 6389 if (showDownloadCartLink && Model.CurrentUser.ID > 0) 6390 { 6391 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuDownloadCart); 6392 } 6393 } 6394 6395 @helper RenderDownloadCart() 6396 { 6397 int downloadCartPageId = GetPageIdByNavigationTag("DownloadCart"); 6398 string downloadCartPageLink = "/Default.aspx?ID=" + downloadCartPageId; 6399 6400 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6401 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 6402 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 6403 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 6404 6405 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 6406 <a href="@downloadCartPageLink" class="@menuLinkClass dw-mod" title="@Translate("Download cart")"> 6407 <span class="u-inline u-position-relative"> 6408 <i class="fas fa-cart-arrow-down fa-1_5x"></i> 6409 <span class="mini-cart__counter u-hidden @(counterPosition == "right" ? "mini-cart__counter--inline" : "") dw-mod js-download-cart-counter"></span> 6410 </span> 6411 </a> 6412 </li> 6413 } 6414 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6415 6416 @using System 6417 @using System.Web 6418 @using Dynamicweb.Rapido.Blocks.Extensibility 6419 @using Dynamicweb.Rapido.Blocks 6420 6421 @functions { 6422 public class SearchConfiguration 6423 { 6424 public string searchFeedId { get; set; } 6425 public string searchSecondFeedId { get; set; } 6426 public int groupsFeedId { get; set; } 6427 public string resultPageLink { get; set; } 6428 public string searchPlaceholder { get; set; } 6429 public string searchType { get; set; } 6430 public string searchTemplate { get; set; } 6431 public string searchContentTemplate { get; set; } 6432 public string searchValue { get; set; } 6433 public bool showGroups { get; set; } 6434 6435 public SearchConfiguration() 6436 { 6437 searchFeedId = ""; 6438 searchSecondFeedId = ""; 6439 searchType = "product-search"; 6440 searchContentTemplate = ""; 6441 showGroups = true; 6442 } 6443 } 6444 } 6445 @{ 6446 Block masterSearchBar = new Block 6447 { 6448 Id = "MasterSearchBar", 6449 SortId = 40, 6450 Template = RenderSearch("bar"), 6451 Design = new Design 6452 { 6453 Size = "auto", 6454 HidePadding = true, 6455 RenderType = RenderType.Column 6456 } 6457 }; 6458 6459 Block masterSearchAction = new Block 6460 { 6461 Id = "MasterDesktopActionsMenuSearch", 6462 SortId = 10, 6463 Template = RenderSearch() 6464 }; 6465 6466 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterSearchBar); 6467 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterSearchAction); 6468 } 6469 6470 @helper RenderSearch(string type = "mini-search") 6471 { 6472 string productsSearchId = Converter.ToString(GetPageIdByNavigationTag("ProductSearchFeed")); 6473 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 6474 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 6475 string searchType = Model.Area.Item.GetItem("Layout").GetList("TopSearch") != null ? Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue : "productSearch"; 6476 6477 SearchConfiguration searchConfiguration = null; 6478 switch (searchType) 6479 { 6480 case "contentSearch": 6481 searchConfiguration = new SearchConfiguration() 6482 { 6483 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 6484 resultPageLink = contentSearchPageLink, 6485 searchPlaceholder = Translate("Search page"), 6486 groupsFeedId = 0, 6487 searchType = "content-search", 6488 searchTemplate = "SearchPagesTemplate", 6489 showGroups = false 6490 }; 6491 break; 6492 case "combinedSearch": 6493 searchConfiguration = new SearchConfiguration() 6494 { 6495 searchFeedId = productsSearchId + "&feed=true", 6496 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 6497 resultPageLink = Converter.ToString(productsPageId), 6498 searchPlaceholder = Translate("Search products or pages"), 6499 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 6500 searchType = "combined-search", 6501 searchTemplate = "SearchProductsTemplateWrap", 6502 searchContentTemplate = "SearchPagesTemplateWrap", 6503 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 6504 }; 6505 break; 6506 default: //productSearch 6507 searchConfiguration = new SearchConfiguration() 6508 { 6509 resultPageLink = Converter.ToString(productsPageId), 6510 searchFeedId = productsSearchId + "&feed=true", 6511 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 6512 searchPlaceholder = Translate("Search products"), 6513 searchTemplate = "SearchResultsTypeAhead", 6514 searchType = "product-search", 6515 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 6516 }; 6517 break; 6518 } 6519 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 6520 6521 if (type == "mini-search") 6522 { 6523 @RenderMiniSearch(searchConfiguration) 6524 } 6525 else 6526 { 6527 @RenderSearchBar(searchConfiguration) 6528 @RenderSearchModal(searchConfiguration) 6529 } 6530 } 6531 6532 @helper RenderSearchModal(SearchConfiguration options) 6533 { 6534 6535 <input type="checkbox" id="SearchModalTrigger" class="modal-trigger"> 6536 <div class="modal-container"> 6537 <label for="SearchModalTrigger" id="SearchModalOverlay" class="modal-overlay"></label> 6538 <div class="js-search-modal search-modal modal modal--xl modal-height--auto" id="SearchModal"> 6539 <div class="modal__body js-typeahead" 6540 data-search-feed-id="@options.searchFeedId" 6541 data-search-second-feed-id="@options.searchSecondFeedId" 6542 data-result-page-id="@options.resultPageLink" 6543 data-groups-page-id="@options.groupsFeedId" 6544 data-search-type="@options.searchType"> 6545 <div class="grid top-section"> 6546 <div class="contact-info grid__col-3 u-padding-left-none"> 6547 <div class="icon"> 6548 <img src="~/Files/Images/SvgIcons/phone.svg" alt="Alternate Text" /> 6549 </div> 6550 <div class="info"> 6551 <div class="info__header"> 6552 @Translate("Smartpage:Search.Modal.Questions", "Spørgsmål?") 6553 </div> 6554 <div class="info__phone"> 6555 @Translate("Smartpage:Search.Modal.PhoneInfo", "Ring tlf: +45 70 22 68 88") 6556 </div> 6557 </div> 6558 </div> 6559 <div class="typeahead u-color-inherit dw-mod custom__header__searchbar" id="ProductSearchBar"> 6560 @if (options.showGroups) 6561 { 6562 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 6563 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@options.groupsFeedId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 6564 } 6565 <div class="typeahead-search-field"> 6566 <form action="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetPageIdByNavigationTag("ProductsPage"))" id="SearchSubmitForm"> 6567 <input id="TypeaheadSearchField" type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field js-ignore-click-outside search-input" placeholder="@HttpUtility.HtmlAttributeEncode(options.searchPlaceholder)" value="@HttpUtility.HtmlAttributeEncode(options.searchValue)" name="Search"> 6568 </form> 6569 </div> 6570 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn" title="@HttpUtility.HtmlAttributeEncode(Translate("Search"))"> 6571 @{ 6572 var customIcon = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Layout").GetFile("CustomSearchIcon"); 6573 if (customIcon != null) 6574 { 6575 <img src="@customIcon.Path" /> 6576 } 6577 else 6578 { 6579 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i> 6580 } 6581 } 6582 6583 </button> 6584 </div> 6585 <div class="u-flex u-flex--row modal-close-wrapper"> 6586 <span class="info-text__close-button">@Translate("Smartpage:Search.Modal.Close", "Luk vindue")</span><label class="modal__close-btn" for="SearchModalTrigger"></label> 6587 </div> 6588 </div> 6589 <div class="grid"> 6590 @RenderSearchContent(options.searchTemplate) 6591 </div> 6592 </div> 6593 </div> 6594 </div> 6595 } 6596 6597 @helper RenderSearchContent(string template) 6598 { 6599 <div class="js-typeahead-search-content grid u-flex--row typeahead-search-content" id="ProductSearchBarContent" data-template="@template" data-init-onload="false" data-pre-render-template="ProductSearchPreRenderContainer"></div> 6600 } 6601 6602 @helper RenderSearchBar(SearchConfiguration options) 6603 { 6604 6605 6606 <div class="typeahead typeahead--centered u-color-inherit custom__header__searchbar" id="ProductSearchBar"> 6607 <div class="typeahead-search-field"> 6608 <label for="SearchModalTrigger" class="search-modal-trigger js-search-modal-trigger" onclick="setTimeout(function () { document.querySelector('.js-typeahead-search-field').focus() }, 10)"></label> 6609 <input type="text" class="u-no-margin u-full-width u-full-height" placeholder="@HttpUtility.HtmlAttributeEncode(options.searchPlaceholder)" value="@HttpUtility.HtmlAttributeEncode(options.searchValue)" name="Search"> 6610 </div> 6611 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod" title="@HttpUtility.HtmlAttributeEncode(Translate("Search"))"> 6612 @{ 6613 var customIcon = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Layout").GetFile("CustomSearchIcon"); 6614 if (customIcon != null) 6615 { 6616 <img src="@customIcon.Path" /> 6617 } 6618 else 6619 { 6620 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i> 6621 } 6622 } 6623 6624 </button> 6625 </div> 6626 } 6627 6628 @helper RenderMiniSearch(SearchConfiguration options) 6629 { 6630 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6631 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 6632 6633 <li class="menu__item menu__item--horizontal menu__item--top-level menu__item--icon u-hidden-xxs is-dropdown is-dropdown--no-icon dw-mod" id="miniSearchIcon"> 6634 <div class="@menuLinkClass dw-mod" title="@Translate("Search")"> 6635 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 6636 </div> 6637 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 6638 <div class="typeahead js-typeahead" id="ProductSearchBar" 6639 data-page-size="7" 6640 data-search-feed-id="@options.searchFeedId" 6641 data-search-second-feed-id="@options.searchSecondFeedId" 6642 data-result-page-id="@options.resultPageLink" 6643 data-search-type="@options.searchType"> 6644 <div class="typeahead-search-field"> 6645 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" data-shop-id="@Pageview.Area.EcomShopId" data-area-id="@Dynamicweb.Core.Converter.ToString(Pageview.AreaID)" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 6646 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 6647 { 6648 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 6649 } 6650 else 6651 { 6652 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 6653 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@options.searchTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 6654 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-json-feed="/Default.aspx?ID=@options.searchSecondFeedId" data-init-onload="false"></div> 6655 </div> 6656 } 6657 </div> 6658 </div> 6659 </div> 6660 </li> 6661 } 6662 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6663 6664 @using System 6665 @using System.Web 6666 @using Dynamicweb.Rapido.Blocks.Extensibility 6667 @using Dynamicweb.Rapido.Blocks 6668 6669 @{ 6670 string headerConfigurationTopLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 6671 bool headerConfigurationHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 6672 6673 BlocksPage headerConfigurationPage = BlocksPage.GetBlockPage("Master"); 6674 6675 Block configDesktopLogo = headerConfigurationPage.GetBlockById("MasterDesktopLogo"); 6676 headerConfigurationPage.RemoveBlock(configDesktopLogo); 6677 6678 Block configDesktopMenu = headerConfigurationPage.GetBlockById("MasterDesktopMenu"); 6679 headerConfigurationPage.RemoveBlock(configDesktopMenu); 6680 6681 Block configSearchBar = headerConfigurationPage.GetBlockById("MasterSearchBar"); 6682 headerConfigurationPage.RemoveBlock(configSearchBar); 6683 6684 Block configSearchAction = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenuSearch"); 6685 headerConfigurationPage.RemoveBlock(configSearchAction); 6686 6687 Block configDesktopActionsMenu = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenu"); 6688 headerConfigurationPage.RemoveBlock(configDesktopActionsMenu); 6689 6690 Block configDesktopExtra = headerConfigurationPage.GetBlockById("MasterDesktopExtra"); 6691 6692 switch (headerConfigurationTopLayout) 6693 { 6694 case "condensed": //2 6695 configDesktopLogo.Design.Size = "auto-width"; 6696 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 6697 6698 configDesktopMenu.SortId = 20; 6699 configDesktopMenu.Design.Size = "auto"; 6700 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6701 6702 configDesktopActionsMenu.SortId = 30; 6703 configDesktopActionsMenu.Design.Size = "auto-width"; 6704 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6705 6706 if (!headerConfigurationHideSearch) 6707 { 6708 configSearchBar.SortId = 40; 6709 configSearchBar.Design.Size = "12"; 6710 configDesktopExtra.SortId = 50; 6711 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 6712 } 6713 break; 6714 case "splitted": //3 6715 configDesktopLogo.Design.Size = "auto"; 6716 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 6717 6718 if (!headerConfigurationHideSearch) 6719 { 6720 configSearchBar.SortId = 20; 6721 configSearchBar.Design.Size = "auto"; 6722 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 6723 } 6724 6725 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6726 6727 configDesktopActionsMenu.SortId = 20; 6728 configDesktopActionsMenu.Design.Size = "auto-width"; 6729 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6730 break; 6731 case "splitted-center": //4 6732 configDesktopLogo.Design.Size = "auto"; 6733 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 6734 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6735 6736 configDesktopActionsMenu.SortId = 30; 6737 configDesktopActionsMenu.Design.Size = "auto-width"; 6738 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopActionsMenu); 6739 6740 if (!headerConfigurationHideSearch) 6741 { 6742 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6743 } 6744 break; 6745 case "minimal": //5 6746 configDesktopLogo.Design.Size = "auto-width"; 6747 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 6748 6749 configDesktopMenu.Design.Size = "auto"; 6750 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6751 6752 configDesktopActionsMenu.SortId = 20; 6753 configDesktopActionsMenu.Design.Size = "auto-width"; 6754 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6755 6756 if (!headerConfigurationHideSearch) 6757 { 6758 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6759 } 6760 break; 6761 case "minimal-center": //6 6762 configDesktopLogo.Design.Size = "auto-width"; 6763 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 6764 6765 configDesktopMenu.Design.Size = "auto"; 6766 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6767 6768 configDesktopActionsMenu.SortId = 20; 6769 configDesktopActionsMenu.Design.Size = "auto-width"; 6770 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6771 6772 if (!headerConfigurationHideSearch) 6773 { 6774 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6775 } 6776 break; 6777 case "minimal-right": //7 6778 configDesktopLogo.Design.Size = "auto-width"; 6779 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 6780 6781 configDesktopMenu.Design.Size = "auto"; 6782 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6783 6784 configDesktopActionsMenu.SortId = 20; 6785 configDesktopActionsMenu.Design.Size = "auto-width"; 6786 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6787 6788 if (!headerConfigurationHideSearch) 6789 { 6790 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6791 } 6792 break; 6793 case "two-lines": //8 6794 configDesktopLogo.Design.Size = "auto"; 6795 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 6796 6797 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6798 6799 configDesktopActionsMenu.SortId = 20; 6800 configDesktopActionsMenu.Design.Size = "auto-width"; 6801 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6802 6803 if (!headerConfigurationHideSearch) 6804 { 6805 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6806 } 6807 break; 6808 case "two-lines-centered": //9 6809 configDesktopLogo.Design.Size = "auto"; 6810 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 6811 6812 configDesktopMenu.Design.Size = "auto-width"; 6813 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6814 6815 configDesktopActionsMenu.SortId = 20; 6816 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 6817 6818 if (!headerConfigurationHideSearch) 6819 { 6820 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 6821 } 6822 break; 6823 case "normal": //1 6824 default: 6825 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 6826 6827 if (!headerConfigurationHideSearch) 6828 { 6829 configSearchBar.SortId = 20; 6830 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 6831 } 6832 6833 configDesktopActionsMenu.SortId = 30; 6834 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopActionsMenu); 6835 6836 configDesktopActionsMenu.Design.Size = "auto-width"; 6837 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 6838 break; 6839 } 6840 } 6841 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6842 @using Dynamicweb.Rapido.Blocks 6843 @using Dynamicweb.Core; 6844 6845 @{ 6846 var user = Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser(); 6847 if (user != null && user.AllowBackend) 6848 { 6849 var editorsGroup = Pageview.AreaSettings.GetItem("Custom").GetRawValue("EditorsGroup"); 6850 if (user.GroupsIds.Contains(Converter.ToInt32(editorsGroup))) 6851 { 6852 Block ShowPageIdBlock = new Block 6853 { 6854 Id = "ShowPageId", 6855 SortId = -10, 6856 Template = RenderShowPageIdSection(), 6857 Design = new Design 6858 { 6859 Size = "auto-width", 6860 HidePadding = true, 6861 RenderType = RenderType.Column, 6862 CssClass = "grid--align-self-center" 6863 } 6864 }; 6865 6866 BlocksPage.GetBlockPage("Master").Add("MasterHeader", ShowPageIdBlock); 6867 } 6868 } 6869 6870 } 6871 6872 @helper RenderShowPageIdSection() 6873 { 6874 <div class="u-ta-center u-padding" style="background-color:#fecd00"> 6875 @Translate("Smartpage:Header.ClickToCopy", "Tryk på side id for at kopiere:") <span onclick="navigator.clipboard.writeText(event.innerText)" class="u-bold u-underline u-pointer">@Pageview.ID</span> 6876 </div> 6877 } 6878 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6879 @using System.Web 6880 @using Dynamicweb.Rapido.Blocks 6881 @using Dynamicweb; 6882 @using Dynamicweb.Core; 6883 @using System.Text.RegularExpressions 6884 @using Dynamicweb.Ecommerce.International 6885 6886 @{ 6887 Block masterToolbar = new Block 6888 { 6889 Id = "MasterToolbar", 6890 SortId = 0, 6891 Template = RenderToolbar(), 6892 Design = new Design 6893 { 6894 Size = "auto-width", 6895 HidePadding = true, 6896 RenderType = RenderType.Column, 6897 CssClass = "grid--align-self-center custom__header__toolbar js-custom__header__toolbar" 6898 } 6899 }; 6900 6901 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterToolbar); 6902 } 6903 6904 6905 @helper RenderToolbar() 6906 { 6907 string trustpilotFreeWidget = Model.Area.Item.GetItem("Custom").GetString("HeaderTrustpilotWidget"); 6908 var headerUsp = GetCacheItems(Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings"), "HeaderUSP"); //Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetItems("HeaderUSP"); 6909 <div class="center-container grid top-container__center-container dw-mod"> 6910 <div class="grid grid--align-center custom__header__usp__container"> 6911 <div> 6912 <ul class="u-flex custom__header__usp"> 6913 @foreach (var usp in headerUsp) 6914 { 6915 var icon = usp.GetFile("Icon"); 6916 <li class="u-flex whitespace-nowrap"> 6917 @if (!string.IsNullOrWhiteSpace(usp.GetString("Link"))) 6918 { 6919 <a class="u-flex" href="@usp.GetString("Link")"> 6920 @{ 6921 if (icon != null) 6922 { 6923 <img class="u-margin-right" src="@icon.Path" alt="@HttpUtility.HtmlAttributeEncode(usp.GetString("Label"))" /> 6924 } 6925 else 6926 { 6927 <i class="fa fa-check u-margin-right u-flex u-flex--align-center"></i> 6928 } 6929 } 6930 @usp.GetString("Label") 6931 </a> 6932 } 6933 else 6934 { 6935 if (icon != null) 6936 { 6937 <img class="u-margin-right" src="@icon.Path" alt="@HttpUtility.HtmlAttributeEncode(usp.GetString("Label"))" /> 6938 } 6939 else 6940 { 6941 <i class="fa fa-check u-margin-right u-flex u-flex--align-center"></i> 6942 } @usp.GetString("Label") 6943 } 6944 </li> 6945 } 6946 </ul> 6947 </div> 6948 @if (!string.IsNullOrEmpty(trustpilotFreeWidget)) 6949 { 6950 <div> 6951 @trustpilotFreeWidget 6952 </div> 6953 } 6954 <div class="u-align-right custom__header__contacttext"> 6955 @Translate("Smartpage:Header.ContactText", "Har du brug for hjælp eller vejledning? +45 70226888") 6956 </div> 6957 <div class="u-align-right currency-selector"> 6958 @RenderCurrencySelectorSmall() 6959 </div> 6960 <div class="u-align-right language-selector"> 6961 @RenderLanguageSelectorSmall() 6962 </div> 6963 </div> 6964 </div> 6965 } 6966 6967 @helper RenderCurrencySelectorSmall() 6968 { 6969 List<Currency> currencies = Dynamicweb.Ecommerce.Services.Currencies.GetCurrenciesForLanguage(Dynamicweb.Ecommerce.Common.Context.LanguageID).ToList(); 6970 6971 if (currencies.Count > 1) 6972 { 6973 bool languageSelectionFromCookie = Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection") != null && Converter.ToBoolean(Dynamicweb.Environment.CookieManager.GetCookie("ActiveLanguageSelection").Value); 6974 var topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout")?.SelectedValue ?? "normal"; 6975 var liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 6976 6977 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon is-dropdown is-dropdown--no-icon dw-mod"> 6978 <div class="current-currency u-flex u-flex--row"> 6979 @Dynamicweb.Ecommerce.Common.Context.Currency.Code 6980 </div> 6981 <div class="menu menu--dropdown menu--dropdown-right currencies-dropdown grid__cell dw-mod"> 6982 @foreach (Currency currency in currencies) 6983 { 6984 var pageId = Pageview.Page.ID; 6985 6986 if (!languageSelectionFromCookie) 6987 { 6988 var currencyLanguageMapping = Pageview.AreaSettings.GetItem("Custom").GetItems("CurrencyLanguageMapping")?.FirstOrDefault(m => m.GetRawValueString("Currency") == currency.Code); 6989 if (currencyLanguageMapping != null) 6990 { 6991 var language = Model.Languages.FirstOrDefault(l => l.ID == Converter.ToInt32(currencyLanguageMapping.GetRawValueString("Language"))); 6992 6993 if (language != null) 6994 { 6995 pageId = language.Page.ID; 6996 } 6997 } 6998 } 6999 7000 var qs = HttpUtility.ParseQueryString(Dynamicweb.Context.Current.Request.QueryString.ToString()); 7001 qs.Set("ID", Converter.ToString(pageId)); 7002 qs.Set("CurrencyCode", currency.Code); 7003 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + qs); 7004 7005 var activeClass = currency.Code == Dynamicweb.Ecommerce.Common.Context.Currency.Code ? "u-bold" : string.Empty; 7006 7007 <div class="menu__item dw-mod"> 7008 <a href="@url" class="menu-dropdown__link dw-mod u-flex @(activeClass)">@currency.Code</a> 7009 </div> 7010 } 7011 </div> 7012 </li> 7013 } 7014 } 7015 7016 @helper RenderLanguageSelectorSmall() 7017 { 7018 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 7019 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 7020 string menuLinkClass = topLayout != "normal" && topLayout != "splitted-center" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 7021 string languageViewType = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue) ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue.ToLower() : ""; 7022 7023 var languages = Model.Languages.Where(l => Dynamicweb.Services.Areas.GetArea(l.ID).Published).ToList(); 7024 7025 if (languages.Count > 1) 7026 { 7027 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon is-dropdown is-dropdown--no-icon dw-mod"> 7028 <div class="current-language u-flex u-flex--row"> 7029 @{ 7030 var currentLanguage = Model.Languages.First(l => l.IsCurrent); 7031 var currentArea = Dynamicweb.Services.Areas.GetArea(currentLanguage.ID); 7032 string currentCultureName = Regex.Replace(currentArea.CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 7033 currentCultureName = char.ToUpper(currentCultureName[0]) + currentCultureName.Substring(1); 7034 string currentLanguageInfo = "<span class=\"flag-icon flag-icon-" + currentArea.EcomCountryCode.ToLower() + " u-margin-right\"></span>" + currentCultureName; 7035 } 7036 @currentLanguageInfo 7037 </div> 7038 <div class="menu menu--dropdown menu--dropdown-right languages-dropdown dw-mod grid__cell"> 7039 @foreach (var lang in languages) 7040 { 7041 var area = Dynamicweb.Services.Areas.GetArea(lang.ID); 7042 var qs = HttpUtility.ParseQueryString(System.Web.HttpContext.Current.Request.QueryString.ToString()); 7043 qs.Set("ID", Converter.ToString(lang.Page.ID)); 7044 qs.Set("CurrencyCode", area.EcomCurrencyId); 7045 qs.Set("ActiveLanguageSelection", "True"); 7046 string url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + qs); 7047 string primaryDomain = area.DomainLock; 7048 7049 if (!string.IsNullOrEmpty(primaryDomain)) 7050 { 7051 url = HttpContext.Current.Request.Url.Scheme + "://" + primaryDomain + url; 7052 } 7053 7054 string widthClass = "menu__item--fixed-width"; 7055 string langInfo = "<span class=\"flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 7056 string cultureName = Regex.Replace(area.CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 7057 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 7058 string activeClass = Dynamicweb.Ecommerce.Common.Context.LanguageID == area.EcomLanguageId ? "u-bold" : string.Empty; 7059 7060 if (languageViewType == "flag-culture") 7061 { 7062 langInfo = "<span class=\" u-margin-right flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " \"></span> " + cultureName; 7063 } 7064 7065 if (languageViewType == "flag") 7066 { 7067 langInfo = "<span class=\" u-margin-right flag-icon flag-icon-" + area.EcomCountryCode.ToLower() + " \"></span>"; 7068 widthClass = ""; 7069 } 7070 7071 if (languageViewType == "name") 7072 { 7073 langInfo = lang.Name; 7074 } 7075 7076 if (languageViewType == "culture") 7077 { 7078 langInfo = cultureName; 7079 widthClass = ""; 7080 } 7081 7082 <div class="menu__item dw-mod @widthClass"> 7083 <a href="@url" class="menu-dropdown__link dw-mod u-flex @activeClass">@langInfo</a> 7084 </div> 7085 } 7086 </div> 7087 </li> 7088 } 7089 } 7090 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7091 7092 @using System 7093 @using System.Web 7094 @using Dynamicweb.Rapido.Blocks.Extensibility 7095 @using Dynamicweb.Rapido.Blocks 7096 7097 @{ 7098 Block masterDesktopActionsOffers = new Block 7099 { 7100 Id = "MasterDesktopActionsOffers", 7101 SortId = 10, 7102 Template = RenderOffers() 7103 }; 7104 7105 @*BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsOffers);*@ 7106 } 7107 7108 @helper RenderOffers() 7109 { 7110 <li class="menu__item menu__item--horizontal menu__item menu__item--icon menu__item--clean is-dropdown is-dropdown--no-icon dw-mod"> 7111 <div class="header-menu__link header-menu__link--icon dw-mod"> 7112 <div class="custom__header__icon"> 7113 <a href="Default.aspx?ID=@GetPageIdByNavigationTag("OffersPage")"> 7114 <div class="custom__header__icon__icon"> 7115 <svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 7116 <g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 7117 <g id="Header" transform="translate(-1289.000000, -56.000000)" fill-rule="nonzero"> 7118 <g id="TILBUD"> 7119 <g transform="translate(1289.000000, 56.000000)"> 7120 <polygon id="Path" fill="#FFCB00" points="43.87725 23.9999062 47.9999063 17.569125 41.2140938 14.0612813 41.569125 6.4306875 33.9385313 6.785625 30.4306875 0 24 4.1225625 17.5692188 0 14.061375 6.78571875 6.430875 6.43078125 6.7858125 14.061375 0 17.569125 4.12265625 23.9999062 0 30.4306875 6.78571875 33.9385312 6.4306875 41.569125 14.0612813 41.2141875 17.569125 48 24 43.8771562 30.4307812 47.9997187 33.938625 41.2140938 41.5692188 41.5690313 41.2141875 33.9384375 48 30.4305937"></polygon> 7121 <path d="M15.68,27.072 C16.544,27.072 17.342,26.904 18.074,26.568 C18.806,26.232 19.442,25.74 19.982,25.092 C20.522,24.444 20.948,23.658 21.26,22.734 C21.572,21.81 21.728,20.76 21.728,19.584 C21.728,18.408 21.572,17.364 21.26,16.452 C20.948,15.54 20.522,14.766 19.982,14.13 C19.442,13.494 18.806,13.008 18.074,12.672 C17.342,12.336 16.544,12.168 15.68,12.168 C14.816,12.168 14.012,12.336 13.268,12.672 C12.524,13.008 11.882,13.494 11.342,14.13 C10.802,14.766 10.382,15.54 10.082,16.452 C9.782,17.364 9.632,18.408 9.632,19.584 C9.632,20.76 9.782,21.81 10.082,22.734 C10.382,23.658 10.802,24.444 11.342,25.092 C11.882,25.74 12.524,26.232 13.268,26.568 C14.012,26.904 14.816,27.072 15.68,27.072 Z M20,36.432 L32.528,12.168 L29.072,12.168 L16.544,36.432 L20,36.432 Z M15.68,23.688 C15.2,23.688 14.78,23.4 14.42,22.824 C14.06,22.248 13.88,21.168 13.88,19.584 C13.88,18.792 13.928,18.138 14.024,17.622 C14.12,17.106 14.252,16.692 14.42,16.38 C14.588,16.068 14.78,15.852 14.996,15.732 C15.212,15.612 15.44,15.552 15.68,15.552 C15.92,15.552 16.148,15.612 16.364,15.732 C16.58,15.852 16.772,16.068 16.94,16.38 C17.108,16.692 17.24,17.106 17.336,17.622 C17.432,18.138 17.48,18.792 17.48,19.584 C17.48,21.168 17.3,22.248 16.94,22.824 C16.58,23.4 16.16,23.688 15.68,23.688 Z M33.32,36.432 C34.184,36.432 34.982,36.264 35.714,35.928 C36.446,35.592 37.082,35.1 37.622,34.452 C38.162,33.804 38.588,33.018 38.9,32.094 C39.212,31.17 39.368,30.12 39.368,28.944 C39.368,27.768 39.212,26.724 38.9,25.812 C38.588,24.9 38.162,24.126 37.622,23.49 C37.082,22.854 36.446,22.368 35.714,22.032 C34.982,21.696 34.184,21.528 33.32,21.528 C32.456,21.528 31.652,21.696 30.908,22.032 C30.164,22.368 29.522,22.854 28.982,23.49 C28.442,24.126 28.022,24.9 27.722,25.812 C27.422,26.724 27.272,27.768 27.272,28.944 C27.272,30.12 27.422,31.17 27.722,32.094 C28.022,33.018 28.442,33.804 28.982,34.452 C29.522,35.1 30.164,35.592 30.908,35.928 C31.652,36.264 32.456,36.432 33.32,36.432 Z M33.32,33.048 C32.84,33.048 32.42,32.76 32.06,32.184 C31.7,31.608 31.52,30.528 31.52,28.944 C31.52,28.152 31.568,27.498 31.664,26.982 C31.76,26.466 31.892,26.052 32.06,25.74 C32.228,25.428 32.42,25.212 32.636,25.092 C32.852,24.972 33.08,24.912 33.32,24.912 C33.56,24.912 33.788,24.972 34.004,25.092 C34.22,25.212 34.412,25.428 34.58,25.74 C34.748,26.052 34.88,26.466 34.976,26.982 C35.072,27.498 35.12,28.152 35.12,28.944 C35.12,30.528 34.94,31.608 34.58,32.184 C34.22,32.76 33.8,33.048 33.32,33.048 Z" id="%" fill="#000000"></path> 7122 </g> 7123 </g> 7124 </g> 7125 </g> 7126 </svg> 7127 </div> 7128 <div class="custom__header__icon__text yellow"> 7129 @Translate("Smartpage:Header.IconsText.Tilbud!", "Tilbud!") 7130 </div> 7131 </a> 7132 </div> 7133 </div> 7134 </li> 7135 7136 } 7137 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7138 @using Dynamicweb.Rapido.Blocks 7139 7140 @{ 7141 bool activateOfferNewspaper = Pageview.AreaSettings.GetItem("Custom").GetBoolean("ActivateOfferNewspaper"); 7142 bool activatePriceBook = Pageview.AreaSettings.GetItem("Custom").GetBoolean("ActivateHeaderPriceBook"); 7143 if (activateOfferNewspaper) 7144 { 7145 Block masterDesktopActionsOfferNewspaperBlock = new Block 7146 { 7147 Id = "MasterDesktopActionsOfferNewspaper", 7148 SortId = 10, 7149 Template = RenderOfferNewspaper() 7150 }; 7151 7152 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsOfferNewspaperBlock); 7153 } 7154 7155 if (activatePriceBook && Model.CurrentUser.ID > 0) 7156 { 7157 var priceBookList = Dynamicweb.Ecommerce.CustomerCenter.CustomerProductList.GetListByCustomerId(Converter.ToInt32(Model.CurrentUser.ID))?.FirstOrDefault(l => l.Type == "PriceBookList"); 7158 if (priceBookList != null) 7159 { 7160 string link = $"/Default.aspx?Id={GetPageIdByNavigationTag("ProductsPage")}&ListID={priceBookList.ID}&ListName={priceBookList.Name}"; 7161 Block masterDesktopActionsPriceBoookBlock = new Block 7162 { 7163 Id = "MasterDesktopActionsPriceBook", 7164 SortId = 10, 7165 Template = RenderPriceBook(link, Translate("Smartpage:Header.PriceBookText.PriceBook", "Din prisbog"), "fal fa-dollar-sign") 7166 }; 7167 7168 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsPriceBoookBlock); 7169 } 7170 } 7171 } 7172 7173 @helper RenderOfferNewspaper() 7174 { 7175 string newsPaperLink = Pageview.AreaSettings.GetItem("Custom").GetString("OfferNewspaperLink"); 7176 7177 <li class="menu__item menu__item--horizontal menu__item menu__item--icon menu__item--clean is-dropdown is-dropdown--no-icon dw-mod"> 7178 <div class="header-menu__link header-menu__link--icon dw-mod"> 7179 <div class="custom__header__icon"> 7180 <a href="@newsPaperLink"> 7181 <div class="custom__header__icon__icon newspaper-icon"> 7182 @RenderOfferNewspaperIcon() 7183 </div> 7184 <div class="custom__header__icon__text"> 7185 <div> 7186 <div class="custom__header__icon__text"> 7187 @Translate("Smartpage:Header.OfferNewspaperText.OfferNewspaper", "Tilbudsavis") 7188 </div> 7189 </div> 7190 </div> 7191 </a> 7192 </div> 7193 </div> 7194 </li> 7195 } 7196 7197 @helper RenderPriceBook(string link, string text, string icon = null) 7198 { 7199 <li class="menu__item menu__item--horizontal menu__item menu__item--icon menu__item--clean is-dropdown is-dropdown--no-icon dw-mod"> 7200 <div class="header-menu__link header-menu__link--icon dw-mod"> 7201 <div class="custom__header__icon"> 7202 <a href="@link"> 7203 @if (!string.IsNullOrEmpty(icon)) 7204 { 7205 <div class="custom__header__icon__icon custom__header__icon__price__book @icon"></div> 7206 } 7207 <div class="custom__header__icon__text"> 7208 <div> 7209 <div class="custom__header__icon__text"> 7210 @text 7211 </div> 7212 </div> 7213 </div> 7214 </a> 7215 </div> 7216 </div> 7217 </li> 7218 } 7219 7220 @helper RenderOfferNewspaperIcon() 7221 { 7222 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#ffffff" height="40px" width="54px" version="1.1" viewBox="0 0 465 465" xml:space="preserve"> 7223 <g> 7224 <path d="M371.957,60.634h-26.884V9.5c0-2.925-1.348-5.688-3.653-7.488c-2.307-1.801-5.316-2.438-8.15-1.729L90.745,60.912 l0.003,0.012c-4.136,1.028-7.205,4.755-7.205,9.209V455.5c0,5.247,4.253,9.5,9.5,9.5h278.915c5.247,0,9.5-4.253,9.5-9.5V70.134 C381.457,64.887,377.205,60.634,371.957,60.634z M326.074,60.634H170.201l155.873-38.966V60.634z M362.457,446H102.542V79.634 h259.915V446z" /> 7225 <path d="M127.632,156.409h209.735c5.247,0,9.5-4.253,9.5-9.5v-43.245c0-5.247-4.253-9.5-9.5-9.5H127.632 c-5.247,0-9.5,4.253-9.5,9.5v43.245C118.132,152.156,122.385,156.409,127.632,156.409z M137.132,113.164h190.735v24.245H137.132 V113.164z" /> 7226 <path d="M337.368,175.123H250.22c-5.247,0-9.5,4.253-9.5,9.5v135.358c0,5.247,4.253,9.5,9.5,9.5h87.147c5.247,0,9.5-4.253,9.5-9.5 V184.623C346.868,179.376,342.615,175.123,337.368,175.123z M327.868,310.481H259.72V194.123h68.147V310.481z" /> 7227 <path d="M127.632,194.123h87.147c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5h-87.147c-5.247,0-9.5,4.253-9.5,9.5 S122.385,194.123,127.632,194.123z" /> 7228 <path d="M127.632,227.794h87.147c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5h-87.147c-5.247,0-9.5,4.253-9.5,9.5 S122.385,227.794,127.632,227.794z" /> 7229 <path d="M127.632,261.465h87.147c5.247,0,9.5-4.253,9.5-9.5c0-5.247-4.253-9.5-9.5-9.5h-87.147c-5.247,0-9.5,4.253-9.5,9.5 C118.132,257.212,122.385,261.465,127.632,261.465z" /> 7230 <path d="M127.632,295.137h87.147c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5h-87.147c-5.247,0-9.5,4.253-9.5,9.5 S122.385,295.137,127.632,295.137z" /> 7231 <path d="M127.632,328.808h87.147c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5h-87.147c-5.247,0-9.5,4.253-9.5,9.5 S122.385,328.808,127.632,328.808z" /> 7232 <path d="M127.632,362.479h209.735c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5H127.632c-5.247,0-9.5,4.253-9.5,9.5 S122.385,362.479,127.632,362.479z" /> 7233 <path d="M127.632,396.15h209.735c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5H127.632c-5.247,0-9.5,4.253-9.5,9.5 S122.385,396.15,127.632,396.15z" /> 7234 <path d="M127.632,429.822h209.735c5.247,0,9.5-4.253,9.5-9.5s-4.253-9.5-9.5-9.5H127.632c-5.247,0-9.5,4.253-9.5,9.5 S122.385,429.822,127.632,429.822z" /> 7235 </g> 7236 </svg> 7237 } 7238 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7239 @using Dynamicweb.Rapido.Blocks 7240 @using Smartpage.PhilipsonWine.LiveShopper.Models; 7241 7242 @{ 7243 if (Pageview.AreaSettings.GetItem("Custom").GetBoolean("ActivateLiveshopper")) 7244 { 7245 var upcomingEvent = Dynamicweb.Context.Current.Application["SpLiveShopperEvent"] as Event; 7246 Block masterDesktopActionsLiveshoppingBlock = new Block 7247 { 7248 Id = "MasterDesktopActionsLiveshopping", 7249 SortId = 10, 7250 Template = RenderLiveshoppingIcon(upcomingEvent) 7251 }; 7252 7253 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsLiveshoppingBlock); 7254 } 7255 } 7256 7257 @helper RenderLiveshoppingIcon(Event upcomingEvent) 7258 { 7259 DateTime now = DateTime.Now; 7260 bool isEventLive = upcomingEvent != null && now > upcomingEvent.Start && now < upcomingEvent.End; 7261 7262 <li class="menu__item menu__item--horizontal menu__item menu__item--icon menu__item--clean is-dropdown is-dropdown--no-icon dw-mod"> 7263 <div class="header-menu__link header-menu__link--icon dw-mod"> 7264 <div class="custom__header__icon"> 7265 <a href="Default.aspx?ID=@GetPageIdByNavigationTag("LiveshoppingPage")"> 7266 <div class="custom__header__icon__icon liveshopping-icon"> 7267 @if (isEventLive) 7268 { 7269 @RenderLiveshoppingGreenIcon() 7270 } 7271 else 7272 { 7273 @RenderLiveshoppingWhiteIcon() 7274 } 7275 </div> 7276 <div class="custom__header__icon__text"> 7277 <div> 7278 @if (isEventLive) 7279 { 7280 <div class="pulsating-circle"></div> 7281 } 7282 <div class="custom__header__icon__text"> 7283 @Translate("Smartpage:Header.LiveshoppingText.Liveshopping", "Liveshopping") 7284 </div> 7285 </div> 7286 @if (isEventLive) 7287 { 7288 <div class="custom__header__icon__text__subtext"> 7289 @Translate("Smartpage:Header.LiveshoppingSubtextText.WeAreLive", "Vi sender nu!") 7290 </div> 7291 } 7292 else if (upcomingEvent != null) 7293 { 7294 TimeSpan timeDifference = now - upcomingEvent.Start; 7295 7296 double daysDifference = Math.Abs((timeDifference).Days); 7297 double hoursDifference = Math.Abs((timeDifference).TotalHours); 7298 double minutesDifference = Math.Abs((timeDifference).TotalMinutes); 7299 double secondsDifference = Math.Abs((timeDifference).TotalSeconds); 7300 7301 string daysText = daysDifference > 1 ? Translate("Smartpage.LiveshoppingCountdown.Days", "dage") : Translate("Smartpage.LiveshoppingCountdown.Day", "dag"); 7302 string hoursText = hoursDifference > 1 ? Translate("Smartpage.LiveshoppingCountdown.Hours", "timer") : Translate("Smartpage.LiveshoppingCountdown.Hour", "time"); 7303 string minutesText = Translate("Smartpage.LiveshoppingCountdown.Minutes", "min"); 7304 string secondsText = Translate("Smartpage.LiveshoppingCountdown.Seconds", "sek"); 7305 7306 <div class="u-flex js-countdown custom__header__icon__text__subtext" data-countdown-seconds="@secondsDifference"> 7307 <div><span class="js-days u-bold"></span>&nbsp;@daysText</div>&nbsp; 7308 <div><span class="js-hours u-bold"></span>&nbsp;@hoursText</div>&nbsp; 7309 <div><span class="js-minutes u-bold"></span>&nbsp;@minutesText</div>&nbsp; 7310 <div><span class="js-seconds u-bold"></span>&nbsp;@secondsText</div> 7311 </div> 7312 } 7313 </div> 7314 </a> 7315 </div> 7316 </div> 7317 </li> 7318 } 7319 7320 @helper RenderLiveshoppingGreenIcon() 7321 { 7322 <svg width="54px" height="40px" viewBox="0 0 54 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 7323 <title>live-active</title> 7324 <defs> 7325 <path d="M32.0214799,18.4559033 C32.8126585,18.452044 33.5016486,17.9130626 33.6984183,17.1440525 L35.7269729,9.64381814 C35.7549923,9.51994021 35.7251134,9.38999772 35.6458307,9.29097171 C35.5633361,9.20212396 35.4508359,9.14728857 35.3302637,9.13715272 L20.291955,9.13715272 L19.264154,5.38251895 C19.2316971,5.17420385 19.0397451,5.02975734 18.8313957,5.05681456 L16.3790846,5.05681456 L16.3790846,5.88010876 L18.5699235,5.88010876 L19.570677,9.63474252 L21.5992316,17.1440525 L21.6533264,17.2887958 L22.3565586,19.8582558 C21.6927986,20.2132651 21.2848056,20.9131054 21.3017102,21.6677388 L21.3017102,22.0839025 L21.3468033,22.0839025 C21.527725,23.0043143 22.3323005,23.6676401 23.2671683,23.6671945 C24.3740406,23.6721779 25.2767896,22.7784417 25.2867211,21.6676964 C25.275395,21.2430932 25.133692,20.8323155 24.8810102,20.4915557 L30.4076803,20.4915557 C30.1582103,20.8334181 30.0197192,21.2440686 30.0109711,21.6676964 C30.0209025,22.7784417 30.9236093,23.6721779 32.0305239,23.6671945 C32.9653917,23.6675977 33.7699672,23.0042719 33.9508889,22.0839025 L33.9959819,22.0839025 L33.9959819,21.6677388 C34.0059557,20.5734908 33.1300427,19.678355 32.0396524,19.6683464 C32.033609,19.668304 32.0275656,19.6682615 32.0215222,19.6682615 L23.2671683,19.6682615 L23.1319313,19.6682615 L22.7893169,18.3835528 C22.943318,18.4348258 23.1049262,18.459296 23.2671683,18.4559457 L32.0214799,18.4559457 L32.0214799,18.4559033 Z M32.3613634,20.6893079 C32.9780335,20.6752928 33.489321,21.1619997 33.503348,21.7763955 C33.5036677,21.7904106 33.5037077,21.8044257 33.5035079,21.8184408 C33.5036677,22.4184631 33.022872,22.908833 32.4207884,22.9226491 L32.4122763,22.9141683 C31.7956062,22.9281834 31.2843187,22.4414766 31.2702916,21.8270808 C31.2561847,21.2126851 31.7446932,20.7032832 32.3613634,20.6893079 Z M23.4694133,20.6891477 C24.086042,20.698581 24.578266,21.2040784 24.5689546,21.818238 C24.57395,22.4231632 24.0856424,22.9176353 23.4782851,22.9226107 C23.4638984,22.9227301 23.4494718,22.9225709 23.4350851,22.922133 L23.4350851,22.913655 C22.8183365,22.9042217 22.3260725,22.398565 22.3355837,21.7843259 C22.3450949,21.1700867 22.8527046,20.6796746 23.4694133,20.6891477 Z" id="path-1"></path> 7326 <filter x="-76.0%" y="-79.4%" width="252.1%" height="258.7%" filterUnits="objectBoundingBox" id="filter-2"> 7327 <feOffset dx="0" dy="0" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset> 7328 <feGaussianBlur stdDeviation="5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> 7329 <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> 7330 </filter> 7331 </defs> 7332 <g id="Header" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 7333 <g transform="translate(-1232.000000, -615.000000)" id="Header---2022---Dec-Copy-2"> 7334 <g transform="translate(-1.000000, 496.000000)"> 7335 <g id="Live" transform="translate(1192.000000, 0.000000)"> 7336 <g id="live-active" transform="translate(41.000000, 125.000000)"> 7337 <g id="Shape"> 7338 <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use> 7339 <use fill="#50A87D" fill-rule="evenodd" xlink:href="#path-1"></use> 7340 </g> 7341 <path d="M10.3647541,23.4047666 C10.5829316,23.6197707 10.8690661,23.7272727 11.1550516,23.7272727 C11.4410371,23.7272727 11.7271716,23.6197707 11.9453492,23.4047666 C12.3818533,22.9744647 12.3818533,22.27717 11.9453492,21.8470149 C9.90470344,19.8360511 8.78073134,17.1623049 8.78073134,14.3182002 C8.78073134,11.4740955 9.90470344,8.80034925 11.9453492,6.78938542 C12.3818533,6.35908351 12.3818533,5.66178882 11.9453492,5.23178063 C11.508994,4.80162559 10.8012582,4.80147873 10.3647541,5.23163377 C7.90176191,7.65865402 6.54545455,10.8857715 6.54545455,14.3182002 C6.54545455,17.7506289 7.90176191,20.9775995 10.3647541,23.4047666 Z" id="Path" fill="#50A87D" fill-rule="nonzero"></path> 7342 <path d="M42.0546508,23.4047666 C42.2728284,23.6197707 42.5589629,23.7272727 42.8449484,23.7272727 C43.1309339,23.7272727 43.4170684,23.6197707 43.6352459,23.4047666 C46.0982381,20.9775995 47.4545455,17.7506289 47.4545455,14.3182002 C47.4545455,10.8857714 46.0980891,7.65865401 43.6352459,5.23163376 C43.1987418,4.80162558 42.491006,4.80147872 42.0546508,5.23178062 C41.6181467,5.66193567 41.6181467,6.35923036 42.0546508,6.78938541 C44.0952966,8.80020238 45.2192687,11.4739486 45.2192687,14.3182002 C45.2192687,17.162158 44.0952966,19.8359043 42.0546508,21.8470149 C41.6181467,22.27717 41.6181467,22.9744647 42.0546508,23.4047666 Z" id="Path" fill="#50A87D" fill-rule="nonzero"></path> 7343 <path d="M6.26235997,27 C6.54414929,27 6.82608544,26.8929969 7.04106176,26.6789908 C7.47116123,26.2506862 7.47116123,25.5566281 7.04106176,25.1284697 C3.92082148,22.0224574 2.20247936,17.8926071 2.20247936,13.5000731 C2.20247936,9.10739287 3.92082148,4.97754257 7.04106176,1.87153028 C7.47116123,1.44322568 7.47116123,0.749167592 7.04106176,0.321009177 C6.61096228,-0.107003059 5.91361082,-0.107003059 5.48365819,0.321009177 C1.94741525,3.84129287 0,8.52179963 0,13.5000731 C0,18.4783466 1.94741525,23.1587071 5.48365819,26.6789908 C5.69863451,26.8928508 5.98042382,27 6.26235997,27 Z" id="Path" fill="#8EFFC8" fill-rule="nonzero"></path> 7344 <path d="M46.1411428,25.1284697 C45.7105281,25.5567743 45.7105281,26.2508324 46.1411428,26.6789908 C46.3563767,26.8929969 46.6386506,27 46.9207775,27 C47.2029043,27 47.4851782,26.8929969 47.7004121,26.6789908 C55.0089536,19.4119921 55.0089536,7.58786173 47.7004121,0.321009177 C47.2697974,-0.107003059 46.5716105,-0.107003059 46.1411428,0.321009177 C45.7105281,0.749313771 45.7105281,1.44337186 46.1411428,1.87153028 C52.5897781,8.28338161 52.5897781,18.7166184 46.1411428,25.1284697 Z" id="Path" fill="#8EFFC8" fill-rule="nonzero"></path> 7345 </g> 7346 </g> 7347 </g> 7348 </g> 7349 </g> 7350 </svg> 7351 } 7352 7353 @helper RenderLiveshoppingWhiteIcon() 7354 { 7355 <svg width="54px" height="40px" viewBox="0 0 54 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 7356 <title>live</title> 7357 <defs> 7358 <path d="M32.0214799,18.4559033 C32.8126585,18.452044 33.5016486,17.9130626 33.6984183,17.1440525 L35.7269729,9.64381814 C35.7549923,9.51994021 35.7251134,9.38999772 35.6458307,9.29097171 C35.5633361,9.20212396 35.4508359,9.14728857 35.3302637,9.13715272 L20.291955,9.13715272 L19.264154,5.38251895 C19.2316971,5.17420385 19.0397451,5.02975734 18.8313957,5.05681456 L16.3790846,5.05681456 L16.3790846,5.88010876 L18.5699235,5.88010876 L19.570677,9.63474252 L21.5992316,17.1440525 L21.6533264,17.2887958 L22.3565586,19.8582558 C21.6927986,20.2132651 21.2848056,20.9131054 21.3017102,21.6677388 L21.3017102,22.0839025 L21.3468033,22.0839025 C21.527725,23.0043143 22.3323005,23.6676401 23.2671683,23.6671945 C24.3740406,23.6721779 25.2767896,22.7784417 25.2867211,21.6676964 C25.275395,21.2430932 25.133692,20.8323155 24.8810102,20.4915557 L30.4076803,20.4915557 C30.1582103,20.8334181 30.0197192,21.2440686 30.0109711,21.6676964 C30.0209025,22.7784417 30.9236093,23.6721779 32.0305239,23.6671945 C32.9653917,23.6675977 33.7699672,23.0042719 33.9508889,22.0839025 L33.9959819,22.0839025 L33.9959819,21.6677388 C34.0059557,20.5734908 33.1300427,19.678355 32.0396524,19.6683464 C32.033609,19.668304 32.0275656,19.6682615 32.0215222,19.6682615 L23.2671683,19.6682615 L23.1319313,19.6682615 L22.7893169,18.3835528 C22.943318,18.4348258 23.1049262,18.459296 23.2671683,18.4559457 L32.0214799,18.4559457 L32.0214799,18.4559033 Z M32.3613634,20.6893079 C32.9780335,20.6752928 33.489321,21.1619997 33.503348,21.7763955 C33.5036677,21.7904106 33.5037077,21.8044257 33.5035079,21.8184408 C33.5036677,22.4184631 33.022872,22.908833 32.4207884,22.9226491 L32.4122763,22.9141683 C31.7956062,22.9281834 31.2843187,22.4414766 31.2702916,21.8270808 C31.2561847,21.2126851 31.7446932,20.7032832 32.3613634,20.6893079 Z M23.4694133,20.6891477 C24.086042,20.698581 24.578266,21.2040784 24.5689546,21.818238 C24.57395,22.4231632 24.0856424,22.9176353 23.4782851,22.9226107 C23.4638984,22.9227301 23.4494718,22.9225709 23.4350851,22.922133 L23.4350851,22.913655 C22.8183365,22.9042217 22.3260725,22.398565 22.3355837,21.7843259 C22.3450949,21.1700867 22.8527046,20.6796746 23.4694133,20.6891477 Z" id="path-1"></path> 7359 <filter x="-76.0%" y="-79.4%" width="252.1%" height="258.7%" filterUnits="objectBoundingBox" id="filter-2"> 7360 <feOffset dx="0" dy="0" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset> 7361 <feGaussianBlur stdDeviation="5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> 7362 <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> 7363 </filter> 7364 </defs> 7365 <g id="Header" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 7366 <g transform="translate(-1232.000000, -59.000000)" id="Header---2022---Dec"> 7367 <g transform="translate(-1.000000, 0.000000)"> 7368 <g id="Live" transform="translate(1192.000000, 65.000000)"> 7369 <g id="live" transform="translate(41.000000, 0.000000)"> 7370 <g id="Shape"> 7371 <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use> 7372 <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use> 7373 </g> 7374 <path d="M10.3647541,23.4047666 C10.5829316,23.6197707 10.8690661,23.7272727 11.1550516,23.7272727 C11.4410371,23.7272727 11.7271716,23.6197707 11.9453492,23.4047666 C12.3818533,22.9744647 12.3818533,22.27717 11.9453492,21.8470149 C9.90470344,19.8360511 8.78073134,17.1623049 8.78073134,14.3182002 C8.78073134,11.4740955 9.90470344,8.80034925 11.9453492,6.78938542 C12.3818533,6.35908351 12.3818533,5.66178882 11.9453492,5.23178063 C11.508994,4.80162559 10.8012582,4.80147873 10.3647541,5.23163377 C7.90176191,7.65865402 6.54545455,10.8857715 6.54545455,14.3182002 C6.54545455,17.7506289 7.90176191,20.9775995 10.3647541,23.4047666 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path> 7375 <path d="M42.0546508,23.4047666 C42.2728284,23.6197707 42.5589629,23.7272727 42.8449484,23.7272727 C43.1309339,23.7272727 43.4170684,23.6197707 43.6352459,23.4047666 C46.0982381,20.9775995 47.4545455,17.7506289 47.4545455,14.3182002 C47.4545455,10.8857714 46.0980891,7.65865401 43.6352459,5.23163376 C43.1987418,4.80162558 42.491006,4.80147872 42.0546508,5.23178062 C41.6181467,5.66193567 41.6181467,6.35923036 42.0546508,6.78938541 C44.0952966,8.80020238 45.2192687,11.4739486 45.2192687,14.3182002 C45.2192687,17.162158 44.0952966,19.8359043 42.0546508,21.8470149 C41.6181467,22.27717 41.6181467,22.9744647 42.0546508,23.4047666 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path> 7376 <path d="M6.26235997,27 C6.54414929,27 6.82608544,26.8929969 7.04106176,26.6789908 C7.47116123,26.2506862 7.47116123,25.5566281 7.04106176,25.1284697 C3.92082148,22.0224574 2.20247936,17.8926071 2.20247936,13.5000731 C2.20247936,9.10739287 3.92082148,4.97754257 7.04106176,1.87153028 C7.47116123,1.44322568 7.47116123,0.749167592 7.04106176,0.321009177 C6.61096228,-0.107003059 5.91361082,-0.107003059 5.48365819,0.321009177 C1.94741525,3.84129287 0,8.52179963 0,13.5000731 C0,18.4783466 1.94741525,23.1587071 5.48365819,26.6789908 C5.69863451,26.8928508 5.98042382,27 6.26235997,27 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path> 7377 <path d="M46.1411428,25.1284697 C45.7105281,25.5567743 45.7105281,26.2508324 46.1411428,26.6789908 C46.3563767,26.8929969 46.6386506,27 46.9207775,27 C47.2029043,27 47.4851782,26.8929969 47.7004121,26.6789908 C55.0089536,19.4119921 55.0089536,7.58786173 47.7004121,0.321009177 C47.2697974,-0.107003059 46.5716105,-0.107003059 46.1411428,0.321009177 C45.7105281,0.749313771 45.7105281,1.44337186 46.1411428,1.87153028 C52.5897781,8.28338161 52.5897781,18.7166184 46.1411428,25.1284697 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path> 7378 </g> 7379 </g> 7380 </g> 7381 </g> 7382 </g> 7383 </svg> 7384 } 7385 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7386 @using Dynamicweb.Rapido.Blocks 7387 7388 @{ 7389 bool activateChainOrdersLink = Pageview.AreaSettings.GetItem("Custom").GetBoolean("ActivateChainOrdersLink"); 7390 var chainCustomerProducts = Smartpage.PhilipsonWine.ChainCustomer.ChainProductService.GetChainCustomerProducts(); 7391 if (activateChainOrdersLink && chainCustomerProducts.Any()) 7392 { 7393 Block masterDesktopActionsChainOrdersBlock = new Block 7394 { 7395 Id = "MasterDesktopActionsChainOrders", 7396 SortId = 10, 7397 Template = RenderChainOrdersAction() 7398 }; 7399 7400 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsChainOrdersBlock); 7401 } 7402 } 7403 7404 @helper RenderChainOrdersAction() 7405 { 7406 <li class="menu__item menu__item--horizontal menu__item menu__item--icon menu__item--clean is-dropdown is-dropdown--no-icon dw-mod"> 7407 <div class="header-menu__link header-menu__link--icon dw-mod"> 7408 <div class="custom__header__icon"> 7409 <a href="Default.aspx?ID=@GetPageIdByNavigationTag("ChainOrdersPage")"> 7410 <div class="custom__header__icon__icon chain-order-icon"> 7411 <svg xmlns="http://www.w3.org/2000/svg" width="26.786" height="25" viewBox="0 0 26.786 25"> 7412 <path id="Path_6" data-name="Path 6" d="M5,30.321A2.679,2.679,0,1,1,7.679,33,2.679,2.679,0,0,1,5,30.321ZM7.679,13.357A2.679,2.679,0,1,0,5,10.679a2.679,2.679,0,0,0,2.679,2.679Zm0,9.821A2.679,2.679,0,1,0,5,20.5,2.679,2.679,0,0,0,7.679,23.179Zm8.929-10.714H30a1.786,1.786,0,0,0,0-3.571H16.607a1.786,1.786,0,1,0,0,3.571Zm0,9.821H30a1.786,1.786,0,1,0,0-3.571H16.607a1.786,1.786,0,1,0,0,3.571Zm0,9.821H30a1.786,1.786,0,0,0,0-3.571H16.607a1.786,1.786,0,1,0,0,3.571Z" transform="translate(-5 -8)" fill="#fff" /> 7413 </svg> 7414 </div> 7415 <div class="custom__header__icon__text"> 7416 <div> 7417 <div class="custom__header__icon__text"> 7418 @Translate("Smartpage:Header.ChainOrdersText.ChainOrders", "Rammeordrer") 7419 </div> 7420 </div> 7421 </div> 7422 </a> 7423 </div> 7424 </div> 7425 </li> 7426 } 7427 7428 7429 @helper RenderDesktopTools() 7430 { 7431 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 7432 7433 <div class="tools-navigation dw-mod"> 7434 <div class="center-container grid top-container__center-container dw-mod"> 7435 @RenderBlockList(subBlocks) 7436 </div> 7437 </div> 7438 } 7439 7440 @helper RenderDesktopToolsText() 7441 { 7442 string toolsText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("ToolsText"); 7443 if (!string.IsNullOrEmpty(toolsText)) 7444 { 7445 <div class="u-margin-top u-margin-bottom">@toolsText</div> 7446 } 7447 } 7448 7449 @helper RenderDesktopToolsNavigation() 7450 { 7451 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 7452 7453 if (renderPagesInToolBar) 7454 { 7455 @RenderNavigation(new 7456 { 7457 id = "topToolsNavigation", 7458 cssclass = "menu menu-tools dw-mod dwnavigation", 7459 template = "TopMenu.xslt" 7460 }) 7461 } 7462 } 7463 7464 @helper RenderDesktopNavigation() 7465 { 7466 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 7467 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 7468 string alignClass = topLayout == "two-lines-centered" ? "grid--justify-center" : ""; 7469 string menuType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetRawValueString("NavigationMegaMenu") : "dropdown"; 7470 bool isSidemenu = menuType == "sidemenu"; 7471 if (isSidemenu) 7472 { 7473 <div class="sidemenu__modal-overlay js-sidemenu-overlay"></div> 7474 } 7475 7476 <nav class="main-navigation @(isSidemenu ? "sidemenu-navigation js-sidemenu-navigation" : "") js-main-navigation dw-mod"> 7477 @if (isSidemenu) 7478 { 7479 <div class="navigation-header"> 7480 <div class="navigation-header__previous js-navigation-previous">@RenderPreviousButton()</div> 7481 <div class="navigation-header__mid"> 7482 <div class="js-navigation-logo"> 7483 @RenderSidemenuLogo() 7484 </div> 7485 <h2 class="js-navigation-active-title"></h2> 7486 </div> 7487 <div class="navigation-header__close js-sidemenu-close">@RenderCloseButton()</div> 7488 </div> 7489 <div class="navigation-container js-navigation-container"> 7490 @RenderBlockList(subBlocks) 7491 </div> 7492 <div class="sidemenu-sub-navigation js-sidemenu-sub-navigation"> 7493 <div class="navigation-header"> 7494 <h2 class="js-sub-navigation-title"></h2> 7495 <div class="navigation-header__close js-sidemenu-close">@RenderCloseButton()</div> 7496 </div> 7497 <div class="navigation-container js-navigation-container"> 7498 <div class="js-sub-navigation-items"></div> 7499 </div> 7500 </div> 7501 } 7502 else 7503 { 7504 <div class="center-container top-container__center-container grid @alignClass dw-mod"> 7505 @RenderBlockList(subBlocks) 7506 </div> 7507 } 7508 </nav> 7509 } 7510 7511 @helper RenderDesktopExtra() 7512 { 7513 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 7514 string menuType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetRawValueString("NavigationMegaMenu") : "dropdown"; 7515 bool isSidemenu = menuType == "sidemenu"; 7516 7517 if (subBlocks.Count > 0) 7518 { 7519 <div class="header header-top dw-mod custom__header__top js-header-top"> 7520 <div class="center-container top-container__center-container grid--justify-space-between grid grid--align-center dw-mod"> 7521 @RenderBlockList(subBlocks) 7522 </div> 7523 </div> 7524 } 7525 if (isSidemenu && Pageview.Page.NavigationTag == "CartPage") 7526 { 7527 <div class="sidemenu__custom__checkout__headerusp-container"> 7528 <div class="custom__checkout__headerusp grid"> 7529 @SidemenuRenderCartUsps("help", Translate("Smartpage:Checkout.Brug for hælp?"), Translate("Smartpage:Checkout.Tel: 70 22 68 88")) 7530 @SidemenuRenderCartUsps("Secure", Translate("Smartpage:Checkout.Sikker betaling"), Translate("Smartpage:Checkout.Krypteret betaling")) 7531 @SidemenuRenderCartUsps("delivery", Translate("Smartpage:Checkout.Hurtig levering"), Translate("Smartpage:Checkout.1-2 dages levering")) 7532 @SidemenuRenderCartUsps("tilfredshed", Translate("Smartpage:Checkout.100% tilfredshed!"), Translate("Smartpage:Checkout.Du kan nemt sende retur")) 7533 </div> 7534 </div> 7535 } 7536 } 7537 7538 @* MOBILE SPECIFIC HEADER ON VERICAL TABLET*@ 7539 @{ 7540 Block mobileTabletHeader = new Block() 7541 { 7542 Id = "TabletMobileTop", 7543 SortId = 10, 7544 Template = RenderTabletMobileTop(), 7545 SkipRenderBlocksList = true 7546 }; 7547 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileTabletHeader); 7548 7549 Block mobileTabletHeaderNavigation = new Block() 7550 { 7551 Id = "MobileTabletHeaderNavigation", 7552 SortId = 50, 7553 Template = RenderMobileTabletHeaderNavigation(), 7554 SkipRenderBlocksList = true, 7555 BlocksList = new List<Block> { 7556 new Block { 7557 Id = "MobileTabletHeaderNavigationTrigger", 7558 SortId = 10, 7559 Template = RenderMobileTabletHeaderNavigationTrigger() 7560 } 7561 } 7562 }; 7563 mobileHeaderBlocksPage.Add("TabletMobileTop", mobileTabletHeaderNavigation); 7564 7565 Block mobileTabletHeaderLogo = new Block() 7566 { 7567 Id = "MobileTabletHeaderLogo", 7568 SortId = 20, 7569 Template = RenderMobileTabletHeaderLogo(), 7570 SkipRenderBlocksList = true 7571 }; 7572 mobileHeaderBlocksPage.Add("TabletMobileTop", mobileTabletHeaderLogo); 7573 7574 Block mobileTabletHeaderActions = new Block() 7575 { 7576 Id = "MobileTabletHeaderActions", 7577 SortId = 30, 7578 Template = RenderMobileTabletTopActions(), 7579 SkipRenderBlocksList = true 7580 }; 7581 mobileHeaderBlocksPage.Add("TabletMobileTop", mobileTabletHeaderActions); 7582 @* bool mobileHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 7583 if (!mobileHideSearch) 7584 { 7585 Block mobileTabletHeaderSearch = new Block 7586 { 7587 Id = "MobileTabletHeaderSearch", 7588 SortId = 10, 7589 Template = RenderMobileTopSearch() 7590 }; 7591 mobileHeaderBlocksPage.Add("MobileTabletHeaderActions", mobileTabletHeaderSearch); 7592 }*@ 7593 7594 Block mobileTabletHeaderMiniCart = new Block 7595 { 7596 Id = "MobileTabletHeaderMiniCart", 7597 SortId = 20, 7598 Template = RenderMobileTabletTopMiniCart() 7599 }; 7600 mobileHeaderBlocksPage.Add("MobileTabletHeaderActions", mobileTabletHeaderMiniCart); 7601 7602 Block tabletMiniCartCounterScriptTemplate = new Block 7603 { 7604 Id = "TabletMiniCartCounterScriptTemplate", 7605 Template = RenderMobileTabletMiniCartCounterContent() 7606 }; 7607 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", tabletMiniCartCounterScriptTemplate); 7608 7609 if (Pageview.Page.NavigationTag == "CartPage" && Pageview.Device.ToString() == "Tablet") 7610 { 7611 Block mobileCheckoutUsp = new Block 7612 { 7613 Id = "MobileCheckoutUsp", 7614 SortId = 50, 7615 Template = RenderMobileCheckoutUsp() 7616 }; 7617 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileCheckoutUsp); 7618 } 7619 } 7620 @helper RenderTabletMobileTop() 7621 { 7622 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("TabletMobileTop").OrderBy(item => item.SortId).ToList(); 7623 7624 <nav class="main-navigation-mobile dw-mod"> 7625 <div class="center-container top-container__center-container dw-mod"> 7626 <div class="grid grid--align-center"> 7627 @RenderBlockList(subBlocks) 7628 </div> 7629 </div> 7630 </nav> 7631 } 7632 7633 @helper RenderMobileTabletHeaderNavigation() 7634 { 7635 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTabletHeaderNavigation").OrderBy(item => item.SortId).ToList(); 7636 7637 <div class="grid__col-auto-width"> 7638 <ul class="menu dw-mod"> 7639 @RenderBlockList(subBlocks) 7640 </ul> 7641 </div> 7642 } 7643 7644 @helper RenderMobileTabletHeaderNavigationTrigger() 7645 { 7646 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod js-mobile-navigation-trigger"> 7647 <label for="TabletNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod"></label> 7648 </li> 7649 } 7650 7651 @helper RenderMobileTabletHeaderLogo() 7652 { 7653 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTabletHeaderLogo").OrderBy(item => item.SortId).ToList(); 7654 7655 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 7656 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 7657 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 7658 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 7659 7660 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 7661 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 7662 { 7663 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 7664 } 7665 7666 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 7667 { 7668 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;width=100&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 7669 } 7670 else 7671 { 7672 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 7673 } 7674 7675 <div class="grid__col-auto grid__col--bleed"> 7676 <div class="grid__cell @centeredLogo"> 7677 <a href="/Default.aspx?ID=@firstPageId" class="logo logo--mobile u-inline-block dw-mod"> 7678 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 7679 </a> 7680 </div> 7681 7682 @RenderBlockList(subBlocks) 7683 </div> 7684 } 7685 7686 @helper RenderMobileTabletTopActions() 7687 { 7688 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTabletHeaderActions").OrderBy(item => item.SortId).ToList(); 7689 7690 <div class="grid__col-auto-width"> 7691 <ul class="menu dw-mod"> 7692 @RenderBlockList(subBlocks) 7693 </ul> 7694 </div> 7695 } 7696 7697 @helper RenderMobileTabletTopMiniCart() 7698 { 7699 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 7700 int cartPageId = GetPageIdByNavigationTag("CartPage"); 7701 double cartProductsCount = 0; 7702 7703 if (Model != null && Model.Cart != null && Model.Cart.CartOrderlines != null) 7704 { 7705 CartInformation cartInformation = new CartInformation(Model.Cart); 7706 7707 cartProductsCount = cartInformation.OrderLineCount; 7708 7709 } 7710 7711 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod" id="miniCartWrapper"> 7712 <div class="mini-cart dw-mod"> 7713 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="menu__link menu__link--icon menu__link--mobile dw-mod js-mini-cart-button"> 7714 <div class="u-inline u-position-relative"> 7715 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fa-1_5x"></i> 7716 <div class="mini-cart__counter dw-mod"> 7717 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounterTablet" data-template="MiniTabletCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 7718 <div class="js-mini-cart-counter-content" data-count="@cartProductsCount"> 7719 @cartProductsCount 7720 </div> 7721 </div> 7722 </div> 7723 </div> 7724 </a> 7725 </div> 7726 </li> 7727 } 7728 7729 @helper RenderMobileTabletMiniCartCounterContent() 7730 { 7731 <script id="MiniTabletCartCounterContent" type="text/x-template"> 7732 {{#.}} 7733 <div class="js-mini-cart-counter-content dw-mod" data-count="{{numberofproducts}}"> 7734 {{numberofproducts}} 7735 </div> 7736 {{/.}} 7737 </script> 7738 } 7739 7740 @helper RenderPreviousButton() 7741 { 7742 <svg xmlns="http://www.w3.org/2000/svg" width="27.663" height="19.992" viewBox="0 0 27.663 19.992"> 7743 <path id="Path_122" data-name="Path 122" d="M11.946,3.067a1.139,1.139,0,0,0-1.61,0L1.346,12.057a.949.949,0,0,0,0,1.344l8.991,8.991a1.139,1.139,0,0,0,1.611-1.611L5.034,13.868H27.592a1.139,1.139,0,1,0,0-2.278H5.034l6.914-6.912a1.139,1.139,0,0,0,0-1.611Z" transform="translate(-1.067 -2.734)" fill="#3b3d3e" fill-rule="evenodd" /> 7744 </svg> 7745 } 7746 7747 @helper RenderSidemenuLogo() 7748 { 7749 <svg xmlns="http://www.w3.org/2000/svg" width="299.404" height="61.255" viewBox="0 0 299.404 61.255"> 7750 <g id="philipson-wine-logo-mobil" transform="translate(0 0)"> 7751 <path id="Path_1" data-name="Path 1" d="M76.936,67.213c2.668-.339,3.176-.931,3.176-4.574V42.646c0-2.2-1.059-2.88-2.965-2.372v-.508L85.2,37.181V51.288c2.033-2.033,4.32-4.025,7.2-4.025,3.176,0,5.337,2.118,5.337,5.8v9.573c0,3.558.466,4.277,2.965,4.574v.339H89.515v-.339c2.711-.339,3.092-.974,3.092-4.574V53.955c0-2.584-.974-3.812-3.092-3.812-1.652,0-3.007.974-4.32,2.161V62.639c0,3.6.466,4.32,2.88,4.574v.339H76.936Z" transform="translate(-50.459 -24.385)" fill="#3b3d3e" /> 7752 <path id="Path_2" data-name="Path 2" d="M150.708,67.539c2.753-.339,3.3-1.016,3.3-4.574V52.376c0-1.95-1.1-2.33-3.135-1.736v-.51l8.26-2.71V62.965c0,3.515.551,4.277,2.923,4.574v.339H150.708Zm2.8-27.066a2.844,2.844,0,0,1,3.008-2.8,2.8,2.8,0,1,1,0,5.591A2.871,2.871,0,0,1,153.5,40.473Z" transform="translate(-98.843 -24.711)" fill="#3b3d3e" /> 7753 <path id="Path_3" data-name="Path 3" d="M190.266,67.213c2.711-.339,3.177-1.016,3.177-4.574V42.731c0-2.923-1.313-2.88-3.219-2.372v-.508l8.3-2.669V62.639c0,3.515.551,4.235,2.965,4.574v.339H190.266Z" transform="translate(-124.76 -24.385)" fill="#3b3d3e" /> 7754 <path id="Path_4" data-name="Path 4" d="M230.106,67.539c2.753-.339,3.3-1.016,3.3-4.574V52.376c0-1.95-1.1-2.33-3.135-1.736v-.51l8.26-2.71V62.965c0,3.515.551,4.277,2.923,4.574v.339H230.106Zm2.8-27.066a2.844,2.844,0,0,1,3.008-2.8,2.8,2.8,0,1,1,0,5.591A2.871,2.871,0,0,1,232.9,40.473Z" transform="translate(-150.917 -24.711)" fill="#3b3d3e" /> 7755 <path id="Path_5" data-name="Path 5" d="M265.189,96.478c2.8-.338,3.262-1.059,3.262-4.617V71.911c0-2.921-1.1-3.218-2.923-2.753V68.65l8.048-2.541V70.6c2.118-2.667,3.431-4.363,6.524-4.363,5.167,0,8.26,4.279,8.26,9.912,0,6.481-4.872,10.886-10.081,10.886-2.372,0-3.177-.762-4.7-2.076V91.9c.043,3.432.932,4.277,3.516,4.574v.339h-11.9Zm17.536-19.1c0-4.151-1.525-7.963-5-7.963-1.906,0-3.008,1.185-4.151,2.5v8.556c0,3.474,1.906,5.21,4.405,5.21,3.346,0,4.744-3.94,4.744-8.3Z" transform="translate(-173.926 -43.358)" fill="#3b3d3e" /> 7756 <path id="Path_6" data-name="Path 6" d="M346.224,86.056a1.281,1.281,0,0,0-.677-.128.839.839,0,0,0-.889.679h-.424V79.66h.381c.551,3.43,3.262,6.31,6.4,6.31a2.973,2.973,0,0,0,3.219-3.007c0-1.821-1.185-2.627-4.7-4.32-4.024-1.864-5.633-3.177-5.633-6.438,0-3.56,3.007-5.973,6.777-5.973a9.222,9.222,0,0,1,4.024.931,1.442,1.442,0,0,0,.678.128.86.86,0,0,0,.762-.551h.423l.339,6.227h-.466c-.677-3.263-3.007-5.592-5.845-5.592-1.78,0-3.219.848-3.219,2.541,0,1.821,1.312,2.5,4.955,4.322,4.194,1.948,6.057,3.346,6.057,6.65,0,4.023-3.685,6.227-7.328,6.227A13.456,13.456,0,0,1,346.224,86.056Z" transform="translate(-225.547 -43.439)" fill="#3b3d3e" /> 7757 <path id="Path_7" data-name="Path 7" d="M394.115,76.938a10.314,10.314,0,0,1,10.632-10.463c5.973,0,10.631,4.109,10.631,10.335a10.338,10.338,0,0,1-10.631,10.463C398.774,87.274,394.115,83.123,394.115,76.938Zm15.673,1.4c0-4.574-1.652-10.673-5.761-10.673-2.922,0-4.32,3.43-4.32,7.709,0,4.617,1.652,10.716,5.76,10.716,2.923,0,4.321-3.515,4.321-7.751Z" transform="translate(-258.483 -43.598)" fill="#3b3d3e" /> 7758 <path id="Path_8" data-name="Path 8" d="M460.1,86.186c2.753-.339,3.176-1.1,3.176-4.574V71.53c0-2.838-1.059-2.88-3.008-2.33v-.508l8.133-2.584V70.26c2.076-2.033,4.321-4.025,7.2-4.025,3.219,0,5.336,2.118,5.336,5.8v9.573c0,3.558.466,4.277,3.008,4.574v.339H472.763v-.339c2.668-.339,3.049-.974,3.049-4.574V72.927c0-2.584-.974-3.812-3.092-3.812-1.652,0-3.008.974-4.321,2.161V81.612c0,3.515.467,4.277,2.88,4.574v.339H460.1Z" transform="translate(-301.759 -43.358)" fill="#3b3d3e" /> 7759 <path id="Path_9" data-name="Path 9" d="M40.509,85.5a9.615,9.615,0,0,1-2.125.487.61.61,0,0,0,.139.01,5.79,5.79,0,0,0,3.456-1.162A7.613,7.613,0,0,1,40.509,85.5Z" transform="translate(-25.174 -55.64)" fill="#3b3d3e" /> 7760 <path id="Path_10" data-name="Path 10" d="M23.817,45.21a8.136,8.136,0,0,0-2.94-2.731,10.692,10.692,0,0,0-3.853-1.347,36.6,36.6,0,0,0-4.7-.268H0v.423c.328.04.56.069.9.119s.685.139,1,.2c1.6.407,1.986,1.261,1.986,4.092V65.053c0,3.774-.675,4.152-3.854,4.579v.338H13.924v-.407a5.839,5.839,0,0,1-2.572-.6,3.325,3.325,0,0,1-1.241-1.053,2.923,2.923,0,0,1-.447-1.52c-.02-.616-.05-1.361-.079-2.215,0-.457,0-.874-.02-1.261s-.02-.814-.02-1.271V57.873h2.175c.824,0,1.678-.04,2.552-.1S16,57.6,16.864,57.466a13.006,13.006,0,0,0,2.413-.6A11.224,11.224,0,0,0,21.4,55.8a7.662,7.662,0,0,0,3.1-3.715,7.255,7.255,0,0,0,.477-2.692A7.446,7.446,0,0,0,23.817,45.21Zm-4.539,8.542A7.075,7.075,0,0,1,16.8,56a5.79,5.79,0,0,1-3.456,1.162.61.61,0,0,1-.139-.01,5.475,5.475,0,0,1-.566.06c-.963.07-2,.1-3.1.1V52.162c0-1.281.01-2.592.02-3.933,0-.159,0-.318.01-.477V42.12c.055-.028.113-.069.172-.1a1.338,1.338,0,0,1,.215-.073c3.248-.717,7.6.2,9.495,3.1a7.408,7.408,0,0,1,1.182,4.142,8.017,8.017,0,0,1-1.361,4.559Z" transform="translate(0 -26.8)" fill="#3b3d3e" /> 7761 <path id="Path_11" data-name="Path 11" d="M723.748,37.943s-1.373,1.04-2.23.735a4.114,4.114,0,0,0-2.712.511c-1.068.546-1.569.953-2.212,1.22a8.238,8.238,0,0,1-1.575.223s.306-.115.346-.336a1.225,1.225,0,0,1,.256-.466,8.021,8.021,0,0,0-1.981-.076,2.99,2.99,0,0,1-2.262.215.777.777,0,0,0,.411-.381c.105-.266.381-.842.381-.842-.406-.587-1.544-.281-2.276-.642a.76.76,0,0,0,.517-.647,3.83,3.83,0,0,0-1.394-.482c-.727-.075-1.424-.943-1.71-.938a.777.777,0,0,0,.411-.381,5.369,5.369,0,0,1,1.515-1.434,3.136,3.136,0,0,0-.933-.512c-.486-.146-.712-.471-1-.467a1.575,1.575,0,0,0,.522-.361,1.548,1.548,0,0,1,.411-.381,5.648,5.648,0,0,1-1.554-.853,1,1,0,0,0,.477-.426,1.508,1.508,0,0,1-1.008-1.038c-.346-.918-.652-.8-.652-.8a4.931,4.931,0,0,0,1.088-.657,3.019,3.019,0,0,1,.893-.521s-.812-1.174-.988-1.149a4.205,4.205,0,0,0,.852-.3c.2-.135-1.113-.772-1.429-1.229s-.9-1.3-1.078-1.279a2.756,2.756,0,0,0,1.133-.591,1.4,1.4,0,0,1,1.093-.371,1.849,1.849,0,0,0-.561-.672c-.311-.171-.255-.787-.456-.938a1.336,1.336,0,0,0,.7-.1c.371-.16.742-.321.9-.235a1.372,1.372,0,0,0-.251-.5c-.226-.326-.1-.7-.321-.742a1.1,1.1,0,0,0,.547-.185l.261-.18a3.462,3.462,0,0,1-.035-2,.791.791,0,0,0-.125-.878,1.451,1.451,0,0,0,.817.206,10.257,10.257,0,0,1,2.888.412,1.989,1.989,0,0,1-.035-.747,1.011,1.011,0,0,0-.01-.572s.6.451.8.316l-.361-.522c-.045-.065.742-.321.918-.346a1.1,1.1,0,0,1-.125-.878.9.9,0,0,0-.035-.747,2.169,2.169,0,0,0,.506.035c.176-.025.547-.185.7-.1a1.355,1.355,0,0,1-.215-1.008c.146-.486.186-.707.1-.837a2.55,2.55,0,0,0,1.013.07,7.275,7.275,0,0,0,.482-1.394c0-.286.617-1.2.547-1.439,0,0,1.454,1.4,2.025,1.395,0,0,.356-1.018.266-1.148a6.343,6.343,0,0,1,2.056.6s-.336-.346-.3-.567-.316-.456-.316-.456l.722-.21a4.1,4.1,0,0,1,.442-2.427.975.975,0,0,0-.1-.416,2.393,2.393,0,0,0,.953.4,1.767,1.767,0,0,1,.707.186,1.784,1.784,0,0,1,.291-.973,4.279,4.279,0,0,0,.672-1.815s.541.782,1.243.682a3.661,3.661,0,0,0,.462-1.284s.205.436.491.431A7.336,7.336,0,0,0,726.508.384,1.362,1.362,0,0,0,727,.815a13.146,13.146,0,0,1,1.509,2.041c.226.326,1.509.788,1.985,1.615,0,0,.04-.221.411-.381s.346-.336.346-.336a2.456,2.456,0,0,0,.321.742,1.988,1.988,0,0,1,.441,1.334,1.914,1.914,0,0,1,.772,1.394.926.926,0,0,1,.587-.406,1.092,1.092,0,0,0,.717-.5,10.167,10.167,0,0,1,.265,1.359,6.652,6.652,0,0,0,.075,1.78l.366-.446a1.849,1.849,0,0,0,.406,1.84,7.759,7.759,0,0,1,1.013-1.183c.326-.226.762-.431.933-.742a1.382,1.382,0,0,0,.341.632,2.554,2.554,0,0,0,.4.3s.406-.667.757-.717c0,0,.18.261.246.216A3.522,3.522,0,0,1,740.7,8.5c.351-.05.431-.491.431-.491a3.231,3.231,0,0,0,.486,1.4,4.558,4.558,0,0,1,.556,1.64,4.857,4.857,0,0,1,1.219-.747,1.62,1.62,0,0,0,.893-.521,1.411,1.411,0,0,0,.3.853,1.412,1.412,0,0,1,.3.853s.186-.707.557-.867a1.343,1.343,0,0,0,.522-.361s-.015.4.14.481.14.481.14.481a2.3,2.3,0,0,1,1.665-.381.982.982,0,0,0,.7-.1,2.565,2.565,0,0,0-.176,1.279,3,3,0,0,1,.02,1.143,6.838,6.838,0,0,0,1.154-.7.836.836,0,0,0,.035.747,2.191,2.191,0,0,1,.3.567,5.011,5.011,0,0,1,1.62-.446,1.339,1.339,0,0,0,.592-.12,5.5,5.5,0,0,0-.176,1.279c.05.351.075.527-.01.682s.918-.346.918-.346l.07.241a1.542,1.542,0,0,1,.7-.386c.351-.05.837.1,1.183-.24,0,0-.341.622-.161.882s1.63.126,1.87.056.983-.391,1.289-.506a2.092,2.092,0,0,1,.857-.015,12.5,12.5,0,0,1-1.124,2.417,5.113,5.113,0,0,0-.6.8,1.106,1.106,0,0,1,.506.035,2.441,2.441,0,0,0-.943,1.424.512.512,0,0,1,.461-.03c.266.105.426.476.667.406,0,0-.527.075-.652.451a2.645,2.645,0,0,1-.878,1.379s.351-.05.667.406c.135.2.506.035.506.035a4.343,4.343,0,0,1-.6.8,4.929,4.929,0,0,0-.517.647.412.412,0,0,1,.446.366.963.963,0,0,1-.517.647.63.63,0,0,1,.577.276c.226.326.361.522.536.5a3.894,3.894,0,0,0-.471.712,4.628,4.628,0,0,1-.993,1.073.619.619,0,0,1,.226.326c.025.176.05.351.16.371s-.286,0-.547.185a3,3,0,0,0-.477.426,1.133,1.133,0,0,1,.511.321,2.252,2.252,0,0,0,1.329.527,1.213,1.213,0,0,0-.562.582,9.586,9.586,0,0,1-1.535,1.544s1.715,1.224,2.086,1.063a3.572,3.572,0,0,0-.823.762,8.241,8.241,0,0,1-1.234,1.143.694.694,0,0,1,.4.3.875.875,0,0,0,.511.321s-.085.155-.632.341a2.265,2.265,0,0,0-.913.632s.577.276.817.206.772.141.752.251a.507.507,0,0,0-.522.361,1.177,1.177,0,0,1,.642.231c.246.216,1.314.923,1.73.828a.738.738,0,0,1-.391.271c-.306.115-.166.6-.471.712a2.592,2.592,0,0,1,.953.4c.4.3.627.627,1,.467,0,0-.436.205-.5.536s-.281.291-.281.291a1.659,1.659,0,0,1,.8.6c.316.456,1.524.392,2.061.888s.646.517.822.492a3.363,3.363,0,0,1-1.434.993c-1.595.621-1.364,1.233-1.715,1.283a.344.344,0,0,1,.311.171.606.606,0,0,0,.356.236,2.4,2.4,0,0,0-.722.21,5.168,5.168,0,0,1-1.179.526.582.582,0,0,1,.205.436c.005.286.562.672.562.672a4.112,4.112,0,0,0-1.008.215c-.371.16-1.224.461-1.424.311a.412.412,0,0,1,.16.371.945.945,0,0,0,.14.481s-.18-.261-.356-.236a2.169,2.169,0,0,1-.506-.035,3.207,3.207,0,0,0,.346.918c.3.567-.015.4.256.787a6.451,6.451,0,0,0-1.143.02,3.007,3.007,0,0,1-1.715.03s.18.261.03.461a.932.932,0,0,0-.055.617,1.5,1.5,0,0,0-.572.01,1.613,1.613,0,0,1-.857.015,1.724,1.724,0,0,1,.3.853c-.015.4.286,1.249.506,1.289a2.993,2.993,0,0,0-.747.035c-.241.07-.862-.271-1.083-.311s-1.163.13-1.254,0c0,0-.236.356-.166.6a1.1,1.1,0,0,0-.642-.231,1.767,1.767,0,0,1-.707-.186.83.83,0,0,1-.186.707.591.591,0,0,0-.166.6s-.271-.391-.557-.386a1.622,1.622,0,0,1-.908-.336c-.09-.13-.08.441-.08.441a.707.707,0,0,0-.557-.386,6.055,6.055,0,0,1-.076,1.013,1.213,1.213,0,0,0,.175.943,3.54,3.54,0,0,1,.175,1.229,1.419,1.419,0,0,0-.6-.166c-.286,0-1.72-.256-1.72-.256a1.5,1.5,0,0,1-.531-.211s.2.15.03.461-.08.441-.08.441-.381-.411-.667-.406a.943.943,0,0,1-.757-.537s.185.547-.01.682-.211.531-.211.531a4,4,0,0,0-1-.752,4.847,4.847,0,0,1-.978-.577,2.332,2.332,0,0,1-.161.882c-.15.2-.075.727-.075.727a1.6,1.6,0,0,0-1.2-.617,1.174,1.174,0,0,1-1.043-.532l-.015.4s-.687-.3-.712-.471a1.737,1.737,0,0,0-.075.727c.01.572-.512.933-.507,1.218,0,0,.015-.4-.316-.456l-.331-.06h0a2.633,2.633,0,0,1-.221,1.213,4.168,4.168,0,0,0-.311,2.337.981.981,0,0,0-.973-.291c-.7.1-1.419-.657-1.419-.657s-.216.246-.125.376a1.484,1.484,0,0,1-.667-.406,1.935,1.935,0,0,0-.381-.411,2.487,2.487,0,0,1-.737.607.293.293,0,0,0-.105.266s-.16-.371-.381-.411a1.478,1.478,0,0,1-.9-1.018.908.908,0,0,1-.391.271.619.619,0,0,0-.326.226s.06-.331-.14-.481a.837.837,0,0,1-.271-.391,1.579,1.579,0,0,1-.863.983c-.436.205-.411.381-.411.381a1.791,1.791,0,0,0-.431-.762,3.867,3.867,0,0,1-.777-1.68s-.236.356-.567.3a.447.447,0,0,0-.391.271.63.63,0,0,0-.055-.637,2.433,2.433,0,0,1-.391-.983,1.381,1.381,0,0,0-.632.341,2.353,2.353,0,0,1-1.088.657l-.2.135h0a1.132,1.132,0,0,0-.12-.592,4.649,4.649,0,0,1-.3-1.82l-.527.075a.613.613,0,0,0-.241.07s.191-.421.1-.552a1.476,1.476,0,0,1,.091-1.123,1.632,1.632,0,0,1-.812.08.617.617,0,0,0-.526.075,1.411,1.411,0,0,0,.005-.968,1.862,1.862,0,0,1-.04-1.033,4.477,4.477,0,0,0-1.4.2c-.7.386-1.1.085-1.62.446a1.081,1.081,0,0,0-.075-.527,2.97,2.97,0,0,1,.2-1.389,3.8,3.8,0,0,0,.025-1.078,1.111,1.111,0,0,0-.637.055c-.2.135.159-.56.521-.826s.268-.844.736-1.072a1.853,1.853,0,0,1-.687-.087c-.405-.121-.54.149-.54.149a5.8,5.8,0,0,1,1.088-1.331,4.112,4.112,0,0,0,.85-.861,3.685,3.685,0,0,0-.722.21,2.741,2.741,0,0,1,.762-.9c.646-.576.576-.816.576-.816s-.312.2-.523.057a.8.8,0,0,0-.431-.135s1.35-2.1,2.521-2.407c.564-.15,2.378-.1,3.051-1.825.416-1.067.4-1.675,1.188-2.092Z" transform="translate(-462.274 -0.252)" fill="#5a9b84" /> 7762 <path id="Path_12" data-name="Path 12" d="M740.031,82.449l-.1-6.922.324-3.711-.044-.227-3.251-1.7a11.665,11.665,0,0,0-2.289-1.984,12.315,12.315,0,0,1-3.242-2.642c-.988-1.149-1.184-1.27-1.4-1.537a7.5,7.5,0,0,1-1.136-1.271c-.37-.628-.711-.424-1.475-1.389s-2.15-2.851-2.15-2.851,2.482,2.8,3.145,3.384,2.436,2.685,2.688,2.816,1.466,1.492,3.036,2.623,2.85,2.238,3.214,2.485,2.9,1.467,2.9,1.467-.711-8.715-.234-12.066-.049-2.6.287-4.184l-.142,6s.016,5.179.179,5.693S740.53,71,740.53,71s3.613-2.628,4.587-3.287,3.672-2.171,4.026-2.5,2.667-1.765,3.132-2.022,4.858-3.1,5.217-3.3-5.742,3.893-5.742,3.893l-4.292,2.809s-2.931,1.964-3.073,2.062l-3.611,2.515c-.1.068-.151.2.105.361s2.995,1.913,3.367,2.057,5.15,2.543,5.15,2.543-3.823-1.693-4.236-1.825a9.566,9.566,0,0,1-1.208-.514c-.226-.117-2.144-1.264-2.144-1.264a11.134,11.134,0,0,0-1.259-.752c-.021.063-.152,1.824-.179,2.389a11.431,11.431,0,0,0-.145,3.041A35.347,35.347,0,0,1,740.031,82.449Z" transform="translate(-475.674 -35.9)" fill="#77ac9a" /> 7763 <path id="Path_13" data-name="Path 13" d="M747.7,114.975a18.044,18.044,0,0,1-2.714,3.291,34.237,34.237,0,0,0-2.867,3.094q-1.369,1.616-2.663,3.293c-.431.558-.849,1.127-1.258,1.7a20.682,20.682,0,0,0-1.242,1.715,20.852,20.852,0,0,1,1.04-1.858c.412-.577.831-1.148,1.264-1.709q1.294-1.685,2.671-3.3a34.344,34.344,0,0,1,2.9-3.123,17.852,17.852,0,0,0,2.667-3.239l0,0a.124.124,0,0,1,.2.14Z" transform="translate(-483.341 -75.279)" fill="#77ac9a" /> 7764 <path id="Path_14" data-name="Path 14" d="M747.266,124.114l-3.516.681c-.574.109-1.2.21-1.774.26a5.872,5.872,0,0,0-.856.184,3.2,3.2,0,0,0-.85.243,2.777,2.777,0,0,1,.779-.48,6.16,6.16,0,0,1,.892-.192c.616-.055,1.167-.147,1.765-.258l3.511-.681a.124.124,0,0,1,.051.242Z" transform="translate(-485.512 -81.241)" fill="#77ac9a" /> 7765 <path id="Path_15" data-name="Path 15" d="M768.036,134.965a40.908,40.908,0,0,1,1.258,3.941,7.883,7.883,0,0,0,.783,1.874l1.047,1.779,1.047,1.779c.321.609.622,1.222.965,1.815s.7,1.179,1.068,1.755c.331.6.7,1.187.986,1.816-.357-.588-.791-1.122-1.194-1.682-.374-.579-.735-1.166-1.075-1.767s-.651-1.218-.971-1.825l-1.045-1.775-1.045-1.775a8.127,8.127,0,0,1-.8-1.918c-.451-1.305-.678-2.684-1.245-3.908l0-.006a.124.124,0,1,1,.224-.1Z" transform="translate(-503.567 -88.471)" fill="#77ac9a" /> 7766 <path id="Path_16" data-name="Path 16" d="M752.621,146.4a7.7,7.7,0,0,0,.582-1.46l.578-1.466,1.107-2.957c.2-.5.344-.971.606-1.493a7.074,7.074,0,0,0,.769-1.345,9.992,9.992,0,0,1,1.609-2.736.124.124,0,1,1,.2.147l0,0a9.732,9.732,0,0,0-1.578,2.684,7.329,7.329,0,0,1-.8,1.392c-.206.421-.39.955-.575,1.435l-1.108,2.959-.581,1.472A7.778,7.778,0,0,1,752.621,146.4Z" transform="translate(-493.612 -88.472)" fill="#77ac9a" /> 7767 <path id="Path_17" data-name="Path 17" d="M777.165,161.344a2.551,2.551,0,0,0-.627,1.1c-.137.412-.174.87-.313,1.317a3.3,3.3,0,0,0-.231,1.29c.006.221.022.444.045.667L776,166.4c-.078-.218-.139-.439-.2-.661-.023-.227-.04-.456-.046-.687a3.555,3.555,0,0,1,.241-1.364c.132-.417.168-.872.315-1.322a2.725,2.725,0,0,1,.716-1.223.123.123,0,1,1,.165.182h0Z" transform="translate(-508.779 -105.666)" fill="#77ac9a" /> 7768 <path id="Path_18" data-name="Path 18" d="M768.406,150.479a8.548,8.548,0,0,0-.87,1.982l-.66,2.109c-.223.7-.425,1.426-.627,2.128-.1.355-.184.711-.254,1.07a8.043,8.043,0,0,0-.256,1.077,6.163,6.163,0,0,1,.013-1.124c.071-.367.16-.729.258-1.088.207-.72.4-1.418.627-2.128l.665-2.125a8.476,8.476,0,0,1,.917-2.063.123.123,0,0,1,.2.136Z" transform="translate(-502.203 -98.55)" fill="#77ac9a" /> 7769 <path id="Path_19" data-name="Path 19" d="M795.156,116.774c.069-.076.018-.023.039,0a.539.539,0,0,0,.034.1,1.765,1.765,0,0,0,.123.216,4.715,4.715,0,0,0,.318.417l.7.811q.713.8,1.469,1.565a17.756,17.756,0,0,0,3.28,2.723l.01.007c.827.572,1.711,1.088,2.581,1.614l2.62,1.573c.87.532,1.739,1.063,2.58,1.652a6.221,6.221,0,0,1,1.136,1.037,4.446,4.446,0,0,0,1.21.906,4.515,4.515,0,0,1-1.307-.8c-.2-.157-.387-.352-.578-.5s-.4-.3-.6-.446c-.828-.58-1.7-1.112-2.565-1.642l-2.618-1.572c-.872-.528-1.75-1.039-2.6-1.626l.01.007a17.977,17.977,0,0,1-3.331-2.762q-.76-.768-1.478-1.575l-.706-.818a4.906,4.906,0,0,1-.334-.439,2,2,0,0,1-.142-.251.765.765,0,0,1-.051-.154c.006-.064-.06-.116.076-.257a.124.124,0,0,1,.128.212Z" transform="translate(-521.368 -76.438)" fill="#77ac9a" /> 7770 <path id="Path_20" data-name="Path 20" d="M820.818,118.753a9.418,9.418,0,0,1-1.607.231l-1.62.133-3.246.085c-1.082.019-2.165.036-3.247.031-.543,0-1.071.015-1.616.052-.547.021-1.084.021-1.632.01a41.652,41.652,0,0,1-6.424-1l-6.32-1.51a.124.124,0,1,1,.058-.241h0l6.3,1.506a41.5,41.5,0,0,0,6.385,1c.534.011,1.079.011,1.613-.01.534-.037,1.088-.054,1.627-.052,1.082,0,2.161-.012,3.243-.031l3.242-.085,1.622-.009A9.359,9.359,0,0,0,820.818,118.753Z" transform="translate(-521.415 -76.431)" fill="#77ac9a" /> 7771 <path id="Path_21" data-name="Path 21" d="M846.918,123.678a2.873,2.873,0,0,0,1.081.913,14.261,14.261,0,0,0,1.371.6c.467.185.934.368,1.408.52a6.6,6.6,0,0,0,.716.192,2.352,2.352,0,0,0,.725.166,2.06,2.06,0,0,1-.774.077,6.708,6.708,0,0,1-.742-.2c-.485-.155-.956-.339-1.425-.525a14.37,14.37,0,0,1-1.4-.609,3.028,3.028,0,0,1-1.187-1.027.123.123,0,0,1,.21-.128h0Z" transform="translate(-555.298 -81.061)" fill="#77ac9a" /> 7772 <path id="Path_22" data-name="Path 22" d="M833.111,123.882a8.446,8.446,0,0,0,1.982,1.438c.732.392,1.49.746,2.251,1.086s1.534.659,2.315.948c.391.143.784.281,1.182.395a3.5,3.5,0,0,0,1.2.311,3.245,3.245,0,0,1-1.266-.073c-.407-.117-.8-.256-1.2-.4-.788-.293-1.563-.615-2.33-.954s-1.526-.7-2.269-1.1a8.495,8.495,0,0,1-2.06-1.506.123.123,0,1,1,.18-.168Z" transform="translate(-546.251 -81.211)" fill="#77ac9a" /> 7773 <path id="Path_23" data-name="Path 23" d="M814.65,121.22a17.748,17.748,0,0,0,2.708,2.674,16.817,16.817,0,0,0,3.258,1.969,24.505,24.505,0,0,0,3.555,1.413,16.173,16.173,0,0,1,1.784.751,10.161,10.161,0,0,1,1.587,1.1,10.018,10.018,0,0,0-1.7-.882,15.949,15.949,0,0,0-1.756-.739,24.768,24.768,0,0,1-3.58-1.424,17.031,17.031,0,0,1-3.305-2,17.971,17.971,0,0,1-2.75-2.718.124.124,0,1,1,.193-.155h0Z" transform="translate(-534.147 -79.469)" fill="#77ac9a" /> 7774 <path id="Path_24" data-name="Path 24" d="M780.794,110.492a9.845,9.845,0,0,0,.614,2.9,21.422,21.422,0,0,0,1.2,2.75,18.733,18.733,0,0,0,1.554,2.563,21.386,21.386,0,0,0,1.962,2.27c1.394,1.444,2.877,2.809,4.385,4.135a8.32,8.32,0,0,0,1.2.89c.419.282.836.568,1.239.875a10.136,10.136,0,0,1,2.094,2.184,10.022,10.022,0,0,0-2.243-1.986q-.6-.449-1.228-.867l-.63-.422c-.215-.155-.4-.322-.592-.486-1.515-1.333-3-2.7-4.4-4.151a21.622,21.622,0,0,1-1.984-2.3,18.961,18.961,0,0,1-1.574-2.6,21.689,21.689,0,0,1-1.214-2.781,10,10,0,0,1-.627-2.989.123.123,0,1,1,.247-.005Z" transform="translate(-511.928 -72.376)" fill="#77ac9a" /> 7775 <path id="Path_25" data-name="Path 25" d="M789.294,89c1.863.606,3.684,1.306,5.569,1.787.942.244,1.891.464,2.849.617a21.037,21.037,0,0,0,2.9.212,36.5,36.5,0,0,0,5.832-.107c.967-.1,1.929-.253,2.887-.428.967-.128,1.927-.313,2.9-.427-.957.194-1.9.46-2.855.67-.962.176-1.931.327-2.906.431a36.666,36.666,0,0,1-5.869.109,21.269,21.269,0,0,1-2.933-.214c-.97-.155-1.925-.377-2.873-.622-1.9-.486-3.734-1.19-5.583-1.791a.124.124,0,1,1,.077-.235Z" transform="translate(-517.558 -58.368)" fill="#77ac9a" /> 7776 <path id="Path_26" data-name="Path 26" d="M807.147,74.509l4.306.233a36.575,36.575,0,0,0,4.3-.176,31.716,31.716,0,0,0,4.24-.712,14.45,14.45,0,0,1,2.137-.4,5.524,5.524,0,0,0,2.105-.351,5.623,5.623,0,0,1-2.079.6,14.136,14.136,0,0,0-2.1.4,31.943,31.943,0,0,1-4.274.718,36.767,36.767,0,0,1-4.328.177l-4.322-.234a.124.124,0,1,1,.013-.247Z" transform="translate(-529.284 -47.943)" fill="#77ac9a" /> 7777 <path id="Path_27" data-name="Path 27" d="M818.6,51.7l3.771-2.147c1.276-.683,2.463-1.517,3.684-2.294s2.4-1.606,3.606-2.407c1.224-.763,2.321-1.728,3.6-2.439a16.651,16.651,0,0,0-1.662,1.393c-.561.458-1.193.826-1.786,1.243-1.208.8-2.4,1.637-3.621,2.417s-2.41,1.612-3.69,2.3l-3.78,2.152a.124.124,0,1,1-.122-.215Z" transform="translate(-536.844 -27.818)" fill="#77ac9a" /> 7778 <path id="Path_28" data-name="Path 28" d="M838.226,57.368a5.528,5.528,0,0,0,1.648.443,7.512,7.512,0,0,0,1.725,0,8.617,8.617,0,0,0,1.689-.376c.274-.094.54-.2.832-.293a3.83,3.83,0,0,1,.9-.055,4.9,4.9,0,0,0-.824.291c-.267.085-.546.195-.827.291a8.873,8.873,0,0,1-1.738.387,7.763,7.763,0,0,1-1.784,0,5.726,5.726,0,0,1-1.733-.469.123.123,0,1,1,.1-.224h0Z" transform="translate(-549.635 -37.439)" fill="#77ac9a" /> 7779 <path id="Path_29" data-name="Path 29" d="M839.631,46.669a6.875,6.875,0,0,1,.962-2.538,5.145,5.145,0,0,1,.91-1.012,5.28,5.28,0,0,0,.443-.48,1.862,1.862,0,0,0,.177-.257.59.59,0,0,0,.052-.125c.023-.034-.022-.079.033-.023l-.021-.194a4.075,4.075,0,0,1,.5-.446c.183-.131.364-.265.552-.39-.133.183-.275.357-.414.535a4.106,4.106,0,0,1-.467.48l-.021-.194a.26.26,0,0,1,.078.292.83.83,0,0,1-.074.184,2.081,2.081,0,0,1-.2.294,5.544,5.544,0,0,1-.464.5,4.882,4.882,0,0,0-.876.972,6.646,6.646,0,0,0-.923,2.437v.008a.124.124,0,0,1-.243-.044Z" transform="translate(-550.677 -27.023)" fill="#77ac9a" /> 7780 <path id="Path_30" data-name="Path 30" d="M830.4,46.345a31.818,31.818,0,0,1,1.5-4.632,18.628,18.628,0,0,1,1.066-2.194,10.881,10.881,0,0,1,.663-1.03,7.674,7.674,0,0,1,.876-.858,10.205,10.205,0,0,0-.676,1,10.625,10.625,0,0,0-.649,1.008,18.386,18.386,0,0,0-1.052,2.166,31.572,31.572,0,0,0-1.484,4.591v0a.124.124,0,0,1-.24-.059Z" transform="translate(-544.619 -24.68)" fill="#77ac9a" /> 7781 <path id="Path_31" data-name="Path 31" d="M827.407,63.97a19.83,19.83,0,0,0,2.534.48,11.834,11.834,0,0,0,2.567.065c.863-.073,1.725-.146,2.58-.255.427-.056.854-.119,1.271-.21a2.971,2.971,0,0,0,1.224-.349,2.83,2.83,0,0,1-1.172.59c-.429.093-.861.157-1.292.214-.863.11-1.728.183-2.591.256a12.091,12.091,0,0,1-2.618-.065,20.068,20.068,0,0,1-2.569-.487.124.124,0,0,1,.062-.24Z" transform="translate(-542.558 -41.779)" fill="#77ac9a" /> 7782 <path id="Path_32" data-name="Path 32" d="M807.573,46.313a35.731,35.731,0,0,1,1.241-4.381,28.328,28.328,0,0,1,1.859-4.155c.709-1.339,1.449-2.664,2.291-3.931.827-1.338,2.126-2.167,3.027-3.387a12.233,12.233,0,0,1-1.364,1.819l-.788.819a7.593,7.593,0,0,0-.669.887c-.833,1.253-1.571,2.574-2.277,3.908a28.055,28.055,0,0,0-1.845,4.122,35.536,35.536,0,0,0-1.231,4.347v0a.124.124,0,1,1-.242-.052Z" transform="translate(-529.651 -19.977)" fill="#77ac9a" /> 7783 <path id="Path_33" data-name="Path 33" d="M788.989,45.215a21.088,21.088,0,0,0,.428-2.962,20.244,20.244,0,0,1,.277-3.011,40.473,40.473,0,0,1,1.318-5.9,48.144,48.144,0,0,1,2.329-5.577c.443-.9.9-1.8,1.428-2.668a11.827,11.827,0,0,0,1.552-2.57,11.92,11.92,0,0,1-1.341,2.7c-.52.85-.975,1.747-1.415,2.646a47.945,47.945,0,0,0-2.315,5.543,40.245,40.245,0,0,0-1.31,5.86,19.991,19.991,0,0,0-.275,2.987,21.331,21.331,0,0,1-.434,3,.124.124,0,1,1-.242-.05Z" transform="translate(-517.462 -14.775)" fill="#77ac9a" /> 7784 <path id="Path_34" data-name="Path 34" d="M768.072,19.083l.251-4.693c.1-1.565.136-3.126.158-4.692s.006-3.13-.07-4.691c-.037-.78-.093-1.56-.189-2.332A7.67,7.67,0,0,0,767.8.384a7.774,7.774,0,0,1,.665,2.261c.1.782.153,1.566.19,2.35.077,1.569.087,3.138.071,4.706s-.062,3.138-.159,4.7l-.251,4.693a.124.124,0,1,1-.247-.013Z" transform="translate(-503.569 -0.252)" fill="#77ac9a" /> 7785 <path id="Path_35" data-name="Path 35" d="M762.081,16.89l-2.428-2.932a11.105,11.105,0,0,1-1.02-1.627q-.222-.425-.413-.866a5.723,5.723,0,0,1-.211-.941,8.154,8.154,0,0,0,.438.843q.186.432.4.85a10.88,10.88,0,0,0,1,1.59l2.422,2.925a.124.124,0,0,1-.189.159Z" transform="translate(-497.146 -6.902)" fill="#77ac9a" /> 7786 <path id="Path_36" data-name="Path 36" d="M756.863,26.857a23.117,23.117,0,0,1-3.781-4.625,21.87,21.87,0,0,1-1.5-2.594l-.29-.685-.339-.659-.569-1.378.792,1.27.342.665.291.685a21.7,21.7,0,0,0,1.477,2.56,22.889,22.889,0,0,0,3.734,4.571l.006.005a.124.124,0,0,1-.167.182Z" transform="translate(-492.147 -11.095)" fill="#77ac9a" /> 7787 <path id="Path_37" data-name="Path 37" d="M751.605,40.819a34.287,34.287,0,0,1-2.431-3.3c-.749-1.139-1.454-2.309-2.091-3.516a37.587,37.587,0,0,1-1.711-3.709,13.49,13.49,0,0,0-.984-1.763,4.506,4.506,0,0,0-1.3-1.522,4.618,4.618,0,0,1,1.509,1.384,13.725,13.725,0,0,1,1,1.8,37.414,37.414,0,0,0,1.705,3.7c.632,1.2,1.333,2.362,2.079,3.5a34.118,34.118,0,0,0,2.409,3.268l0,0a.124.124,0,0,1-.189.16Z" transform="translate(-487.358 -17.716)" fill="#77ac9a" /> 7788 <path id="Path_38" data-name="Path 38" d="M747.181,47.516a40.23,40.23,0,0,1-4.232-4.383,26.8,26.8,0,0,1-1.775-2.481A24.032,24.032,0,0,1,739.666,38a34.742,34.742,0,0,1-2.03-5.744q-.4-1.469-.719-2.96l-.233-1.505a11.111,11.111,0,0,0-.258-1.494,11.106,11.106,0,0,1,.38,1.471l.353,1.476q.315,1.483.715,2.945a34.5,34.5,0,0,0,2.014,5.7,23.794,23.794,0,0,0,1.494,2.626,26.555,26.555,0,0,0,1.759,2.459,40.016,40.016,0,0,0,4.2,4.353.124.124,0,0,1-.161.188Z" transform="translate(-482.991 -17.246)" fill="#77ac9a" /> 7789 <path id="Path_39" data-name="Path 39" d="M714.161,63.262c-.49-.057-.983-.107-1.474-.147a12.509,12.509,0,0,0-1.47-.057,6.532,6.532,0,0,1-1.5-.17,6.727,6.727,0,0,1-.729-.2,2.624,2.624,0,0,1-.629-.434,3.255,3.255,0,0,0,.71.2,6.517,6.517,0,0,0,.7.2,6.329,6.329,0,0,0,1.442.164,12.713,12.713,0,0,1,1.5.058c.5.041.989.091,1.483.148a.124.124,0,0,1-.028.246Z" transform="translate(-464.579 -40.827)" fill="#77ac9a" /> 7790 <path id="Path_40" data-name="Path 40" d="M713.224,48.234c.248.169.484.352.721.537.207.214.411.433.6.663a9.537,9.537,0,0,1,1.024,1.476c.3.516.541,1.064.834,1.567a5.569,5.569,0,0,0,1.037,1.37l.015.013a.123.123,0,0,1-.163.185h0a5.683,5.683,0,0,1-1.1-1.445c-.3-.521-.537-1.063-.834-1.568a9.271,9.271,0,0,0-1-1.439c-.187-.224-.387-.439-.592-.65Z" transform="translate(-467.773 -31.635)" fill="#77ac9a" /> 7791 <path id="Path_41" data-name="Path 41" d="M713.849,70.752q-1.143.073-2.285.1a20.681,20.681,0,0,1-2.3-.044,14.12,14.12,0,0,1-2.249-.486l-1.1-.316a3.713,3.713,0,0,0-1.082-.319,3.314,3.314,0,0,1,1.149.081l1.1.316a13.887,13.887,0,0,0,2.207.478,20.513,20.513,0,0,0,2.265.042c.758-.019,1.518-.053,2.275-.1a.124.124,0,1,1,.018.247Z" transform="translate(-462.275 -45.694)" fill="#77ac9a" /> 7792 <path id="Path_42" data-name="Path 42" d="M719.966,85.662c-.81.115-1.62.207-2.435.273a19.611,19.611,0,0,1-2.456.07c-1.636-.1-3.249-.331-4.862-.573l-.013,0c-.571-.148-1.144-.295-1.72-.421l-.853-.241a3.385,3.385,0,0,0-.867-.156,3.43,3.43,0,0,1,.892.026c.3.036.593.068.884.125.578.136,1.154.276,1.728.428l-.012,0c1.605.242,3.222.47,4.836.571a19.5,19.5,0,0,0,2.423-.07c.808-.066,1.617-.157,2.418-.271a.124.124,0,1,1,.038.244Z" transform="translate(-463.534 -55.481)" fill="#77ac9a" /> 7793 <path id="Path_43" data-name="Path 43" d="M728.321,98.625a33.363,33.363,0,0,1-3.9,1.458,15.066,15.066,0,0,1-2.036.471,20.748,20.748,0,0,1-2.083.124,23.842,23.842,0,0,1-4.162-.108,19.116,19.116,0,0,0-2.055-.146q-1.031-.085-2.071-.111,1.034-.1,2.077-.136a19.419,19.419,0,0,1,2.082.148,23.576,23.576,0,0,0,4.121.107c.69-.033,1.387-.021,2.056-.121a14.831,14.831,0,0,0,2-.463,33.18,33.18,0,0,0,3.867-1.446.124.124,0,1,1,.105.224Z" transform="translate(-466.981 -64.526)" fill="#77ac9a" /> 7794 <path id="Path_44" data-name="Path 44" d="M729.448,104.4a21.76,21.76,0,0,1-2.524,2.284,10.7,10.7,0,0,1-1.43.94,6.145,6.145,0,0,1-.786.36l-.432.069c-.147,0-.293,0-.433,0l.4-.124.378-.176a5.94,5.94,0,0,0,.752-.345,10.484,10.484,0,0,0,1.4-.918,21.543,21.543,0,0,0,2.492-2.256l0,0a.124.124,0,0,1,.179.17Z" transform="translate(-474.738 -68.339)" fill="#77ac9a" /> 7795 <path id="Path_45" data-name="Path 45" d="M740.509,101.543c-.876,1.037-1.795,2.033-2.768,2.978q-.728.711-1.525,1.353c-.265.215-.545.411-.829.6a4.978,4.978,0,0,1-.965.362l.431-.267.4-.3c.276-.187.549-.378.809-.59q.784-.629,1.507-1.337c.965-.937,1.882-1.932,2.75-2.959a.124.124,0,1,1,.192.156Z" transform="translate(-481.676 -66.461)" fill="#77ac9a" /> 7796 <path id="Path_46" data-name="Path 46" d="M740.031,82.45l-.1-6.922.324-3.711-.044-.226-3.251-1.7a11.665,11.665,0,0,0-2.289-1.984,12.313,12.313,0,0,1-3.242-2.642c-.988-1.149-1.184-1.27-1.4-1.537a7.5,7.5,0,0,1-1.136-1.271c-.37-.628-.711-.424-1.476-1.389s-2.15-2.851-2.15-2.851,2.482,2.8,3.145,3.384,2.436,2.685,2.688,2.816,1.466,1.492,3.036,2.623,2.85,2.238,3.214,2.485,2.9,1.467,2.9,1.467-.712-8.715-.234-12.066-.049-2.6.287-4.184l-.142,6s.016,5.179.179,5.693S740.53,71,740.53,71s3.613-2.628,4.587-3.287,3.672-2.171,4.026-2.5,2.667-1.765,3.132-2.022,4.858-3.1,5.217-3.3-5.742,3.893-5.742,3.893l-4.292,2.809s-2.931,1.964-3.073,2.062l-3.611,2.515c-.1.068-.151.2.105.361s2.995,1.913,3.367,2.057,5.15,2.543,5.15,2.543-3.823-1.693-4.236-1.826a9.563,9.563,0,0,1-1.208-.514c-.226-.117-2.144-1.264-2.144-1.264a11.115,11.115,0,0,0-1.259-.752c-.021.063-.152,1.824-.179,2.389a11.429,11.429,0,0,0-.145,3.041A35.352,35.352,0,0,1,740.031,82.45Z" transform="translate(-475.673 -35.9)" fill="#77ac9a" /> 7797 <path id="Path_47" data-name="Path 47" d="M747.7,114.977a18.041,18.041,0,0,1-2.714,3.292,34.25,34.25,0,0,0-2.867,3.094q-1.369,1.616-2.663,3.293c-.431.559-.849,1.127-1.258,1.7a20.788,20.788,0,0,0-1.242,1.715,20.947,20.947,0,0,1,1.04-1.858c.412-.577.831-1.148,1.264-1.709q1.294-1.685,2.671-3.3a34.323,34.323,0,0,1,2.9-3.123,17.845,17.845,0,0,0,2.667-3.239l0,0a.124.124,0,0,1,.2.14Z" transform="translate(-483.341 -75.281)" fill="#77ac9a" /> 7798 <path id="Path_48" data-name="Path 48" d="M747.266,124.115l-3.516.681c-.574.108-1.2.21-1.774.26a5.916,5.916,0,0,0-.856.184,3.207,3.207,0,0,0-.85.243,2.777,2.777,0,0,1,.779-.48,6.161,6.161,0,0,1,.892-.192c.616-.055,1.167-.147,1.765-.258l3.511-.681a.124.124,0,0,1,.051.242Z" transform="translate(-485.512 -81.241)" fill="#77ac9a" /> 7799 <path id="Path_49" data-name="Path 49" d="M768.036,134.967a40.907,40.907,0,0,1,1.258,3.941,7.881,7.881,0,0,0,.784,1.874l1.047,1.779,1.047,1.779c.321.609.622,1.222.965,1.815s.7,1.179,1.068,1.755c.331.6.7,1.188.986,1.816-.357-.588-.791-1.122-1.194-1.682-.374-.579-.735-1.167-1.075-1.767s-.651-1.219-.97-1.825l-1.045-1.775-1.045-1.775a8.134,8.134,0,0,1-.8-1.918c-.451-1.305-.678-2.684-1.245-3.908l0-.006a.124.124,0,1,1,.224-.1Z" transform="translate(-503.568 -88.472)" fill="#77ac9a" /> 7800 <path id="Path_50" data-name="Path 50" d="M752.621,137.407c.518-.915.734-1.966,1.16-2.926l1.107-2.957c.2-.5.344-.971.606-1.493a7.083,7.083,0,0,0,.769-1.345,9.994,9.994,0,0,1,1.609-2.736l-.026.072.111-4.724a.124.124,0,0,1,.247.006l-.111,4.724a.133.133,0,0,1-.026.073,9.743,9.743,0,0,0-1.578,2.684,7.328,7.328,0,0,1-.8,1.391c-.206.421-.39.955-.575,1.435l-1.108,2.959a14.218,14.218,0,0,1-.612,1.459A7.768,7.768,0,0,1,752.621,137.407Z" transform="translate(-493.612 -79.474)" fill="#77ac9a" /> 7801 <path id="Path_51" data-name="Path 51" d="M777.165,161.35a2.552,2.552,0,0,0-.627,1.1c-.137.412-.174.869-.313,1.317a3.3,3.3,0,0,0-.231,1.29c.006.221.022.444.045.667l-.043.686c-.078-.218-.139-.439-.2-.662-.023-.227-.04-.456-.046-.687a3.559,3.559,0,0,1,.241-1.365c.132-.417.168-.872.315-1.321a2.727,2.727,0,0,1,.716-1.223.123.123,0,1,1,.165.183h0Z" transform="translate(-508.779 -105.671)" fill="#77ac9a" /> 7802 <path id="Path_52" data-name="Path 52" d="M768.406,150.481a8.536,8.536,0,0,0-.87,1.982l-.66,2.109c-.223.7-.425,1.427-.627,2.128-.1.354-.184.711-.254,1.07a8.086,8.086,0,0,0-.256,1.076,6.176,6.176,0,0,1,.013-1.123c.071-.367.161-.729.258-1.088.207-.72.4-1.418.627-2.128l.665-2.125a8.475,8.475,0,0,1,.917-2.063.123.123,0,1,1,.2.136Z" transform="translate(-502.203 -98.551)" fill="#77ac9a" /> 7803 <path id="Path_53" data-name="Path 53" d="M795.156,116.77c.069-.076.018-.023.039,0a.535.535,0,0,0,.034.1,1.761,1.761,0,0,0,.123.216,4.671,4.671,0,0,0,.318.417l.7.811q.713.8,1.469,1.565a17.757,17.757,0,0,0,3.28,2.723l.01.007c.827.572,1.711,1.088,2.581,1.614l2.62,1.573c.87.532,1.739,1.063,2.58,1.652a6.22,6.22,0,0,1,1.136,1.037,4.452,4.452,0,0,0,1.21.906,4.517,4.517,0,0,1-1.307-.8c-.2-.157-.387-.352-.578-.5s-.4-.3-.6-.446c-.828-.58-1.7-1.112-2.565-1.642l-2.618-1.572c-.872-.528-1.75-1.039-2.6-1.626l.01.007a17.965,17.965,0,0,1-3.331-2.763q-.761-.767-1.478-1.575l-.706-.818a4.971,4.971,0,0,1-.334-.439,1.99,1.99,0,0,1-.142-.252.765.765,0,0,1-.051-.154c.006-.064-.06-.116.076-.257a.124.124,0,1,1,.128.212Z" transform="translate(-521.369 -76.434)" fill="#77ac9a" /> 7804 <path id="Path_54" data-name="Path 54" d="M820.82,118.755a9.422,9.422,0,0,1-1.607.231l-1.62.133-3.246.085c-1.082.019-2.165.036-3.247.031-.543,0-1.07.015-1.616.052-.547.021-1.084.021-1.632.01a41.616,41.616,0,0,1-6.424-1l-6.32-1.51a.124.124,0,1,1,.057-.241h0l6.3,1.507a41.5,41.5,0,0,0,6.385,1c.534.011,1.079.011,1.613-.01.534-.036,1.088-.054,1.627-.052,1.082,0,2.161-.011,3.243-.031l3.242-.085,1.622-.009A9.393,9.393,0,0,0,820.82,118.755Z" transform="translate(-521.416 -76.432)" fill="#77ac9a" /> 7805 <path id="Path_55" data-name="Path 55" d="M846.918,123.68a2.87,2.87,0,0,0,1.081.913,14.174,14.174,0,0,0,1.371.6c.466.185.934.368,1.408.52a6.609,6.609,0,0,0,.716.192,2.351,2.351,0,0,0,.725.166,2.061,2.061,0,0,1-.774.077,6.789,6.789,0,0,1-.742-.2c-.485-.155-.956-.339-1.425-.526a14.3,14.3,0,0,1-1.4-.608,3.027,3.027,0,0,1-1.187-1.027.123.123,0,0,1,.21-.128h0Z" transform="translate(-555.299 -81.062)" fill="#77ac9a" /> 7806 <path id="Path_56" data-name="Path 56" d="M833.112,123.884a8.435,8.435,0,0,0,1.982,1.438c.732.392,1.49.747,2.251,1.086s1.534.659,2.315.949c.391.143.784.281,1.182.395a3.5,3.5,0,0,0,1.2.311,3.246,3.246,0,0,1-1.266-.073c-.407-.117-.8-.256-1.2-.4-.788-.293-1.563-.615-2.33-.954s-1.526-.7-2.269-1.1a8.5,8.5,0,0,1-2.06-1.506.123.123,0,0,1,.18-.168h0Z" transform="translate(-546.252 -81.212)" fill="#77ac9a" /> 7807 <path id="Path_57" data-name="Path 57" d="M814.651,121.222a17.751,17.751,0,0,0,2.707,2.674,16.816,16.816,0,0,0,3.258,1.969,24.512,24.512,0,0,0,3.555,1.413,16.174,16.174,0,0,1,1.784.751,10.165,10.165,0,0,1,1.587,1.1,10.015,10.015,0,0,0-1.7-.882,15.946,15.946,0,0,0-1.756-.739,24.773,24.773,0,0,1-3.581-1.424,17.046,17.046,0,0,1-3.306-2,17.952,17.952,0,0,1-2.75-2.718.124.124,0,0,1,.193-.154Z" transform="translate(-534.147 -79.47)" fill="#77ac9a" /> 7808 <path id="Path_58" data-name="Path 58" d="M780.794,110.493a9.841,9.841,0,0,0,.614,2.9,21.443,21.443,0,0,0,1.2,2.75,18.726,18.726,0,0,0,1.554,2.563,21.383,21.383,0,0,0,1.962,2.27c1.394,1.444,2.877,2.809,4.385,4.135a8.285,8.285,0,0,0,1.2.89c.419.282.836.568,1.239.875a10.143,10.143,0,0,1,2.094,2.184,10.024,10.024,0,0,0-2.243-1.986q-.6-.449-1.228-.867l-.63-.422c-.215-.155-.4-.322-.592-.486-1.515-1.333-3-2.7-4.4-4.151a21.622,21.622,0,0,1-1.984-2.3,18.966,18.966,0,0,1-1.574-2.6,21.7,21.7,0,0,1-1.214-2.782,9.995,9.995,0,0,1-.627-2.989.123.123,0,0,1,.247-.006Z" transform="translate(-511.927 -72.377)" fill="#77ac9a" /> 7809 <path id="Path_59" data-name="Path 59" d="M789.3,89.006c1.863.606,3.684,1.306,5.569,1.787.942.244,1.891.464,2.85.617a20.984,20.984,0,0,0,2.9.212,36.426,36.426,0,0,0,5.833-.107c.967-.1,1.929-.253,2.887-.428.967-.128,1.927-.313,2.9-.427-.957.195-1.9.46-2.855.67-.963.176-1.931.328-2.906.431a36.75,36.75,0,0,1-5.869.109,21.322,21.322,0,0,1-2.933-.215c-.97-.155-1.926-.377-2.874-.622-1.9-.486-3.734-1.19-5.583-1.791a.124.124,0,0,1,.077-.235Z" transform="translate(-517.567 -58.372)" fill="#77ac9a" /> 7810 <path id="Path_60" data-name="Path 60" d="M807.147,74.51l4.306.233a36.5,36.5,0,0,0,4.3-.176,31.661,31.661,0,0,0,4.24-.712,14.453,14.453,0,0,1,2.137-.4,5.518,5.518,0,0,0,2.105-.351,5.624,5.624,0,0,1-2.079.6,14.138,14.138,0,0,0-2.1.4,31.941,31.941,0,0,1-4.274.718,36.762,36.762,0,0,1-4.328.177l-4.322-.234a.124.124,0,0,1,.013-.247h0Z" transform="translate(-529.284 -47.943)" fill="#77ac9a" /> 7811 <path id="Path_61" data-name="Path 61" d="M824.467,42.285a16.6,16.6,0,0,0-1.724,1.286c-.561.457-1.193.825-1.786,1.243-1.208.8-2.4,1.637-3.621,2.417s-2.41,1.612-3.69,2.3l-3.78,2.152.008,0-2.387,1.557-2.453,1.456,2.319-1.661,2.386-1.559.008,0,3.771-2.147c1.276-.683,2.463-1.517,3.684-2.294s2.4-1.606,3.606-2.407c.591-.415,1.217-.779,1.779-1.237a16.671,16.671,0,0,1,1.756-1.309.124.124,0,0,1,.129.211h0Z" transform="translate(-527.987 -27.58)" fill="#77ac9a" /> 7812 <path id="Path_62" data-name="Path 62" d="M838.227,57.369a5.528,5.528,0,0,0,1.648.443,7.511,7.511,0,0,0,1.725,0,8.645,8.645,0,0,0,1.689-.376c.274-.094.54-.2.832-.293a3.812,3.812,0,0,1,.9-.055,4.907,4.907,0,0,0-.825.291c-.267.085-.546.2-.827.292a8.9,8.9,0,0,1-1.738.387,7.783,7.783,0,0,1-1.784,0,5.727,5.727,0,0,1-1.733-.469.123.123,0,0,1,.1-.224h0Z" transform="translate(-549.635 -37.439)" fill="#77ac9a" /> 7813 <path id="Path_63" data-name="Path 63" d="M839.632,46.669a6.88,6.88,0,0,1,.962-2.538,5.137,5.137,0,0,1,.91-1.012,5.3,5.3,0,0,0,.443-.48,1.854,1.854,0,0,0,.177-.257.586.586,0,0,0,.052-.125c.023-.034-.022-.079.033-.023l-.021-.195a4.07,4.07,0,0,1,.5-.446c.183-.131.364-.265.552-.391-.134.183-.275.358-.414.535a4.079,4.079,0,0,1-.467.48l-.021-.195a.261.261,0,0,1,.078.292.824.824,0,0,1-.074.184,2.1,2.1,0,0,1-.2.294,5.571,5.571,0,0,1-.464.5,4.882,4.882,0,0,0-.876.972,6.641,6.641,0,0,0-.923,2.437v.008a.124.124,0,0,1-.243-.043Z" transform="translate(-550.678 -27.023)" fill="#77ac9a" /> 7814 <path id="Path_64" data-name="Path 64" d="M830.4,46.346a31.811,31.811,0,0,1,1.5-4.632,18.668,18.668,0,0,1,1.066-2.195,10.886,10.886,0,0,1,.663-1.03,7.649,7.649,0,0,1,.876-.858,10.161,10.161,0,0,0-.676,1,10.655,10.655,0,0,0-.649,1.008,18.375,18.375,0,0,0-1.052,2.166,31.577,31.577,0,0,0-1.484,4.592v0a.124.124,0,1,1-.24-.059Z" transform="translate(-544.62 -24.681)" fill="#77ac9a" /> 7815 <path id="Path_65" data-name="Path 65" d="M827.409,63.971a19.83,19.83,0,0,0,2.534.48,11.833,11.833,0,0,0,2.567.065c.863-.073,1.725-.146,2.58-.255.427-.056.853-.119,1.271-.21a2.965,2.965,0,0,0,1.224-.348,2.83,2.83,0,0,1-1.171.59c-.429.093-.861.157-1.292.214-.863.11-1.728.183-2.591.256a12.091,12.091,0,0,1-2.618-.065,20.07,20.07,0,0,1-2.569-.487.124.124,0,0,1,.062-.24Z" transform="translate(-542.558 -41.78)" fill="#77ac9a" /> 7816 <path id="Path_66" data-name="Path 66" d="M807.574,46.314a35.742,35.742,0,0,1,1.241-4.381,28.334,28.334,0,0,1,1.859-4.155c.709-1.339,1.449-2.664,2.291-3.931.827-1.338,2.125-2.167,3.027-3.387a12.228,12.228,0,0,1-1.364,1.818l-.788.82a7.609,7.609,0,0,0-.669.887c-.833,1.253-1.571,2.575-2.277,3.908a28.06,28.06,0,0,0-1.845,4.122,35.518,35.518,0,0,0-1.231,4.347v0a.124.124,0,0,1-.242-.052Z" transform="translate(-529.652 -19.977)" fill="#77ac9a" /> 7817 <path id="Path_67" data-name="Path 67" d="M788.989,45.215a21.088,21.088,0,0,0,.428-2.962,20.244,20.244,0,0,1,.277-3.011,40.489,40.489,0,0,1,1.319-5.9,48.143,48.143,0,0,1,2.329-5.577c.443-.9.9-1.8,1.428-2.669a11.816,11.816,0,0,0,1.551-2.571,11.917,11.917,0,0,1-1.341,2.7c-.52.85-.975,1.747-1.415,2.646a47.9,47.9,0,0,0-2.315,5.544,40.237,40.237,0,0,0-1.31,5.86,20.007,20.007,0,0,0-.275,2.987,21.322,21.322,0,0,1-.434,3,.124.124,0,1,1-.242-.05Z" transform="translate(-517.462 -14.775)" fill="#77ac9a" /> 7818 <path id="Path_68" data-name="Path 68" d="M767.67.074a10.27,10.27,0,0,1,.639,3.072c.092,1.034.135,2.07.164,3.106.044,2.072.016,4.142-.06,6.212l-.326,6.2-.149,3.094-.271,3.1.024-3.1.149-3.1.325-6.195c.076-2.064.1-4.132.06-6.2-.029-1.032-.072-2.063-.163-3.09a10.175,10.175,0,0,0-.611-2.977l-.008-.017a.123.123,0,1,1,.226-.1Z" transform="translate(-503.327 0)" fill="#77ac9a" /> 7819 <path id="Path_69" data-name="Path 69" d="M762.08,16.89l-2.428-2.932a11.126,11.126,0,0,1-1.02-1.627q-.223-.425-.413-.866a5.723,5.723,0,0,1-.211-.941,8.143,8.143,0,0,0,.438.843q.186.432.4.85a10.881,10.881,0,0,0,1,1.59l2.422,2.925a.124.124,0,1,1-.189.159Z" transform="translate(-497.146 -6.902)" fill="#77ac9a" /> 7820 <path id="Path_70" data-name="Path 70" d="M756.863,26.857a23.107,23.107,0,0,1-3.781-4.624,21.869,21.869,0,0,1-1.5-2.594l-.29-.685-.339-.659-.569-1.378.792,1.27.342.665.291.685a21.667,21.667,0,0,0,1.477,2.56,22.892,22.892,0,0,0,3.734,4.571l.006.005a.124.124,0,0,1-.167.182Z" transform="translate(-492.147 -11.095)" fill="#77ac9a" /> 7821 <path id="Path_71" data-name="Path 71" d="M751.605,40.82a34.285,34.285,0,0,1-2.431-3.3c-.749-1.139-1.455-2.309-2.091-3.516a37.572,37.572,0,0,1-1.711-3.709,13.461,13.461,0,0,0-.984-1.763,4.5,4.5,0,0,0-1.3-1.522,4.616,4.616,0,0,1,1.509,1.384,13.709,13.709,0,0,1,1,1.8,37.45,37.45,0,0,0,1.705,3.7c.632,1.2,1.333,2.362,2.079,3.5a34.1,34.1,0,0,0,2.409,3.268l0,0a.124.124,0,1,1-.188.16Z" transform="translate(-487.358 -17.717)" fill="#77ac9a" /> 7822 <path id="Path_72" data-name="Path 72" d="M747.181,47.517a40.23,40.23,0,0,1-4.232-4.383,26.764,26.764,0,0,1-1.775-2.481A24.045,24.045,0,0,1,739.666,38a34.747,34.747,0,0,1-2.03-5.744q-.4-1.469-.719-2.96l-.233-1.505a11.117,11.117,0,0,0-.258-1.494,11.116,11.116,0,0,1,.38,1.471l.353,1.477q.315,1.482.715,2.945a34.493,34.493,0,0,0,2.014,5.7,23.8,23.8,0,0,0,1.494,2.626,26.545,26.545,0,0,0,1.759,2.459,40.019,40.019,0,0,0,4.2,4.353.124.124,0,1,1-.161.188Z" transform="translate(-482.99 -17.247)" fill="#77ac9a" /> 7823 <path id="Path_73" data-name="Path 73" d="M714.16,63.262c-.49-.057-.983-.107-1.474-.147a12.5,12.5,0,0,0-1.47-.057,6.529,6.529,0,0,1-1.5-.17,6.729,6.729,0,0,1-.729-.2,2.624,2.624,0,0,1-.629-.434,3.257,3.257,0,0,0,.71.2,6.523,6.523,0,0,0,.7.2,6.33,6.33,0,0,0,1.442.164,12.643,12.643,0,0,1,1.5.058c.5.041.989.091,1.483.148a.124.124,0,1,1-.028.246Z" transform="translate(-464.579 -40.827)" fill="#77ac9a" /> 7824 <path id="Path_74" data-name="Path 74" d="M713.223,48.235a6.439,6.439,0,0,1,1.324,1.2,9.522,9.522,0,0,1,1.024,1.476c.3.516.541,1.064.834,1.567a5.568,5.568,0,0,0,1.037,1.37l.013.011.006.007,1.059,1.2a.124.124,0,0,1-.186.164l-1.059-1.2.019.017a5.69,5.69,0,0,1-1.1-1.445c-.3-.521-.537-1.063-.834-1.568a9.285,9.285,0,0,0-1-1.439C713.964,49.164,713.6,48.7,713.223,48.235Z" transform="translate(-467.773 -31.635)" fill="#77ac9a" /> 7825 <path id="Path_75" data-name="Path 75" d="M713.849,70.753q-1.143.073-2.285.1a20.684,20.684,0,0,1-2.3-.044,14.117,14.117,0,0,1-2.249-.486l-1.1-.315a3.7,3.7,0,0,0-1.082-.32,3.314,3.314,0,0,1,1.149.081l1.1.316a13.892,13.892,0,0,0,2.207.478,20.442,20.442,0,0,0,2.265.042c.758-.019,1.518-.053,2.275-.1a.124.124,0,0,1,.018.247Z" transform="translate(-462.275 -45.695)" fill="#77ac9a" /> 7826 <path id="Path_76" data-name="Path 76" d="M719.966,85.663c-.81.115-1.62.207-2.435.273a19.676,19.676,0,0,1-2.456.07c-1.636-.1-3.249-.331-4.862-.574l-.013,0c-.571-.149-1.144-.3-1.72-.422l-.853-.241a3.385,3.385,0,0,0-.867-.156,3.431,3.431,0,0,1,.892.026c.3.036.593.068.885.125.578.136,1.154.276,1.728.428l-.012,0c1.605.242,3.222.47,4.836.571a19.43,19.43,0,0,0,2.423-.07c.808-.066,1.617-.157,2.418-.271a.124.124,0,0,1,.038.245Z" transform="translate(-463.534 -55.482)" fill="#77ac9a" /> 7827 <path id="Path_77" data-name="Path 77" d="M728.319,98.637a33.364,33.364,0,0,1-3.9,1.457,15.017,15.017,0,0,1-2.036.471,20.853,20.853,0,0,1-2.083.124,23.843,23.843,0,0,1-4.162-.109,19.2,19.2,0,0,0-2.055-.146q-1.031-.084-2.071-.112,1.035-.1,2.077-.136a19.418,19.418,0,0,1,2.081.148,23.611,23.611,0,0,0,4.121.106,20.549,20.549,0,0,0,2.056-.121,14.777,14.777,0,0,0,2-.463,33.121,33.121,0,0,0,3.867-1.445.124.124,0,0,1,.105.224Z" transform="translate(-466.979 -64.537)" fill="#77ac9a" /> 7828 <path id="Path_78" data-name="Path 78" d="M729.448,104.409a21.793,21.793,0,0,1-2.524,2.284,10.694,10.694,0,0,1-1.43.94,6.19,6.19,0,0,1-.786.36l-.432.069c-.147,0-.292,0-.433,0l.4-.125.378-.176a5.886,5.886,0,0,0,.752-.345,10.449,10.449,0,0,0,1.4-.918,21.539,21.539,0,0,0,2.492-2.255l0,0a.124.124,0,0,1,.179.171Z" transform="translate(-474.738 -68.343)" fill="#77ac9a" /> 7829 <path id="Path_79" data-name="Path 79" d="M740.508,101.562c-.876,1.037-1.795,2.033-2.768,2.979q-.728.711-1.525,1.353c-.265.215-.545.411-.829.6a4.962,4.962,0,0,1-.965.363l.431-.267.4-.3c.276-.187.549-.378.809-.59q.784-.629,1.507-1.336c.965-.938,1.882-1.932,2.75-2.959a.124.124,0,0,1,.192.156Z" transform="translate(-481.675 -66.48)" fill="#77ac9a" /> 7830 <path id="Path_80" data-name="Path 80" d="M754.387,99.154l1.986-.847.072.25Z" transform="translate(-494.77 -64.475)" fill="#77ac9a" /> 7831 <path id="Path_81" data-name="Path 81" d="M754.22,99.073a.088.088,0,0,1-.034-.17l1.985-.847a.091.091,0,0,1,.072,0,.088.088,0,0,1,.047.056l.072.249a.089.089,0,0,1-.06.11l-2.058.6A.1.1,0,0,1,754.22,99.073Zm1.928-.815-.549.234.569-.165Z" transform="translate(-494.603 -64.306)" fill="#77ac9a" /> 7832 <path id="Path_82" data-name="Path 82" d="M763.679,118.041a9.777,9.777,0,0,0,.79-1.4c.017-.208.133.2.133.2Z" transform="translate(-500.865 -76.46)" fill="#77ac9a" /> 7833 <path id="Path_83" data-name="Path 83" d="M763.51,117.959a.093.093,0,0,1-.051-.016.089.089,0,0,1-.023-.121,8.587,8.587,0,0,0,.776-1.359c.007-.087.04-.134.1-.14.074-.012.127.041.206.322a.089.089,0,0,1-.015.078l-.922,1.2A.087.087,0,0,1,763.51,117.959Zm.822-1.316-.012.028.015-.019Z" transform="translate(-500.696 -76.29)" fill="#77ac9a" /> 7834 <path id="Path_84" data-name="Path 84" d="M789.9,77.482s-.019,3.167-.13,3.447a.516.516,0,0,0,.066.5s2.154.987,2.782,1.2-3.123-1.055-3.123-1.055Z" transform="translate(-517.794 -50.817)" fill="#77ac9a" /> 7835 <path id="Path_85" data-name="Path 85" d="M792.527,82.565a.172.172,0,0,1-.04-.006h0l-.03-.01-.039-.013-.062-.021-3.062-1.033a.088.088,0,0,1-.06-.092l.406-4.086a.09.09,0,0,1,.092-.079.089.089,0,0,1,.084.089c0,.326-.022,3.191-.137,3.479a.427.427,0,0,0,.042.394c.225.1,2.169.988,2.752,1.184l.069.023-.007.021c.081.041.075.061.064.092A.073.073,0,0,1,792.527,82.565Zm-3.11-1.227.827.279c-.34-.153-.588-.266-.617-.28a.089.089,0,0,1-.031-.024.6.6,0,0,1-.08-.586,8.5,8.5,0,0,0,.086-1.242Z" transform="translate(-517.625 -50.649)" fill="#77ac9a" /> 7836 <path id="Path_86" data-name="Path 86" d="M790.813,114.132l-.019,0a41.193,41.193,0,0,1-7.236-2.672.088.088,0,0,1-.041-.118.086.086,0,0,1,.118-.041,41.032,41.032,0,0,0,7.2,2.659.088.088,0,0,1-.019.175Z" transform="translate(-513.87 -72.99)" fill="#77ac9a" /> 7837 <path id="Path_87" data-name="Path 87" d="M528.231,44.722c-.974-2.5-2.117-3.007-4.363-3.261v-.339h13v.339c-1.99.211-2.838.677-2.838,1.9a8.983,8.983,0,0,0,.8,3.305l5.846,14.741,4.447-11.734-2.244-5.719c-.721-1.948-2.034-2.33-3.727-2.5v-.339h12.749v.339c-2.076.169-3.135.677-3.135,2.033a10.446,10.446,0,0,0,.932,3.3l5.76,14.741,5.719-14.826a10.587,10.587,0,0,0,.72-3.133c0-1.313-.8-1.907-3.007-2.118v-.339h8.514v.339c-2.288.254-2.754.974-3.643,3.3L553.645,71.154l-7.582-19.146c.043,0-7.328,19.146-7.328,19.146Z" transform="translate(-343.583 -26.97)" fill="#3b3d3e" /> 7838 <path id="Path_88" data-name="Path 88" d="M649.672,67.539c2.753-.339,3.3-1.016,3.3-4.574V52.376c0-1.95-1.1-2.33-3.135-1.736v-.51l8.261-2.71V62.965c0,3.515.55,4.277,2.922,4.574v.339H649.672Zm2.8-27.066a2.844,2.844,0,0,1,3.008-2.8,2.8,2.8,0,1,1,0,5.591A2.871,2.871,0,0,1,652.467,40.473Z" transform="translate(-426.092 -24.711)" fill="#3b3d3e" /> 7839 <path id="Path_89" data-name="Path 89" d="M686.232,86.186c2.753-.339,3.176-1.1,3.176-4.574V71.53c0-2.838-1.059-2.88-3.008-2.33v-.508l8.133-2.584V70.26c2.076-2.033,4.321-4.025,7.2-4.025,3.219,0,5.336,2.118,5.336,5.8v9.573c0,3.558.466,4.277,3.008,4.574v.339H698.9v-.339c2.668-.339,3.049-.974,3.049-4.574V72.927c0-2.584-.974-3.812-3.092-3.812-1.652,0-3.008.974-4.321,2.161V81.612c0,3.515.466,4.277,2.88,4.574v.339H686.232Z" transform="translate(-450.07 -43.358)" fill="#3b3d3e" /> 7840 <path id="Path_90" data-name="Path 90" d="M758.857,77.108c0-5,3.431-10.632,9.319-10.632,5.76,0,8.725,3.94,8.725,7.963H763.6c0,5.338,2.88,9.278,7.032,9.278,2.118,0,4.575-.636,6.523-3.94l.339.169c-1.271,3.643-4.448,7.329-9.192,7.329C762.965,87.274,758.857,82.869,758.857,77.108Zm12.749-4.066c-.339-2.712-1.355-5.253-3.812-5.253-2.33,0-3.854,2.415-4.109,5.253Z" transform="translate(-497.702 -43.598)" fill="#3b3d3e" /> 7841 </g> 7842 </svg> 7843 7844 } 7845 7846 @helper RenderCloseButton() 7847 { 7848 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"> 7849 <path id="Path_91" data-name="Path 91" d="M2.267,2.267a.908.908,0,0,1,1.285,0L12,10.715l8.447-8.449a.909.909,0,0,1,1.285,1.287L13.284,12l8.449,8.448a.909.909,0,0,1-1.287,1.285L12,13.284,3.552,21.734a.909.909,0,1,1-1.285-1.287L10.715,12,2.265,3.552a.908.908,0,0,1,0-1.285Z" transform="translate(-1.999 -1.999)" fill="#3b3d3e" fill-rule="evenodd" /> 7850 </svg> 7851 } 7852 7853 @helper SidemenuRenderCartUsps(string icon, string toptext, string bottomtext) 7854 { 7855 var svg = icon + ".svg"; 7856 7857 <div class="grid__col-12 grid__col-md-3"> 7858 <div class="grid grid--align-center u-justify-content--center border-right"> 7859 <div class="grid__col-2"> 7860 <img src="Files/Images/SvgIcons/@svg" height="35" width="35" /> 7861 </div> 7862 <div class="grid__col-8"> 7863 <div class="u-block"> 7864 <strong>@toptext</strong> 7865 </div> 7866 <div class="u-block"> 7867 @bottomtext 7868 </div> 7869 </div> 7870 </div> 7871 </div> 7872 }</text> 7873 if (Pageview.Device.ToString() == "Tablet") 7874 { 7875 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7876 7877 @using System 7878 @using System.Web 7879 @using System.Collections.Generic 7880 @using Dynamicweb.Rapido.Blocks.Extensibility 7881 @using Dynamicweb.Rapido.Blocks 7882 7883 @functions { 7884 BlocksPage tabletNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 7885 } 7886 7887 @{ 7888 bool mobileNavigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 7889 bool mobileHideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 7890 bool mobileHideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 7891 bool mobileHideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 7892 bool mobileHideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 7893 bool mobileHideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 7894 bool tabletHideCustomerStockLink = false; 7895 7896 Block mobileNavigation = new Block() 7897 { 7898 Id = "TabletNavigation", 7899 SortId = 10, 7900 Template = TabletNavigation(), 7901 SkipRenderBlocksList = true 7902 }; 7903 tabletNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 7904 7905 if (Model.CurrentUser.ID > 0 && !mobileHideMyProfileLink) 7906 { 7907 Block mobileNavigationSignIn = new Block 7908 { 7909 Id = "MobileNavigationSignIn", 7910 SortId = 10, 7911 Template = RenderTabletNavigationSignIn() 7912 }; 7913 tabletNavigationBlocksPage.Add("TabletNavigation", mobileNavigationSignIn); 7914 } 7915 7916 Block mobileNavigationMenu = new Block 7917 { 7918 Id = "TabletNavigationMenu", 7919 SortId = 20, 7920 Template = RenderTabletNavigationMenu() 7921 }; 7922 tabletNavigationBlocksPage.Add("TabletNavigation", mobileNavigationMenu); 7923 7924 Block mobileNavigationActions = new Block 7925 { 7926 Id = "TabletNavigationActions", 7927 SortId = 30, 7928 Template = RenderTabletNavigationActions(), 7929 SkipRenderBlocksList = true 7930 }; 7931 tabletNavigationBlocksPage.Add("TabletNavigation", mobileNavigationActions); 7932 7933 if (!mobileNavigationItemsHideSignIn) 7934 { 7935 if (Model.CurrentUser.ID <= 0) 7936 { 7937 Block mobileNavigationSignInAction = new Block 7938 { 7939 Id = "TabletNavigationSignInAction", 7940 SortId = 10, 7941 Template = RenderTabletNavigationSignInAction() 7942 }; 7943 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationSignInAction); 7944 7945 if (!mobileHideCreateAccountLink) 7946 { 7947 Block mobileNavigationCreateAccountAction = new Block 7948 { 7949 Id = "TabletNavigationCreateAccountAction", 7950 SortId = 20, 7951 Template = RenderTabletNavigationCreateAccountAction() 7952 }; 7953 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationCreateAccountAction); 7954 } 7955 } 7956 else 7957 { 7958 if (!mobileHideMyOrdersLink) 7959 { 7960 Block mobileNavigationOrdersAction = new Block 7961 { 7962 Id = "TabletNavigationOrdersAction", 7963 SortId = 20, 7964 Template = RenderTabletNavigationOrdersAction() 7965 }; 7966 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationOrdersAction); 7967 } 7968 if (!mobileHideMyFavoritesLink) 7969 { 7970 Block mobileNavigationFavoritesAction = new Block 7971 { 7972 Id = "TabletNavigationFavoritesAction", 7973 SortId = 30, 7974 Template = RenderTabletNavigationFavoritesAction() 7975 }; 7976 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationFavoritesAction); 7977 } 7978 if (!mobileHideMySavedCardsLink) 7979 { 7980 Block mobileNavigationSavedCardsAction = new Block 7981 { 7982 Id = "TabletNavigationFavoritesAction", 7983 SortId = 30, 7984 Template = RenderTabletNavigationSavedCardsAction() 7985 }; 7986 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationSavedCardsAction); 7987 } 7988 7989 if (!tabletHideCustomerStockLink) 7990 { 7991 Block tabletNavigationCustomerStockAction = new Block 7992 { 7993 Id = "TabletNavigationCustomerStockAction", 7994 SortId = 31, 7995 Template = RenderTabletNavigationCustomerStockAction() 7996 }; 7997 tabletNavigationBlocksPage.Add("TabletNavigationActions", tabletNavigationCustomerStockAction); 7998 } 7999 8000 Block mobileNavigationSignOutAction = new Block 8001 { 8002 Id = "TabletNavigationSignOutAction", 8003 SortId = 40, 8004 Template = RenderTabletNavigationSignOutAction() 8005 }; 8006 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationSignOutAction); 8007 } 8008 } 8009 8010 if (Model.Languages.Count > 1) 8011 { 8012 Block mobileNavigationLanguagesAction = new Block 8013 { 8014 Id = "TabletNavigationLanguagesAction", 8015 SortId = 50, 8016 Template = RenderTabletNavigationLanguagesAction() 8017 }; 8018 tabletNavigationBlocksPage.Add("TabletNavigationActions", mobileNavigationLanguagesAction); 8019 } 8020 } 8021 8022 8023 @helper TabletNavigation() 8024 { 8025 List<Block> subBlocks = this.tabletNavigationBlocksPage.GetBlockListById("TabletNavigation").OrderBy(item => item.SortId).ToList(); 8026 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 8027 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 8028 8029 <!-- Trigger for mobile navigation --> 8030 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 8031 8032 <!-- Mobile navigation --> 8033 <nav class="mobile-navigation mobile-navigation--@position dw-mod js-mobile-navigation"> 8034 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 8035 <div class="mobile-navigation-header"> 8036 <div class="mobile-navigation-header-topbar"> 8037 <p>@Translate("Smartpage:MobilMenu.headerText", "Brug for hjælp? +45 70 22 68 88")</p> 8038 <div class="mobile-navigation-header-close js-navigation-close"> 8039 <div class="mobile-navigation-header-cross"> 8040 <span></span> 8041 <span></span> 8042 </div> 8043 <p>@Translate("Smartpage:MobilMenu.CloseText", "Luk")</p> 8044 </div> 8045 </div> 8046 @RenderTabletNavigationSearchBar() 8047 </div> 8048 @RenderBlockList(subBlocks) 8049 </div> 8050 <div class="mobile-navigation-footer"> 8051 <ul> 8052 @foreach (var icon in Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetItems("HeaderUSP")) 8053 { 8054 <li> 8055 @if (!string.IsNullOrWhiteSpace(icon.GetString("Link"))) 8056 { 8057 <a href="@icon.GetString("Link")"><i class="fa fa-check"></i> @icon.GetString("Label")</a> 8058 } 8059 else 8060 { 8061 <i class="fa fa-check"></i> @icon.GetString("Label") 8062 } 8063 </li> 8064 } 8065 </ul> 8066 </div> 8067 </nav> 8068 8069 <label class="mobile-nav-trigger-off js-mobile-nav-trigger-off" for="MobileNavTrigger"></label> 8070 } 8071 8072 @helper RenderTabletNavigationSignIn() 8073 { 8074 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 8075 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 8076 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 8077 string myProfilePageLink = linkStart + myProfilePageId; 8078 string userName = Model.CurrentUser.FirstName; 8079 if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(Model.CurrentUser.LastName)) 8080 { 8081 userName += " " + Model.CurrentUser.LastName; 8082 } 8083 if (string.IsNullOrEmpty(userName)) 8084 { 8085 userName = Model.CurrentUser.Name; 8086 } 8087 if (string.IsNullOrEmpty(userName)) 8088 { 8089 userName = Model.CurrentUser.UserName; 8090 } 8091 if (string.IsNullOrEmpty(userName)) 8092 { 8093 userName = Model.CurrentUser.Email; 8094 } 8095 8096 <ul class="menu menu-mobile"> 8097 <li class="menu-mobile__item"> 8098 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @userName</a> 8099 </li> 8100 </ul> 8101 } 8102 8103 @helper RenderTabletNavigationMenu() 8104 { 8105 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 8106 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 8107 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 8108 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 8109 int startLevel = 0; 8110 8111 var navigationSettings = new Dynamicweb.Frontend.Navigation.NavigationSettings() 8112 { 8113 RootAreaId = 0, 8114 RootPageId = 0, 8115 RootNavigationTag = "main-menu", 8116 StartLevel = 1, 8117 StopLevel = 99, 8118 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 8119 }; 8120 8121 var navigationTemplate = "Navigation/SpViewModelNavigationMobile.cshtml"; 8122 @Navigation.RenderNavigation(navigationTemplate, navigationSettings) 8123 8124 8125 if (isSlidesDesign) 8126 { 8127 <script> 8128 function goToLevel(level) { 8129 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 8130 } 8131 8132 document.addEventListener('DOMContentLoaded', function () { 8133 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 8134 }); 8135 </script> 8136 } 8137 8138 if (renderPagesInToolBar) 8139 { 8140 @RenderNavigation(new 8141 { 8142 id = "topToolsMobileNavigation", 8143 cssclass = "menu menu-mobile dwnavigation", 8144 template = "ToolsMenuForMobile.xslt" 8145 }) 8146 } 8147 } 8148 8149 @helper RenderTabletNavigationActions() 8150 { 8151 List<Block> subBlocks = this.tabletNavigationBlocksPage.GetBlockListById("TabletNavigationActions").OrderBy(item => item.SortId).ToList(); ; 8152 8153 <ul class="menu menu-mobile"> 8154 @RenderBlockList(subBlocks) 8155 </ul> 8156 } 8157 8158 @helper RenderTabletNavigationSignInAction() 8159 { 8160 <li class="menu-mobile__item mobile-navigation-login"> 8161 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign in")</label> 8162 </li> 8163 } 8164 8165 @helper RenderTabletNavigationCreateAccountAction() 8166 { 8167 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 8168 8169 <li class="menu-mobile__item mobile-navigation-create-account"> 8170 <h3>@Translate("Smartpage:MobilMenu.CreateAccountHeading", "Opret bruger og få 100 DKK i opstartsbonus")</h3> 8171 <p>@Translate("Smartpage:MobilMenu.CreateAccountText", "(Gælder på dit næste køb)")</p> 8172 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Create account")</a> 8173 </li> 8174 } 8175 8176 @helper RenderTabletNavigationProfileAction() 8177 { 8178 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 8179 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 8180 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 8181 string myProfilePageLink = linkStart + myProfilePageId; 8182 8183 <li class="menu-mobile__item"> 8184 <a href="@myProfilePageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 8185 </li> 8186 } 8187 8188 @helper RenderTabletNavigationOrdersAction() 8189 { 8190 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 8191 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 8192 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 8193 string myOrdersPageLink = linkStart + myOrdersPageId; 8194 string ordersIcon = "fas fa-list"; 8195 8196 <li class="menu-mobile__item"> 8197 <a href="@myOrdersPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@ordersIcon menu-mobile__link-icon"></i> @Translate("My Orders")</a> 8198 </li> 8199 } 8200 8201 @helper RenderTabletNavigationFavoritesAction() 8202 { 8203 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 8204 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 8205 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 8206 string myFavoritesPageLink = linkStart + myFavoritesPageId; 8207 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 8208 8209 8210 <li class="menu-mobile__item"> 8211 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 8212 </li> 8213 } 8214 8215 @helper RenderTabletNavigationSavedCardsAction() 8216 { 8217 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 8218 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 8219 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 8220 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 8221 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 8222 8223 <li class="menu-mobile__item"> 8224 <a href="@mySavedCardsPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 8225 </li> 8226 } 8227 8228 @helper RenderTabletNavigationCustomerStockAction() 8229 { 8230 int customerStockPageId = GetPageIdByNavigationTag("CustomerStockPage"); 8231 8232 <li class="menu-mobile__item"> 8233 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@customerStockPageId"><i class="fal fa-clipboard-list menu-mobile__link-icon"></i> @Translate("Smartpage:SignInActions.CustomerStock", "Mit kundelager")</a> 8234 </li> 8235 } 8236 8237 @helper RenderTabletNavigationSignOutAction() 8238 { 8239 int pageId = Model.TopPage.ID; 8240 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 8241 8242 <li class="menu-mobile__item"> 8243 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" onclick="RememberState.SetCookie('useAnotherAddress', false)"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 8244 </li> 8245 } 8246 8247 @helper RenderTabletNavigationLanguagesAction() 8248 { 8249 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 8250 8251 string selectedLanguage = ""; 8252 foreach (var lang in Model.Languages) 8253 { 8254 if (lang.IsCurrent) 8255 { 8256 selectedLanguage = lang.Name; 8257 } 8258 } 8259 8260 <li class="menu-mobile__item dw-mod menu-mobile__item-language"> 8261 @if (isSlidesDesign) 8262 { 8263 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 8264 } 8265 else 8266 { 8267 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 8268 } 8269 <div class="menu-mobile__link__wrap"> 8270 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 8271 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 8272 </div> 8273 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 8274 @if (isSlidesDesign) 8275 { 8276 <li class="menu-mobile__item dw-mod"> 8277 <div class="menu-mobile__link__wrap"> 8278 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 8279 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 8280 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 8281 </div> 8282 </li> 8283 } 8284 @foreach (var lang in Model.Languages) 8285 { 8286 <li class="menu-mobile__item dw-mod"> 8287 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID">@lang.Name</a> 8288 </li> 8289 } 8290 </ul> 8291 </li> 8292 } 8293 8294 8295 @helper RenderTabletNavigationSearchBar() 8296 { 8297 string searchFeedId = string.Empty; 8298 string searchSecondFeedId = string.Empty; 8299 int groupsFeedId; 8300 string productsSearchId = Converter.ToString(GetPageIdByNavigationTag("ProductSearchFeed")); 8301 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 8302 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 8303 string resultPageLink; 8304 string searchPlaceholder; 8305 string searchType = "product-search"; 8306 string searchTemplate; 8307 string searchContentTemplate = ""; 8308 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 8309 bool showGroups = true; 8310 8311 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 8312 { 8313 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 8314 resultPageLink = contentSearchPageLink; 8315 searchPlaceholder = Translate("Search page"); 8316 groupsFeedId = 0; 8317 searchType = "content-search"; 8318 searchTemplate = "SearchPagesTemplate"; 8319 showGroups = false; 8320 } 8321 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 8322 { 8323 searchFeedId = productsPageId + "&feed=true"; 8324 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 8325 resultPageLink = Converter.ToString(productsPageId); 8326 searchPlaceholder = Translate("Search products or pages"); 8327 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 8328 searchType = "combined-search"; 8329 searchTemplate = "SearchProductsTemplateWrap"; 8330 searchContentTemplate = "SearchPagesTemplateWrap"; 8331 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 8332 } 8333 else 8334 { 8335 resultPageLink = Converter.ToString(productsPageId); 8336 searchFeedId = productsSearchId + "&feed=true"; 8337 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 8338 searchPlaceholder = Translate("Search products"); 8339 searchTemplate = "SearchResultsTypeAheadMobile"; 8340 searchType = "product-search"; 8341 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 8342 } 8343 8344 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 8345 8346 <div class="main-navigation-mobile mobile-navigation-header-search typeahead-mobile dw-mod"> 8347 <div class="center-container top-container__center-container u-no-padding dw-mod"> 8348 <div class="grid"> 8349 <div class="typeahead-mobile__search-field tablet dw-mod u-no-padding-x js-typeahead" data-page-size="@(searchType == "combined-search" ? 4 : 8)" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageLink" data-search-type="@searchType"> 8350 <div class="mobile-navigation-header-search"> 8351 <i class="far fa-search"></i> 8352 <input id="TypeaheadSearchFieldMobile" type="text" class="js-typeahead-search-field js-tablet-search u-w160px u-no-margin" data-shop-id="@Pageview.Area.EcomShopId" data-area-id="@Dynamicweb.Core.Converter.ToString(Pageview.AreaID)" placeholder="@HttpUtility.HtmlAttributeEncode(searchPlaceholder)" value="@HttpUtility.HtmlAttributeEncode(searchValue)"> 8353 <form class="u-full-width" action="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(productsPageId)" id="SearchSubmitForm"> 8354 <input type="text" class="typeahead-autocomplete js-typeahead-autocomplete u-no-margin" disabled /> 8355 </form> 8356 </div> 8357 <div class="tablet-search js-tablet-search-container u-min-w220px u-full-width"> 8358 <span class="typeahead-search-overlay typeahead-search-container js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></span> 8359 </div> 8360 </div> 8361 </div> 8362 </div> 8363 </div> 8364 }</text> 8365 } 8366 } 8367 } 8368 8369 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 8370 8371 @using System 8372 @using System.Web 8373 @using Dynamicweb.Rapido.Blocks.Extensibility 8374 @using Dynamicweb.Rapido.Blocks 8375 @using Dynamicweb.Rapido.Blocks.Components.General 8376 @using Dynamicweb.Frontend 8377 @using Dynamicweb.Core 8378 8379 @functions { 8380 int impersonationPageId; 8381 string impersonationLayout; 8382 int impersonationFeed; 8383 Block impersonationBar; 8384 bool businessContactImpersonation; 8385 8386 string GetUserNameFromParams(string firstName, string middleName, string lastName, string name, string email, string userName) 8387 { 8388 string username = ""; 8389 8390 if (!string.IsNullOrEmpty(firstName) && !string.IsNullOrEmpty(lastName)) 8391 { 8392 username = firstName + " " + (!string.IsNullOrEmpty(middleName) ? middleName + " " : "") + lastName; 8393 } 8394 else if (!string.IsNullOrEmpty(name)) 8395 { 8396 username = name; 8397 } 8398 else if (!string.IsNullOrEmpty(email)) 8399 { 8400 username = email; 8401 } 8402 else 8403 { 8404 username = userName; 8405 } 8406 return username; 8407 } 8408 8409 string GetUserName(UserViewModel user) 8410 { 8411 return GetUserNameFromParams(user.FirstName, user.MiddleName, user.LastName, user.Name, user.Email, user.UserName); 8412 } 8413 8414 string GetUserName(Dynamicweb.Security.UserManagement.User user) 8415 { 8416 return GetUserNameFromParams(user.FirstName, user.MiddleName, user.LastName, user.Name, user.Email, user.UserName); 8417 } 8418 } 8419 8420 @{ 8421 impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 8422 impersonationLayout = Model.Area.Item.GetItem("Ecommerce").GetList("ImpersonationLayout") != null ? Model.Area.Item.GetItem("Ecommerce").GetList("ImpersonationLayout").SelectedValue : "bar"; 8423 impersonationFeed = GetPageIdByNavigationTag("UsersFeed"); 8424 8425 businessContactImpersonation = Pageview.User?.CurrentSecondaryUser != null ? Converter.ToBoolean(Pageview.User.CurrentSecondaryUser.CustomFieldValues.FirstOrDefault(x => x.CustomField.SystemName == "AccessUser_SpBcImpersonator")?.Value) : Converter.ToBoolean(Pageview.User?.CustomFieldValues.FirstOrDefault(x => x.CustomField.SystemName == "AccessUser_SpBcImpersonator")?.Value); 8426 8427 8428 if (Model.CurrentUser.ID > 0 && Model.HasSecondaryUsers) 8429 { 8430 impersonationBar = new Block 8431 { 8432 Id = "ImpersonationBar", 8433 SortId = 50, 8434 Template = RenderImpersonation(), 8435 SkipRenderBlocksList = true, 8436 Design = new Design 8437 { 8438 Size = "auto-width", 8439 HidePadding = true, 8440 RenderType = RenderType.Column 8441 } 8442 }; 8443 8444 if (impersonationLayout == "top-bar") 8445 { 8446 impersonationBar.SortId = 9; 8447 } 8448 8449 Block impersonationContent = new Block 8450 { 8451 Id = "ImpersonationContent", 8452 SortId = 20 8453 }; 8454 8455 if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 8456 { 8457 //Render stop impersonation view 8458 impersonationContent.Template = RenderStopImpersonationView(); 8459 8460 8461 Modal stopImpersonation = new Modal 8462 { 8463 Id = "StopImpersonation", 8464 Heading = new Heading 8465 { 8466 Level = 2, 8467 Title = Translate("Sign out"), 8468 Icon = new Icon 8469 { 8470 Name = "fa-sign-out", 8471 Prefix = "fas", 8472 LabelPosition = IconLabelPosition.After 8473 } 8474 }, 8475 Width = ModalWidth.Sm, 8476 BodyTemplate = RenderStopImpersonationForm() 8477 }; 8478 8479 Block stopImpersonationBlock = new Block 8480 { 8481 Id = "StopImpersonationBlock", 8482 SortId = 10, 8483 Component = stopImpersonation 8484 }; 8485 impersonationBar.BlocksList.Add(stopImpersonationBlock); 8486 } 8487 else 8488 { 8489 //Render main view 8490 switch (impersonationLayout) 8491 { 8492 case "right-lower-box": 8493 impersonationContent.BlocksList.Add( 8494 new Block 8495 { 8496 Id = "RightLowerBoxHeader", 8497 SortId = 10, 8498 Component = new Heading 8499 { 8500 Level = 5, 8501 Title = Translate("View the list of users you can sign in as"), 8502 CssClass = "impersonation-text" 8503 } 8504 } 8505 ); 8506 impersonationContent.BlocksList.Add( 8507 new Block 8508 { 8509 Id = "RightLowerBoxContent", 8510 SortId = 20, 8511 Template = RenderImpersonationControls() 8512 } 8513 ); 8514 break; 8515 case "right-lower-bar": 8516 impersonationContent.BlocksList.Add( 8517 new Block 8518 { 8519 Id = "RightLowerBarContent", 8520 SortId = 10, 8521 Template = RenderImpersonationControls() 8522 } 8523 ); 8524 break; 8525 case "bar": 8526 default: 8527 impersonationContent.BlocksList.Add( 8528 new Block 8529 { 8530 Id = "ViewListLink", 8531 SortId = 20, 8532 Template = RenderViewListLink() 8533 } 8534 ); 8535 impersonationContent.BlocksList.Add( 8536 new Block 8537 { 8538 Id = "BarTypeaheadSearch", 8539 SortId = 30, 8540 Template = RenderTypeaheadSearch() 8541 } 8542 ); 8543 break; 8544 } 8545 } 8546 impersonationBar.BlocksList.Add(impersonationContent); 8547 8548 impersonationBar.BlocksList.Add( 8549 new Block 8550 { 8551 Id = "ImpersonationSearchTemplates", 8552 SortId = 30, 8553 Template = RenderSearchResultTemplate() 8554 } 8555 ); 8556 if (impersonationLayout != "bar" && impersonationLayout != "top-bar") 8557 { 8558 impersonationBar.BlocksList.Add( 8559 new Block 8560 { 8561 Id = "ImpersonationSearchScripts", 8562 SortId = 40, 8563 Template = RenderSearchScripts() 8564 } 8565 ); 8566 } 8567 BlocksPage.GetBlockPage("Master").Add("MasterHeader", impersonationBar); 8568 } 8569 } 8570 8571 @helper RenderImpersonation() 8572 { 8573 List<Block> subBlocks = impersonationBar.BlocksList.OrderBy(item => item.SortId).ToList(); 8574 <input type="checkbox" class="impersonation-trigger js-remember-state" id="ImpersonationMinimizeTrigger" /> 8575 <div class="impersonation impersonation--@(impersonationLayout)-layout dw-mod" id="Impersonation"> 8576 @if (impersonationLayout == "right-lower-box") 8577 { 8578 @RenderRightLowerBoxHeader() 8579 } 8580 <div class="center-container top-container__center-container impersonation__container @(impersonationLayout != "bar" && impersonationLayout != "top-bar" ? "impersonation__container--box" : "") dw-mod"> 8581 @*Impersonation*@ 8582 @RenderBlockList(subBlocks) 8583 </div> 8584 </div> 8585 } 8586 8587 @helper RenderRightLowerBoxHeader() 8588 { 8589 <div class="impersonation__header dw-mod"> 8590 <div class="impersonation__title">@Translate("Impersonation")</div> 8591 <label for="ImpersonationMinimizeTrigger" class="btn btn--impersonation impersonation__minimize-btn dw-mod" onclick="this.blur();"> 8592 @Render(new Icon 8593 { 8594 Prefix = "fas", 8595 Name = "fa-window-minimize" 8596 }) 8597 </label> 8598 </div> 8599 } 8600 8601 @helper RenderStopImpersonationView() 8602 { 8603 string secondaryUserName = GetUserName(Model.CurrentSecondaryUser); 8604 string userName = GetUserName(Pageview.User); 8605 string impersonationText = "<span class=\"impersonation-light-text dw-mod\">" + Translate("Logged in as") + "</span> <b>" + secondaryUserName + "</b> <span class=\"impersonation-light-text dw-mod\">" + Translate("by") + "</span> <b>" + userName + "</b> "; 8606 8607 if (businessContactImpersonation) 8608 { 8609 impersonationText = "<span class=\"impersonation-light-text dw-mod\">" + Translate("Smartpage:ImpersonationBar.BuyingOnBehalfOf", "Du køber på vegne af") + "</span> <b>" + Model.CurrentUser.Company + "</b>"; 8610 } 8611 8612 impersonationText = !businessContactImpersonation ? "<span class=\"impersonation-light-text dw-mod\">" + Translate("Logged in as") + "</span> <b>" + userName + "</b> <span class=\"impersonation-light-text dw-mod\">" + Translate("by") + "</span> <b>" + secondaryUserName + "</b> " : impersonationText; 8613 8614 if (impersonationLayout == "right-lower-box") 8615 { 8616 <div class="u-margin-bottom--lg u-ta-center"> 8617 @impersonationText 8618 </div> 8619 <div class="u-margin-bottom--lg u-ta-center"> 8620 @RenderSwitchAccountButton() 8621 </div> 8622 @RenderStopImpersonationButton() 8623 } 8624 else 8625 { 8626 <div class="grid grid--align-center impersonation__stop-wrap"> 8627 <div class="impersonation-bar-item dw-mod"> 8628 @impersonationText 8629 </div> 8630 <div class="impersonation-bar-item dw-mod"> 8631 @RenderSwitchAccountButton() 8632 </div> 8633 <div class="impersonation-bar-item dw-mod"> 8634 @if (businessContactImpersonation) 8635 { 8636 @RenderStopImpersonation() 8637 } 8638 else 8639 { 8640 @RenderStopImpersonationButton() 8641 } 8642 </div> 8643 </div> 8644 } 8645 } 8646 8647 @helper RenderStopImpersonation() 8648 { 8649 int pageId = Model.TopPage.ID; 8650 <form method="post" class="u-no-margin"> 8651 @Render(new Button 8652 { 8653 ButtonType = ButtonType.Submit, 8654 ButtonLayout = ButtonLayout.LinkClean, 8655 Title = businessContactImpersonation ? Translate("Smartpage:Impersonation.DeselectCustomer", "Fravælg kunde") : Translate("Stop impersonation"), 8656 Href = "/Default.aspx?ID=" + pageId, 8657 CssClass = "btn--full", 8658 Icon = new Icon 8659 { 8660 Name = "fa-sign-out", 8661 Prefix = "fal", 8662 LabelPosition = IconLabelPosition.After 8663 }, 8664 Name = "DwExtranetRemoveSecondaryUser" 8665 }) 8666 </form> 8667 } 8668 8669 @helper RenderSwitchAccountButton() 8670 { 8671 @Render(new Button 8672 { 8673 Href = "/Default.aspx?ID=" + impersonationPageId, 8674 ButtonLayout = ButtonLayout.LinkClean, 8675 Title = businessContactImpersonation ? Translate("Smartpage:Impersonation.ChangeCustomer", "Vælg anden kunde") : Translate("Switch account"), 8676 Icon = new Icon 8677 { 8678 Name = "fa-users", 8679 Prefix = "fal", 8680 LabelPosition = IconLabelPosition.After 8681 }, 8682 CssClass = "u-no-margin u-color-inherit" 8683 }) 8684 } 8685 8686 @helper RenderStopImpersonationForm() 8687 { 8688 string secondaryUserName = GetUserName(Model.CurrentSecondaryUser); 8689 string userName = GetUserName(Pageview.User); 8690 int pageId = Model.TopPage.ID; 8691 8692 <div class="u-align-center u-margin-bottom-10px u-font-size--sm">@Translate("Smartpage:Impersonation.DeselectCustomerBeforeLogoff", "Du skal først fravælge den valgte kunde før du kan logge ud")</div> 8693 8694 <form method="post" class="u-no-margin"> 8695 @if (businessContactImpersonation) 8696 { 8697 @Render(new Button 8698 { 8699 ButtonType = ButtonType.Submit, 8700 ButtonLayout = ButtonLayout.Secondary, 8701 Title = Translate("Smartpage:Impersonation.DeselectCustomer", "Fravælg kunde"), 8702 Href = "/Default.aspx?ID=" + impersonationPageId, 8703 CssClass = "btn--full", 8704 Name = "DwExtranetRemoveSecondaryUser" 8705 }) 8706 } 8707 else 8708 { 8709 @Render(new Button 8710 { 8711 ButtonType = ButtonType.Submit, 8712 ButtonLayout = ButtonLayout.Secondary, 8713 Title = Translate("Sign out as") + " " + userName, 8714 Href = "/Default.aspx?ID=" + impersonationPageId, 8715 CssClass = "btn--full", 8716 Name = "DwExtranetRemoveSecondaryUser" 8717 }) 8718 } 8719 </form> 8720 } 8721 8722 @helper RenderStopImpersonationButton() 8723 { 8724 @Render(new Button 8725 { 8726 ButtonType = ButtonType.Button, 8727 ButtonLayout = ButtonLayout.LinkClean, 8728 Title = Translate("Sign out"), 8729 Icon = new Icon 8730 { 8731 Name = "fa-sign-out", 8732 Prefix = "fal", 8733 LabelPosition = IconLabelPosition.After 8734 }, 8735 OnClick = "document.getElementById('StopImpersonationModalTrigger').checked = true", 8736 CssClass = "u-no-margin" 8737 }) 8738 } 8739 8740 @helper RenderImpersonationControls() 8741 { 8742 <div class="impersonation__controls"> 8743 @RenderViewListLink() 8744 @RenderSearchBox() 8745 </div> 8746 @RenderResultsList() 8747 } 8748 8749 @helper RenderViewListLink() 8750 { 8751 string title = impersonationLayout == "right-lower-box" ? Translate("View the list") : Translate("View the list of users you can sign in as"); 8752 8753 if (businessContactImpersonation) 8754 { 8755 title = Translate("Smartpage:ImpersonationBar.ViewUsersList", "Vis listen med kunder du kan købe på vegne af"); 8756 } 8757 8758 string buttonClasses = impersonationLayout == "right-lower-box" ? "impersonation__button btn btn--impersonation" : "impersonation__link impersonation__link"; 8759 8760 @Render(new Link 8761 { 8762 ButtonLayout = ButtonLayout.None, 8763 Title = title, 8764 Href = "/Default.aspx?ID=" + impersonationPageId, 8765 CssClass = buttonClasses 8766 }) 8767 } 8768 8769 @helper RenderSearchBox() 8770 { 8771 <div class="impersonation__search-wrap"> 8772 <input placeholder="@Translate("Search users")" type="text" class="impersonation__search-field dw-mod" onkeyup="searchKeyUpHandler(event)" id="ImpersonationBoxSearchField"> 8773 <div id="ImpersonationBoxSearchFind" class="impersonation__search-icon dw-mod" onclick="updateResults(document.getElementById('ImpersonationBoxSearchField').value)"> 8774 <i class="fal fa-search"></i> 8775 </div> 8776 <div id="ImpersonationBoxSearchClear" class="impersonation__search-icon u-hidden dw-mod" onclick="clearResults();"> 8777 <i class="fal fa-times"></i> 8778 </div> 8779 </div> 8780 } 8781 8782 @helper RenderTypeaheadSearch() 8783 { 8784 <div class="typeahead u-ta-right impersonation__typeahead js-typeahead dw-mod" id="ImpersonationSearchBar" 8785 data-page-size="5" 8786 data-search-feed-id="@impersonationFeed" 8787 data-result-page-id="@impersonationPageId" 8788 data-search-type="user-search" 8789 data-search-parameter-name="q"> 8790 8791 <div class="typeahead-search-field"> 8792 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@HttpUtility.HtmlAttributeEncode(businessContactImpersonation ? Translate("Search customers") : Translate("Search users"))"> 8793 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ImpersonationSearchBarContent" data-template="ImpersonationSearchResult" data-json-feed="/Default.aspx?ID=@impersonationFeed" data-init-onload="false"></ul> 8794 </div> 8795 </div> 8796 } 8797 8798 @helper RenderResultsList() 8799 { 8800 <ul id="ImpersonationBoxSearchResults" class="impersonation__search-results js-handlebars-root dw-mod" data-template="ImpersonationSearchResult" data-json-feed="/Default.aspx?ID=@impersonationFeed" data-init-onload="false" data-preloader="minimal"></ul> 8801 } 8802 8803 @helper RenderSearchResultTemplate() 8804 { 8805 <script id="ImpersonationSearchResult" type="text/x-template"> 8806 {{#.}} 8807 {{#Users}} 8808 <li class="impersonation__search-results-item impersonation-user"> 8809 <form method="post" class="impersonation-user__form" name="account{{id}}"> 8810 <input type="hidden" id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector" value="{{id}}"> 8811 @if (businessContactImpersonation) 8812 { 8813 <div class="impersonation-user__info"> 8814 <div class="impersonation-user__name">{{company}}</div> 8815 <div class="impersonation-user__number">{{customerNumber}}</div> 8816 </div> 8817 8818 @Render(new Button 8819 { 8820 ButtonType = ButtonType.Submit, 8821 ButtonLayout = ButtonLayout.Secondary, 8822 Title = Translate("Smartpage:Impersonation.SelectCustomer", "Vælg kunde"), 8823 CssClass = "impersonation-user__sign-in-btn u-pull--right u-no-margin" 8824 }); 8825 } 8826 else 8827 { 8828 <div class="impersonation-user__info"> 8829 <div class="impersonation-user__name">{{userName}}</div> 8830 <div class="impersonation-user__number">{{customerNumber}}</div> 8831 </div> 8832 8833 @Render(new Button 8834 { 8835 ButtonType = ButtonType.Submit, 8836 ButtonLayout = ButtonLayout.Secondary, 8837 Title = Translate("Sign in as"), 8838 CssClass = "impersonation-user__sign-in-btn u-pull--right u-no-margin" 8839 }); 8840 } 8841 </form> 8842 </li> 8843 {{/Users}} 8844 {{#unless Users}} 8845 <li class="impersonation__search-results-item impersonation__search-results-item--not-found"> 8846 @Translate("Your search gave 0 results") 8847 </li> 8848 {{/unless}} 8849 {{/.}} 8850 </script> 8851 } 8852 8853 @helper RenderSearchScripts() 8854 { 8855 <script> 8856 let inputDelayTimer; 8857 function searchKeyUpHandler(e) { 8858 clearTimeout(inputDelayTimer); 8859 let value = e.target.value; 8860 if (value != "") { 8861 inputDelayTimer = setTimeout(function () { 8862 updateResults(value); 8863 }, 500); 8864 } else { 8865 clearResults(); 8866 } 8867 }; 8868 8869 function updateResults(value) { 8870 if (value == "") { 8871 return null; 8872 } 8873 HandlebarsBolt.UpdateContent("ImpersonationBoxSearchResults", "/Default.aspx?ID=@impersonationFeed&q=" + value); 8874 document.getElementById("ImpersonationBoxSearchFind").classList.add("u-hidden"); 8875 document.getElementById("ImpersonationBoxSearchClear").classList.remove("u-hidden"); 8876 } 8877 8878 function clearResults() { 8879 document.getElementById("ImpersonationBoxSearchField").value = ""; 8880 HandlebarsBolt.CleanContainer("ImpersonationBoxSearchResults"); 8881 document.getElementById("ImpersonationBoxSearchFind").classList.remove("u-hidden"); 8882 document.getElementById("ImpersonationBoxSearchClear").classList.add("u-hidden"); 8883 } 8884 </script> 8885 } 8886 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 8887 8888 @using System 8889 @using System.Web 8890 @using System.Collections.Generic 8891 @using Dynamicweb.Rapido.Blocks.Extensibility 8892 @using Dynamicweb.Rapido.Blocks 8893 8894 @{ 8895 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 8896 string orderlinesView = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView").SelectedValue : "table"; 8897 8898 Block orderLines = new Block 8899 { 8900 Id = "MiniCartOrderLines", 8901 SkipRenderBlocksList = true, 8902 BlocksList = new List<Block> 8903 { 8904 new Block { 8905 Id = "MiniCartOrderLinesList", 8906 SortId = 20, 8907 Template = RenderMiniCartOrderLinesList() 8908 } 8909 } 8910 }; 8911 8912 Block orderlinesScriptTemplates = new Block 8913 { 8914 Id = "OrderlinesScriptTemplates" 8915 }; 8916 8917 if (orderlinesView == "table") 8918 { 8919 orderLines.Template = RenderMiniCartOrderLinesTable(); 8920 orderLines.BlocksList.Add( 8921 new Block 8922 { 8923 Id = "MiniCartOrderlinesTableHeader", 8924 SortId = 10, 8925 Template = RenderMiniCartOrderLinesHeader() 8926 } 8927 ); 8928 8929 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 8930 } 8931 else 8932 { 8933 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 8934 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 8935 } 8936 8937 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 8938 8939 Block miniCartScriptTemplates = new Block() 8940 { 8941 Id = "MasterMiniCartTemplates", 8942 SortId = 1, 8943 Template = RenderMiniCartScriptTemplates(), 8944 SkipRenderBlocksList = true, 8945 BlocksList = new List<Block> 8946 { 8947 orderLines, 8948 new Block { 8949 Id = "MiniCartFooter", 8950 Template = RenderMiniCartFooter(), 8951 SortId = 50, 8952 SkipRenderBlocksList = true, 8953 BlocksList = new List<Block> 8954 { 8955 new Block { 8956 Id = "MiniCartSubTotal", 8957 Template = RenderMiniCartSubTotal(), 8958 SortId = 30 8959 }, 8960 new Block { 8961 Id = "MiniCartFees", 8962 Template = RenderMiniCartFees(), 8963 SortId = 40 8964 }, 8965 new Block { 8966 Id = "MiniCartPoints", 8967 Template = RenderMiniCartPoints(), 8968 SortId = 50 8969 }, 8970 new Block { 8971 Id = "MiniCartTotal", 8972 Template = RenderMiniCartTotal(), 8973 SortId = 60 8974 }, 8975 new Block { 8976 Id = "MiniCartDisclaimer", 8977 Template = RenderMiniCartDisclaimer(), 8978 SortId = 70 8979 }, 8980 new Block { 8981 Id = "MiniCartActions", 8982 Template = RenderMiniCartActions(), 8983 SortId = 80 8984 } 8985 } 8986 } 8987 } 8988 }; 8989 8990 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 8991 } 8992 8993 @helper RenderMiniCartScriptsTableTemplates() 8994 { 8995 <script id="MiniCartOrderline" type="text/x-template"> 8996 {{#unless isEmpty}} 8997 <tr> 8998 <td class="u-w60px"><a href="{{link}}" class="{{hideimage}}"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"></a></td> 8999 <td class="u-va-middle"> 9000 {{#if note}} 9001 <span class="mini-cart-note">{{note}}</span> 9002 {{/if}} 9003 <a href="{{link}}" class="mini-cart-orderline__name" title="{{name}}">{{name}}</a> 9004 {{#if variantname}} 9005 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{variantname}}</a> 9006 {{/if}} 9007 {{#if unitname}} 9008 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{unitname}}</div> 9009 {{/if}} 9010 </td> 9011 <td class="u-ta-right u-va-middle">{{quantity}}</td> 9012 <td class="u-ta-right u-va-middle"> 9013 {{#if pointsTotal}} 9014 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 9015 {{else}} 9016 {{totalprice}} 9017 {{/if}} 9018 </td> 9019 </tr> 9020 {{/unless}} 9021 </script> 9022 9023 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 9024 {{#unless isEmpty}} 9025 <tr class="table__row--no-border"> 9026 <td class="u-w60px"> 9027 {{#if image}} 9028 @Render(new Image { Path = "{{image}}", Title = "{{name}} {{variantname}}", ImageDefault = new ImageSettings { Width = 60, Height = 60, Crop = 5 }, CssClass = "u-middle-horizontal" }) 9029 {{/if}} 9030 </td> 9031 <td><div class="mini-cart-orderline__name dw-mod">{{name}}</div></td> 9032 <td class="u-ta-right">&nbsp;</td> 9033 <td class="u-ta-right">{{totalprice}}</td> 9034 </tr> 9035 {{/unless}} 9036 </script> 9037 9038 <script id="MiniPmxCartOrderline" type="text/x-template"> 9039 {{#unless isEmpty}} 9040 <tr class="table__row--no-border"> 9041 <td class="u-w60px"> 9042 @Render(new Image { Path = "Admin/Public/GetImage.ashx?Width=115&Height=115&Crop=5&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/philipsonwine/pickandmix/Kasse.png", Title = Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse"), DisableImageEngine = true, CssClass = "product-image" }) 9043 </td> 9044 <td class="u-va-middle"> 9045 <span class="mini-cart-orderline__name">@Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse") {{nr}}</span> 9046 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">@Translate("Smartpage:Checkout.PMXCart.TopText", "Pick and mix")</div> 9047 </td> 9048 <td class="u-ta-right u-va-middle">{{quantity}}</td> 9049 <td class="u-ta-right u-va-middle"> 9050 {{totalPriceClean}} 9051 </td> 9052 </tr> 9053 {{/unless}} 9054 </script> 9055 } 9056 9057 @helper RenderMiniCartScriptsListTemplates() 9058 { 9059 int cartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 9060 9061 <script id="MiniCartOrderline" type="text/x-template"> 9062 {{#unless isEmpty}} 9063 <div class="mini-cart-orderline grid dw-mod"> 9064 <div class="grid__col-4"> 9065 <a href="{{link}}" class="{{hideimage}}"> 9066 @{ 9067 string imageEngine = "/Admin/Public/GetImage.ashx?width=100&height=100&crop=5&Compression=75&image={{image}}"; 9068 9069 // CDN 9070 var cdnUrl = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetString("CDNUrl"); 9071 bool cdnActivate = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("CDNActivate"); 9072 if (!string.IsNullOrWhiteSpace(cdnUrl) && cdnActivate) 9073 { 9074 imageEngine = cdnUrl + imageEngine; 9075 } 9076 } 9077 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="@imageEngine" alt="{{name}}" title="{{name}}"> 9078 </a> 9079 </div> 9080 <div class="grid__col-8"> 9081 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--truncate mini-cart-orderline__name--md u-padding-right--lg" title="{{name}}">{{name}}</a> 9082 {{#if variantname}} 9083 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Variant"): {{variantname}}</div> 9084 {{/if}} 9085 {{#if unitname}} 9086 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Unit"): {{unitname}}</div> 9087 {{/if}} 9088 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Qty"): {{quantity}}</div> 9089 9090 <div class="grid__cell-footer"> 9091 <div class="grid__cell"> 9092 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 9093 {{#if pointsTotal}} 9094 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 9095 {{else}} 9096 {{totalprice}} 9097 {{/if}} 9098 </div> 9099 <button type="button" 9100 title="@Translate("Remove orderline")" 9101 class="btn btn--clean btn--condensed u-pull--right mini-cart-orderline__remove-btn dw-mod" 9102 onclick="{{#if googleImpression}}googleImpressionRemoveFromCart({{googleImpression}});{{/if}}Cart.UpdateCart('miniCartContent', '/Default.aspx?ID=@cartFeedPageId', 'CartCmd=DelOrderLine&key={{id}}&redirect=false', true);"> 9103 @Translate("Remove") 9104 </button> 9105 </div> 9106 </div> 9107 </div> 9108 </div> 9109 {{/unless}} 9110 </script> 9111 9112 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 9113 {{#unless isEmpty}} 9114 <div class="mini-cart-orderline mini-cart-orderline--discount grid dw-mod"> 9115 <div class="grid__col-8"> 9116 <div class="mini-cart-orderline__name mini-cart-orderline__name dw-mod">{{name}}</div> 9117 </div> 9118 <div class="grid__col-4 u-align-right">{{totalprice}}</div> 9119 </div> 9120 {{/unless}} 9121 </script> 9122 } 9123 9124 @helper RenderMiniCartScriptTemplates() 9125 { 9126 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 9127 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 9128 string cartPageLink = string.Concat("/Default.aspx?ID=", GetPageIdByNavigationTag("CartPage")); 9129 bool miniCartUseGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 9130 9131 <script id="MiniCartContent" type="text/x-template"> 9132 {{#.}} 9133 {{#unless isEmpty}} 9134 @if (miniCartUseGoogleTagManager) 9135 { 9136 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 9137 } 9138 @RenderBlockList(subBlocks) 9139 {{/unless}} 9140 {{/.}} 9141 </script> 9142 } 9143 9144 @helper RenderMiniCartOrderLinesTable() 9145 { 9146 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 9147 9148 <div class="u-overflow-auto"> 9149 <table class="table mini-cart-table dw-mod"> 9150 @RenderBlockList(subBlocks) 9151 </table> 9152 </div> 9153 } 9154 9155 @helper RenderMiniCartOrderLinesBlocks() 9156 { 9157 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 9158 9159 <div class="u-overflow-auto"> 9160 @RenderBlockList(subBlocks) 9161 </div> 9162 } 9163 9164 @helper RenderMiniCartOrderLinesHeader() 9165 { 9166 <thead> 9167 <tr> 9168 <td>&nbsp;</td> 9169 <td>@Translate("Product")</td> 9170 <td class="u-ta-right">@Translate("Qty")</td> 9171 <td class="u-ta-right" width="150">@Translate("Price")</td> 9172 </tr> 9173 </thead> 9174 } 9175 9176 @helper RenderMiniCartOrderLinesList() 9177 { 9178 <text> 9179 {{#OrderLines}} 9180 {{#ifCond template "===" "CartOrderline"}} 9181 {{>MiniCartOrderline}} 9182 {{/ifCond}} 9183 {{#ifCond template "===" "CartOrderlineMobile"}} 9184 {{>MiniCartOrderline}} 9185 {{/ifCond}} 9186 {{#ifCond template "===" "CartOrderlineDiscount"}} 9187 {{>MiniCartOrderlineDiscount}} 9188 {{/ifCond}} 9189 {{/OrderLines}} 9190 {{#PickAndMixOrderLines}} 9191 {{>MiniPmxCartOrderline}} 9192 {{/PickAndMixOrderLines}} 9193 </text> 9194 } 9195 9196 @helper RenderMiniCartFees() 9197 { 9198 bool pointShop = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 9199 if (!pointShop) 9200 { 9201 <text> 9202 {{#unless hidePaymentfee}} 9203 <div class="grid"> 9204 <div class="grid__col-6 grid__col--bleed-y"> 9205 {{paymentmethod}} 9206 </div> 9207 <div class="grid__col-6 grid__col--bleed-y grid--align-end">{{paymentfee}}</div> 9208 </div> 9209 {{/unless}} 9210 </text> 9211 } 9212 <text> 9213 {{#unless hideShippingfee}} 9214 {{#if shippingmethod}} 9215 <div class="grid"> 9216 <div class="grid__col-6 grid__col--bleed-y"> 9217 {{shippingmethod}} 9218 </div> 9219 <div class="grid__col-6 grid__col--bleed-y grid--align-end">{{shippingfee}}</div> 9220 </div> 9221 {{/if}} 9222 {{/unless}} 9223 </text> 9224 <text> 9225 {{#if hasTaxSettings}} 9226 <div class="grid"> 9227 <div class="grid__col-6 grid__col--bleed-y">@Translate("Sales Tax")</div> 9228 <div class="grid__col-6 grid__col--bleed-y grid--align-end">{{totaltaxes}}</div> 9229 </div> 9230 {{/if}} 9231 </text> 9232 <text> 9233 {{#customerStockOrderlines}} 9234 <div class="grid"> 9235 <div class="grid__col-6 grid__col--bleed-y"> 9236 {{Description}} 9237 </div> 9238 <div class="grid__col-6 grid__col--bleed-y grid--align-end">{{Fee}}</div> 9239 </div> 9240 {{/customerStockOrderlines}} 9241 </text> 9242 } 9243 9244 @helper RenderMiniCartFooter() 9245 { 9246 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 9247 9248 <div class="mini-cart__footer u-border-top u-padding-top dw-mod"> 9249 @RenderBlockList(subBlocks) 9250 </div> 9251 } 9252 9253 @helper RenderMiniCartActions() 9254 { 9255 int cartPageId = GetPageIdByNavigationTag("CartPage"); 9256 9257 <button type="button" title="@Translate("Empty cart")" class="btn btn--secondary u-full-width dw-mod u-no-margin u-margin-bottom" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button> 9258 <a href="/Default.aspx?ID=@cartPageId" title="@Translate("Proceed to checkout")" class="btn btn--primary u-full-width u-no-margin dw-mod">@Translate("Proceed to checkout")</a> 9259 } 9260 9261 @helper RenderMiniCartPoints() 9262 { 9263 <text> 9264 {{#if earnings}} 9265 <div class="grid"> 9266 <div class="grid__col-6 grid__col--bleed-y">@Translate("Earnings")</div> 9267 <div class="grid__col-6 grid__col--bleed-y grid--align-end"> 9268 <div> 9269 <span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points") 9270 </div> 9271 </div> 9272 </div> 9273 {{/if}} 9274 </text> 9275 } 9276 9277 @helper RenderMiniCartSubTotal() 9278 { 9279 bool hasTaxSettings = Dynamicweb.Rapido.Services.Countries.HasTaxSettings(Model.Cart.ID); 9280 bool pointShop = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 9281 if (!pointShop) 9282 { 9283 <text> 9284 {{#unless hideSubTotal}} 9285 <div class="grid dw-mod u-bold"> 9286 <div class="grid__col-6 grid__col--bleed-y">@Translate("Subtotal")</div> 9287 <div class="grid__col-6 grid__col--bleed-y grid--align-end"> 9288 @if (hasTaxSettings) 9289 { 9290 <text>{{subtotalpricewithouttaxes}}</text> 9291 } 9292 else 9293 { 9294 <text>{{subtotalprice}}</text> 9295 } 9296 </div> 9297 </div> 9298 {{/unless}} 9299 </text> 9300 } 9301 } 9302 9303 @helper RenderMiniCartTotal() 9304 { 9305 bool pointShop = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 9306 9307 <div class="mini-cart-totals grid u-border-top u-margin-top dw-mod"> 9308 <div class="grid__col-6">@Translate("Total")</div> 9309 <div class="grid__col-6 grid--align-end"> 9310 <div> 9311 @if (pointShop) 9312 { 9313 <span class="u-color--loyalty-points">{{pointsUsedInCart}}</span> @Translate("points") 9314 } 9315 else 9316 { 9317 <text>{{totalprice}}</text> 9318 } 9319 </div> 9320 </div> 9321 </div> 9322 } 9323 9324 @helper RenderMiniCartDisclaimer() 9325 { 9326 <text> 9327 {{#if showCheckoutDisclaimer}} 9328 <div class="grid u-margin-bottom u-ta-right"> 9329 <small class="grid__col-12">{{checkoutDisclaimer}}</small> 9330 </div> 9331 {{/if}} 9332 </text> 9333 } 9334 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 9335 @using Dynamicweb.Rapido.Blocks 9336 @using Dynamicweb.Rapido.Blocks.Components.General 9337 @using Smartpage.EventGrid.Models 9338 @using Smartpage.Relewise.Services.Models 9339 9340 @using Dynamicweb.Ecommerce.ProductCatalog 9341 @using Dynamicweb.Rendering 9342 @using Dynamicweb.Core 9343 @using System 9344 @using System.Web 9345 @using System.Collections.Generic 9346 @using Dynamicweb.Rapido.Blocks 9347 @using Dynamicweb.Rapido.Blocks.Components 9348 @using Dynamicweb.Rapido.Blocks.Components.General 9349 @using Dynamicweb.Rapido.Services 9350 @using Smartpage.PhilipsonWine.PickNMix.Helper; 9351 9352 @helper GridView(Dynamicweb.Frontend.ItemViewModel gridViewSettings) 9353 { 9354 int columnsCount = gridViewSettings.GetList("Columns") != null ? Converter.ToInt32(gridViewSettings.GetList("Columns").SelectedValue) : 3; 9355 string imageZoomOnHover = gridViewSettings.GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 9356 9357 <script id="ProductGridItemContainer" type="text/x-template"> 9358 {{#.}} 9359 {{#unless ispickMixProductContainer}} 9360 <div id="Product{{id}}" data-template="GridViewItem" data-preloader="overlay" class="grid__col-lg-@(12 / columnsCount) grid__col-md-6 grid__col-sm-6 grid__col-xs-6 product-list__grid-item @imageZoomOnHover dw-mod product-list-product js-product-list-product"> 9361 {{#Product}} 9362 {{>GridViewItem}} 9363 {{/Product}} 9364 {{#Banner}} 9365 {{>GridViewItemBanner}} 9366 {{/Banner}} 9367 </div> 9368 {{/unless}} 9369 9370 {{/.}} 9371 </script> 9372 } 9373 9374 @helper RenderGridViewItemBanner() 9375 { 9376 <script id="GridViewItemBanner" type="text/x-template"> 9377 <div class="grid__col--auto product-scroll-trigger u-no-padding u-full-height u-grey-border u-white-background u-padding-sides-8px u-justify-content--center banner-grid" style="background: url('{{bannerImage}}'); background-size: cover;"> 9378 <div class="grid__col-12 u-padding-sides-8px"> 9379 <p class="banner-text u-padding-sides-8px">{{bannerText}}</p> 9380 {{#if showButton}} 9381 <div class="grid__col-8"> 9382 <a class="btn btn-banner u-padding-sides-8px" href="{{bannerButtonLink}}">{{bannerButtonText}}</a> 9383 </div> 9384 {{/if}} 9385 </div> 9386 </div> 9387 </script> 9388 } 9389 9390 @helper RenderGridViewItem(BlocksPage page) 9391 { 9392 List<Block> subBlocks = page.GetBlockListById("GridViewItem"); 9393 int sliderSpeed = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetInt32("IconSliderSpeed") != 0 ? Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetInt32("IconSliderSpeed") : 3000; 9394 <script id="GridViewItem" type="text/x-template"> 9395 {{#.}} 9396 <div class="grid-card"> 9397 <div class="grid__col--auto js-product-scroll-trigger product-scroll-trigger u-no-padding u-full-height u-white-background" data-params="{{googleImpression}}"> 9398 {{#unless RecommendationDisplayAsGrid}} 9399 {{>RenderBadges}} 9400 {{>RenderLabels}} 9401 {{/unless}} 9402 @RenderBlockList(subBlocks) 9403 </div> 9404 </div> 9405 {{/.}} 9406 </script> 9407 9408 <script id="RenderBadges" type="text/x-template"> 9409 <div class="productlist-badges"> 9410 @RenderGridViewItemStickers() 9411 {{#ExpertRatings}} 9412 {{#if isFreeText}} 9413 <div class="rating-badge c100"> 9414 <span class="rating-badge--score__freetext">{{text}}</span> 9415 </div> 9416 {{else}} 9417 {{#if isInterval}} 9418 <div class="rating-badge c100"> 9419 <span class="rating-badge--score__interval">{{{text}}}</span> 9420 <span class="rating-badge--text">{{name}}</span> 9421 </div> 9422 {{else}} 9423 <div class="rating-badge c100"> 9424 <span class="rating-badge--score">{{{text}}}</span> 9425 <span class="rating-badge--text">{{name}}</span> 9426 </div> 9427 {{/if}} 9428 {{/if}} 9429 {{/ExpertRatings}} 9430 {{#if CustomerRatingActive}} 9431 <div class="rating-badge customer-rating"> 9432 <span class="rating-badge--score">{{{CustomerRatingInText}}}</span> 9433 <div class="customer-ratings-container"> 9434 <div class="js-stars stars" data-average-rating="{{CustomerRatingInText}}"> 9435 <i class="fas fa-star js-star star"></i> 9436 <i class="fas fa-star js-star star"></i> 9437 <i class="fas fa-star js-star star"></i> 9438 <i class="fas fa-star js-star star"></i> 9439 <i class="fas fa-star js-star star"></i> 9440 </div> 9441 </div> 9442 <span class="rating-badge--text">({{CustomerRatingCount}} {{CustomerRatingCountText}})</span> 9443 </div> 9444 {{/if}} 9445 </div> 9446 </script> 9447 9448 <script id="RenderLabels" type="text/x-template"> 9449 <div class="label-container"> 9450 {{#if bomQuantity}} 9451 <div class="top-label"> 9452 <span class="top-label__bom-quantity">{{{bomQuantity}}}</span> 9453 </div> 9454 {{/if}} 9455 {{#Labels}} 9456 <div class="top-label"> 9457 <div class="top-label__label top-label__label" style="background-color:{{labelBgColor}}; color:{{labelTextColor}}"> 9458 {{labelText}} 9459 {{#if tooltipText}} 9460 <i class="fal fa-question-circle info-icon js-tooltip tooltip-icon tooltip-icon--product-list" data-tooltip-placement="{{tooltipPlacement}}" data-tooltip-content="{{tooltipText}}"></i> 9461 {{/if}} 9462 </div> 9463 </div> 9464 {{/Labels}} 9465 </div> 9466 </script> 9467 9468 } 9469 9470 @helper RenderGridViewItemHiddenProperties() 9471 { 9472 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 9473 @*<input type="hidden" name="ProductID{{id}}" value="{{productId}}" />*@ 9474 <input type="hidden" name="VariantID{{id}}" value="{{variantid}}" id="Variant_{{id}}" /> 9475 <input type="hidden" name="UnitID{{id}}" value="{{unitId}}" id="Unit_{{id}}" /> 9476 } 9477 9478 @helper RenderGridViewItemImageContainer(BlocksPage page) 9479 { 9480 List<Block> subBlocks = page.GetBlockListById("GridViewItemImageContainer"); 9481 9482 <div class="product-list__grid-item__image dw-mod {{noImage}}"> 9483 @RenderBlockList(subBlocks) 9484 </div> 9485 } 9486 9487 @helper RenderGridViewItemImage() 9488 { 9489 <text> 9490 {{#if isPickAndMixPage}} 9491 <div class="grid-image-container pmx-grid-image-container"> 9492 <div class="grid-image pmx-modal-trigger js-pmx-modal-trigger" style="background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.03)), url('{{image}}');" data-product-id="{{productId}}"></div> 9493 </div> 9494 {{else}} 9495 <a href="{{link}}" 9496 onclick="Scroll.SavePosition(event); {{#if googleImpression}}googleEnchantImpressionClick({{googleImpression}}, event){{/if}}" 9497 title="{{{name}}}" 9498 class="u-block u-position-relative image-hover__wrapper dw-mod"> 9499 <div class="grid-image-container {{#if eventProduct}}event-grid-image-container{{/if}}"> 9500 <div class="grid-image" style="background-image: {{#unless eventProduct}}-webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.03)),{{/unless}} url('{{image}}');" alt="{{name}}"></div> 9501 </div> 9502 </a> 9503 {{/if}} 9504 </text> 9505 9506 } 9507 9508 @helper RenderGridViewItemStickers() 9509 { 9510 <text> 9511 {{#StickersContainers}} 9512 {{>StickersContainer}} 9513 {{/StickersContainers}} 9514 </text> 9515 } 9516 9517 @helper RenderGridViewItemFavorites() 9518 { 9519 <div class="favorites favorites--for-grid-view u-pull--right {{favoriteProductFromImport}} dw-mod" {{favoriteProductFromImport}}> 9520 {{#Favorite}} 9521 {{>FavoriteTemplate}} 9522 {{/Favorite}} 9523 </div> 9524 } 9525 9526 @helper RenderGridViewItemInfoContainer(BlocksPage page) 9527 { 9528 List<Block> subBlocks = page.GetBlockListById("GridViewItemInfoContainer"); 9529 9530 <div class="grid__cell product-list__grid-item__price-info dw-mod"> 9531 @RenderBlockList(subBlocks) 9532 </div> 9533 } 9534 9535 @helper RenderGridViewItemTitle() 9536 { 9537 <a href="{{link}}" class="u-color-inherit" onclick="{{#if googleImpression}}googleEnchantImpressionClick({{googleImpression}}, event){{/if}}" title="{{name}}{{#if variantName}}, {{variantName}}{{/if}}"> 9538 <h6 class="u-condensed-text u-bold">{{{name}}}{{#if variantName}}, {{variantName}}{{/if}}</h6> 9539 </a> 9540 } 9541 9542 @helper RenderGridViewItemNumber() 9543 { 9544 <div class="item-number dw-mod">{{number}}</div> 9545 } 9546 9547 @helper RenderGridViewItemPrice(Dynamicweb.Frontend.ItemViewModel gridViewSettings) 9548 { 9549 int columnsCount = gridViewSettings.GetList("Columns") != null ? Converter.ToInt32(gridViewSettings.GetList("Columns").SelectedValue) : 4; 9550 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 9551 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 9552 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 9553 bool isPricesWithVATEnabled = Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 9554 9555 if (pointShopOnly) 9556 { 9557 <text> 9558 {{#if havePointPrice}} 9559 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 9560 @if (showCartButton) 9561 { 9562 <text> 9563 {{#unless canBePurchasedWithPoints}} 9564 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 9565 {{/unless}} 9566 </text> 9567 } 9568 {{else}} 9569 @Translate("Not available") 9570 {{/if}} 9571 </text> 9572 9573 } 9574 else 9575 { 9576 <div class="price price--product-list dw-mod">{{price}}</div> 9577 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 9578 if (showVATPrice) 9579 { 9580 <div class="vat-price vat-price--product-list u-margin-top dw-mod"> 9581 @if (columnsCount <= 4) 9582 { 9583 if (isPricesWithVATEnabled) 9584 { 9585 <span>@Translate("excl. VAT")</span><span> ({{priceWithoutVAT}})</span> 9586 } 9587 else 9588 { 9589 <span>@Translate("incl. VAT")</span><span> ({{priceWithVAT}})</span> 9590 } 9591 } 9592 else 9593 { 9594 if (isPricesWithVATEnabled) 9595 { 9596 <div>@Translate("excl. VAT")</div><div>({{priceWithoutVAT}})</div> 9597 } 9598 else 9599 { 9600 <div>@Translate("incl. VAT")</div><div>({{priceWithVAT}})</div> 9601 } 9602 } 9603 </div> 9604 } 9605 <text> 9606 {{#if priceRRP}} 9607 <div><small>@Translate("RRP") {{priceRRP}}</small></div> 9608 {{/if}} 9609 </text> 9610 } 9611 } 9612 9613 @helper RenderGridViewItemFooter(BlocksPage page, Dynamicweb.Frontend.ItemViewModel gridViewSettings) 9614 { 9615 List<Block> subBlocks = page.GetBlockListById("GridViewItemFooter"); 9616 bool showStaticVariants = gridViewSettings.GetBoolean("ShowStaticVariants"); 9617 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 9618 <div class="grid-footer"> 9619 <div class="product-list__grid-item__footer @footerClasses dw-mod u-padding-1px"> 9620 @RenderBlockList(subBlocks) 9621 </div> 9622 </div> 9623 } 9624 9625 @helper RenderGridViewItemViewButton(Dynamicweb.Frontend.ItemViewModel gridViewSettings) 9626 { 9627 string viewMoreText = gridViewSettings.GetString("ViewMoreText"); 9628 viewMoreText = !string.IsNullOrEmpty(viewMoreText) ? viewMoreText : "View"; 9629 9630 @Render(new Link 9631 { 9632 Href = "{{link}}", 9633 Id = "CartButton_{{id}}", 9634 Title = Translate(viewMoreText), 9635 OnClick = "{{#if googleImpression}}googleEnchantImpressionClick({{googleImpression}}, event){{/if}}", 9636 ButtonLayout = ButtonLayout.Secondary, 9637 CssClass = "u-no-margin" 9638 }); 9639 } 9640 9641 @helper RenderGridViewItemPricesAndAddToCart(Dynamicweb.Frontend.ItemViewModel gridViewSettings, int customerRatingHeartsPadding = 3) 9642 { 9643 int columnsCount = gridViewSettings.GetList("Columns") != null ? Converter.ToInt32(gridViewSettings.GetList("Columns").SelectedValue) : 4; 9644 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 9645 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 9646 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 9647 bool isPricesWithVATEnabled = Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 9648 9649 9650 <div class="grid"> 9651 <div class="grid__col-12 {{#if eventProduct}}event-{{/if}}title-container"> 9652 {{#unless eventProduct}} 9653 {{#unless RecommendationDisplayAsGrid}} 9654 <span class="area u-ta-center">{{producerName}}</span> 9655 {{/unless}} 9656 {{/unless}} 9657 {{#if isPickAndMixPage}} 9658 <h3 class="u-bold title js-title u-ta-center pmx-modal-trigger js-pmx-modal-trigger" data-product-id="{{productId}}">{{name}}</h3> 9659 {{else}} 9660 <a href="{{link}}" class="u-color-inherit" onclick="Scroll.SavePosition(event); {{#if googleImpression}}googleEnchantImpressionClick({{googleImpression}}, event){{/if}}" title="{{name}}"> 9661 <h3 class="u-bold title js-title u-ta-center">{{name}}</h3> 9662 </a> 9663 {{/if}} 9664 9665 {{#if eventProduct}} 9666 <p class="event-place"> 9667 {{eventRestaurantName}}, {{eventAddressShort}} 9668 <span class="event-time">{{eventDate}}, {{eventTime}}</span> 9669 </p> 9670 {{/if}} 9671 </div> 9672 </div> 9673 <text> 9674 {{#unless eventProduct}} 9675 {{#unless RecommendationDisplayAsGrid}} 9676 <div class="grid"> 9677 <div class="grid__col-12"> 9678 <div class="tags"> 9679 {{#if type}} 9680 {{#ifCond area "||" country}} 9681 <span class="tags__tag"> 9682 {{type}}, 9683 </span> 9684 {{else}} 9685 <span class="tags__tag"> 9686 {{type}} 9687 </span> 9688 {{/ifCond}} 9689 {{/if}} 9690 {{#if area}} 9691 {{#if country}} 9692 <span class="tags__tag">{{area}},</span> 9693 {{else}} 9694 <span class="tags__tag">{{area}}</span> 9695 {{/if}} 9696 {{/if}} 9697 {{#if country}} 9698 <span class="tags__tag">{{country}}</span> 9699 {{/if}} 9700 </div> 9701 </div> 9702 </div> 9703 {{/unless}} 9704 {{/unless}} 9705 </text> 9706 9707 <text> 9708 {{#if isAddToCartModal}} 9709 <div class="savings">@Translate("Smartpage:ProductList.Product.Save", "SPAR") <strong>{{savings}}</strong> @Translate("Smartpage:ProductList.Product.PerUnit", "PR. FL.")</div> 9710 {{/if}} 9711 </text> 9712 <div class="grid"> 9713 <div class="{{pricesSectionCol}}"> 9714 <div class="prices"> 9715 {{#unless eventProduct}} 9716 {{#unless isAddToCartModal}} 9717 {{#if bomItemSavings}} 9718 <div class="savings">@Translate("Smartpage:ProductList.Product.Save", "SPAR") <strong>{{bomItemSavingsFormatted}}</strong></div> 9719 {{else if savings}} 9720 <div class="savings">@Translate("Smartpage:ProductList.Product.Save", "SPAR") <strong>{{savings}}</strong> @Translate("Smartpage:ProductList.Product.PerUnit", "PR. FL.")</div> 9721 {{else}} 9722 {{/if}} 9723 {{/unless}} 9724 {{/unless}} 9725 <div class="price price--product-list dw-mod">{{price}}{{#if isSubscription}}@Translate("Smartpage:Checkout.PerMonth", "/md"){{/if}}</div> 9726 <div class="quantity-price"> 9727 {{#if isBomParent}} 9728 {{#if bomItemsTotalPriceNotZero}} 9729 <span class="u-block u-color-font-black quantity-price__amount"><strong><s>{{bomQuantityDescription}}</s></strong></span> 9730 {{else}} 9731 {{quantityDescription}} 9732 {{/if}} 9733 <div>{{pricePerBomItem}}</div> 9734 {{else}} 9735 {{quantityDescription}} 9736 {{/if}} 9737 </div> 9738 </div> 9739 </div> 9740 {{#if availableForPurchase}} 9741 {{#unless RecommendationDisplayAsGrid}} 9742 <div class="{{addToCartSectionCol}} add-to-cart"> 9743 <div class="grid u-justify-content--center {{#if isPickAndMixPage }}pmx-add-wrapper{{/if}}"> 9744 {{#unless disabledBuyButton}} 9745 {{#unless isPickAndMixPage}} 9746 {{#unless isSubscription}} 9747 <div class="grid__col-5 u-no-padding"> 9748 <input id="Quantity{{id}}" name="Quantity{{id}}" min="1" max="{{stockLevel}}" value="{{kolli}}" type="number" class="quantity dw-mod js-stockcheck js-change-quantity" data-max-order-quantity-rule-active="{{MaxOrderQuantityRuleActive}}"> 9749 </div> 9750 {{else}} 9751 <input id="Quantity{{id}}" name="Quantity{{id}}" min="1" value="1" type="hidden" class="dw-mod js-stockcheck js-change-quantity" data-max-order-quantity-rule-active="{{MaxOrderQuantityRuleActive}}"> 9752 {{/unless}} 9753 {{/unless}} 9754 {{/unless}} 9755 {{#if disabledBuyButton}} 9756 <div class="grid__col-12 u-no-padding"> 9757 <button class="btn btn--add-to-cart {{disabledBuyButton}}" title="@Translate("Smartpage:Product.Buy.OutOfStock", "Udsolgt")" onclick="Cart.AddToCart(event, { id: '{{productId}}', variantId: '{{variantid}}', unitId: '{{unitId}}', productInfo: {{productInfo}}, quantity: parseInt(document.getElementById('Quantity{{id}}').value), SpPrimeur: '{{isPrimeur}}'}); {{facebookPixelAction}}" type="button"> 9758 <span>@Translate("Smartpage:Product.Buy.OutOfStock", "Udsolgt")</span> 9759 </button> 9760 </div> 9761 {{/if}} 9762 {{#unless disabledBuyButton}} 9763 <div class="grid__col-7 u-no-padding"> 9764 {{#if isPickAndMixPage}} 9765 @{ 9766 string picknmixFeed = $"/Default.aspx?ID={GetPageIdByNavigationTag("picknmixfeedpage")}"; 9767 string pageId = Dynamicweb.Context.Current.Request["ID"]; 9768 9769 string productFeedUrl = $"/Default.aspx?ID={GetPageIdByNavigationTag("picknmix")}"; 9770 9771 productFeedUrl += "&MainProductId={prodIds}&feed=true&redirect=false"; 9772 } 9773 <div class="u-position-relative js-pmx-add-wrapper"> 9774 <button class="btn btn--add-to-cart add-to-pmx js-add-to-pmx {{#if quantityPickedPmx}} d-none {{/if}}" title="@HttpUtility.HtmlAttributeEncode(Translate("Smartpage:PickAndMix.Product.Buy", "Køb"))" data-currfeedurl="@productFeedUrl" data-id="{{productId}}" data-productname="{{name}}" data-maxquantity="{{stockLevel}}" data-method="add" data-feedurl="@picknmixFeed" type="button" data-currency-code="{{currency}}"> 9775 <span>@Translate("Smartpage:PickAndMix.Product.Buy", "Tilføj")</span> 9776 </button> 9777 <div class="js-pmx-add-remove-wrap pmx-add-remove-wrap {{#unless quantityPickedPmx}} d-none {{/unless}}"> 9778 <div class="action js-remove-from-pmx" data-currfeedurl="@productFeedUrl" data-id="{{productId}}" data-method="delete" data-feedurl="@picknmixFeed" data-currency-code="{{currency}}" data-index="0"> 9779 - 9780 </div> 9781 <input class="js-update-pmx" data-input-id="js-pmx-input{{productId}}" min="0" type="number" value="{{quantityPickedPmx}}" data-id="{{productId}}" data-maxquantity="{{stockLevel}}" data-method="update" data-productname="{{name}}" data-feedurl="@picknmixFeed" data-currency-code="{{currency}}" data-index="0" data-currfeedurl="@productFeedUrl" /> 9782 <div class="action js-add-to-pmx" data-maxquantity="{{stockLevel}}" data-productname="{{name}}" data-currfeedurl="@productFeedUrl" data-id="{{productId}}" data-method="add" data-feedurl="@picknmixFeed" data-currency-code="{{currency}}"> 9783 + 9784 </div> 9785 </div> 9786 </div> 9787 {{else}} 9788 <button class="btn btn--add-to-cart {{disabledBuyButton}}" title="@Translate("Smartpage:Product.Buy", "Køb")" onclick="Cart.AddToCart(event, { id: '{{productId}}', variantId: '{{variantid}}', unitId: '{{unitId}}', productInfo: {{productInfo}}, quantity: parseInt(document.getElementById('Quantity{{id}}').value), SpPrimeur: '{{isPrimeur}}' }); {{facebookPixelAction}}" type="button" data-product-id="{{productId}}" data-one-unit-price="{{oneUnitPrice}}" data-volume-unit-price="{{volumeUnitPrice}}" data-volume-unit-threshold="{{kolli}}" data-currency-code="{{currency}}"> 9789 <span>@Translate("Smartpage:Product.Buy", "Køb")</span> 9790 </button> 9791 {{/if}} 9792 </div> 9793 {{/unless}} 9794 </div> 9795 </div> 9796 {{/unless}} 9797 {{/if}} 9798 {{#if primeurDeliveryDate}} 9799 <div class="grid__col-12 incoming-primeur-date"> 9800 <div class="incoming-primeur-date__date"> 9801 {{ primeurDeliveryDate }} 9802 </div> 9803 </div> 9804 {{/if}} 9805 {{#if bomSoldOutMessage}} 9806 <div class="grid__col-12 sold-out-message-container"> 9807 <div class="sold-out-message"> 9808 <span class="message">{{ bomSoldOutMessage }}</span> 9809 </div> 9810 </div> 9811 {{/if}} 9812 </div> 9813 } 9814 9815 @helper RenderGridViewItemActions(Dynamicweb.Frontend.ItemViewModel gridViewSettings, int customerRatingHeartsPadding = 2) 9816 { 9817 if (Dynamicweb.Rapido.Services.User.IsBuyingAllowed()) 9818 { 9819 @RenderGridViewItemPricesAndAddToCart(gridViewSettings, customerRatingHeartsPadding) 9820 } 9821 } 9822 @using Dynamicweb 9823 @using Dynamicweb.Rapido.Blocks.Components.General 9824 @using Dynamicweb.Rapido.Blocks 9825 @using Smartpage.Relewise.Services.Models 9826 9827 @functions{ 9828 BlocksPage productRecommendationSliderBlock = new BlocksPage(); 9829 Dynamicweb.Frontend.ItemViewModel gridViewSettingsRecommendationSlider = null; 9830 } 9831 9832 @helper RenderRecommendationSlider(Smartpage.Relewise.Services.Models.RecommendationItem recommendationItem, int preloaderElementsAmount = 0) 9833 { 9834 string marginStyle = "style='margin-top: 2rem; margin-bottom: 2rem;'"; 9835 9836 <div class="@recommendationItem.GridClasses" @(recommendationItem.HideMargin ? string.Empty : marginStyle)> 9837 @RenderRecommendationSliderColumns(recommendationItem, preloaderElementsAmount) 9838 </div> 9839 } 9840 9841 @helper RenderRecommendationSliderColumns(RecommendationItem recommendationItem, int preloaderElementsAmount) 9842 { 9843 <div class="@recommendationItem.ColClasses js-product-slider-item @(recommendationItem.DisplayAsGrid ? "recommendations-grid-view-container" : "")"> 9844 @if (!string.IsNullOrEmpty(recommendationItem.Headline)) 9845 { 9846 string centerClass = recommendationItem.CenterHeadline ? "u-ta-center" : ""; 9847 string fontColor = !string.IsNullOrEmpty(recommendationItem.HeadlineColor) ? recommendationItem.HeadlineColor : ""; 9848 <h2 class="@centerClass" style="color: @fontColor">@recommendationItem.Headline</h2> 9849 } 9850 9851 9852 9853 @if (!string.IsNullOrEmpty(recommendationItem.APIRoute)) 9854 { 9855 9856 gridViewSettingsRecommendationSlider = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView"); 9857 9858 string feedUrl = recommendationItem.GetUrl(GetPageIdByNavigationTag("ProductsPageNoFacets")); 9859 9860 Block gridViewItem = new Block 9861 { 9862 Id = "GridViewItem", 9863 SortId = 10, 9864 Template = RenderGridViewItem(productRecommendationSliderBlock), 9865 SkipRenderBlocksList = true, 9866 BlocksList = new List<Block> { 9867 new Block 9868 { 9869 Id = "GridViewItemHiddenProperties", 9870 SortId = 10, 9871 Template = RenderGridViewItemHiddenProperties() 9872 }, 9873 new Block 9874 { 9875 Id = "GridViewItemImageContainer", 9876 SortId = 20, 9877 SkipRenderBlocksList = true, 9878 Template = RenderGridViewItemImageContainer(productRecommendationSliderBlock), 9879 BlocksList = new List<Block> 9880 { 9881 new Block 9882 { 9883 Id = "GridViewItemImage", 9884 SortId = 10, 9885 Template = RenderGridViewItemImage() 9886 } 9887 } 9888 }, 9889 new Block 9890 { 9891 Id = "GridViewItemFooter", 9892 SortId = 40, 9893 SkipRenderBlocksList = true, 9894 Template = RenderGridViewItemFooter(productRecommendationSliderBlock, gridViewSettingsRecommendationSlider), 9895 BlocksList = new List<Block> { 9896 new Block 9897 { 9898 Id = "GridViewItemActions", 9899 SortId = 10, 9900 Template = RenderGridViewItemActions(gridViewSettingsRecommendationSlider, 2) 9901 } 9902 } 9903 } 9904 } 9905 }; 9906 9907 productRecommendationSliderBlock.Add(gridViewItem); 9908 9909 string swiperPrevButtonClass = recommendationItem.Id + "_SwiperButtonPrev"; 9910 string swiperNextButtonClass = recommendationItem.Id + "_SwiperButtonNext"; 9911 bool isCartPage = Pageview.ID == GetPageIdByNavigationTag("CartPage"); 9912 9913 <div class="js-handlebars-root-async grid" id="@recommendationItem.Id" data-template="@("ProductContainer_" + recommendationItem.Id)" data-json-feed="@feedUrl"></div> 9914 <div class="@(recommendationItem.DisplayAsGrid ? "recommendations-grid-view-preloader recommendations-grid-view-preloader--loading" : "product-slider-preloader product-slider-preloader--loading") js-product-slider-preloader"> 9915 @for (int i = 0; i < preloaderElementsAmount; i++) 9916 { 9917 <div class="product-slider-preloader-element @(isCartPage ? "is-cart-page" : "")"></div> 9918 } 9919 </div> 9920 9921 9922 <script id="@("ProductContainer_" + recommendationItem.Id)" type="text/x-template"> 9923 <div class="swiper-container js-product-slider-container product-slider-container @recommendationItem.Id @(!recommendationItem.DisplayAsGrid ? recommendationItem.SwiperContainerClasses : "js-recommendations-deactivate-slider")" data-swiper-config="@recommendationItem.GetLayout()"> 9924 {{#each .}} 9925 <div class="swiper-wrapper @(recommendationItem.DisplayAsGrid ? "recommendations-grid-wrapper" : "")"> 9926 {{#each ProductsContainer}} 9927 <div id="Product{{id}}" data-template="GridViewItem" data-preloader="overlay" class="product-list__grid-item dw-mod js-product-list-product product-list-product swiper-slide product-slider-grid-view-item"> 9928 {{#each Product}} 9929 {{>GridViewItem}} 9930 {{/each}} 9931 </div> 9932 {{/each}} 9933 </div> 9934 <div class="swiper-pagination"></div> 9935 {{/each}} 9936 </div> 9937 @if (!recommendationItem.DisplayAsGrid) 9938 { 9939 <div id="@swiperPrevButtonClass" class="swiper-button-prev"></div> 9940 <div id="@swiperNextButtonClass" class="swiper-button-next"></div> 9941 } 9942 </script> 9943 9944 @RenderBlockList(productRecommendationSliderBlock.BlocksRoot.BlocksList) 9945 9946 <script id="ProductPreRenderContainer" type="text/x-template"> 9947 <div class="grid__col-auto"> 9948 <div class="pre-render-element pre-render-element--lg" style="height: 570px;"></div> 9949 </div> 9950 </script> 9951 9952 <script id="StickersContainer" type="text/x-template"> 9953 <div class="stickers-container stickers-container--{{{convertStickerPositionToClassName Position}}} dw-mod"> 9954 {{#Stickers}} 9955 {{>Sticker}} 9956 {{/Stickers}} 9957 </div> 9958 </script> 9959 9960 <script id="Sticker" type="text/x-template"> 9961 @Render(new Sticker { Title = "{{Title}}", CssClass = "{{CssClass}}" }) 9962 </script> 9963 } 9964 9965 </div> 9966 } 9967 9968 @{ 9969 string addToCartNotificationType = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 9970 string addToCartNotificationMiniCartLayout = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout").SelectedValue : "dropdown"; 9971 bool addToCartHideCartIcon = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 9972 9973 string id = "RecommendationsAddToCartSlider"; 9974 var recommendationItem = new RecommendationItem() 9975 { 9976 Id = id, 9977 CenterHeadline = true, 9978 Headline = Translate("Smartpage.ProductSlider.Recommendations.Headline." + id, "Andre købte også"), 9979 Label = "Anbefalinger Powerstep", 9980 Limit = "20", 9981 APIRoute = "PurchasedWithProduct", 9982 NumberOfSlides = 3, 9983 Layout = RecommendationItem.SliderLayout.PowerStep, 9984 GridClasses = "grid u-full-height grid--justify-center", 9985 ColClasses = "grid__col-12 u-no-padding", 9986 HideMargin = true 9987 }; 9988 9989 if (Dynamicweb.Rapido.Services.User.IsBuyingAllowed() && !string.IsNullOrEmpty(addToCartNotificationType)) 9990 { 9991 if (addToCartNotificationType == "modal") 9992 { 9993 Block addToCartNotificationModal = new Block 9994 { 9995 Id = "AddToCartNotificationModal", 9996 Template = RenderAddToCartNotificationModal() 9997 }; 9998 9999 Block addToCartNotificationScript = new Block 10000 { 10001 Id = "AddToCartNotificationScript", 10002 Template = RenderAddToCartNotificationModalScript(recommendationItem) 10003 }; 10004 10005 Block freightMeterScript = new Block 10006 { 10007 Id = "FreightMeterScript", 10008 Template = RenderFreightMeterScript() 10009 }; 10010 10011 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 10012 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 10013 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", freightMeterScript); 10014 } 10015 else if (addToCartNotificationType == "toggle" && addToCartNotificationMiniCartLayout != "none" && !addToCartHideCartIcon) 10016 { 10017 Block addToCartNotificationScript = new Block 10018 { 10019 Id = "AddToCartNotificationScript", 10020 Template = RenderAddToCartNotificationToggleScript() 10021 }; 10022 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 10023 } 10024 } 10025 10026 } 10027 10028 10029 @helper RenderAddToCartNotificationModal() 10030 { 10031 <div id="LastAddedProductModal" class="last-added-product-modal" data-template="LastAddedProductTemplate"></div> 10032 } 10033 10034 @helper RenderAddToCartNotificationModalScript(RecommendationItem recommendationItem) 10035 { 10036 int cartPageId = GetPageIdByNavigationTag("CartPage"); 10037 <script id="LastAddedProductTemplate" type="text/x-template"> 10038 @{ 10039 10040 Modal lastAddedProduct = new Modal 10041 { 10042 Id = "LastAddedProduct", 10043 Width = ModalWidth.Lg, 10044 BodyTemplate = Pageview.Device.ToString() == "Mobile" ? RenderMobileModalContent(recommendationItem) : RenderModalContent(recommendationItem), 10045 OnClose = "window.scrollLockDisable();" 10046 }; 10047 10048 @Render(lastAddedProduct) 10049 } 10050 </script> 10051 10052 int miniCartPageId = GetPageIdByNavigationTag("MiniCartFeed"); 10053 string feedUrl = "/Default.aspx?ID=" + miniCartPageId; 10054 <script> 10055 document.addEventListener('addToCart', function (event) { 10056 if (event.detail.lineNotAddedNotification != null) { 10057 showCartLineNotAddedModal(event.detail.lineNotAddedNotification); 10058 } else { 10059 // Show added to cart modal if not on carts page 10060 if (document.querySelector('.carts-page') == null) { 10061 Cart.ShowLastAddedProductModal(event.detail); 10062 HandlebarsBolt.UpdateContent('freightMeter', '@feedUrl'); 10063 } 10064 } 10065 }); 10066 10067 function closeModal(e) { 10068 if (e.classList.contains("js-toggle-last-added-product-modal")) { 10069 localStorage.setItem('LastAddedProductModalHidden', 'true'); 10070 var today = new Date(); 10071 var oneWeekFromNow = today.setDate(today.getDate() + 7); 10072 localStorage.setItem('LastAddedProductModal.ExpiresIn', JSON.stringify(oneWeekFromNow)); 10073 } 10074 10075 document.getElementById('LastAddedProductModalTrigger').checked = false; 10076 window.scrollLockDisable(); 10077 } 10078 </script> 10079 10080 string swiperPaginationClass = recommendationItem.Id + "_SwiperPagination"; 10081 string swiperPrevButtonClass = recommendationItem.Id + "_SwiperButtonPrev"; 10082 string swiperNextButtonClass = recommendationItem.Id + "_SwiperButtonNext"; 10083 10084 <script id="@("ProductContainer_" + recommendationItem.Id)" type="text/x-template"> 10085 <div class="@recommendationItem.GridClasses"> 10086 <div class="@recommendationItem.ColClasses"> 10087 <div class="recommendations"> 10088 <div id="@("SliderContainer_" + recommendationItem.Id)" class="swiper-container custom-swiper-container product-slider-container js-product-slider-container @recommendationItem.Id" data-swiper-config="@recommendationItem.GetLayout()"> 10089 {{#each .}} 10090 <div id="AddToCartRecommendations" class="swiper-wrapper powerstep"> 10091 {{#each ProductsContainer}} 10092 <div id="Product{{id}}" data-template="GridViewItem" data-preloader="overlay" class="product-list__grid-item dw-mod swiper-slide product-slider-grid-view-item product-card js-product-grid-item" data-product-id="{{productId}}"> 10093 {{#each Product}} 10094 {{>GridViewItem}} 10095 {{/each}} 10096 </div> 10097 {{/each}} 10098 </div> 10099 {{/each}} 10100 <div class="swiper-pagination @swiperPaginationClass"></div> 10101 </div> 10102 <div id="@swiperPrevButtonClass" class="swiper-button-prev"></div> 10103 <div id="@swiperNextButtonClass" class="swiper-button-next"></div> 10104 </div> 10105 </div> 10106 </div> 10107 </script> 10108 10109 } 10110 10111 @helper RenderModalContent(RecommendationItem recommendationItem) 10112 { 10113 int cartPageId = GetPageIdByNavigationTag("CartPage"); 10114 int miniCartPageId = GetPageIdByNavigationTag("MiniCartFeed"); 10115 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 10116 10117 <div class="grid added-to-cart-section"> 10118 <div class="added-to-cart u-flex u-no-padding u-flex--align-center u-justify-content--center grid grid__col-12 u-flex--row"> 10119 <h3 class="grid__col-12 grid--justify-center added-to-cart-text">@RenderCheckmark() @Translate("Smartpage:LastAddedProductModal.AddedToCart", "Tilføjet til kurven")</h3> 10120 @if (activateFreightMeter) 10121 { 10122 <div class="js-handlebars-root freight-meter" id="freightMeter" data-template="FreightMeter" data-json-feed="/Default.aspx?ID=@miniCartPageId" data-preloader="none"></div> 10123 } 10124 <div class="product-image-container grid__col-1"> 10125 {{#if EcomOrderLineFieldInput_SpPickAndMixGroupId1}} 10126 @Render(new Image { Path = "Admin/Public/GetImage.ashx?Width=115&Height=115&Crop=5&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/philipsonwine/pickandmix/Kasse.png", Title = Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse"), DisableImageEngine = true, CssClass = "product-image" }) 10127 {{else}} 10128 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["ProductId"])) 10129 { 10130 @Render(new Image { Path = "{{ productInfo.image }}", Link = "{{ productInfo.link }}", Title = "{{ productInfo.name }}", DisableImageEngine = true, CssClass = "product-image" }) 10131 } 10132 else 10133 { 10134 @Render(new Image { Path = "{{ productInfo.addToCartModalImage }}", Link = "{{ productInfo.link }}", Title = "{{ productInfo.name }}", DisableImageEngine = true, CssClass = "product-image" }) 10135 } 10136 {{/if}} 10137 </div> 10138 <div class="grid__col-5"> 10139 <div class="u-flex u-flex--column"> 10140 {{#if EcomOrderLineFieldInput_SpPickAndMixGroupId1}} 10141 <div>@Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse")</div> 10142 {{else}} 10143 <div class="u-margin-right added-to-cart-quantity">{{quantity}} <span class="u-lowercase">{{unitId}}</span></div> 10144 {{#if productInfo.name}} 10145 <div class="powerstep-product-name">{{productInfo.name}}</div> 10146 {{else}} 10147 <div>{{name}}</div> 10148 {{/if}} 10149 {{#if productInfo.variantName}} 10150 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 10151 {{/if}} 10152 {{#if productInfo.unitName}} 10153 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 10154 {{/if}} 10155 {{/if}} 10156 </div> 10157 </div> 10158 <div class="grid__col-6 u-full-height"> 10159 <div class="u-full-width u-flex u-flex--row buttons"> 10160 @Render(new Button 10161 { 10162 ButtonType = ButtonType.Button, 10163 ButtonLayout = ButtonLayout.Secondary, 10164 Title = HttpUtility.HtmlAttributeEncode(Translate("Smartpage:LastAddedProductModal.ContinueShopping", "Shop videre")), 10165 CssClass = "u-pull--left u-no-margin btn-continue-shopping u-margin-right--lg white-button", 10166 OnClick = "closeModal(this)" 10167 }) 10168 @Render(new Link 10169 { 10170 Href = "/Default.aspx?ID=" + cartPageId, 10171 ButtonLayout = ButtonLayout.Primary, 10172 CssClass = "u-pull--right u-no-margin btn-go-to-checkout", 10173 Title = HttpUtility.HtmlAttributeEncode(Translate("Smartpage:LastAddedProductModal.GoToCart", "Gå til kurven")), 10174 OnClick = "closeModal(this)" 10175 }) 10176 </div> 10177 <button onclick="closeModal(this)" class="dont-show-again u-align-content-left u-font-size--xs js-toggle-last-added-product-modal"> 10178 @Translate("Smartpage:LastAddedProductModal.DontShowAgain", "Vis ikke igen") 10179 </button> 10180 </div> 10181 </div> 10182 </div> 10183 10184 <div> 10185 {{#if productInfo.hasCustomAddToCartModal}} 10186 <div class="custom-add-to-cart-modal-message"> 10187 <div> 10188 <p>{{{productInfo.customModalMessage}}}</p> 10189 </div> 10190 </div> 10191 {{else}} 10192 <div class="others-bought-section"> 10193 @RenderModalSubheading(recommendationItem) 10194 </div> 10195 {{/if}} 10196 </div> 10197 } 10198 10199 @helper RenderMobileModalContent(RecommendationItem recommendationItem) 10200 { 10201 int cartPageId = GetPageIdByNavigationTag("CartPage"); 10202 int miniCartPageId = GetPageIdByNavigationTag("MiniCartFeed"); 10203 bool activateFreightMeter = Dynamicweb.Frontend.PageView.Current().AreaSettings.GetItem("Custom").GetBoolean("ActivateFreightMeter"); 10204 10205 <div class="grid grid--align-center grid--justify-center added-to-cart-section"> 10206 <div class="added-to-cart u-flex u-no-padding u-flex--align-center u-justify-content--center grid__col-12 grid u-flex--row"> 10207 <div class="grid"> 10208 <h3 class="added-to-cart-text grid__col-12"> @RenderCheckmark() @Translate("Smartpage:LastAddedProductModal.AddedToCart", "Tilføjet til kurven")</h3> 10209 @if (activateFreightMeter) 10210 { 10211 <div class="js-handlebars-root freight-meter" id="freightMeter" data-template="FreightMeter" data-json-feed="/Default.aspx?ID=@miniCartPageId" data-preloader="none"></div> 10212 } 10213 <div class="product-image-container grid__col-2"> 10214 {{#if EcomOrderLineFieldInput_SpPickAndMixGroupId1}} 10215 @Render(new Image { Path = "Admin/Public/GetImage.ashx?Width=115&Height=115&Crop=5&DoNotUpscale=True&FillCanvas=False&Image=/Files/Images/philipsonwine/pickandmix/Kasse.png", Title = Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse"), DisableImageEngine = true, CssClass = "product-image" }) 10216 {{else}} 10217 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["ProductId"])) 10218 { 10219 @Render(new Image { Path = "{{ productInfo.image }}", Link = "{{ productInfo.link }}", Title = "{{ productInfo.name }}", DisableImageEngine = true, CssClass = "product-image" }) 10220 } 10221 else 10222 { 10223 @Render(new Image { Path = "{{ productInfo.addToCartModalImage }}", Link = "{{ productInfo.link }}", Title = "{{ productInfo.name }}", DisableImageEngine = true, CssClass = "product-image" }) 10224 } 10225 {{/if}} 10226 </div> 10227 <div class="u-flex u-flex--column grid--justify-center grid__col-10"> 10228 {{#if EcomOrderLineFieldInput_SpPickAndMixGroupId1}} 10229 <div>@Translate("Smartpage:Checkout.PMXCart.Name", "Din egen vinkasse")</div> 10230 {{else}} 10231 <div class="u-margin-right added-to-cart-quantity">{{quantity}} <span class="u-lowercase">{{unitId}}</span></div> 10232 {{#if productInfo.name}} 10233 <div class="powerstep-product-name">{{productInfo.name}}</div> 10234 {{else}} 10235 <div>{{name}}</div> 10236 {{/if}} 10237 {{#if productInfo.variantName}} 10238 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 10239 {{/if}} 10240 {{#if productInfo.unitName}} 10241 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 10242 {{/if}} 10243 {{/if}} 10244 </div> 10245 </div> 10246 </div> 10247 </div> 10248 10249 <div> 10250 {{#if productInfo.hasCustomAddToCartModal}} 10251 <div class="custom-add-to-cart-modal-message"> 10252 <div> 10253 <p>{{{productInfo.customModalMessage}}}</p> 10254 </div> 10255 </div> 10256 {{else}} 10257 <div class="others-bought-section"> 10258 @RenderModalSubheading(recommendationItem) 10259 </div> 10260 {{/if}} 10261 </div> 10262 10263 <div class="grid__col-12 grid--justify-center u-no-padding bottom-actions"> 10264 <div class="u-flex u-flex--row buttons"> 10265 @Render(new Button 10266 { 10267 ButtonType = ButtonType.Button, 10268 ButtonLayout = ButtonLayout.Secondary, 10269 Title = HttpUtility.HtmlAttributeEncode(Translate("Smartpage:LastAddedProductModal.ContinueShopping", "Shop videre")), 10270 CssClass = "u-pull--left u-no-margin btn-continue-shopping u-margin-right--lg white-button", 10271 OnClick = "closeModal(this)" 10272 }) 10273 @Render(new Link 10274 { 10275 Href = "/Default.aspx?ID=" + cartPageId, 10276 ButtonLayout = ButtonLayout.Primary, 10277 CssClass = "u-pull--right u-no-margin btn-go-to-checkout", 10278 Title = HttpUtility.HtmlAttributeEncode(Translate("Smartpage:LastAddedProductModal.GoToCart", "Gå til kurven")), 10279 OnClick = "closeModal(this)" 10280 }) 10281 </div> 10282 10283 <button onclick="closeModal(this)" class="dont-show-again u-align-content-left u-font-size--xs js-toggle-last-added-product-modal"> 10284 @Translate("Smartpage:LastAddedProductModal.DontShowAgain", "Vis ikke igen") 10285 </button> 10286 </div> 10287 } 10288 10289 @helper RenderFreightMeterScript() 10290 { 10291 <script id="FreightMeter" type="text/x-template"> 10292 {{#.}} 10293 <div class="freight-message {{powerstepFreightMessageCssClass}}"> 10294 {{powerstepFreightMessage}} 10295 10296 {{#unless powerstepFreightMessageCssClass}} 10297 <span class="u-bold">@Translate("Smartpage:LastAddedProductModal.FreeFreight", "fri fragt")</span> 10298 {{/unless}} 10299 </div> 10300 <div class="progress-bar-container"> 10301 <div class="progress-bar-indicator" style="width:{{percentageFreeFreight}}%"></div> 10302 </div> 10303 {{/.}} 10304 </script> 10305 } 10306 10307 @{ 10308 10309 string cartPageId = GetPageIdByNavigationTag("CartPage").ToString(); 10310 10311 if (Dynamicweb.Context.Current.Items["Smartpage:LineAdjusted"] != null) 10312 { 10313 var lineAdjustedNotification = Dynamicweb.Context.Current.Items["Smartpage:LineAdjusted"] as List<LineAdjusted>; 10314 10315 <input type="checkbox" id="CartLineAdjustedModalTrigger" class="modal-trigger" checked> 10316 <div class="modal-container"> 10317 <label class="modal-overlay"></label> 10318 <div class="modal modal--lg modal-height--auto" id="CartLineAdjustedModal"> 10319 @foreach (LineAdjusted lineAdjusted in lineAdjustedNotification) 10320 { 10321 <div class="modal__header u-fs-18"> 10322 <div class="u-ta-center"> 10323 <strong><span class="u-underline"><span class="js-product-name">@lineAdjusted.ProductName</span>@Translate("Smartpage:CartLineAdjustedModal.AdjustedNotification", " kan ikke købes i det ønskede antal.")</span></strong> 10324 </div> 10325 </div> 10326 <div class="modal__body"> 10327 <div class="grid grid--justify-center"> 10328 <div class="grid__col-12 grid__col-lg-4-auto"> 10329 <div class="u-ta-center js-text-description u-margin-bottom"> 10330 <span>@String.Format(Translate("Smartpage:CartLineAdjustedModal.NewStock", "Der er desværre kun {0} stk. tilbage."), lineAdjusted.NewQuantity)</span><br /> 10331 </div> 10332 </div> 10333 </div> 10334 </div> 10335 10336 10337 } 10338 <a href="Default.aspx?ID=@cartPageId" class="modal__close-btn u-margin-top-5" onclick="document.getElementById('CartLineAdjustedModalTrigger').checked = false;"></a> 10339 10340 <div class="grid"> 10341 <div class="grid__col-12-auto u-flex--row u-justify-content--center"> 10342 <div class="grid__col-6-auto"> 10343 <a href="Default.aspx?ID=@cartPageId" class="btn btn--secondary u-no-margin--bottom dw-mod js-dismiss-modal" onclick="document.getElementById('CartLineAdjusteddModalTrigger').checked = false;">@Translate("Smartpage:CartLineAdjustedModal.Back", "Tilbage til kurv")</a> 10344 </div> 10345 </div> 10346 </div> 10347 </div> 10348 </div> 10349 10350 } 10351 10352 if (Dynamicweb.Context.Current.Items["Smartpage:RemovedInactiveLine"] != null) 10353 { 10354 var lineRemovedNotification = Dynamicweb.Context.Current.Items["Smartpage:RemovedInactiveLine"] as List<LineRemoved>; 10355 10356 <input type="checkbox" id="CartLineRemovedModalTrigger" class="modal-trigger" checked> 10357 <div class="modal-container"> 10358 <label class="modal-overlay"></label> 10359 <div class="modal modal--lg modal-height--auto" id="CartLineRemovedModal"> 10360 @foreach (LineRemoved lineRemoved in lineRemovedNotification) 10361 { 10362 string reason = lineRemoved.ReasonDescription == "NotInStock" ? "Varen er desværre blevet udsolgt i mellemtiden." : "Der er sket en fejl."; 10363 10364 <div class="modal__header u-fs-18"> 10365 <div class="u-ta-center"> 10366 <strong><span class="u-underline"><span class="js-product-name">@lineRemoved.ProductName</span>@Translate("Smartpage:CartLineRemovedModal.IsRemovedNotifacation", " er blevet fjernet fra kurven")</span></strong> 10367 </div> 10368 </div> 10369 <div class="modal__body"> 10370 <div class="grid grid--justify-center"> 10371 <div class="grid__col-12 grid__col-lg-4-auto"> 10372 <div class="u-ta-center js-text-description u-margin-bottom"> 10373 <span>@Translate("Smartpage:CartLineRemoval.CouldNotAdd", "Kunne ikke tilføje")</span> @lineRemoved.ProductName <br /> 10374 <span>@Translate("Smartpage:CartLineRemoval.Reason." + reason, reason)</span> 10375 </div> 10376 </div> 10377 </div> 10378 </div> 10379 10380 10381 <a href="Default.aspx?ID=@cartPageId" class="modal__close-btn u-margin-top-5" onclick="document.getElementById('CartLineRemovedModalTrigger').checked = false;"></a> 10382 } 10383 <div class="grid"> 10384 <div class="grid__col-12-auto u-flex--row u-justify-content--center"> 10385 <div class="grid__col-6-auto"> 10386 <a href="Default.aspx?ID=@cartPageId" class="btn btn--secondary u-no-margin--bottom dw-mod js-dismiss-modal" onclick="document.getElementById('CartLineRemovedModalTrigger').checked = false;">@Translate("Smartpage:CartLineRemovedModal.OK", "OK")</a> 10387 </div> 10388 </div> 10389 </div> 10390 </div> 10391 </div> 10392 10393 } 10394 10395 } 10396 10397 @helper RenderModalSubheading(RecommendationItem recommendationItem) 10398