XO-FLOW

Digital og intuitiv som ingen anden unit

XO FLOW er en ny digital dentalunit med workflowvejledning, dental-apps, indbygget computer, netværksforbindelse og andre nye, digitale funktioner, som ikke er set før inden for odontologien.

XO FLOW er forsynet med to nyskabelser:

Dashboard: Et fingerbetjent grafisk brugerinterface integreret i instrumentbroen, som både tandlæge og klinikassistent bruger til at styre alle funktioner – uden at miste fokus på patienten.
Navigator: En touchscreen med dental-apps til at indstille unitten og integrere med andre enheder og software-løsninger i et netværk.

Derudover får du:

  • med kun ét klik adgang til instrument-indstillinger, hvor alle instrumentparametre er optimeret til den enkelte opgave
  • instrument-workflows til fx hærdning af kompositfyldninger og præparation af rodkanaler med optimale instrumentindstillinger i hvert trin
  • en unit der er let at forstå og bruge
  • flerbrugerløsning, hvor hver bruger har adgang til sine egne indstillinger fra alle units i et netværk
  • integration med softwareløsninger og andre enheder i et netværk – fx elektroniske patientjournaler ergonomisk design og en indbygget ergonomiguide
  • pladsbesparende design
  • modulær teknik
  • lavere serviceudgifter
  • maksimal oppetid
  • 20 års levetid

Red Dot vinder 2021 i kategorierne “Medical Devices and Technology” og “Innovative products”.

