Error compiling template "Designs/VanBuuren_generated/_parsed/ThemeMaster.parsed.cshtml"
Line 408: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 408: 'Services.Items' is obsolete: 'Use Dynamicweb.Content.Services.Items instead.'
Line 409: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 409: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 442: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 442: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 464: A local variable or function named 'isVisualEditor' is already defined in this scope
Line 473: A local variable or function named 'websitesettings' is already defined in this scope
Line 414: The variable 'isThemeMaster' is assigned but its value is never used
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 // This code was generated by a tool.
4 // Runtime Version:4.0.30319.42000
5 //
6 // Changes to this file may cause incorrect behavior and will be lost if
7 // the code is regenerated.
8 // </auto-generated>
9 //------------------------------------------------------------------------------
10
11 namespace CompiledRazorTemplates.Dynamic {
12
13 #line 233 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
14 using System;
15
16 #line default
17 #line hidden
18 using System.Collections.Generic;
19
20 #line 235 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
21 using System.Linq;
22
23 #line default
24 #line hidden
25
26 #line 238 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
27 using Dynamicweb;
28
29 #line default
30 #line hidden
31
32 #line 244 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
33 using Bluedesk.Tools.Generic;
34
35 #line default
36 #line hidden
37
38 #line 236 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
39 using System.Globalization;
40
41 #line default
42 #line hidden
43
44 #line 239 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
45 using Dynamicweb.Content.Items;
46
47 #line default
48 #line hidden
49
50 #line 246 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
51 using Bluedesk.DynamicWeb.ItemTypes;
52
53 #line default
54 #line hidden
55
56 #line 247 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
57 using Bluedesk.DynamicWeb.ItemTypes.Settings;
58
59 #line default
60 #line hidden
61
62 #line 241 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
63 using Dynamicweb.Frontend;
64
65 #line default
66 #line hidden
67
68 #line 242 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
69 using Dynamicweb.Frontend.Navigation;
70
71 #line default
72 #line hidden
73
74 #line 10 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
75 using Dynamicweb.Ecommerce.ProductCatalog;
76
77 #line default
78 #line hidden
79
80 #line 240 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
81 using Dynamicweb.Environment;
82
83 #line default
84 #line hidden
85
86 #line 234 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
87 using System.Web;
88
89 #line default
90 #line hidden
91
92 #line 252 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
93 using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
94
95 #line default
96 #line hidden
97
98 #line 249 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
99 using Bluedesk.DynamicWeb.ItemTypes.Configuration;
100
101 #line default
102 #line hidden
103
104 #line 250 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
105 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
106
107 #line default
108 #line hidden
109
110 #line 52 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
111 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
112
113 #line default
114 #line hidden
115
116 #line 251 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
117 using Bluedesk.DynamicWeb.ItemTypes.Extensions;
118
119 #line default
120 #line hidden
121
122
123 public class RazorEngine_77c283e1a8dd491da71bad58dd09f421 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> {
124
125 #line hidden
126
127 #line 181 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
128 public RazorEngine.Templating.TemplateWriter RenderCSSKeyAndValue(string Key, string Value)
129 {
130 #line default
131 #line hidden
132 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
133
134 #line 182 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
135
136 if (!string.IsNullOrWhiteSpace(Value))
137 {
138
139
140 #line default
141 #line hidden
142 WriteLiteralTo(__razor_helper_writer, "\t\t");
143
144
145 #line 185 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
146 WriteTo(__razor_helper_writer, Key);
147
148
149 #line default
150 #line hidden
151 WriteLiteralTo(__razor_helper_writer, " : ");
152
153
154 #line 185 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
155 WriteTo(__razor_helper_writer, Value);
156
157
158 #line default
159 #line hidden
160 WriteLiteralTo(__razor_helper_writer, " !important;");
161
162 WriteLiteralTo(__razor_helper_writer, "\r\n");
163
164
165 #line 186 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
166 }
167
168
169 #line default
170 #line hidden
171 });
172
173 #line 187 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
174 }
175 #line default
176 #line hidden
177
178
179 #line 189 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
180 public RazorEngine.Templating.TemplateWriter SetFontCSSVariables(FontConfigurationItemTab FontConfiguration)
181 {
182 #line default
183 #line hidden
184 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => {
185
186 #line 190 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
187
188
189 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : "";
190 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : "";
191 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : "";
192 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : "";
193
194 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
195
196 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
197 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
198
199 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
200 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
201
202
203
204 #line default
205 #line hidden
206 WriteLiteralTo(__razor_helper_writer, "\t");
207
208 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t\t--Position:\t\t");
209
210
211 #line 207 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
212 WriteTo(__razor_helper_writer, Position);
213
214
215 #line default
216 #line hidden
217 WriteLiteralTo(__razor_helper_writer, ";\r\n\r\n");
218
219 WriteLiteralTo(__razor_helper_writer, "\t\t");
220
221
222 #line 209 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
223 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding));
224
225
226 #line default
227 #line hidden
228 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
229
230 WriteLiteralTo(__razor_helper_writer, "\t\t");
231
232
233 #line 211 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
234 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Top", Top));
235
236
237 #line default
238 #line hidden
239 WriteLiteralTo(__razor_helper_writer, "\r\n");
240
241 WriteLiteralTo(__razor_helper_writer, "\t\t");
242
243
244 #line 212 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
245 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Left", Left));
246
247
248 #line default
249 #line hidden
250 WriteLiteralTo(__razor_helper_writer, "\r\n");
251
252 WriteLiteralTo(__razor_helper_writer, "\t\t");
253
254
255 #line 213 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
256 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Right", Right));
257
258
259 #line default
260 #line hidden
261 WriteLiteralTo(__razor_helper_writer, "\r\n");
262
263 WriteLiteralTo(__razor_helper_writer, "\t\t");
264
265
266 #line 214 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
267 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Bottom", Bottom));
268
269
270 #line default
271 #line hidden
272 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
273
274 WriteLiteralTo(__razor_helper_writer, "\t\t");
275
276
277 #line 216 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
278 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Color", Color));
279
280
281 #line default
282 #line hidden
283 WriteLiteralTo(__razor_helper_writer, "\r\n");
284
285 WriteLiteralTo(__razor_helper_writer, "\t\t");
286
287
288 #line 217 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
289 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize));
290
291
292 #line default
293 #line hidden
294 WriteLiteralTo(__razor_helper_writer, "\r\n");
295
296 WriteLiteralTo(__razor_helper_writer, "\t\t");
297
298
299 #line 218 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
300 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle));
301
302
303 #line default
304 #line hidden
305 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
306
307 WriteLiteralTo(__razor_helper_writer, "\t\t");
308
309
310 #line 220 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
311 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight));
312
313
314 #line default
315 #line hidden
316 WriteLiteralTo(__razor_helper_writer, "\r\n");
317
318 WriteLiteralTo(__razor_helper_writer, "\t\t");
319
320
321 #line 221 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
322 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily));
323
324
325 #line default
326 #line hidden
327 WriteLiteralTo(__razor_helper_writer, "\r\n");
328
329 WriteLiteralTo(__razor_helper_writer, "\t\t");
330
331
332 #line 222 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
333 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight));
334
335
336 #line default
337 #line hidden
338 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
339
340 WriteLiteralTo(__razor_helper_writer, "\t\t");
341
342
343 #line 224 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
344 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor));
345
346
347 #line default
348 #line hidden
349 WriteLiteralTo(__razor_helper_writer, "\r\n");
350
351 WriteLiteralTo(__razor_helper_writer, "\t\t");
352
353
354 #line 225 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
355 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderColor", BorderColor));
356
357
358 #line default
359 #line hidden
360 WriteLiteralTo(__razor_helper_writer, "\r\n");
361
362 WriteLiteralTo(__razor_helper_writer, "\t\t");
363
364
365 #line 226 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
366 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderSize", BorderSize));
367
368
369 #line default
370 #line hidden
371 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t");
372
373 WriteLiteralTo(__razor_helper_writer, "\r\n");
374
375
376 #line 229 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
377
378
379
380 #line default
381 #line hidden
382 });
383
384 #line 230 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
385 }
386 #line default
387 #line hidden
388
389
390 public RazorEngine_77c283e1a8dd491da71bad58dd09f421() {
391 }
392
393 public override void Execute() {
394 WriteLiteral("\r\n");
395
396
397 #line 13 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
398 Write(Title("Configuration page template"));
399
400
401 #line default
402 #line hidden
403 WriteLiteral("\r\n\r\n");
404
405
406 #line 15 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
407
408 var websitesettings = Dynamicweb.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id);
409 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
410
411 var designRoot = "/Files/Templates/Designs/" + Pageview.Area.Layout.Design.Name;
412 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
413
414 bool isThemeMaster = true;
415
416 bool isVisualEditor = Dynamicweb.Context.Current.Request.GetBoolean("visualedit");
417
418
419 #line default
420 #line hidden
421 WriteLiteral("\r\n\r\n");
422
423 WriteLiteral("\r\n");
424
425 WriteLiteral("\r\n");
426
427 WriteLiteral("\r\n");
428
429 WriteLiteral("\r\n");
430
431 WriteLiteral("\r\n");
432
433 WriteLiteral("\r\n");
434
435 WriteLiteral("\r\n");
436
437
438 #line 54 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
439
440
441 // Hydrated once per request: the product detail template (rendered before the master) reads the same MasterConfig.
442 MasterConfig mc = application._webapi.Helper.RenderCache.GetForRequest("MasterConfig_" + Pageview.AreaID, () => Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration").Item.ToCodeFirstItem<MasterConfig>());
443
444 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : "";
445
446 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration;
447 EcomConfig EcommerceConfiguration = mc.EcomConfiguration;
448
449 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True";
450 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers;
451 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber;
452 if (pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null)
453 {
454 WithVATBool = false;
455 }
456 if (pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber))
457 {
458 WithVATBool = false;
459 }
460 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower();
461 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower();
462
463 bool IsNotContentManager = false;
464 bool isVisualEditor = Pageview.IsVisualEditorMode;
465
466 if (isVisualEditor)
467 {
468 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID;
469 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true);
470 }
471
472 // Recaptcha configuration
473 var websitesettings = Dynamicweb.Content.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id);
474 string recaptchaType = websitesettings.RecaptchaType;
475 string recaptchaKey = websitesettings.RecaptchaKey;
476
477
478 #line default
479 #line hidden
480 WriteLiteral("\r\n\r\n\r\n<!DOCTYPE html>\r\n<html");
481
482 WriteLiteral(" prefix=\"og: http://ogp.me/ns#\"");
483
484 WriteLiteral(">\r\n<head>\r\n\t");
485
486 WriteLiteral("\r\n\r\n</head>\r\n\r\n<body>\r\n\r\n\t<script");
487
488 WriteLiteral(" type=\"text/javascript\"");
489
490 WriteLiteral(@">
491
492 var stylesDump;
493
494 function onTryItClick(variable) {
495
496 var StyleID = variable + 'Style';
497 var contentID = variable + 'Content';
498 var frameID = variable + 'Frame';
499 var MasterConfigID = 'MasterConfig';
500
501 var style = document.getElementById(StyleID).innerHTML;
502 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
503 var content = document.getElementById(contentID).innerHTML;
504 var iframe = document.getElementById(frameID);
505
506 stylesDump = stylesDump + style;
507
508 var frameDoc = iframe.document;
509 if (iframe.contentWindow)
510 frameDoc = iframe.contentWindow.document;
511
512 frameDoc.open();
513 frameDoc.writeln(content);
514 frameDoc.writeln(MasterConfig);
515 frameDoc.writeln(stylesDump);
516 frameDoc.close();
517
518 document.getElementById(contentID).remove();
519
520 }
521
522 </script>
523
524 <section");
525
526 WriteLiteral(" id=\"MasterConfig\"");
527
528 WriteLiteral(">\r\n");
529
530
531 #line 159 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
532
533
534 #line default
535 #line hidden
536 WriteLiteral("\r\n");
537
538 WriteLiteral("\r\n");
539
540 WriteLiteral("\r\n");
541
542 WriteLiteral("\r\n");
543
544 WriteLiteral("\r\n");
545
546 WriteLiteral("\r\n");
547
548 WriteLiteral("\r\n");
549
550
551 #line 232 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
552
553
554 #line default
555 #line hidden
556 WriteLiteral("\r\n");
557
558 WriteLiteral("\r\n");
559
560 WriteLiteral("\r\n");
561
562 WriteLiteral("\r\n");
563
564 WriteLiteral("\r\n\t</section>\r\n\r\n");
565
566
567 #line 256 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
568
569
570 #line default
571 #line hidden
572
573 #line 256 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
574 if (isVisualEditor)
575 {
576
577
578 #line default
579 #line hidden
580 WriteLiteral("\t\t<link");
581
582 WriteAttribute("href", Tuple.Create(" href=\"", 8716), Tuple.Create("\"", 8730)
583
584 #line 258 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
585 , Tuple.Create(Tuple.Create("", 8723), Tuple.Create<System.Object, System.Int32>(appcss
586
587 #line default
588 #line hidden
589 , 8723), false)
590 );
591
592 WriteLiteral(" rel=\"stylesheet\"");
593
594 WriteLiteral(" />\r\n");
595
596
597 #line 259 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
598
599
600
601 #line default
602 #line hidden
603 WriteLiteral("\t\t<header");
604
605 WriteLiteral(" style=\"padding: 25px;\"");
606
607 WriteLiteral(">\r\n\t\t\t<h1>Theme</h1>\r\n\t\t\t<h2");
608
609 WriteLiteral(" style=\"font-weight: normal;\"");
610
611 WriteLiteral(">");
612
613
614 #line 262 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
615 Write(Model.Title);
616
617
618 #line default
619 #line hidden
620 WriteLiteral("</h2>\r\n\t\t</header>\r\n");
621
622
623 #line 264 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
624 }
625
626
627 #line default
628 #line hidden
629 WriteLiteral("\r\n");
630
631 WriteLiteral("\t");
632
633
634 #line 266 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
635 Write(Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme"));
636
637
638 #line default
639 #line hidden
640 WriteLiteral("\r\n\r\n");
641
642
643 #line 268 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
644
645
646 #line default
647 #line hidden
648
649 #line 268 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
650 if (isVisualEditor)
651 {
652 if (font_configuration != null)
653 {
654 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
655 {
656
657
658 #line default
659 #line hidden
660 WriteLiteral("\t\t\t\t<link");
661
662 WriteAttribute("href", Tuple.Create(" href=\"", 9222), Tuple.Create("\"", 9246)
663
664 #line 274 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
665 , Tuple.Create(Tuple.Create("", 9229), Tuple.Create<System.Object, System.Int32>(item["FontLink"]
666
667 #line default
668 #line hidden
669 , 9229), false)
670 );
671
672 WriteLiteral(" rel=\"stylesheet\"");
673
674 WriteLiteral(">\r\n");
675
676
677 #line 275 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
678 }
679 }
680
681
682
683 #line default
684 #line hidden
685 WriteLiteral("\t\t<link");
686
687 WriteLiteral(" rel=\"stylesheet\"");
688
689 WriteLiteral(" href=\"https://pro.fontawesome.com/releases/v5.15.4/css/all.css\"");
690
691 WriteLiteral(" integrity=\"sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+k" +
692 "QU\"");
693
694 WriteLiteral(" crossorigin=\"anonymous\"");
695
696 WriteLiteral(">\r\n");
697
698
699 #line 279 "D:\Dynamicweb.NET\vanBuuren\Production\host\files\Templates\Designs\VanBuuren_generated\_parsed\ThemeMaster.parsed.cshtml"
700 }
701
702
703 #line default
704 #line hidden
705 WriteLiteral("</body>\r\n</html>\r\n");
706
707 }
708 }
709 }
710
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
2 @using Dynamicweb;
3 @using Bluedesk.Tools.Generic;
4 @using System.Globalization;
5 @using Dynamicweb.Content.Items;
6 @using Bluedesk.DynamicWeb.ItemTypes;
7 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
8 @using Dynamicweb.Frontend
9 @using Dynamicweb.Frontend.Navigation
10 @using Dynamicweb.Ecommerce.ProductCatalog
11 @using Dynamicweb.Environment
12
13 @Title("Configuration page template")
14
15 @{
16 var websitesettings = Dynamicweb.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id);
17 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
18
19 var designRoot = "/Files/Templates/Designs/" + Pageview.Area.Layout.Design.Name;
20 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
21
22 bool isThemeMaster = true;
23
24 bool isVisualEditor = Dynamicweb.Context.Current.Request.GetBoolean("visualedit");
25 }
26
27 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
28
29 @using System;
30 @using System.Web;
31 @using System.Linq;
32 @using System.Globalization;
33
34 @using Dynamicweb;
35 @using Dynamicweb.Content.Items;
36 @using Dynamicweb.Environment;
37 @using Dynamicweb.Frontend;
38 @using Dynamicweb.Frontend.Navigation;
39
40 @using Bluedesk.Tools.Generic;
41
42 @using Bluedesk.DynamicWeb.ItemTypes;
43 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
44 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
45
46 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
47 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
48
49 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
50
51 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
52 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
53
54 @{
55
56 // Hydrated once per request: the product detail template (rendered before the master) reads the same MasterConfig.
57 MasterConfig mc = application._webapi.Helper.RenderCache.GetForRequest("MasterConfig_" + Pageview.AreaID, () => Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration").Item.ToCodeFirstItem<MasterConfig>());
58
59 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : "";
60
61 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration;
62 EcomConfig EcommerceConfiguration = mc.EcomConfiguration;
63
64 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True";
65 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers;
66 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber;
67 if (pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null)
68 {
69 WithVATBool = false;
70 }
71 if (pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber))
72 {
73 WithVATBool = false;
74 }
75 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower();
76 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower();
77
78 bool IsNotContentManager = false;
79 bool isVisualEditor = Pageview.IsVisualEditorMode;
80
81 if (isVisualEditor)
82 {
83 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID;
84 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true);
85 }
86
87 // Recaptcha configuration
88 var websitesettings = Dynamicweb.Content.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id);
89 string recaptchaType = websitesettings.RecaptchaType;
90 string recaptchaKey = websitesettings.RecaptchaKey;
91 }
92
93
94 <!DOCTYPE html>
95 <html prefix="og: http://ogp.me/ns#">
96 <head>
97 @*@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
98 @using System;
99 @using System.Web;
100 @using System.Linq;
101 @using System.Globalization;
102
103 @using Dynamicweb;
104 @using Dynamicweb.Content.Items;
105 @using Dynamicweb.Environment;
106 @using Dynamicweb.Frontend;
107 @using Dynamicweb.Frontend.Navigation;
108
109 @using Bluedesk.Tools.Generic;
110
111 @using Bluedesk.DynamicWeb.ItemTypes;
112 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
113
114 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
115 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
116 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
117 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
118 *@
119
120 </head>
121
122 <body>
123
124 <script type="text/javascript">
125
126 var stylesDump;
127
128 function onTryItClick(variable) {
129
130 var StyleID = variable + 'Style';
131 var contentID = variable + 'Content';
132 var frameID = variable + 'Frame';
133 var MasterConfigID = 'MasterConfig';
134
135 var style = document.getElementById(StyleID).innerHTML;
136 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
137 var content = document.getElementById(contentID).innerHTML;
138 var iframe = document.getElementById(frameID);
139
140 stylesDump = stylesDump + style;
141
142 var frameDoc = iframe.document;
143 if (iframe.contentWindow)
144 frameDoc = iframe.contentWindow.document;
145
146 frameDoc.open();
147 frameDoc.writeln(content);
148 frameDoc.writeln(MasterConfig);
149 frameDoc.writeln(stylesDump);
150 frameDoc.close();
151
152 document.getElementById(contentID).remove();
153
154 }
155
156 </script>
157
158 <section id="MasterConfig">
159 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
160 @using System;
161 @using System.Web;
162 @using System.Linq;
163 @using System.Globalization;
164
165 @using Dynamicweb;
166 @using Dynamicweb.Content.Items;
167 @using Dynamicweb.Environment;
168 @using Dynamicweb.Frontend;
169 @using Dynamicweb.Frontend.Navigation;
170
171 @using Bluedesk.Tools.Generic;
172
173 @using Bluedesk.DynamicWeb.ItemTypes;
174 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
175 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
176
177 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
178 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
179 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
180
181 @helper RenderCSSKeyAndValue(string Key, string Value)
182 {
183 if (!string.IsNullOrWhiteSpace(Value))
184 {
185 <text>@Key : @Value !important;</text>
186 }
187 }
188
189 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration)
190 {
191
192 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : "";
193 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : "";
194 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : "";
195 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : "";
196
197 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
198
199 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
200 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
201
202 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
203 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
204
205 <text>
206
207 --Position: @Position;
208
209 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding)
210
211 @RenderCSSKeyAndValue("--Top", Top)
212 @RenderCSSKeyAndValue("--Left", Left)
213 @RenderCSSKeyAndValue("--Right", Right)
214 @RenderCSSKeyAndValue("--Bottom", Bottom)
215
216 @RenderCSSKeyAndValue("--Color", Color)
217 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize)
218 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle)
219
220 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight)
221 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily)
222 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight)
223
224 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor)
225 @RenderCSSKeyAndValue("--BorderColor", BorderColor)
226 @RenderCSSKeyAndValue("--BorderSize", BorderSize)
227
228 </text>
229
230 }
231
232 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
233 @using System;
234 @using System.Web;
235 @using System.Linq;
236 @using System.Globalization;
237
238 @using Dynamicweb;
239 @using Dynamicweb.Content.Items;
240 @using Dynamicweb.Environment;
241 @using Dynamicweb.Frontend;
242 @using Dynamicweb.Frontend.Navigation;
243
244 @using Bluedesk.Tools.Generic;
245
246 @using Bluedesk.DynamicWeb.ItemTypes;
247 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
248
249 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
250 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
251 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
252 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
253
254 </section>
255
256 @if (isVisualEditor)
257 {
258 <link href="@appcss" rel="stylesheet" />
259
260 <header style="padding: 25px;">
261 <h1>Theme</h1>
262 <h2 style="font-weight: normal;">@Model.Title</h2>
263 </header>
264 }
265
266 @Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme")
267
268 @if (isVisualEditor)
269 {
270 if (font_configuration != null)
271 {
272 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
273 {
274 <link href="@item["FontLink"]" rel="stylesheet">
275 }
276 }
277
278 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous">
279 }
280 </body>
281 </html>
282