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