Job at INDURA

We believe in a strong corporate culture where positive attitudes and values ensure a healthy work environment, good collaboration, and the important balance between work and personal life.

Would you like to be a part of INDURA?

INDURA is a workplace with a high degree of employee involvement and a sense of community. We are confident that we become a better workplace by delegating responsibility to our employees. We also believe that we become more dynamic and flexible when each employee feels a sense of responsibility, takes a stand, and is not afraid to take independent initiatives.

We aim to develop our employees and future colleagues by building new knowledge through targeted professional qualifications and personal development.

We value:

Positive relationships with others
Openness to our colleagues' opinions and honesty in attitudes and viewpoints
Any initiatives that contribute to avoiding or solving challenges and problems
The extra effort that positively supports our colleagues' work
Pride and ownership of the company as a workplace
Respect for people, opinions, and differences
Freedom under responsibility
We believe in a winning culture where we all work together for common results
Our tone of communication is informal, and there is a high ceiling

Current Jobs

Error executing template "Designs/Swift/Paragraph/Base_Paragraph.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_2ea89d9697754464857c65c241af0fed.Execute() in C:\Dynamicweb\indura2024\Files\Templates\Designs\Swift\Paragraph\Base_Paragraph.cshtml:line 335
   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 @using System.Linq 2 @inherits Dynamicweb.Rendering.ViewModelTemplate<Twoday.Custom.Models.Content.ParagraphViewModel> 3 4 @using System 5 @using System.Collections.Generic 6 @using System.Linq 7 @using Dynamicweb.Content.Items 8 9 @functions 10 { 11 12 public string GetContainerClassList(Dynamicweb.Frontend.GridRowViewModel model) 13 { 14 List<string> returnValues = new List<string>(); 15 string container = "container-xl"; 16 17 if (model.Item.GetString("Width") == "bleed") 18 { 19 if (model.Item?.GetRawValueString("OverallAlignment") == "justify-content-end") 20 { 21 container = "container-xl me-sm-0 pe-sm-0 custom-container-justify-content-end"; 22 } 23 else if (model.Item?.GetRawValueString("OverallAlignment") == "justify-content-start") 24 { 25 container = "container-xl ms-sm-0 ps-sm-0 custom-container-justify-content-start"; 26 } 27 else 28 { 29 container = "container-fluid px-0"; 30 } 31 } 32 33 returnValues.Add(container); 34 return string.Join(" ", returnValues); 35 } 36 37 38 39 public string GetColumnWidthClassList(Dynamicweb.Frontend.ItemViewModel model) 40 { 41 42 string columnWidth = "col"; 43 string mobileWidth = string.Empty; 44 string tabletWidth = string.Empty; 45 string desktopWidth = string.Empty; 46 string xlWidth = string.Empty; 47 48 if (model != null) 49 { 50 51 if (model.GetField("Mobile").GetRawValue() != null && model.GetField("Mobile").GetRawValue().ToString() != "auto") 52 { 53 54 mobileWidth = "col-" + model.GetField("Mobile").GetRawValue(); 55 if (model.GetField("Tablet").GetRawValue() == null) 56 { 57 mobileWidth = mobileWidth + " col-sm"; 58 } 59 } 60 if (model.GetField("Width").GetRawValue() != null && model.GetField("Width").GetRawValue().ToString() != "auto") 61 { 62 desktopWidth = "col-md-" + model.GetField("Width").GetRawValue(); 63 } 64 if (model.GetField("Tablet").GetRawValue() != null && model.GetField("Tablet").GetRawValue().ToString() != "auto") 65 { 66 67 desktopWidth = " col-lg-" + model.GetField("Width").GetRawValue(); 68 tabletWidth = "col-md-" + model.GetField("Tablet").GetRawValue(); 69 if (model.GetField("XL").GetRawValue() == null) 70 { 71 tabletWidth = tabletWidth + " col-lg-" + model.GetField("Width").GetRawValue(); 72 } 73 } 74 if (model.GetField("XL").GetRawValue() != null && model.GetField("XL").GetRawValue().ToString() != "auto") 75 { 76 xlWidth = "col-xxxl-" + model.GetField("XL").GetRawValue(); 77 } 78 79 columnWidth = $"col {mobileWidth} {tabletWidth} {desktopWidth} {xlWidth}"; 80 81 } 82 return string.Join(" ", columnWidth); 83 } 84 85 public string GetRowWidthClassList(Dynamicweb.Frontend.GridRowViewModel model) 86 { 87 List<string> returnValues = new List<string>(); 88 89 string rowWidth = model.Item.GetRawValueString("Width", string.Empty).ToLower(); 90 91 if (rowWidth == "6") 92 { 93 returnValues.Add("col-12 col-lg-6"); 94 } 95 if (rowWidth == "8") 96 { 97 returnValues.Add("col-12 col-lg-8"); 98 } 99 if (rowWidth == "9") 100 { 101 returnValues.Add("col-12 col-lg-9"); 102 } 103 if (rowWidth == "10") 104 { 105 returnValues.Add("col-12 col-lg-10"); 106 } 107 if (rowWidth == "12") 108 { 109 returnValues.Add("col-12 col-lg-12"); 110 } 111 if (rowWidth == "bleed") 112 { 113 returnValues.Add("col-12"); 114 } 115 116 return string.Join(" ", returnValues); 117 } 118 119 public string GetSectionContentAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 120 { 121 List<string> returnValues = new List<string>(); 122 123 returnValues.Add(model.Item.GetRawValueString("OverallAlignment", string.Empty).ToLower()); 124 125 return string.Join(" ", returnValues); 126 } 127 128 public string GetRowHorizontalAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 129 { 130 131 List<string> returnValues = new List<string>(); 132 133 returnValues.Add(model.Item.GetRawValueString("HorizontalAlignment", string.Empty).ToLower()); 134 135 return string.Join(" ", returnValues); 136 } 137 138 public string GetRowVerticalAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 139 { 140 141 List<string> returnValues = new List<string>(); 142 143 returnValues.Add(model.Item.GetRawValueString("VerticalAlignment", string.Empty).ToLower()); 144 145 return string.Join(" ", returnValues); 146 } 147 148 public string GetRowSpacing(Dynamicweb.Frontend.GridRowViewModel model) 149 { 150 List<string> returnValues = new List<string>(); 151 152 string disableGutters = model.Item.GetRawValueString("ContentSpacing", string.Empty).ToLower(); 153 154 returnValues.Add(disableGutters == "disable-gutters" ? "g-0" : "g-4"); 155 156 return string.Join(" ", returnValues); 157 } 158 159 public string GetSectionClassList(Dynamicweb.Frontend.GridRowViewModel model) 160 { 161 List<string> returnValues = new List<string>(); 162 returnValues.Add($"item_{model.Item.SystemName.ToLower()}"); 163 returnValues.Add(!string.IsNullOrWhiteSpace(model.Item.GetRawValueString("Theme")) ? " theme " + model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""); 164 string paddingTop = model.Item.GetRawValueString("PaddingTop", "large"); 165 string paddingBottom = model.Item.GetRawValueString("PaddingBottom", "large"); 166 167 if (paddingTop == "none") 168 { 169 returnValues.Add("pt-0"); 170 } 171 if (paddingTop == "small") 172 { 173 returnValues.Add("pt-3"); 174 } 175 if (paddingTop == "medium") 176 { 177 returnValues.Add("pt-5"); 178 } 179 if (paddingTop == "large") { 180 returnValues.Add("pt-7"); 181 } 182 183 if (paddingTop == "extralarge") { 184 returnValues.Add("pt-8"); 185 } 186 187 if (paddingTop == "extraextralarge") { 188 returnValues.Add("pt-9"); 189 } 190 191 if (paddingBottom == "none") 192 { 193 returnValues.Add("pb-0"); 194 } 195 if (paddingBottom == "small") 196 { 197 returnValues.Add("pb-3"); 198 } 199 if (paddingBottom == "medium") 200 { 201 returnValues.Add("pb-5"); 202 } 203 if (paddingBottom == "large") { 204 returnValues.Add("pb-7"); 205 } 206 207 if (paddingBottom == "extralarge") { 208 returnValues.Add("pb-8"); 209 } 210 211 if (paddingBottom == "extraextralarge") { 212 returnValues.Add("pb-9"); 213 } 214 215 return string.Join(" ", returnValues); 216 } 217 218 219 220 } 221 222 223 @helper RenderImage() 224 { 225 if (!string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("Image"))) 226 { 227 string ratioCssClass = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "0" && Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "" ? "ratio" : string.Empty; 228 string ratioVariable = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "0" && Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "" ? "style=\"--bs-aspect-ratio: " + Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") + "\"" : string.Empty; 229 string ImageObjectFit = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageObjectFit", string.Empty); 230 ImageObjectFit = ImageObjectFit == "cover" ? string.Empty : ImageObjectFit; 231 ImageObjectFit = ImageObjectFit == "contain" ? "object-fit:contain" : ImageObjectFit; 232 233 var parms = new Dictionary<string, object>(); 234 parms.Add("loading", "lazy"); 235 parms.Add("style", ImageObjectFit); 236 parms.Add("alt", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImageAltText")); 237 parms.Add("columns", Model.GridRowColumnCount); 238 239 parms.Add("fullwidth", true); 240 parms.Add("cssClass", "img-fluid w-100 " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImageCustomClasses")); 241 242 243 <figure class="mb-0 @ratioCssClass" @ratioVariable> 244 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 245 </figure> 246 } 247 } 248 249 @{ 250 var colSizeClasslist = GetColumnWidthClassList(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("ImageWidth")); 251 252 string imgPlacement = string.Empty; 253 string imgFormatting = string.Empty; 254 255 if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Image") 256 { 257 imgPlacement = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImagePlacement"); 258 } 259 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Graphic") 260 { 261 imgPlacement = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetString("ImagePlacement"); 262 } 263 264 if (imgPlacement == "image-top") 265 { 266 imgPlacement = "flex-column"; 267 imgFormatting = string.Empty; 268 269 270 } else if (imgPlacement == "image-left") 271 { 272 imgPlacement = "flex-column flex-md-row"; 273 imgFormatting = "row flex-md-row"; 274 275 276 } else if (imgPlacement == "image-right") 277 { 278 imgPlacement = "flex-column flex-md-row-reverse"; 279 imgFormatting = "row flex-md-row-reverse"; 280 281 } 282 283 284 285 var parms = new Dictionary<string, object>(); 286 parms.Add("cssClass", "h-100 w-100"); 287 288 } 289 290 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 291 @using Dynamicweb.Ecommerce.ProductCatalog 292 @using System.IO 293 @using Dynamicweb.Frontend 294 295 @{ 296 bool movePageBehind = false; 297 bool isFirstPoster = false; 298 string movePageBehindClass = ""; 299 if (Pageview.Page.PropertyItem != null) 300 { 301 string headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top"; 302 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false; 303 304 if (movePageBehind) 305 { 306 movePageBehindClass = " poster-behind"; 307 if (!Dynamicweb.Context.Current.Items.Contains("firstPosterIsRendered")) 308 { 309 isFirstPoster = true; 310 Dynamicweb.Context.Current.Items.Add("firstPosterIsRendered", true); 311 } 312 313 } 314 315 } 316 } 317 318 @if (movePageBehind && isFirstPoster) 319 { 320 <script> 321 ['resize', 'load'].forEach(function (e) { 322 window.addEventListener(e, () => swift.Scroll.setContentPosition()); 323 }); 324 </script> 325 } 326 327 @using System.Collections.Generic 328 @using System.Linq 329 330 @{ 331 string layout = Model.Item?.GetItem("Paragraph_Text")?.GetRawValueString("Layout"); 332 var textColSizeClasslist = GetColumnWidthClassList(Model.Item?.GetItem("Paragraph_Text")?.GetItem("TextWidth")); 333 334 var textHeight = string.Empty; 335 if (string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("Image")) && !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text")) && string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetString("Image"))) 336 { 337 textHeight = "h-100"; 338 } 339 340 if (layout == "top-left") 341 { 342 layout = "d-flex flex-column align-items-start"; 343 } else if (layout == "top-center") 344 { 345 layout = "d-flex flex-column align-items-center text-center mx-auto"; 346 } 347 else if (layout == "top-right") 348 { 349 layout = "d-flex flex-column align-items-end text-end ms-auto"; 350 } 351 else if (layout == "center-left") 352 { 353 layout = "d-flex flex-column justify-content-center"; 354 } 355 else if (layout == "center") 356 { 357 layout = "d-flex flex-column justify-content-center align-items-center text-center mx-auto"; 358 } 359 else if (layout == "center-right") 360 { 361 layout = "d-flex flex-column justify-content-center align-items-end text-end ms-auto"; 362 } 363 else if (layout == "bottom-left") 364 { 365 layout = "d-flex flex-column justify-content-end"; 366 } 367 else if (layout == "bottom-center") 368 { 369 layout = "d-flex flex-column justify-content-end align-items-center text-center mx-auto"; 370 } 371 else if (layout == "bottom-right") 372 { 373 layout = "d-flex flex-column justify-content-end align-items-end text-end ms-auto"; 374 } 375 } 376 377 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 378 @using System.Collections.Generic 379 @using Dynamicweb.Ecommerce.ProductCatalog 380 381 @{ 382 string linkType = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetRawValueString("LinkType", "page") != string.Empty ? Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetRawValueString("LinkType", "page") : string.Empty; 383 Dynamicweb.Frontend.LinkViewModel link = new Dynamicweb.Frontend.LinkViewModel(); 384 385 if (linkType == "page" && Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetLink("ButtonLink") != null) 386 { 387 link = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetLink("ButtonLink"); 388 } 389 390 if (linkType == "product-group") 391 { 392 IList<ProductGroupViewModel> selectedGroups = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetValue<IList<ProductGroupViewModel>>("ProductGroupLink"); 393 IList<string> groupIds = new List<string> {}; 394 395 if (selectedGroups != null) 396 { 397 foreach (var fromGroup in selectedGroups) 398 { 399 groupIds.Add(fromGroup.Id); 400 } 401 } 402 403 link = new Dynamicweb.Frontend.LinkViewModel() 404 { 405 Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag("Shop") + "&GroupID=" + string.Join(",", groupIds) 406 }; 407 } 408 409 if (linkType == "product") 410 { 411 ProductListViewModel products = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetValue<ProductListViewModel>("ProductLink"); 412 IList<string> productIds = new List<string> {}; 413 414 if (products != null) 415 { 416 foreach (var product in products.Products) 417 { 418 productIds.Add(product.Id); 419 } 420 } 421 422 string productParameter = productIds.Count == 1 ? "ProductID" : "MainProductId"; 423 string pageTag = productIds.Count == 1 ? "ProductDetailPage" : "Shop"; 424 link = new Dynamicweb.Frontend.LinkViewModel() 425 { 426 Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag(pageTag) + "&" + productParameter + "=" + string.Join(",", productIds) 427 }; 428 } 429 430 } 431 432 433 @{ 434 bool hasImage = Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") != null; 435 bool hasGraphic = Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetFile("Image") != null; 436 bool hasVideo = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID")); 437 bool hasText = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Text")?.GetString("Text")); 438 bool hasHeading = Model.Headings.Any(); 439 bool hasButton = Model.Buttons.Any(); 440 } 441 442 @if (Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImagePlacement") == "image-poster" || Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video")?.GetString("VideoPlacement") == "video-poster") 443 { 444 string posterOverlay = string.Empty; 445 if (hasImage && hasText || hasImage && hasHeading || hasImage && hasButton) 446 { 447 posterOverlay = "poster-overlay"; 448 } 449 <div class="p-poster-container @posterOverlay" id="@Model.ID"> 450 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 451 452 @{ 453 string theme = string.Empty; 454 string posterHeight = string.Empty; 455 string mediaType = Model.Item.GetItem("Paragraph_Media").GetString("Media"); 456 457 if ( mediaType == "video") 458 { 459 posterHeight = Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("Height"); 460 461 theme = !string.IsNullOrWhiteSpace(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme")) ? " theme " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 462 } else if (mediaType == "image") 463 { 464 posterHeight = Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetString("Height"); 465 466 theme = !string.IsNullOrWhiteSpace(Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("Theme")) ? " theme " + Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 467 468 } 469 470 posterHeight = posterHeight == "auto" ? "height-auto" : posterHeight; 471 posterHeight = posterHeight == "small" ? "min-vh-50 min-vh-md-50" : posterHeight; 472 posterHeight = posterHeight == "medium" ? "min-vh-50 min-vh-md-75" : posterHeight; 473 posterHeight = posterHeight == "large" ? "min-vh-100 min-vh-md-100" : posterHeight; 474 posterHeight = posterHeight == "ratio-1x1" ? "ratio ratio-1x1 mx-auto" : posterHeight; 475 posterHeight = posterHeight == "ratio-4x3" ? "ratio ratio-4x3 mx-auto" : posterHeight; 476 posterHeight = posterHeight == "ratio-16x9" ? "ratio ratio-16x9 mx-auto" : posterHeight; 477 posterHeight = posterHeight == "ratio-9x16" ? "ratio ratio-9x16 mx-auto" : posterHeight; 478 posterHeight = posterHeight == "ratio-3x4" ? "ratio ratio-3x4 mx-auto" : posterHeight; 479 480 481 } 482 483 <div class="position-relative row @posterHeight @theme @(movePageBehindClass)"> 484 485 @if (Model.Item.GetItem("Paragraph_Media").GetString("Media") == "video") 486 { 487 <div class="p-poster-video-container position-absolute top-0 bottom-0 end-0 start-0 px-0"> 488 <video preload="auto" loop autoplay muted playsinline class="h-100 w-100" style="object-fit: cover;"> 489 <source src="@Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("VideoPath")" 490 type="video/@Path.GetExtension(Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("VideoPath")).ToLower().Replace(".", "")"> 491 </video> 492 </div> 493 494 } else if (Model.Item.GetItem("Paragraph_Media").GetString("Media") == "image") 495 { 496 <div class="position-absolute top-0 bottom-0 end-0 start-0 px-0"> 497 498 @if (link != null && !string.IsNullOrEmpty(link.Url)) 499 { 500 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; 501 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; 502 <a class="bottom-0 position-absolute top-0 w-100" href="@link.Url" @target @rel style="z-index: 2"> 503 </a> 504 } 505 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 506 </div> 507 <figure class="m-0"> 508 @RenderPartial("Components/Image.cshtml", Model.Item.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 509 </figure> 510 511 } 512 513 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 514 @using System.Linq 515 516 517 <div class="d-flex @(posterHeight == "none" ? string.Empty : "position-absolute top-0 bottom-0")"> 518 <div class="container-xl mx-auto px-0 py-5 row"> 519 @inherits Dynamicweb.Rendering.ViewModelTemplate<Twoday.Custom.Models.Content.ParagraphViewModel> 520 @using System.Linq 521 @using Twoday.Custom.Models.UI 522 523 @if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Text") != null) 524 { 525 if (Model.Headings.Any() || Model.Buttons.Any() || !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 526 { 527 <div class="p-txt-container @textHeight @(layout) @textColSizeClasslist"> 528 529 @foreach (HeadingViewModel heading in Model.Headings) 530 { 531 @heading 532 } 533 534 @if (!string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 535 { 536 @Model.Item.GetItem("Paragraph_Text").GetString("Text") 537 } 538 539 @if (Model.Buttons.Any()) 540 { 541 <div class="d-flex flex-wrap grid gap-3"> 542 @foreach (ButtonViewModel button in Model.Buttons) 543 { 544 @button 545 } 546 </div> 547 } 548 </div> 549 } 550 } 551 552 </div> 553 </div> 554 555 </div> 556 557 </div> 558 } 559 else 560 { 561 if (hasImage || hasGraphic || hasVideo || hasText || hasHeading || hasButton) 562 { 563 string isCard = string.Empty; 564 565 if (Model.GetModuleOutput().Any()) 566 { 567 isCard = ""; 568 textHeight = ""; 569 } 570 else 571 { 572 isCard = " h-100"; 573 textHeight = ""; 574 } 575 576 577 <div class="p-panel-container @textHeight @imgPlacement" id="@Model.ID"> 578 <div class="@imgFormatting@isCard"> 579 @if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Image") 580 { 581 if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") != null) 582 { 583 string imgPadding = string.Empty; 584 585 if (!string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text")) || Model.Buttons.Any() || Model.Headings.Any()) 586 { 587 imgPadding = "mb-4"; 588 } 589 else 590 { 591 imgPadding = "mb-0"; 592 } 593 594 <div class="p-img-container @imgPadding @colSizeClasslist mx-auto"> 595 @if (link != null && !string.IsNullOrEmpty(link.Url)) 596 { 597 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; 598 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; 599 <a href="@link.Url" @target @rel> 600 @RenderImage() 601 </a> 602 } 603 else 604 { 605 @RenderImage() 606 } 607 </div> 608 } 609 610 } 611 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Graphic") 612 { 613 <div class="p-graphic-container mb-3 col flex-grow-0 pe-0"> 614 <div class="@(layout) graphic-size-@Model.Item.GetItem("Paragraph_Media").GetItem("Graphic").GetString("GraphicSize")"> 615 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel()) 616 </div> 617 </div> 618 619 } 620 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Video") 621 { 622 if (Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video")?.GetString("VideoPlacement") != "video-poster") 623 { 624 <div class="p-video-container"> 625 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 626 @using Dynamicweb.Ecommerce.ProductCatalog 627 628 @{ 629 630 631 string visual = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Visual", "inline"); 632 633 string provider = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("VideoSourceProvider", "none"); 634 string videoId = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID"); 635 636 Dynamicweb.Frontend.FileViewModel video = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetFile("VideoPath"); 637 string videoPath = video?.Path ?? ""; 638 639 string posterPath = "/Admin/Public/GetImage.ashx?image=" + @Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoPoster") + "&width=1000&format=webp"; 640 641 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/play.svg"; 642 string theme = !string.IsNullOrWhiteSpace(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme")) ? " theme " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 643 } 644 645 646 @switch(visual) { 647 case "inline" : 648 <div class="h-100 position-relative grid grid-1"> 649 650 @switch (provider) 651 { 652 case "youtube" : 653 case "vimeo" : 654 655 <div 656 id="player_@Pageview.CurrentParagraph.ID" 657 class="player plyr__video-embed @(theme) h-100 w-100" 658 data-plyr-provider="@provider" 659 data-plyr-embed-id="@videoId" 660 style="--plyr-color-main: var(--swift-foreground-color); " 661 > 662 </div> 663 664 break; 665 666 case "self-hosted" : 667 668 <video 669 id="player_@Pageview.CurrentParagraph.ID" 670 class="player plyr__video-embed @(theme) h-100 w-100" 671 src="@videoPath" 672 style="--plyr-color-main: var(--swift-foreground-color);" 673 preload="metadata" 674 poster="@posterPath"> 675 </video> 676 677 break; 678 } 679 <script type="module" defer src="~/Files/Templates/Designs/Swift/Assets/js/plyr.js"></script> 680 <script type="module" defer> 681 682 const player = new Plyr('#player_@Pageview.CurrentParagraph.ID', { 683 type: 'video', 684 youtube: { 685 noCookie: true, 686 showinfo: 0 687 }, 688 fullscreen: { 689 enabled: true, 690 iosNative: true, 691 } 692 }); 693 </script> 694 695 </div> 696 697 break; 698 699 case "poster-modal" : 700 <div class="h-100 position-relative@(theme) grid grid-1"> 701 <div class="player position-relative" data-player="player_@Pageview.CurrentParagraph.ID"> 702 703 @RenderVideo() 704 705 <div class="position-absolute top-0 bottom-0 end-0 start-0 h-100 d-flex align-items-center justify-content-center gradient-overlay"> 706 <button type="button" class="btn btn-primary rounded-circle lh-1 p-3" data-bs-toggle="modal" data-bs-target="#modal_@Pageview.CurrentParagraph.ID"> 707 <span class="icon-3"> 708 @ReadFile(iconPath) 709 </span> 710 <span class="visually-hidden">@Translate("Play video")</span> 711 </button> 712 </div> 713 </div> 714 </div> 715 716 <div class="modal fade" id="modal_@Pageview.CurrentParagraph.ID" tabindex="-1" aria-hidden="true"> 717 <div class="modal-dialog modal-xl modal-dialog-centered"> 718 <div class="modal-content"> 719 <div class="modal-body p-0"> 720 721 @switch (provider) 722 { 723 case "youtube" : 724 case "vimeo" : 725 726 <div 727 id="player_@Pageview.CurrentParagraph.ID" 728 class="player plyr__video-embed @(theme) h-100 w-100" 729 data-plyr-provider="@provider" 730 data-plyr-embed-id="@videoId" 731 style="--plyr-color-main: var(--swift-foreground-color); " 732 > 733 </div> 734 735 break; 736 737 case "self-hosted" : 738 739 <video 740 id="player_@Pageview.CurrentParagraph.ID" 741 class="player plyr__video-embed @(theme) h-100 w-100" 742 src="@videoPath" 743 style="--plyr-color-main: var(--swift-foreground-color);" 744 preload="metadata" 745 > 746 </video> 747 748 break; 749 } 750 <script type="module" src="~/Files/Templates/Designs/Swift/Assets/js/plyr.js"></script> 751 <script type="module"> 752 753 var player = new Plyr('#player_@Pageview.CurrentParagraph.ID', { 754 youtube: { 755 noCookie: true, 756 showinfo: 0 757 }, 758 fullscreen: { 759 enabled: true, 760 iosNative: true, 761 } 762 }); 763 764 document.querySelector('#modal_@Pageview.CurrentParagraph.ID').addEventListener('show.bs.modal', function (event) { 765 player.togglePlay(); 766 767 player.on('ready', event => { 768 player.play(); 769 }); 770 }); 771 772 document.querySelector('#modal_@Pageview.CurrentParagraph.ID').addEventListener('hide.bs.modal', function (event) { 773 player.pause(); 774 }); 775 </script> 776 777 </div> 778 </div> 779 </div> 780 </div> 781 782 break; 783 } 784 785 @helper RenderVideo() 786 { 787 string provider = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("VideoSourceProvider", "none"); 788 string videoId = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID"); 789 string ratio = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("AspectRatio", ""); 790 ratio = ratio != "0" ? ratio : ""; 791 string ratioCssClass = ratio != "" && ratio != "fill" ? " ratio" : ""; 792 string ratioVariable = ratio != "" ? "style=\"--bs-aspect-ratio: " + ratio + "\"" : ""; 793 string fillClass = ratio == "fill" ? " h-100" : ""; 794 795 var parms = new Dictionary<string, object>(); 796 parms.Add("loading", "lazy"); 797 if (ratio == "fill") { 798 parms.Add("cssClass", "w-100 h-100"); 799 } 800 else 801 { 802 parms.Add("cssClass", "mw-100 mh-100"); 803 } 804 parms.Add("style",""); 805 parms.Add("alt", @Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("ImageAltText")); 806 parms.Add("columns", Model.GridRowColumnCount); 807 808 <figure class="m-0@(ratioCssClass)@(fillClass)" @ratioVariable> 809 810 @if (string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoPoster"))) 811 { 812 switch (provider) 813 { 814 case "youtube" : 815 @RenderYouTubePoster(videoId) 816 break; 817 818 case "vimeo" : 819 @RenderVimeoPoster(videoId) 820 break; 821 } 822 } 823 else 824 { 825 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetFile("VideoPoster") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 826 } 827 828 </figure> 829 } 830 831 @helper RenderYouTubePoster(string videoId) 832 { 833 <script type="module"> 834 function setVideoThumbnail(source) { 835 var figure = document.querySelector("[data-player='player_@Pageview.CurrentParagraph.ID'] figure"); 836 var thumbnail = document.createElement("img"); 837 thumbnail.style = "object-fit: cover;"; 838 thumbnail.classList.add('mw-100','mh-100'); 839 thumbnail.src = source; 840 figure.appendChild(thumbnail); 841 }; 842 setVideoThumbnail('https://i.ytimg.com/vi/@(videoId)/hqdefault.jpg'); 843 </script> 844 } 845 846 @helper RenderVimeoPoster(string videoId) 847 { 848 <script type="module"> 849 function setVideoThumbnail(source) { 850 let figure = document.querySelector("[data-player='player_@Pageview.CurrentParagraph.ID'] figure"); 851 let thumbnail = document.createElement("img"); 852 thumbnail.style = "object-fit: cover;"; 853 thumbnail.classList.add('mw-100','mh-100'); 854 thumbnail.src = source; 855 figure.appendChild(thumbnail); 856 }; 857 function getVimeoThumbnail() { 858 fetch('https://vimeo.com/api/v2/video/@(videoId).json') 859 .then(function(response) { 860 return response.text(); 861 }) 862 .then(function(data) { 863 let { thumbnail_large } = JSON.parse(data)[0]; 864 let thumbnail = `${thumbnail_large}`; 865 thumbnail = thumbnail.replace("_640", "_1920"); 866 setVideoThumbnail(thumbnail); 867 }) 868 .catch(error => { 869 console.log(error); 870 }); 871 } 872 873 getVimeoThumbnail(); 874 </script> 875 } 876 877 </div> 878 } 879 } 880 @inherits Dynamicweb.Rendering.ViewModelTemplate<Twoday.Custom.Models.Content.ParagraphViewModel> 881 @using System.Linq 882 @using Twoday.Custom.Models.UI 883 884 @if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Text") != null) 885 { 886 if (Model.Headings.Any() || Model.Buttons.Any() || !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 887 { 888 <div class="p-txt-container @textHeight @(layout) @textColSizeClasslist"> 889 890 @foreach (HeadingViewModel heading in Model.Headings) 891 { 892 @heading 893 } 894 895 @if (!string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 896 { 897 @Model.Item.GetItem("Paragraph_Text").GetString("Text") 898 } 899 900 @if (Model.Buttons.Any()) 901 { 902 <div class="d-flex flex-wrap grid gap-3"> 903 @foreach (ButtonViewModel button in Model.Buttons) 904 { 905 @button 906 } 907 </div> 908 } 909 </div> 910 } 911 } 912 913 </div> 914 </div> 915 } 916 else 917 { 918 if (Pageview.IsVisualEditorMode) 919 { 920 <div class="alert alert-warning" role="alert"> 921 @Translate("This paragraph is empty") 922 </div> 923 } 924 } 925 } 926 @Model.GetModuleOutput() 927

Apply Speculatively

If you are looking for an office job in sales, purchasing, or finance, or as a warehouse worker, we welcome your speculative application at job@indura.dk.