Error executing template "Designs/Rapido/ContentPage/Paragraph/Carousel.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_06516bb2299041d5926713a19ab51ec8.<>c__DisplayClass46_0.<RenderTheSlide>b__0(TextWriter __razor_helper_writer) in E:\dynamicweb.net\Solutions\staging.nordenta.dk\Application\Files\Templates\Designs\Rapido\ContentPage\Paragraph\Carousel.cshtml:line 2215
   at CompiledRazorTemplates.Dynamic.RazorEngine_06516bb2299041d5926713a19ab51ec8.Execute() in E:\dynamicweb.net\Solutions\staging.nordenta.dk\Application\Files\Templates\Designs\Rapido\ContentPage\Paragraph\Carousel.cshtml:line 2194
   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()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Frontend 3 @using Dynamicweb.Rapido.Blocks.Components 4 @using Dynamicweb.Rapido.Blocks.Components.General 5 @using Dynamicweb.Content 6 @using Dynamicweb.Content.Items 7 @using Dynamicweb 8 9 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 10 @using Dynamicweb.Frontend 11 12 @* Include the components *@ 13 @using System.Text.RegularExpressions 14 @using System.Collections.Generic 15 @using System.Reflection 16 @using System.Web 17 @using System.Web.UI.HtmlControls 18 @using Dynamicweb.Rapido.Blocks.Components 19 @using Dynamicweb.Rapido.Blocks.Components.Articles 20 @using Dynamicweb.Rapido.Blocks.Components.Documentation 21 @using Dynamicweb.Rapido.Blocks 22 23 24 @*--- START: Base block renderers ---*@ 25 26 @helper RenderBlockList(List<Block> blocks) 27 { 28 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 29 blocks = blocks.OrderBy(item => item.SortId).ToList(); 30 31 foreach (Block item in blocks) 32 { 33 if (debug) { 34 <!-- Block START: @item.Id --> 35 } 36 37 if (item.Design == null) 38 { 39 @RenderBlock(item) 40 } 41 else if (item.Design.RenderType == RenderType.None) { 42 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 43 44 <div class="@cssClass dw-mod"> 45 @RenderBlock(item) 46 </div> 47 } 48 else if (item.Design.RenderType != RenderType.Hide) 49 { 50 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 51 52 if (!item.SkipRenderBlocksList) { 53 if (item.Design.RenderType == RenderType.Row) 54 { 55 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 56 @RenderBlock(item) 57 </div> 58 } 59 60 if (item.Design.RenderType == RenderType.Column) 61 { 62 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 63 string size = item.Design.Size ?? "12"; 64 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 65 66 <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"> 67 @RenderBlock(item) 68 </div> 69 } 70 71 if (item.Design.RenderType == RenderType.Table) 72 { 73 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 74 @RenderBlock(item) 75 </table> 76 } 77 78 if (item.Design.RenderType == RenderType.TableRow) 79 { 80 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 81 @RenderBlock(item) 82 </tr> 83 } 84 85 if (item.Design.RenderType == RenderType.TableColumn) 86 { 87 <td class="@cssClass dw-mod" id="Block__@item.Id"> 88 @RenderBlock(item) 89 </td> 90 } 91 92 if (item.Design.RenderType == RenderType.CardHeader) 93 { 94 <div class="card-header @cssClass dw-mod"> 95 @RenderBlock(item) 96 </div> 97 } 98 99 if (item.Design.RenderType == RenderType.CardBody) 100 { 101 <div class="card @cssClass dw-mod"> 102 @RenderBlock(item) 103 </div> 104 } 105 106 if (item.Design.RenderType == RenderType.CardFooter) 107 { 108 <div class="card-footer @cssClass dw-mod"> 109 @RenderBlock(item) 110 </div> 111 } 112 } 113 else 114 { 115 @RenderBlock(item) 116 } 117 } 118 119 if (debug) { 120 <!-- Block END: @item.Id --> 121 } 122 } 123 } 124 125 @helper RenderBlock(Block item) 126 { 127 bool debug = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("debug")) ? Convert.ToBoolean(HttpContext.Current.Request.QueryString.Get("debug")) : false; 128 129 if (item.Template != null) 130 { 131 @BlocksPage.RenderTemplate(item.Template) 132 } 133 134 if (item.Component != null) 135 { 136 string customSufix = "Custom"; 137 string methodName = item.Component.HelperName; 138 139 ComponentBase[] methodParameters = new ComponentBase[1]; 140 methodParameters[0] = item.Component; 141 Type methodType = this.GetType(); 142 143 MethodInfo customMethod = methodType.GetMethod(methodName + customSufix); 144 MethodInfo generalMethod = methodType.GetMethod(methodName); 145 146 try { 147 if (debug) { 148 <!-- Component: @methodName.Replace("Render", "") --> 149 } 150 @customMethod.Invoke(this, methodParameters).ToString(); 151 } catch { 152 try { 153 @generalMethod.Invoke(this, methodParameters).ToString(); 154 } catch(Exception ex) { 155 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked", ex); 156 } 157 } 158 } 159 160 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 161 { 162 @RenderBlockList(item.BlocksList) 163 } 164 } 165 166 @*--- END: Base block renderers ---*@ 167 168 @using Dynamicweb.Rapido.Blocks.Components 169 @using Dynamicweb.Rapido.Blocks.Components.General 170 @using Dynamicweb.Rapido.Blocks 171 @using System.IO 172 173 @* Required *@ 174 @using Dynamicweb.Rapido.Blocks.Components 175 @using Dynamicweb.Rapido.Blocks.Components.General 176 @using Dynamicweb.Rapido.Blocks 177 178 179 @helper Render(ComponentBase component) 180 { 181 if (component != null) 182 { 183 @component.Render(this) 184 } 185 } 186 187 @* Components *@ 188 @using System.Reflection 189 @using Dynamicweb.Rapido.Blocks.Components.General 190 191 192 @* Component *@ 193 194 @helper RenderIcon(Icon settings) 195 { 196 if (settings != null) 197 { 198 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 199 200 if (settings.Name != null) 201 { 202 if (string.IsNullOrEmpty(settings.Label)) 203 { 204 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 205 } 206 else 207 { 208 if (settings.LabelPosition == IconLabelPosition.Before) 209 { 210 <div class="u-flex u-flex--align-items-center @settings.CssClass">@settings.Label <i class="@settings.Prefix @settings.Name u-margin-left" @color></i></div> 211 } 212 else 213 { 214 <div class="@settings.CssClass"><i class="@settings.Prefix @settings.Name u-margin-right--lg u-w20px" @color></i>@settings.Label</div> 215 } 216 } 217 } 218 else if (!string.IsNullOrEmpty(settings.Label)) 219 { 220 @settings.Label 221 } 222 } 223 } 224 @using System.Reflection 225 @using Dynamicweb.Rapido.Blocks.Components.General 226 @using Dynamicweb.Rapido.Blocks.Components 227 @using Dynamicweb.Core 228 229 @* Component *@ 230 231 @helper RenderButton(Button settings) 232 { 233 if (settings != null && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 234 { 235 Dictionary<string, string> attributes = new Dictionary<string, string>(); 236 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 237 if (settings.Disabled) 238 { 239 attributes.Add("disabled", "true"); 240 classList.Add("disabled"); 241 } 242 if (settings.Id == "ExpressBuyProductButton") 243 { 244 245 settings.Id = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 246 settings.ConfirmTitle = Translate("Out of stock"); 247 settings.ConfirmText = Translate("Product is out of stock?"); 248 Button secondPopupSettings = new Button() 249 { 250 Id = settings.Id + "incart", 251 OnClick = settings.OnClick, 252 ConfirmTitle = Translate("Product in cart!"), 253 ConfirmText = Translate("Are you sure that you want to add more products?") 254 255 }; 256 257 @RenderConfirmDialog(settings); 258 @RenderConfirmDialog(secondPopupSettings); 259 settings.OnClick = "expressBuyAddToCart(event)"; 260 } 261 else 262 { 263 if (!string.IsNullOrEmpty(settings.ConfirmText) || !string.IsNullOrEmpty(settings.ConfirmTitle)) 264 { 265 settings.Id = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 266 @RenderConfirmDialog(settings); 267 settings.OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = true"; 268 } 269 } 270 271 272 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 273 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 274 if (!string.IsNullOrEmpty(settings.AltText)) 275 { 276 attributes.Add("title", settings.AltText); 277 } 278 else if (!string.IsNullOrEmpty(settings.Title)) 279 { 280 attributes.Add("title", settings.Title); 281 } 282 283 var onClickEvents = new List<string>(); 284 if (!string.IsNullOrEmpty(settings.OnClick)) 285 { 286 onClickEvents.Add(settings.OnClick); 287 } 288 if (!string.IsNullOrEmpty(settings.Href)) 289 { 290 onClickEvents.Add("location.href='" + settings.Href + "'"); 291 } 292 if (onClickEvents.Count > 0) 293 { 294 attributes.Add("onClick", string.Join(";", onClickEvents)); 295 } 296 297 if (settings.ButtonLayout != ButtonLayout.None) 298 { 299 classList.Add("btn"); 300 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 301 if (btnLayout == "linkclean") 302 { 303 btnLayout = "link-clean"; //fix 304 } 305 classList.Add("btn--" + btnLayout); 306 } 307 308 if (settings.Icon == null) 309 { 310 settings.Icon = new Icon(); 311 } 312 313 settings.Icon.CssClass += Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower() != "linkclean" ? " u-flex--align-center" : ""; 314 settings.Icon.Label = settings.Title; 315 316 attributes.Add("type", Enum.GetName(typeof(ButtonType), settings.ButtonType).ToLower()); 317 318 <button class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</button> 319 } 320 } 321 322 @helper RenderConfirmDialog(Button settings) 323 { 324 Modal confirmDialog = new Modal 325 { 326 Id = settings.Id, 327 Width = ModalWidth.Sm, 328 Heading = new Heading 329 { 330 Level = 2, 331 Title = settings.ConfirmTitle 332 }, 333 BodyText = settings.ConfirmText 334 }; 335 336 confirmDialog.AddAction(new Button { Title = Translate("Cancel"), ButtonLayout = ButtonLayout.Secondary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false" }); 337 confirmDialog.AddAction(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = "document.getElementById('" + settings.Id + "ModalTrigger').checked = false;" + settings.OnClick }); 338 339 @Render(confirmDialog) 340 } 341 @using Dynamicweb.Rapido.Blocks.Components.General 342 @using Dynamicweb.Rapido.Blocks.Components 343 @using Dynamicweb.Core 344 345 @helper RenderDashboard(Dashboard settings) 346 { 347 var widgets = settings.GetWidgets(); 348 349 if (!string.IsNullOrEmpty(settings.WidgetsBaseBackgroundColor)) 350 { 351 //set bg color for them 352 353 System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml(settings.WidgetsBaseBackgroundColor); 354 int r = Convert.ToInt16(color.R); 355 int g = Convert.ToInt16(color.G); 356 int b = Convert.ToInt16(color.B); 357 358 var count = widgets.Length; 359 var max = Math.Max(r, Math.Max(g, b)); 360 double step = 255.0 / (max * count); 361 var i = 0; 362 foreach (var widget in widgets) 363 { 364 i++; 365 366 var shade = "rgb(" + Converter.ToString(r * step * i).Replace(",", ".") + ", " + Converter.ToString(g * step * i).Replace(",", ".") + ", " + Converter.ToString(b * step * i).Replace(",", ".") + ")"; 367 widget.BackgroundColor = shade; 368 } 369 } 370 371 <div class="dashboard @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 372 @foreach (var widget in widgets) 373 { 374 <div class="dashboard__widget"> 375 @Render(widget) 376 </div> 377 } 378 </div> 379 } 380 @using Dynamicweb.Rapido.Blocks.Components.General 381 @using Dynamicweb.Rapido.Blocks.Components 382 383 @helper RenderDashboardWidgetLink(DashboardWidgetLink settings) 384 { 385 if (!string.IsNullOrEmpty(settings.Link)) 386 { 387 var backgroundStyles = ""; 388 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 389 { 390 backgroundStyles = "style=\"background-color:" + settings.BackgroundColor + "\""; 391 } 392 393 <a href="@settings.Link" class="widget widget--link @settings.CssClass dw-mod" @backgroundStyles title="@settings.Title" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 394 <div class="u-center-middle u-color-light"> 395 @if (settings.Icon != null) 396 { 397 settings.Icon.CssClass += "widget__icon"; 398 @Render(settings.Icon) 399 } 400 <div class="widget__title">@settings.Title</div> 401 </div> 402 </a> 403 } 404 } 405 @using Dynamicweb.Rapido.Blocks.Components.General 406 @using Dynamicweb.Rapido.Blocks.Components 407 408 @helper RenderDashboardWidgetCounter(DashboardWidgetCounter settings) 409 { 410 var backgroundStyles = ""; 411 if (!string.IsNullOrEmpty(settings.BackgroundColor)) 412 { 413 backgroundStyles = "style='background-color:" + settings.BackgroundColor + "'"; 414 } 415 416 <div class="widget @settings.CssClass dw-mod" @backgroundStyles @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 417 <div class="u-center-middle u-color-light"> 418 @if (settings.Icon != null) 419 { 420 settings.Icon.CssClass += "widget__icon"; 421 @Render(settings.Icon) 422 } 423 <div class="widget__counter">@settings.Count</div> 424 <div class="widget__title">@settings.Title</div> 425 </div> 426 </div> 427 } 428 @using System.Reflection 429 @using Dynamicweb.Rapido.Blocks.Components.General 430 @using Dynamicweb.Rapido.Blocks.Components 431 @using Dynamicweb.Core 432 433 @* Component *@ 434 435 @helper RenderLink(Link settings) 436 { 437 if (settings != null && !string.IsNullOrEmpty(settings.Href) && (!string.IsNullOrEmpty(settings.Title) || settings.Icon != null)) 438 { 439 Dictionary<string, string> attributes = new Dictionary<string, string>(); 440 List<string> classList = settings.CssClass != null ? settings.CssClass.Split(' ').ToList() : new List<string>(); 441 if (settings.Disabled) 442 { 443 attributes.Add("disabled", "true"); 444 classList.Add("disabled"); 445 } 446 447 if (!string.IsNullOrEmpty(settings.AltText)) 448 { 449 attributes.Add("title", settings.AltText); 450 } 451 else if (!string.IsNullOrEmpty(settings.Title)) 452 { 453 attributes.Add("title", settings.Title); 454 } 455 456 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 457 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 458 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onClick", settings.OnClick); } 459 attributes.Add("href", settings.Href); 460 461 if (settings.ButtonLayout != ButtonLayout.None) 462 { 463 classList.Add("btn"); 464 string btnLayout = Enum.GetName(typeof(ButtonLayout), settings.ButtonLayout).ToLower(); 465 if (btnLayout == "linkclean") 466 { 467 btnLayout = "link-clean"; //fix 468 } 469 classList.Add("btn--" + btnLayout); 470 } 471 472 if (settings.Icon == null) 473 { 474 settings.Icon = new Icon(); 475 } 476 settings.Icon.Label = settings.Title; 477 478 if (settings.Target == LinkTargetType.Blank && settings.Rel == LinkRelType.None) 479 { 480 settings.Rel = LinkRelType.Noopener; 481 } 482 if (settings.Target != LinkTargetType.None) 483 { 484 attributes.Add("target", "_" + Enum.GetName(typeof(LinkTargetType), settings.Target).ToLower()); 485 } 486 if (settings.Download) 487 { 488 attributes.Add("download", "true"); 489 } 490 if (settings.Rel != LinkRelType.None) 491 { 492 attributes.Add("rel", Enum.GetName(typeof(LinkRelType), settings.Rel).ToLower()); 493 } 494 495 <a class="@string.Join(" ", classList) dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@Render(settings.Icon)</a> 496 } 497 } 498 @using System.Reflection 499 @using Dynamicweb.Rapido.Blocks.Components 500 @using Dynamicweb.Rapido.Blocks.Components.General 501 @using Dynamicweb.Rapido.Blocks 502 503 504 @* Component *@ 505 506 @helper RenderRating(Rating settings) 507 { 508 if (settings.Score > 0) 509 { 510 int rating = settings.Score; 511 string iconType = "fa-star"; 512 513 switch (settings.Type.ToString()) { 514 case "Stars": 515 iconType = "fa-star"; 516 break; 517 case "Hearts": 518 iconType = "fa-heart"; 519 break; 520 case "Lemons": 521 iconType = "fa-lemon"; 522 break; 523 case "Bombs": 524 iconType = "fa-bomb"; 525 break; 526 } 527 528 <div class="u-ta-right"> 529 @for (int i = 0; i < settings.OutOf; i++) 530 { 531 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 532 } 533 </div> 534 } 535 } 536 @using System.Reflection 537 @using Dynamicweb.Rapido.Blocks.Components.General 538 @using Dynamicweb.Rapido.Blocks.Components 539 540 541 @* Component *@ 542 543 @helper RenderSelectFieldOption(SelectFieldOption settings) 544 { 545 Dictionary<string, string> attributes = new Dictionary<string, string>(); 546 if (settings.Checked) { attributes.Add("selected", "true"); } 547 if (settings.Disabled) { attributes.Add("disabled", "true"); } 548 if (settings.Value != null) { attributes.Add("value", settings.Value); } 549 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 550 551 <option @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Label</option> 552 } 553 @using System.Reflection 554 @using Dynamicweb.Rapido.Blocks.Components.General 555 @using Dynamicweb.Rapido.Blocks.Components 556 557 558 @* Component *@ 559 560 @helper RenderNavigation(Navigation settings) { 561 @RenderNavigation(new 562 { 563 id = settings.Id, 564 cssclass = settings.CssClass, 565 startLevel = settings.StartLevel, 566 endlevel = settings.EndLevel, 567 expandmode = settings.Expandmode, 568 sitemapmode = settings.SitemapMode, 569 template = settings.Template 570 }) 571 } 572 @using Dynamicweb.Rapido.Blocks.Components.General 573 @using Dynamicweb.Rapido.Blocks.Components 574 575 576 @* Component *@ 577 578 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 579 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 580 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 581 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 582 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 583 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 584 settings.SitemapMode = false; 585 586 @RenderNavigation(settings) 587 } 588 @using Dynamicweb.Rapido.Blocks.Components.General 589 @using Dynamicweb.Rapido.Blocks.Components 590 591 592 @* Component *@ 593 594 @helper RenderLeftNavigation(LeftNavigation settings) { 595 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 596 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 597 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 598 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 599 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 600 601 <div class="grid__cell"> 602 @RenderNavigation(settings) 603 </div> 604 } 605 @using System.Reflection 606 @using Dynamicweb.Rapido.Blocks.Components.General 607 @using Dynamicweb.Core 608 609 @* Component *@ 610 611 @helper RenderHeading(Heading settings) 612 { 613 if (settings != null && !string.IsNullOrEmpty(settings.Title)) 614 { 615 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 616 string tagName = settings.Level != 0 ? "h" + settings.Level.ToString() : "div"; 617 618 @("<" + tagName + " class=\"" + settings.CssClass + " dw-mod\" " + color + ">") 619 if (!string.IsNullOrEmpty(settings.Link)) 620 { 621 @Render(new Link { Href = settings.Link, Icon = settings.Icon, Title = settings.Title, ButtonLayout = ButtonLayout.None }) 622 } 623 else 624 { 625 if (settings.Icon == null) 626 { 627 settings.Icon = new Icon(); 628 } 629 settings.Icon.Label = settings.Title; 630 @Render(settings.Icon) 631 } 632 @("</" + tagName + ">"); 633 } 634 } 635 @using Dynamicweb.Rapido.Blocks.Components 636 @using Dynamicweb.Rapido.Blocks.Components.General 637 @using Dynamicweb.Rapido.Blocks 638 639 640 @* Component *@ 641 642 @helper RenderImage(Image settings) 643 { 644 if (settings.FilterPrimary != ImageFilter.None || settings.FilterSecondary != ImageFilter.None) 645 { 646 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 647 if (!string.IsNullOrEmpty(settings.FilterColor)) { optionalAttributes.Add("style", "background-color: " + settings.FilterColor); } 648 649 if (settings.Caption != null) 650 { 651 @:<div> 652 } 653 654 var primaryFilterClass = settings.FilterPrimary.ToString().ToLower(); 655 var secondaryFilterClass = settings.FilterSecondary.ToString().ToLower(); 656 657 <div class="image-filter image-filter--@primaryFilterClass u-position-relative dw-mod" @ComponentMethods.AddAttributes(optionalAttributes)> 658 <div class="image-filter image-filter--@secondaryFilterClass dw-mod"> 659 @if (settings.Link != null) 660 { 661 <a href="@settings.Link"> 662 @RenderTheImage(settings) 663 </a> 664 } 665 else 666 { 667 @RenderTheImage(settings) 668 } 669 </div> 670 </div> 671 672 if (settings.Caption != null) 673 { 674 <span class="image-caption dw-mod">@settings.Caption</span> 675 @:</div> 676 } 677 } 678 else 679 { 680 if (settings.Caption != null) 681 { 682 @:<div> 683 } 684 if (!string.IsNullOrEmpty(settings.Link)) 685 { 686 <a href="@settings.Link"> 687 @RenderTheImage(settings) 688 </a> 689 } 690 else 691 { 692 @RenderTheImage(settings) 693 } 694 695 if (settings.Caption != null) 696 { 697 <span class="image-caption dw-mod">@settings.Caption</span> 698 @:</div> 699 } 700 } 701 } 702 703 @helper RenderTheImage(Image settings) 704 { 705 if (settings != null) 706 { 707 string alternativeImage = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("AlternativeImage")) ? Pageview.AreaSettings.GetItem("Settings").GetFile("AlternativeImage").PathUrlEncoded : "/Images/missing_image.jpg"; 708 string placeholderImage = "/Files/Images/placeholder.gif"; 709 string imageEngine = "/Admin/Public/GetImage.ashx?"; 710 711 string imageStyle = ""; 712 713 switch (settings.Style) 714 { 715 case ImageStyle.Ball: 716 imageStyle = "grid__cell-img--ball"; 717 break; 718 719 case ImageStyle.Triangle: 720 imageStyle = "grid__cell-img--triangle"; 721 break; 722 } 723 724 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle || settings.Style == ImageStyle.Triangle) 725 { 726 settings.ImageDefault.Crop = settings.ImageDefault.Crop == 5 ? settings.ImageDefault.Crop = 0 : settings.ImageDefault.Crop; 727 728 if (settings.ImageDefault != null) 729 { 730 settings.ImageDefault.Height = settings.ImageDefault.Width; 731 } 732 if (settings.ImageMedium != null) 733 { 734 settings.ImageMedium.Height = settings.ImageMedium.Width; 735 } 736 if (settings.ImageSmall != null) 737 { 738 settings.ImageSmall.Height = settings.ImageSmall.Width; 739 } 740 } 741 742 string defaultImage = imageEngine; 743 string imageSmall = ""; 744 string imageMedium = ""; 745 746 if (settings.DisableImageEngine) 747 { 748 defaultImage = settings.Path; 749 } 750 else 751 { 752 if (settings.ImageDefault != null) 753 { 754 defaultImage += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageDefault); 755 756 if (settings.Path.GetType() != typeof(string)) 757 { 758 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 759 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 760 } 761 else 762 { 763 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 764 } 765 766 defaultImage += "&AlternativeImage=" + alternativeImage; 767 } 768 769 if (settings.ImageSmall != null) 770 { 771 imageSmall = "data-src-small=\"" + imageEngine; 772 imageSmall += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageSmall); 773 774 if (settings.Path.GetType() != typeof(string)) 775 { 776 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 777 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 778 } 779 else 780 { 781 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 782 } 783 784 imageSmall += "&alternativeImage=" + alternativeImage; 785 786 imageSmall += "\""; 787 } 788 789 if (settings.ImageMedium != null) 790 { 791 imageMedium = "data-src-medium=\"" + imageEngine; 792 imageMedium += Dynamicweb.Rapido.Services.Images.GetImagePathFromSettings(settings.ImageMedium); 793 794 if (settings.Path.GetType() != typeof(string)) 795 { 796 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 797 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 798 } 799 else 800 { 801 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 802 } 803 804 imageMedium += "&alternativeImage=" + alternativeImage; 805 806 imageMedium += "\""; 807 } 808 } 809 810 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 811 if (!string.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 812 if (!string.IsNullOrEmpty(settings.Title)) 813 { 814 optionalAttributes.Add("alt", settings.Title); 815 optionalAttributes.Add("title", settings.Title); 816 } 817 818 if (settings.DisableLazyLoad) 819 { 820 <img id="@settings.Id" class="@imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 821 } 822 else 823 { 824 <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) /> 825 } 826 } 827 } 828 @using System.Reflection 829 @using Dynamicweb.Rapido.Blocks.Components.General 830 @using Dynamicweb.Rapido.Blocks.Components 831 832 @* Component *@ 833 834 @helper RenderFileField(FileField settings) 835 { 836 var attributes = new Dictionary<string, string>(); 837 if (string.IsNullOrEmpty(settings.Id)) 838 { 839 settings.Id = Guid.NewGuid().ToString("N"); 840 } 841 842 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 843 if (settings.Disabled) { attributes.Add("disabled", "true"); } 844 if (settings.Required) { attributes.Add("required", "true"); } 845 if (settings.Multiple) { attributes.Add("multiple", "true"); } 846 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 847 if (string.IsNullOrEmpty(settings.ChooseFileText)) 848 { 849 settings.ChooseFileText = Translate("Choose file"); 850 } 851 if (string.IsNullOrEmpty(settings.NoFilesChosenText)) 852 { 853 settings.NoFilesChosenText = Translate("No files chosen..."); 854 } 855 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 856 857 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 858 859 string setValueToFakeInput = "FileUpload.setValueToFakeInput(this)"; 860 attributes.Add("onchange", setValueToFakeInput + (!string.IsNullOrEmpty(settings.OnChange) ? settings.OnChange : "")); 861 862 attributes.Add("type", "file"); 863 if (settings.Value != null) { attributes.Add("value", settings.Value); } 864 settings.CssClass = "u-full-width " + settings.CssClass; 865 866 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 867 868 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 869 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 870 { 871 <div class="u-full-width"> 872 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 873 @if (settings.Link != null) { 874 <div class="u-pull--right"> 875 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 876 @Render(settings.Link) 877 </div> 878 } 879 </div> 880 881 } 882 883 @if (!string.IsNullOrEmpty(settings.HelpText)) 884 { 885 <small class="form__help-text">@settings.HelpText</small> 886 } 887 888 <div class="form__field-combi file-input u-no-margin dw-mod"> 889 <input @ComponentMethods.AddAttributes(resultAttributes) class="file-input__real-input" data-no-files-text="@settings.NoFilesChosenText" data-many-files-text="@Translate("files")" /> 890 <label for="@settings.Id" class="file-input__btn btn--secondary btn dw-mod">@settings.ChooseFileText</label> 891 <label for="@settings.Id" class="@settings.CssClass file-input__fake-input js-fake-input dw-mod">@settings.NoFilesChosenText</label> 892 @if (settings.UploadButton != null) 893 { 894 settings.UploadButton.CssClass += " btn--condensed u-no-margin"; 895 @Render(settings.UploadButton) 896 } 897 </div> 898 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 899 </div> 900 } 901 @using System.Reflection 902 @using Dynamicweb.Rapido.Blocks.Components.General 903 @using Dynamicweb.Rapido.Blocks.Components 904 @using Dynamicweb.Core 905 @using System.Linq 906 907 @* Component *@ 908 909 @helper RenderDateTimeField(DateTimeField settings) 910 { 911 if (string.IsNullOrEmpty(settings.Id)) 912 { 913 settings.Id = Guid.NewGuid().ToString("N"); 914 } 915 916 var textField = new TextField { 917 Name = settings.Name, 918 Id = settings.Id, 919 Label = settings.Label, 920 HelpText = settings.HelpText, 921 Value = settings.Value, 922 Disabled = settings.Disabled, 923 Required = settings.Required, 924 ErrorMessage = settings.ErrorMessage, 925 CssClass = settings.CssClass, 926 WrapperCssClass = settings.WrapperCssClass, 927 OnChange = settings.OnChange, 928 OnClick = settings.OnClick, 929 Link = settings.Link, 930 ExtraAttributes = settings.ExtraAttributes, 931 // 932 Placeholder = settings.Placeholder 933 }; 934 935 @Render(textField) 936 937 List<string> jsAttributes = new List<string>(); 938 939 jsAttributes.Add("mode: '" + Enum.GetName(typeof(DateTimeFieldMode), settings.Mode).ToLower() + "'"); 940 941 if (!string.IsNullOrEmpty(settings.DateFormat)) 942 { 943 jsAttributes.Add("dateFormat: '" + settings.DateFormat + "'"); 944 } 945 if (!string.IsNullOrEmpty(settings.MinDate)) 946 { 947 jsAttributes.Add("minDate: '" + settings.MinDate + "'"); 948 } 949 if (!string.IsNullOrEmpty(settings.MaxDate)) 950 { 951 jsAttributes.Add("maxDate: '" + settings.MaxDate + "'"); 952 } 953 if (settings.IsInline) 954 { 955 jsAttributes.Add("inline: " + Converter.ToString(settings.IsInline).ToLower()); 956 } 957 if (settings.EnableTime) 958 { 959 jsAttributes.Add("enableTime: " + Converter.ToString(settings.EnableTime).ToLower()); 960 } 961 if (settings.EnableWeekNumbers) 962 { 963 jsAttributes.Add("weekNumbers: " + Converter.ToString(settings.EnableWeekNumbers).ToLower()); 964 } 965 if (settings.Id == "cart_deliveryDate") 966 { 967 jsAttributes.Add("disable: [disableweekdays, disablespecificdates]"); 968 } 969 970 jsAttributes.AddRange(settings.GetFlatPickrOptions().Select(x => x.Key + ": " + x.Value)); 971 972 <script> 973 document.addEventListener("DOMContentLoaded", function () { 974 flatpickr("#@textField.Id", { 975 @string.Join(",", jsAttributes) 976 }); 977 }); 978 </script> 979 } 980 @using System.Reflection 981 @using Dynamicweb.Rapido.Blocks.Components.General 982 @using Dynamicweb.Rapido.Blocks.Components 983 984 @* Component *@ 985 986 @helper RenderTextField(TextField settings) 987 { 988 var attributes = new Dictionary<string, string>(); 989 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 990 { 991 settings.Id = Guid.NewGuid().ToString("N"); 992 } 993 994 /*base settings*/ 995 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 996 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 997 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 998 if (settings.Disabled) { attributes.Add("disabled", "true"); } 999 if (settings.Required) { attributes.Add("required", "true"); } 1000 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1001 /*end*/ 1002 1003 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1004 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1005 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1006 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1007 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 1008 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 1009 attributes.Add("type", Enum.GetName(typeof(TextFieldType), settings.Type).ToLower()); 1010 if (settings.Type == TextFieldType.Password) { attributes.Add("autocomplete", "off"); }; 1011 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1012 1013 settings.CssClass = "u-full-width " + settings.CssClass; 1014 1015 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1016 1017 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1018 1019 string noMargin = "u-no-margin"; 1020 if (!settings.ReadOnly) { 1021 noMargin = ""; 1022 } 1023 1024 <div class="form__field-group u-full-width @noMargin @settings.WrapperCssClass dw-mod"> 1025 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1026 { 1027 <div class="u-full-width"> 1028 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1029 @if (settings.Link != null) { 1030 settings.Link.ButtonLayout = ButtonLayout.LinkClean; 1031 1032 <div class="u-pull--right"> 1033 @Render(settings.Link) 1034 </div> 1035 } 1036 </div> 1037 1038 } 1039 1040 @if (!string.IsNullOrEmpty(settings.HelpText)) 1041 { 1042 <small class="form__help-text">@settings.HelpText</small> 1043 } 1044 1045 @if (settings.ActionButton != null) 1046 { 1047 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1048 <div class="form__field-combi u-no-margin dw-mod"> 1049 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1050 @Render(settings.ActionButton) 1051 </div> 1052 } 1053 else 1054 { 1055 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1056 } 1057 1058 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1059 </div> 1060 } 1061 @using System.Reflection 1062 @using Dynamicweb.Rapido.Blocks.Components.General 1063 @using Dynamicweb.Rapido.Blocks.Components 1064 1065 @* Component *@ 1066 1067 @helper RenderNumberField(NumberField settings) 1068 { 1069 var attributes = new Dictionary<string, string>(); 1070 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1071 { 1072 settings.Id = Guid.NewGuid().ToString("N"); 1073 } 1074 1075 /*base settings*/ 1076 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1077 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1078 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1079 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1080 if (settings.Required) { attributes.Add("required", "true"); } 1081 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1082 /*end*/ 1083 1084 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1085 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1086 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1087 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1088 if (settings.Max != null) { attributes.Add("max", settings.Max.ToString()); } 1089 if (settings.Min != null) { attributes.Add("min", settings.Min.ToString()); } 1090 if (settings.Step != 0) { attributes.Add("step", settings.Step.ToString()); } 1091 if (settings.Value != null && !string.IsNullOrEmpty(settings.Value.ToString())) { attributes.Add("value", settings.Value.ToString()); } 1092 attributes.Add("type", "number"); 1093 1094 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1095 1096 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1097 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1098 { 1099 <div class="u-full-width"> 1100 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1101 @if (settings.Link != null) { 1102 <div class="u-pull--right"> 1103 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1104 @Render(settings.Link) 1105 </div> 1106 } 1107 </div> 1108 1109 } 1110 1111 @if (!string.IsNullOrEmpty(settings.HelpText)) 1112 { 1113 <small class="form__help-text">@settings.HelpText</small> 1114 } 1115 1116 @if (settings.ActionButton != null) 1117 { 1118 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1119 <div class="form__field-combi u-no-margin dw-mod"> 1120 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1121 @Render(settings.ActionButton) 1122 </div> 1123 } 1124 else 1125 { 1126 <div class="form__field-combi u-no-margin dw-mod"> 1127 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1128 </div> 1129 } 1130 1131 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1132 </div> 1133 } 1134 @using System.Reflection 1135 @using Dynamicweb.Rapido.Blocks.Components.General 1136 @using Dynamicweb.Rapido.Blocks.Components 1137 1138 1139 @* Component *@ 1140 1141 @helper RenderTextareaField(TextareaField settings) 1142 { 1143 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1144 string id = settings.Id; 1145 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(id)) 1146 { 1147 id = Guid.NewGuid().ToString("N"); 1148 } 1149 1150 if (!string.IsNullOrEmpty(id)) { attributes.Add("id", id); } 1151 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1152 if (!string.IsNullOrEmpty(settings.OnKeyUp)) { attributes.Add("onkeyup", settings.OnKeyUp); } 1153 if (!string.IsNullOrEmpty(settings.OnInput)) { attributes.Add("oninput", settings.OnInput); } 1154 if (!string.IsNullOrEmpty(settings.OnFocus)) { attributes.Add("onfocus", settings.OnFocus); } 1155 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1156 if (!string.IsNullOrEmpty(settings.Placeholder)) { attributes.Add("placeholder", settings.Placeholder); } 1157 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1158 if (settings.Required) { attributes.Add("required", "true"); } 1159 if (settings.ReadOnly) { attributes.Add("readonly", "true"); } 1160 if (settings.MaxLength != 0) { attributes.Add("maxlength", settings.MaxLength.ToString()); } 1161 if (settings.Rows != 0) { attributes.Add("rows", settings.Rows.ToString()); } 1162 attributes.Add("name", settings.Name); 1163 1164 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1165 1166 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1167 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1168 { 1169 <div class="u-full-width"> 1170 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1171 @if (settings.Link != null) { 1172 <div class="u-pull--right"> 1173 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1174 @Render(settings.Link) 1175 </div> 1176 } 1177 </div> 1178 } 1179 1180 @if (!string.IsNullOrEmpty(settings.HelpText)) 1181 { 1182 <small class="form__help-text">@settings.HelpText</small> 1183 } 1184 1185 <textarea class="u-full-width @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Value</textarea> 1186 1187 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1188 </div> 1189 } 1190 @using System.Reflection 1191 @using Dynamicweb.Rapido.Blocks.Components.General 1192 @using Dynamicweb.Rapido.Blocks.Components 1193 1194 1195 @* Component *@ 1196 1197 @helper RenderHiddenField(HiddenField settings) { 1198 var attributes = new Dictionary<string, string>(); 1199 attributes.Add("type", "hidden"); 1200 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1201 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1202 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1203 1204 <input @ComponentMethods.AddAttributes(attributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 1205 } 1206 @using System.Reflection 1207 @using Dynamicweb.Rapido.Blocks.Components.General 1208 @using Dynamicweb.Rapido.Blocks.Components 1209 1210 @* Component *@ 1211 1212 @helper RenderCheckboxField(CheckboxField settings) 1213 { 1214 var attributes = new Dictionary<string, string>(); 1215 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1216 { 1217 settings.Id = Guid.NewGuid().ToString("N"); 1218 } 1219 1220 /*base settings*/ 1221 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1222 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1223 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1224 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1225 if (settings.Required) { attributes.Add("required", "true"); } 1226 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1227 /*end*/ 1228 1229 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1230 1231 attributes.Add("type", "checkbox"); 1232 if (settings.Checked) { attributes.Add("checked", "true"); } 1233 settings.CssClass = "form__control " + settings.CssClass; 1234 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1235 1236 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1237 1238 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1239 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1240 @if (!string.IsNullOrEmpty(settings.Label)) 1241 { 1242 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1243 } 1244 1245 @if (settings.Link != null) { 1246 <span> 1247 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1248 @Render(settings.Link) 1249 </span> 1250 } 1251 1252 @if (!string.IsNullOrEmpty(settings.HelpText)) 1253 { 1254 <small class="form__help-text checkbox-help dw-mod">@settings.HelpText</small> 1255 } 1256 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1257 </div> 1258 } 1259 @using System.Reflection 1260 @using Dynamicweb.Rapido.Blocks.Components.General 1261 @using Dynamicweb.Rapido.Blocks.Components 1262 1263 1264 @* Component *@ 1265 1266 @helper RenderCheckboxListField(CheckboxListField settings) 1267 { 1268 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1269 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1270 { 1271 <div class="u-full-width"> 1272 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1273 @if (settings.Link != null) { 1274 <div class="u-pull--right"> 1275 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1276 @Render(settings.Link) 1277 </div> 1278 } 1279 </div> 1280 1281 } 1282 1283 <div class="u-pull--left"> 1284 @if (!string.IsNullOrEmpty(settings.HelpText)) 1285 { 1286 <small class="form__help-text">@settings.HelpText</small> 1287 } 1288 1289 @foreach (var item in settings.Options) 1290 { 1291 if (settings.Required) 1292 { 1293 item.Required = true; 1294 } 1295 if (settings.Disabled) 1296 { 1297 item.Disabled = true; 1298 } 1299 if (!string.IsNullOrEmpty(settings.Name)) 1300 { 1301 item.Name = settings.Name; 1302 } 1303 if (!string.IsNullOrEmpty(settings.CssClass)) 1304 { 1305 item.CssClass += settings.CssClass; 1306 } 1307 1308 /* value is not supported */ 1309 1310 if (!string.IsNullOrEmpty(settings.OnClick)) 1311 { 1312 item.OnClick += settings.OnClick; 1313 } 1314 if (!string.IsNullOrEmpty(settings.OnChange)) 1315 { 1316 item.OnChange += settings.OnChange; 1317 } 1318 @Render(item) 1319 } 1320 1321 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1322 </div> 1323 1324 </div> 1325 } 1326 @using Dynamicweb.Rapido.Blocks.Components.General 1327 1328 @* Component *@ 1329 1330 @helper RenderSearch(Search settings) 1331 { 1332 var searchValue = HttpContext.Current.Request.QueryString.Get(settings.SearchParameter) ?? ""; 1333 var groupValue = HttpContext.Current.Request.QueryString.Get(settings.GroupsParameter) ?? ""; 1334 1335 if (string.IsNullOrEmpty(settings.Id)) 1336 { 1337 settings.Id = Guid.NewGuid().ToString("N"); 1338 } 1339 1340 var resultAttributes = new Dictionary<string, string>(); 1341 1342 if (settings.PageSize != 0) 1343 { 1344 resultAttributes.Add("data-page-size", settings.PageSize.ToString()); 1345 } 1346 if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1347 { 1348 resultAttributes.Add("data-groups-feed-url", settings.GroupItemsFeedUrl); 1349 if (!string.IsNullOrEmpty(groupValue)) 1350 { 1351 resultAttributes.Add("data-selected-group", groupValue); 1352 } 1353 if (!string.IsNullOrEmpty(settings.GroupsParameter)) 1354 { 1355 resultAttributes.Add("data-groups-parameter", settings.GroupsParameter); 1356 } 1357 } 1358 resultAttributes.Add("data-force-init", "true"); 1359 if (settings.GoToFirstSearchResultOnEnter) 1360 { 1361 resultAttributes.Add("data-go-to-first-search-result-on-enter", settings.GoToFirstSearchResultOnEnter.ToString().ToLower()); 1362 } 1363 if (!string.IsNullOrEmpty(settings.SearchParameter)) 1364 { 1365 resultAttributes.Add("data-search-parameter", settings.SearchParameter); 1366 } 1367 resultAttributes.Add("data-search-feed-url", settings.SearchData.SearchFeedUrl); 1368 resultAttributes.Add("data-results-template-id", settings.SearchData.ResultsTemplateId); 1369 1370 if (settings.SecondSearchData != null) 1371 { 1372 resultAttributes.Add("data-second-search-feed-url", settings.SecondSearchData.SearchFeedUrl); 1373 resultAttributes.Add("data-second-results-template-id", settings.SecondSearchData.ResultsTemplateId); 1374 } 1375 if (!string.IsNullOrEmpty(settings.ResultsPageUrl)) 1376 { 1377 resultAttributes.Add("data-results-page-url", settings.ResultsPageUrl); 1378 } 1379 1380 resultAttributes = resultAttributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1381 1382 string searchFieldCss = (settings.SearchButton == null) ? "search--with-icon" : ""; 1383 1384 <div class="search @settings.CssClass @searchFieldCss js-search-data-source dw-mod" id="@settings.Id" @ComponentMethods.AddAttributes(resultAttributes)> 1385 @if (!string.IsNullOrEmpty(settings.GroupItemsFeedUrl)) 1386 { 1387 <button type="button" class="search__groups-btn dw-mod js-search-groups-btn">@Translate("All")</button> 1388 <ul class="dropdown dropdown--absolute-position dw-mod search__groups-results js-search-groups-list"></ul> 1389 } 1390 1391 <input type="text" class="search__field dw-mod js-search-field" placeholder="@settings.Placeholder" value="@searchValue"> 1392 1393 <div class="dropdown dropdown--absolute-position search__results dw-mod js-search-results @(settings.SecondSearchData != null ? "search__results--combined" : "")"> 1394 @if (settings.SecondSearchData != null) 1395 { 1396 <div class="search__column search__column--products dw-mod"> 1397 <div class="search__column-header dw-mod">@Translate("Products")</div> 1398 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1399 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1400 { 1401 @Render(new Link { 1402 Title = Translate("View all"), 1403 CssClass = "js-view-all-button u-margin", 1404 Href = settings.SearchData.ResultsPageUrl 1405 }); 1406 } 1407 </div> 1408 <div class="search__column search__column--pages dw-mod"> 1409 <div class="search__column-header">@Translate("Pages")</div> 1410 <ul class="search__results-list dw-mod js-search-results-second-list" id="@(settings.Id)_SecondResultsList"></ul> 1411 @if (!string.IsNullOrEmpty(settings.SecondSearchData.ResultsPageUrl)) 1412 { 1413 @Render(new Link 1414 { 1415 Title = Translate("View all"), 1416 CssClass = "js-view-all-button u-margin", 1417 Href = settings.SecondSearchData.ResultsPageUrl 1418 }); 1419 } 1420 </div> 1421 } 1422 else 1423 { 1424 <div class="search__column search__column--only dw-mod"> 1425 <ul class="search__results-list dw-mod js-search-results-list" id="@(settings.Id)_ResultsList"></ul> 1426 @if (!string.IsNullOrEmpty(settings.SearchData.ResultsPageUrl)) 1427 { 1428 @Render(new Link { 1429 Title = Translate("View all"), 1430 CssClass = "js-view-all-button u-margin", 1431 Href = settings.SearchData.ResultsPageUrl 1432 }); 1433 } 1434 </div> 1435 } 1436 </div> 1437 1438 @if (settings.SearchButton != null) 1439 { 1440 settings.SearchButton.CssClass += " search__btn js-search-btn"; 1441 if (settings.RenderDefaultSearchIcon) 1442 { 1443 settings.SearchButton.Icon = new Icon { Name = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue }; 1444 } 1445 @Render(settings.SearchButton); 1446 } 1447 </div> 1448 } 1449 @using System.Reflection 1450 @using Dynamicweb.Rapido.Blocks.Components.General 1451 @using Dynamicweb.Rapido.Blocks.Components 1452 1453 1454 @* Component *@ 1455 1456 @helper RenderSelectField(SelectField settings) 1457 { 1458 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1459 { 1460 settings.Id = Guid.NewGuid().ToString("N"); 1461 } 1462 1463 <div class="form__field-group u-full-width @settings.WrapperCssClass dw-mod"> 1464 @if (!string.IsNullOrEmpty(settings.Label) || settings.Link != null ) 1465 { 1466 <div class="u-full-width"> 1467 @if (!string.IsNullOrEmpty(settings.Label)) { <label for="@settings.Id" class="u-pull--left">@settings.Label</label> } 1468 @if (settings.Link != null) { 1469 <div class="u-pull--right"> 1470 @{ settings.Link.ButtonLayout = ButtonLayout.LinkClean; } 1471 @Render(settings.Link) 1472 </div> 1473 } 1474 </div> 1475 } 1476 1477 @if (!string.IsNullOrEmpty(settings.HelpText)) 1478 { 1479 <small class="form__help-text">@settings.HelpText</small> 1480 } 1481 1482 @if (settings.ActionButton != null) 1483 { 1484 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1485 <div class="form__field-combi u-no-margin dw-mod"> 1486 @RenderSelectBase(settings) 1487 @Render(settings.ActionButton) 1488 </div> 1489 } 1490 else 1491 { 1492 @RenderSelectBase(settings) 1493 } 1494 1495 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1496 </div> 1497 } 1498 1499 @helper RenderSelectBase(SelectField settings) 1500 { 1501 var attributes = new Dictionary<string, string>(); 1502 1503 /*base settings*/ 1504 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1505 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1506 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1507 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1508 if (settings.Required) { attributes.Add("required", "true"); } 1509 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1510 /*end*/ 1511 1512 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1513 1514 <select @ComponentMethods.AddAttributes(resultAttributes) class="u-full-width @settings.CssClass dw-mod"> 1515 @if (settings.Default != null) 1516 { 1517 @Render(settings.Default) 1518 } 1519 1520 @foreach (var item in settings.Options) 1521 { 1522 if (settings.Value != null) { 1523 item.Checked = item.Value == settings.Value; 1524 } 1525 @Render(item) 1526 } 1527 </select> 1528 } 1529 @using System.Reflection 1530 @using Dynamicweb.Rapido.Blocks.Components.General 1531 @using Dynamicweb.Rapido.Blocks.Components 1532 1533 @* Component *@ 1534 1535 @helper RenderRadioButtonField(RadioButtonField settings) 1536 { 1537 var attributes = new Dictionary<string, string>(); 1538 if (!string.IsNullOrEmpty(settings.Label) && string.IsNullOrEmpty(settings.Id)) 1539 { 1540 settings.Id = Guid.NewGuid().ToString("N"); 1541 } 1542 1543 /*base settings*/ 1544 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1545 if (!string.IsNullOrEmpty(settings.OnClick)) { attributes.Add("onclick", settings.OnClick); } 1546 if (!string.IsNullOrEmpty(settings.OnChange)) { attributes.Add("onchange", settings.OnChange); } 1547 if (settings.Disabled) { attributes.Add("disabled", "true"); } 1548 if (settings.Required) { attributes.Add("required", "true"); } 1549 if (!string.IsNullOrEmpty(settings.Name)) { attributes.Add("name", settings.Name); } 1550 /*end*/ 1551 1552 attributes.Add("type", "radio"); 1553 if (settings.Checked) { attributes.Add("checked", "true"); } 1554 settings.CssClass = "form__control " + settings.CssClass; 1555 if (settings.Value != null) { attributes.Add("value", settings.Value); } 1556 1557 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary (d => d.Key, d => d.Last().Value); 1558 1559 <div class="form__field-group @settings.WrapperCssClass dw-mod"> 1560 <input @ComponentMethods.AddAttributes(resultAttributes) class="@settings.CssClass dw-mod" /> 1561 @if (!string.IsNullOrEmpty(settings.Label)) 1562 { 1563 <label for="@settings.Id" class="dw-mod">@settings.Label</label> 1564 } 1565 @if (!string.IsNullOrEmpty(settings.HelpText)) 1566 { 1567 <small class="form__help-text">@settings.HelpText</small> 1568 } 1569 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1570 </div> 1571 } 1572 @using System.Reflection 1573 @using Dynamicweb.Rapido.Blocks.Components.General 1574 @using Dynamicweb.Rapido.Blocks.Components 1575 1576 1577 @* Component *@ 1578 1579 @helper RenderRadioButtonListField(RadioButtonListField settings) 1580 { 1581 if (settings.Required && !String.IsNullOrEmpty(settings.Label)) { settings.Label += " <span class=\"required dw-mod\">*</span>"; } 1582 1583 <div class="form__field-group @settings.WrapperCssClass u-margin-bottom dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1584 @if (!string.IsNullOrEmpty(settings.Label)) 1585 { 1586 <label>@settings.Label</label> 1587 } 1588 @if (!string.IsNullOrEmpty(settings.HelpText)) 1589 { 1590 <small class="form__help-text">@settings.HelpText</small> 1591 } 1592 1593 @foreach (var item in settings.Options) 1594 { 1595 if (settings.Required) 1596 { 1597 item.Required = true; 1598 } 1599 if (settings.Disabled) 1600 { 1601 item.Disabled = true; 1602 } 1603 if (!string.IsNullOrEmpty(settings.Name)) 1604 { 1605 item.Name = settings.Name; 1606 } 1607 if (settings.Value != null && settings.Value == item.Value) 1608 { 1609 item.Checked = true; 1610 } 1611 if (!string.IsNullOrEmpty(settings.OnClick)) 1612 { 1613 item.OnClick += settings.OnClick; 1614 } 1615 if (!string.IsNullOrEmpty(settings.OnChange)) 1616 { 1617 item.OnChange += settings.OnChange; 1618 } 1619 if (!string.IsNullOrEmpty(settings.CssClass)) 1620 { 1621 item.CssClass += settings.CssClass; 1622 } 1623 @Render(item) 1624 } 1625 1626 @Render(new NotificationMessage { Message = settings.ErrorMessage }) 1627 </div> 1628 } 1629 @using System.Reflection 1630 @using Dynamicweb.Rapido.Blocks.Components.General 1631 @using Dynamicweb.Rapido.Blocks.Components 1632 1633 1634 @* Component *@ 1635 1636 @helper RenderNotificationMessage(NotificationMessage settings) 1637 { 1638 if (!string.IsNullOrEmpty(settings.Message)) 1639 { 1640 var attributes = new Dictionary<string, string>(); 1641 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1642 1643 string messageTypeClass = Enum.GetName(typeof(NotificationMessageType), settings.MessageType).ToLower(); 1644 string messageLayoutClass = Enum.GetName(typeof(NotificationMessageLayout), settings.MessageLayout).ToLower(); 1645 string minHeightClass = settings.Icon != null ? "u-min-h70px" : ""; 1646 1647 <div class="notification-message-@messageTypeClass notification-message-@messageLayoutClass @messageLayoutClass @minHeightClass @settings.CssClass u-full-width dw-mod" @ComponentMethods.AddAttributes(attributes)> 1648 @if (settings.Icon != null) { 1649 settings.Icon.Label = !string.IsNullOrEmpty(settings.Icon.Label) ? settings.Message + settings.Icon.Label : settings.Message; 1650 @Render(settings.Icon) 1651 } else { 1652 @settings.Message 1653 } 1654 </div> 1655 } 1656 } 1657 @using Dynamicweb.Rapido.Blocks.Components.General 1658 1659 1660 @* Component *@ 1661 1662 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1663 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1664 1665 <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> 1666 @if (settings.SubBlocks != null) { 1667 @RenderBlockList(settings.SubBlocks) 1668 } 1669 </div> 1670 } 1671 @using System.Reflection 1672 @using Dynamicweb.Rapido.Blocks.Components.General 1673 @using Dynamicweb.Rapido.Blocks.Components 1674 @using System.Text.RegularExpressions 1675 1676 1677 @* Component *@ 1678 1679 @helper RenderSticker(Sticker settings) { 1680 if (!String.IsNullOrEmpty(settings.Title)) { 1681 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1682 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1683 1684 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1685 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1686 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1687 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1688 optionalAttributes.Add("style", styleTag); 1689 } 1690 1691 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1692 } 1693 } 1694 1695 @using System.Reflection 1696 @using Dynamicweb.Rapido.Blocks.Components.General 1697 @using Dynamicweb.Rapido.Blocks.Components 1698 1699 1700 @* Component *@ 1701 1702 @helper RenderStickersCollection(StickersCollection settings) 1703 { 1704 if (settings.Stickers.Count > 0) 1705 { 1706 string position = "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower(); 1707 1708 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1709 @foreach (Sticker sticker in settings.Stickers) 1710 { 1711 @Render(sticker) 1712 } 1713 </div> 1714 } 1715 } 1716 1717 @using Dynamicweb.Rapido.Blocks.Components.General 1718 1719 1720 @* Component *@ 1721 1722 @helper RenderForm(Form settings) { 1723 if (settings != null) 1724 { 1725 Dictionary<string, string> optionalAttributes = new Dictionary<string, string>(); 1726 if (!string.IsNullOrEmpty(settings.Action)) { optionalAttributes.Add("action", settings.Action); }; 1727 if (!string.IsNullOrEmpty(settings.Name)) { optionalAttributes.Add("name", settings.Name); }; 1728 if (!string.IsNullOrEmpty(settings.OnSubmit)) { optionalAttributes.Add("onsubmit", settings.OnSubmit); }; 1729 var enctypes = new Dictionary<string, string> 1730 { 1731 { "multipart", "multipart/form-data" }, 1732 { "text", "text/plain" }, 1733 { "application", "application/x-www-form-urlencoded" } 1734 }; 1735 if (settings.Enctype != FormEnctype.none) { optionalAttributes.Add("enctype", enctypes[Enum.GetName(typeof(FormEnctype), settings.Enctype).ToLower()]); }; 1736 optionalAttributes.Add("method", settings.Method.ToString()); 1737 1738 if (!string.IsNullOrEmpty(settings.FormStartMarkup)) 1739 { 1740 @settings.FormStartMarkup 1741 } 1742 else 1743 { 1744 @:<form class="@settings.CssClass u-no-margin dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1745 } 1746 1747 foreach (var field in settings.GetFields()) 1748 { 1749 @Render(field) 1750 } 1751 1752 @:</form> 1753 } 1754 } 1755 @using System.Reflection 1756 @using Dynamicweb.Rapido.Blocks.Components.General 1757 @using Dynamicweb.Rapido.Blocks.Components 1758 1759 1760 @* Component *@ 1761 1762 @helper RenderText(Text settings) 1763 { 1764 @settings.Content 1765 } 1766 @using System.Reflection 1767 @using Dynamicweb.Rapido.Blocks.Components.General 1768 @using Dynamicweb.Rapido.Blocks.Components 1769 1770 1771 @* Component *@ 1772 1773 @helper RenderContentModule(ContentModule settings) { 1774 if (!string.IsNullOrEmpty(settings.Content)) 1775 { 1776 @settings.Content 1777 } 1778 } 1779 @using System.Reflection 1780 @using Dynamicweb.Rapido.Blocks.Components.General 1781 @using Dynamicweb.Rapido.Blocks.Components 1782 1783 1784 @* Component *@ 1785 1786 @helper RenderModal(Modal settings) { 1787 if (settings != null) 1788 { 1789 string modalId = !string.IsNullOrEmpty(settings.Id) ? settings.Id : Guid.NewGuid().ToString("N"); 1790 1791 string onchange = !string.IsNullOrEmpty(settings.OnClose) ? "onchange=\"if(!this.checked){" + settings.OnClose + "}\"" : ""; 1792 1793 <input type="checkbox" id="@(modalId)ModalTrigger" class="modal-trigger" @onchange /> 1794 1795 <div class="modal-container"> 1796 @if (!settings.DisableDarkOverlay) 1797 { 1798 <label for="@(modalId)ModalTrigger" id="@(modalId)ModalOverlay" class="modal-overlay"></label> 1799 } 1800 <div class="modal modal--@settings.Width.ToString().ToLower() modal-height--@settings.Height.ToString().ToLower()" id="@(modalId)Modal"> 1801 @if (settings.Heading != null) 1802 { 1803 if (!string.IsNullOrEmpty(settings.Heading.Title)) 1804 { 1805 <div class="modal__header"> 1806 @Render(settings.Heading) 1807 </div> 1808 } 1809 } 1810 <div class="modal__body @(settings.Width.ToString().ToLower() == "full" ? "modal__body--full" : "")"> 1811 @if (!string.IsNullOrEmpty(settings.BodyText)) 1812 { 1813 @settings.BodyText 1814 } 1815 @if (settings.BodyTemplate != null) 1816 { 1817 @settings.BodyTemplate 1818 } 1819 @{ 1820 var actions = settings.GetActions(); 1821 } 1822 </div> 1823 @if (actions.Length > 0) 1824 { 1825 <div class="modal__footer"> 1826 @foreach (var action in actions) 1827 { 1828 if (Pageview.Device.ToString() != "Mobile") { 1829 action.CssClass += " u-no-margin"; 1830 } else { 1831 action.CssClass += " u-full-width u-margin-bottom"; 1832 } 1833 1834 @Render(action) 1835 } 1836 </div> 1837 } 1838 <label class="modal__close-btn" for="@(modalId)ModalTrigger"></label> 1839 </div> 1840 </div> 1841 } 1842 } 1843 @using Dynamicweb.Rapido.Blocks.Components.General 1844 1845 @* Component *@ 1846 1847 @helper RenderMediaListItem(MediaListItem settings) 1848 { 1849 <div class="media-list-item @settings.CssClass dw-mod" @(!string.IsNullOrEmpty(settings.Id) ? "id=\"" + settings.Id + "\"" : "")> 1850 @if (!string.IsNullOrEmpty(settings.Label)) 1851 { 1852 if (!string.IsNullOrEmpty(settings.Link)) 1853 { 1854 @Render(new Link 1855 { 1856 Href = settings.Link, 1857 CssClass = "media-list-item__sticker dw-mod", 1858 ButtonLayout = ButtonLayout.None, 1859 Title = settings.Label, 1860 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 1861 }) 1862 } 1863 else if (!string.IsNullOrEmpty(settings.OnClick)) 1864 { 1865 <span class="media-list-item__sticker dw-mod" onclick="@(settings.OnClick)"> 1866 <span class="u-uppercase">@settings.Label</span> 1867 </span> 1868 } 1869 else 1870 { 1871 <span class="media-list-item__sticker media-list-item__sticker--no-link dw-mod"> 1872 <span class="u-uppercase">@settings.Label</span> 1873 </span> 1874 } 1875 } 1876 <div class="media-list-item__wrap"> 1877 <div class="media-list-item__info dw-mod"> 1878 <div class="media-list-item__header dw-mod"> 1879 @if (!string.IsNullOrEmpty(settings.Title)) 1880 { 1881 if (!string.IsNullOrEmpty(settings.Link)) 1882 { 1883 @Render(new Link 1884 { 1885 Href = settings.Link, 1886 CssClass = "media-list-item__name dw-mod", 1887 ButtonLayout = ButtonLayout.None, 1888 Title = settings.Title, 1889 OnClick = !string.IsNullOrEmpty(settings.OnClick) ? settings.OnClick : "" 1890 }) 1891 } 1892 else if (!string.IsNullOrEmpty(settings.OnClick)) 1893 { 1894 <span class="media-list-item__name dw-mod" onclick="@(settings.OnClick)">@settings.Title</span> 1895 } 1896 else 1897 { 1898 <span class="media-list-item__name media-list-item__name--no-link dw-mod">@settings.Title</span> 1899 } 1900 } 1901 1902 @if (!string.IsNullOrEmpty(settings.Status)) 1903 { 1904 <div class="media-list-item__state dw-mod">@settings.Status</div> 1905 } 1906 </div> 1907 @{ 1908 settings.InfoTable.CssClass += " media-list-item__parameters-table"; 1909 } 1910 1911 @Render(settings.InfoTable) 1912 </div> 1913 <div class="media-list-item__actions dw-mod"> 1914 <div class="media-list-item__actions-list dw-mod"> 1915 @{ 1916 var actions = settings.GetActions(); 1917 1918 foreach (ButtonBase action in actions) 1919 { 1920 action.ButtonLayout = ButtonLayout.None; 1921 action.CssClass += " media-list-item__action link"; 1922 1923 @Render(action) 1924 } 1925 } 1926 </div> 1927 1928 @if (settings.SelectButton != null && !string.IsNullOrEmpty(settings.SelectButton.Title)) 1929 { 1930 settings.SelectButton.CssClass += " u-no-margin"; 1931 1932 <div class="media-list-item__action-button"> 1933 @Render(settings.SelectButton) 1934 </div> 1935 } 1936 </div> 1937 </div> 1938 </div> 1939 } 1940 @using Dynamicweb.Rapido.Blocks.Components.General 1941 @using Dynamicweb.Rapido.Blocks.Components 1942 1943 @helper RenderTable(Table settings) 1944 { 1945 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1946 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1947 1948 var enumToClasses = new Dictionary<TableDesign, string> 1949 { 1950 { TableDesign.Clean, "table--clean" }, 1951 { TableDesign.Bordered, "table--bordered" }, 1952 { TableDesign.Striped, "table--striped" }, 1953 { TableDesign.Hover, "table--hover" }, 1954 { TableDesign.Compact, "table--compact" }, 1955 { TableDesign.Condensed, "table--condensed" }, 1956 { TableDesign.NoTopBorder, "table--no-top-border" } 1957 }; 1958 string tableDesignClass = ""; 1959 if (settings.Design != TableDesign.None) 1960 { 1961 tableDesignClass = enumToClasses[settings.Design]; 1962 } 1963 1964 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableDesign.None) { attributes.Add("class", "table " + tableDesignClass + " " + settings.CssClass + " dw-mod"); } 1965 1966 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 1967 1968 <table @ComponentMethods.AddAttributes(resultAttributes)> 1969 @if (settings.Header != null) 1970 { 1971 <thead> 1972 @Render(settings.Header) 1973 </thead> 1974 } 1975 <tbody> 1976 @foreach (var row in settings.Rows) 1977 { 1978 @Render(row) 1979 } 1980 </tbody> 1981 @if (settings.Footer != null) 1982 { 1983 <tfoot> 1984 @Render(settings.Footer) 1985 </tfoot> 1986 } 1987 </table> 1988 } 1989 @using Dynamicweb.Rapido.Blocks.Components.General 1990 @using Dynamicweb.Rapido.Blocks.Components 1991 1992 @helper RenderTableRow(TableRow settings) 1993 { 1994 Dictionary<string, string> attributes = new Dictionary<string, string>(); 1995 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 1996 1997 var enumToClasses = new Dictionary<TableRowDesign, string> 1998 { 1999 { TableRowDesign.NoBorder, "table__row--no-border" }, 2000 { TableRowDesign.Border, "table__row--border" }, 2001 { TableRowDesign.TopBorder, "table__row--top-line" }, 2002 { TableRowDesign.BottomBorder, "table__row--bottom-line" }, 2003 { TableRowDesign.Solid, "table__row--solid" } 2004 }; 2005 2006 string tableRowDesignClass = ""; 2007 if (settings.Design != TableRowDesign.None) 2008 { 2009 tableRowDesignClass = enumToClasses[settings.Design]; 2010 } 2011 2012 if (!string.IsNullOrEmpty(settings.CssClass) || settings.Design != TableRowDesign.None) { attributes.Add("class", "table__row " + tableRowDesignClass + " " + settings.CssClass + " dw-mod"); } 2013 2014 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2015 2016 <tr @ComponentMethods.AddAttributes(resultAttributes)> 2017 @foreach (var cell in settings.Cells) 2018 { 2019 if (settings.IsHeaderRow) 2020 { 2021 cell.IsHeader = true; 2022 } 2023 @Render(cell) 2024 } 2025 </tr> 2026 } 2027 @using Dynamicweb.Rapido.Blocks.Components.General 2028 @using Dynamicweb.Rapido.Blocks.Components 2029 @using Dynamicweb.Core 2030 2031 @helper RenderTableCell(TableCell settings) 2032 { 2033 Dictionary<string, string> attributes = new Dictionary<string, string>(); 2034 if (!string.IsNullOrEmpty(settings.Id)) { attributes.Add("id", settings.Id); } 2035 if (settings.Colspan != 0) { attributes.Add("colspan", Converter.ToString(settings.Colspan)); } 2036 if (settings.Rowspan != 0) { attributes.Add("rowspan", Converter.ToString(settings.Rowspan)); } 2037 if (!string.IsNullOrEmpty(settings.CssClass)) { attributes.Add("class", settings.CssClass + " dw-mod"); } 2038 2039 var resultAttributes = attributes.Concat(settings.ExtraAttributes).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.Last().Value); 2040 2041 string tagName = settings.IsHeader ? "th" : "td"; 2042 2043 @("<" + tagName + " " + ComponentMethods.AddAttributes(resultAttributes) + ">") 2044 @settings.Content 2045 @("</" + tagName + ">"); 2046 } 2047 @using System.Linq 2048 @using Dynamicweb.Rapido.Blocks.Components.General 2049 2050 @* Component *@ 2051 2052 @helper RenderPagination(Dynamicweb.Rapido.Blocks.Components.General.Pagination settings) 2053 { 2054 var pageNumberQueryStringName = Dynamicweb.Rapido.Services.Pagination.GetPageNumberQueryStringName(settings); // Get the proper 'page number' query string parameter 2055 var queryParameters = Dynamicweb.Rapido.Services.Url.GetQueryParameters(pageNumberQueryStringName); // Get the NameValueCollection from the querystring 2056 2057 if (settings.NumberOfPages > 1) 2058 { 2059 string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + "/Default.aspx"; 2060 string ariaLabel = !string.IsNullOrWhiteSpace(settings.AriaLabel) ? settings.AriaLabel : Translate("Page navigation"); 2061 Dictionary<string, int> startAndEndPageNumber = Dynamicweb.Rapido.Services.Pagination.GetStartAndEndPageNumber(settings); 2062 2063 <div class="pager u-margin-top dw-mod @settings.CssClass" aria-label="@ariaLabel"> 2064 @if (settings.ShowPagingInfo) 2065 { 2066 <div class="pager__info dw-mod"> 2067 @Translate("Page") @settings.CurrentPageNumber @Translate("of") @settings.NumberOfPages 2068 </div> 2069 } 2070 <ul class="pager__list dw-mod"> 2071 @if (!string.IsNullOrWhiteSpace(settings.FirstPageUrl) && settings.ShowFirstAndLastControls) 2072 { 2073 @Render(new PaginationItem { Link = settings.FirstPageUrl, Icon = settings.FirstIcon }) 2074 } 2075 @if (!string.IsNullOrWhiteSpace(settings.PreviousPageUrl) && settings.ShowNextAndPrevControls) 2076 { 2077 @Render(new PaginationItem { Link = settings.PreviousPageUrl, Icon = settings.PrevIcon }) 2078 } 2079 @if (settings.GetPages().Any()) 2080 { 2081 foreach (var page in settings.GetPages()) 2082 { 2083 @Render(page) 2084 } 2085 } 2086 else 2087 { 2088 for (var page = startAndEndPageNumber["StartPage"]; page <= startAndEndPageNumber["EndPage"]; page++) 2089 { 2090 queryParameters = Dynamicweb.Rapido.Services.Url.UpdateQueryStringParameter(queryParameters, pageNumberQueryStringName, page.ToString()); 2091 @Render(new PaginationItem { Label = page.ToString(), Link = Dynamicweb.Rapido.Services.Url.BuildUri(url, queryParameters).PathAndQuery, IsActive = (settings.CurrentPageNumber == page) }); 2092 } 2093 } 2094 @if (!string.IsNullOrWhiteSpace(settings.NextPageUrl) && settings.ShowNextAndPrevControls) 2095 { 2096 @Render(new PaginationItem { Link = settings.NextPageUrl, Icon = settings.NextIcon }) 2097 } 2098 @if (!string.IsNullOrWhiteSpace(settings.LastPageUrl) && settings.ShowFirstAndLastControls) 2099 { 2100 @Render(new PaginationItem { Link = settings.LastPageUrl, Icon = settings.LastIcon }) 2101 } 2102 </ul> 2103 </div> 2104 } 2105 } 2106 2107 @helper RenderPaginationItem(PaginationItem settings) 2108 { 2109 if (settings.Icon == null) 2110 { 2111 settings.Icon = new Icon(); 2112 } 2113 2114 settings.Icon.Label = settings.Label; 2115 <li class="pager__btn dw-mod"> 2116 @if (settings.IsActive) 2117 { 2118 <span class="pager__num pager__num--current dw-mod"> 2119 @Render(settings.Icon) 2120 </span> 2121 } 2122 else 2123 { 2124 <a href="@settings.Link" class="pager__num dw-mod"> 2125 @Render(settings.Icon) 2126 </a> 2127 } 2128 </li> 2129 } 2130 2131 2132 @using Dynamicweb.Rapido.Blocks.Components.General 2133 @using Dynamicweb.Rapido.Blocks.Components.Ecommerce 2134 2135 2136 2137 2138 2139 @functions { 2140 public string GenerateRgba(string color, string opacity) 2141 { 2142 color = color.Replace("#", ""); 2143 if (color.Length == 6) { 2144 return "rgba(" + Convert.ToInt32(color.Substring(0, 2), 16) + ", " + Convert.ToInt32(color.Substring(2, 2), 16) + ", " + Convert.ToInt32(color.Substring(4, 2), 16) + ", " + opacity + ");"; 2145 } else { 2146 return Convert.ToInt16(color).ToString(); 2147 } 2148 } 2149 } 2150 2151 @{ 2152 List<ItemViewModel> slides = new List<ItemViewModel>(); 2153 2154 if (Model.Item.GetItem("SlideOne") != null) { 2155 if (!string.IsNullOrEmpty(Model.Item.GetItem("SlideOne").GetString("Image"))) { 2156 slides.Add(Model.Item.GetItem("SlideOne")); 2157 } 2158 } 2159 2160 if (Model.Item.GetItem("SlideTwo") != null) { 2161 if (!string.IsNullOrEmpty(Model.Item.GetItem("SlideTwo").GetString("Image"))) { 2162 slides.Add(Model.Item.GetItem("SlideTwo")); 2163 } 2164 } 2165 2166 if (Model.Item.GetItem("SlideThree") != null) { 2167 if (!string.IsNullOrEmpty(Model.Item.GetItem("SlideThree").GetString("Image"))) { 2168 slides.Add(Model.Item.GetItem("SlideThree")); 2169 } 2170 } 2171 2172 if (Model.Item.GetItem("SlideFour") != null) { 2173 if (!string.IsNullOrEmpty(Model.Item.GetItem("SlideFour").GetString("Image"))) { 2174 slides.Add(Model.Item.GetItem("SlideFour")); 2175 } 2176 } 2177 2178 if (Model.Item.GetItem("SlideFive") != null) { 2179 if (!string.IsNullOrEmpty(Model.Item.GetItem("SlideFive").GetString("Image"))) { 2180 slides.Add(Model.Item.GetItem("SlideFive")); 2181 } 2182 } 2183 } 2184 2185 @if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) { 2186 @Render(new Heading { Title = Model.Item.GetString("Title"), Level = 2 }) 2187 } 2188 2189 <div class="carousel u-full-height dw-mod" id="Paragraph_@(Model.ID)"> 2190 <div class="carousel__container u-full-height js-carousel-slides dw-mod"> 2191 @foreach (var slide in slides) 2192 { 2193 <div class="carousel__slide u-padding--lg dw-mod"> 2194 @RenderTheSlide(slide) 2195 </div> 2196 } 2197 </div> 2198 </div> 2199 2200 @helper RenderTheSlide(ItemViewModel slide) { 2201 var colorService = new ColorSwatchService(); 2202 string backgroundColor = slide.GetString("BackgroundColor") != null ? slide.GetString("BackgroundColor") : ""; 2203 backgroundColor = !backgroundColor.Contains("#") ? "background-color: " + colorService.GetHexColor(Pageview.AreaID, backgroundColor) : backgroundColor; 2204 string textColor = slide.GetString("TextColor") != null ? slide.GetString("TextColor") : ""; 2205 textColor = !textColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, textColor) : textColor; 2206 string styles = backgroundColor + "; color: " + textColor; 2207 2208 string horizontalAlign = slide.GetString("HorizontalAlignment") != null ? "u-ta-" + slide.GetList("HorizontalAlignment").SelectedValue.ToString().ToLower() : ""; 2209 string verticalAlign = slide.GetString("VerticalAlignment") != null ? "u-align-self-" + slide.GetList("VerticalAlignment").SelectedValue.ToString().ToLower() : ""; 2210 string alignmentCssClasses = horizontalAlign + " " + verticalAlign; 2211 2212 if (!string.IsNullOrEmpty(slide.GetString("Image"))) { 2213 int cropMode = !string.IsNullOrEmpty(Convert.ToString(slide.GetList("ImageCrop"))) ? Convert.ToInt32(slide.GetList("ImageCrop").SelectedValue) : 0; 2214 2215 Image image = new Image 2216 { 2217 Path = slide.GetFile("Image").Path, 2218 CssClass = "background-image__cover", 2219 ImageDefault = new ImageSettings 2220 { 2221 Crop = cropMode, 2222 Height = 845, 2223 Width = 1920 2224 }, 2225 ImageMedium = new ImageSettings 2226 { 2227 Crop = cropMode, 2228 Height = 450, 2229 Width = 1024 2230 }, 2231 ImageSmall = new ImageSettings 2232 { 2233 Crop = cropMode, 2234 Height = 544, 2235 Width = 640 2236 } 2237 }; 2238 2239 image.FilterPrimary = !string.IsNullOrEmpty(slide.GetList("ImageFilterPrimary").SelectedValue) ? (ImageFilter) Enum.Parse(typeof(ImageFilter), slide.GetList("ImageFilterPrimary").SelectedValue.Replace("-", ""), true) : ImageFilter.None; 2240 image.FilterSecondary = !string.IsNullOrEmpty(slide.GetList("ImageFilterSecondary").SelectedValue) ? (ImageFilter) Enum.Parse(typeof(ImageFilter), slide.GetList("ImageFilterSecondary").SelectedValue.Replace("-", ""), true) : ImageFilter.None; 2241 2242 if (!string.IsNullOrEmpty(slide.GetString("ColorForTheFilter"))) { 2243 image.FilterColor = slide.GetString("ColorForTheFilter").StartsWith("#") ? GenerateRgba(slide.GetString("ColorForTheFilter"), "0.3") : ""; 2244 } 2245 2246 <div class="background-image dw-mod"> 2247 <div class="background-image__wrapper dw-mod"> 2248 @Render(image) 2249 </div> 2250 </div> 2251 } 2252 2253 if (!string.IsNullOrEmpty(textColor)) { 2254 <style> 2255 .slideContent-@slide.Id p, .slideContent-@slide.Id h1, .slideContent-@slide.Id h2, .slideContent-@slide.Id h3 { 2256 color: @textColor; 2257 } 2258 </style> 2259 } 2260 2261 string link = !string.IsNullOrEmpty(slide.GetString("Link")) ? slide.GetString("Link") : ""; 2262 string linkTarget = link.Contains("http") ? "_blank" : "_self"; 2263 2264 if (!string.IsNullOrEmpty(link)) { 2265 <a href="@link" target="@linkTarget" class="u-full-width u-full-height u-position-absolute">&nbsp;</a> 2266 } 2267 2268 <div class="content-row__item__body @alignmentCssClasses slideContent-@slide.Id dw-mod"> 2269 @if (!string.IsNullOrEmpty(slide.GetString("Title")) || !string.IsNullOrEmpty(slide.GetString("Text"))) { 2270 <div class="grid__cell"> 2271 @Render(new Heading { Title = slide.GetString("Title"), Level = 2 }) 2272 @Render(new Text { Content = slide.GetString("Text") }) 2273 </div> 2274 } 2275 2276 @if (!string.IsNullOrEmpty(slide.GetItem("ButtonOne").GetString("Title")) || !string.IsNullOrEmpty(slide.GetItem("ButtonTwo").GetString("Title"))) { 2277 <div class="grid__cell"> 2278 @ParagraphButton(slide.GetItem("ButtonOne")) 2279 @ParagraphButton(slide.GetItem("ButtonTwo")) 2280 </div> 2281 } 2282 </div> 2283 } 2284 2285 @{ 2286 if (slides.Count > 1) 2287 { 2288 bool enableDots = !Model.Item.GetBoolean("HideDots"); 2289 2290 <script> 2291 document.addEventListener("DOMContentLoaded", function () { 2292 var hideArrows = "@Model.Item.GetBoolean("HideArrows")"; 2293 2294 new CarouselModule("#Paragraph_@(Model.ID)", { 2295 slideTime: @Model.Item.GetString("SlideTime"), 2296 dots: @(enableDots.ToString().ToLower()), 2297 prevBtn: hideArrows == "True" ? "u-hidden" : "carousel-prev-btn dw-mod", 2298 nextBtn: hideArrows == "True" ? "u-hidden" : "carousel-next-btn dw-mod" 2299 }); 2300 }) 2301 </script> 2302 } 2303 } 2304 2305 @helper ParagraphButton(ItemViewModel item) { 2306 if (item != null) { 2307 if (!string.IsNullOrEmpty(item.GetString("Title"))) { 2308 Button button = new Button { 2309 Title = item.GetString("Title"), 2310 Href = item.GetString("Link"), 2311 CssClass = "u-no-margin", 2312 ButtonLayout = (ButtonLayout)System.Enum.Parse(typeof(ButtonLayout), char.ToUpper(item.GetList("Layout").SelectedValue[0]) + item.GetList("Layout").SelectedValue.Substring(1)) 2313 }; 2314 2315 if (!string.IsNullOrEmpty(item.GetString("Icon"))) { 2316 button.Icon = new Icon { 2317 CssClass = item.GetString("Icon") 2318 }; 2319 } 2320 2321 @Render(button) 2322 } 2323 } 2324 }

Sjælland/Fyn

Jens K. Petersen,
Salgschef
26 87 19 22
jkp@nordenta.dk

Fyn/Jylland

Claus Vesterlund,
Konsulent
26 87 19 63
cve@nordenta.dk

Jylland

Claus Nielsen,
Produktspecialist, CAD/CAM & røntgen
25 12 04 71
cni@nordenta.dk