Error compiling template "Designs/ClientBase_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 439: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 439: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 462: A local variable or function named 'isVisualEditor' is already defined in this scope
Line 492: A local variable or function named 'font_configuration' is already defined in this scope
Line 492: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 492: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 499: A local variable or function named 'designRoot' is already defined in this scope
Line 528: A local variable or function named 'appcss' is already defined in this scope
Line 414: The variable 'isThemeMaster' is assigned but its value is never used
Line 508: The variable 'isOffline' 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 311 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
14 using System;
15
16 #line default
17 #line hidden
18 using System.Collections.Generic;
19
20 #line 313 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
21 using System.Linq;
22
23 #line default
24 #line hidden
25
26 #line 316 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
27 using Dynamicweb;
28
29 #line default
30 #line hidden
31
32 #line 322 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
33 using Bluedesk.Tools.Generic;
34
35 #line default
36 #line hidden
37
38 #line 314 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
39 using System.Globalization;
40
41 #line default
42 #line hidden
43
44 #line 317 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
45 using Dynamicweb.Content.Items;
46
47 #line default
48 #line hidden
49
50 #line 324 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
51 using Bluedesk.DynamicWeb.ItemTypes;
52
53 #line default
54 #line hidden
55
56 #line 325 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
57 using Bluedesk.DynamicWeb.ItemTypes.Settings;
58
59 #line default
60 #line hidden
61
62 #line 319 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
63 using Dynamicweb.Frontend;
64
65 #line default
66 #line hidden
67
68 #line 320 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
69 using Dynamicweb.Frontend.Navigation;
70
71 #line default
72 #line hidden
73
74 #line 10 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
75 using Dynamicweb.Ecommerce.ProductCatalog;
76
77 #line default
78 #line hidden
79
80 #line 318 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
81 using Dynamicweb.Environment;
82
83 #line default
84 #line hidden
85
86 #line 312 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
87 using System.Web;
88
89 #line default
90 #line hidden
91
92 #line 330 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
93 using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
94
95 #line default
96 #line hidden
97
98 #line 327 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
99 using Bluedesk.DynamicWeb.ItemTypes.Configuration;
100
101 #line default
102 #line hidden
103
104 #line 328 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
105 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
106
107 #line default
108 #line hidden
109
110 #line 49 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
111 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
112
113 #line default
114 #line hidden
115
116 #line 329 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
117 using Bluedesk.DynamicWeb.ItemTypes.Extensions;
118
119 #line default
120 #line hidden
121
122
123 public class RazorEngine_61ca782d28094c1b80a30c27489bea5e : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> {
124
125 #line hidden
126
127 #line 259 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 260 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 263 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 263 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 264 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
166 }
167
168
169 #line default
170 #line hidden
171 });
172
173 #line 265 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
174 }
175 #line default
176 #line hidden
177
178
179 #line 267 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 268 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 285 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 287 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 289 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 290 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 291 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 292 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 294 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 295 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 296 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 298 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 299 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 300 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 302 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 303 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 304 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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 307 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
377
378
379
380 #line default
381 #line hidden
382 });
383
384 #line 308 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
385 }
386 #line default
387 #line hidden
388
389
390 public RazorEngine_61ca782d28094c1b80a30c27489bea5e() {
391 }
392
393 public override void Execute() {
394 WriteLiteral("\r\n");
395
396
397 #line 13 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_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
436 #line 51 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
437
438
439 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration");
440 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>();
441
442 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false;
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 WithVATBool = false;
454 }
455 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) {
456 WithVATBool = false;
457 }
458 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower();
459 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower();
460
461 bool IsNotContentManager = false;
462 bool isVisualEditor = Pageview.IsVisualEditorMode;
463
464 if (isVisualEditor)
465 {
466 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID;
467 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true);
468 }
469
470 BaseSettingsObj BaseSettings = new BaseSettingsObj();
471
472 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
473 HttpContext.Current.Session["BaseSettings"] = BaseSettings;
474
475 //if (HttpContext.Current.Session["BaseSettings"] == null)
476 //{
477
478 //}
479 //else
480 //{
481 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"];
482 // if (BaseSettings.AreaID != Pageview.AreaID)
483 // {
484 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
485 // HttpContext.Current.Session["BaseSettings"] = BaseSettings;
486 // }
487 //}
488
489 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration;
490 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons;
491
492 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
493
494 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain();
495 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName;
496 var langName = Pageview.Area.Culture;
497
498 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue();
499 var designRoot = BaseSettings.DesignRoot;
500
501 var phonenumber = BaseSettings.CorporateSettings.Phonenumber;
502 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty);
503 var emailadress = BaseSettings.CorporateSettings.Emailadress;
504 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right";
505 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm;
506 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor;
507
508 bool isOffline = false;
509
510 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime;
511 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime;
512 DateTime today = DateTime.Now;
513 var cHour = DateTime.Now.TimeOfDay;
514 int cDay = (int)DateTime.Now.DayOfWeek;
515 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5);
516 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None);
517 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture);
518 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat;
519 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay;
520 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd;
521 if (isNoValidDate || isOvertime)
522 {
523 isOffline = true;
524 }
525
526 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false;
527
528 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
529
530 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true);
531 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true);
532 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true);
533
534 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon;
535 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16;
536 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32;
537
538 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js");
539 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js");
540 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js");
541
542 //*** Start Scanapp configuration ***\\
543 bool hideHeader = false;
544 bool hideFooter = false;
545 bool hideBottombar = false;
546
547 if (HttpContext.Current.Session["ScanApp"] != null)
548 {
549 hideHeader = mc.ScanAppConfig.ShowHeader;
550 hideFooter = mc.ScanAppConfig.ShowFooter;
551 hideBottombar = mc.ScanAppConfig.ShowBottombar;
552 }
553 // END Scanapp configration **\\
554
555
556
557 #line default
558 #line hidden
559 WriteLiteral("\r\n\r\n\r\n<!DOCTYPE html>\r\n<html");
560
561 WriteLiteral(" prefix=\"og: http://ogp.me/ns#\"");
562
563 WriteLiteral(">\r\n<head>\r\n\t");
564
565 WriteLiteral("\r\n\r\n</head>\r\n\r\n<body>\r\n\r\n\t<script");
566
567 WriteLiteral(" type=\"text/javascript\"");
568
569 WriteLiteral(@">
570
571 var stylesDump;
572
573 function onTryItClick(variable) {
574
575 var StyleID = variable + 'Style';
576 var contentID = variable + 'Content';
577 var frameID = variable + 'Frame';
578 var MasterConfigID = 'MasterConfig';
579
580 var style = document.getElementById(StyleID).innerHTML;
581 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
582 var content = document.getElementById(contentID).innerHTML;
583 var iframe = document.getElementById(frameID);
584
585 stylesDump = stylesDump + style;
586
587 var frameDoc = iframe.document;
588 if (iframe.contentWindow)
589 frameDoc = iframe.contentWindow.document;
590
591 frameDoc.open();
592 frameDoc.writeln(content);
593 frameDoc.writeln(MasterConfig);
594 frameDoc.writeln(stylesDump);
595 frameDoc.close();
596
597 document.getElementById(contentID).remove();
598
599 }
600
601 </script>
602
603 <section");
604
605 WriteLiteral(" id=\"MasterConfig\"");
606
607 WriteLiteral(">\r\n");
608
609
610 #line 237 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
611
612
613 #line default
614 #line hidden
615 WriteLiteral("\r\n");
616
617 WriteLiteral("\r\n");
618
619 WriteLiteral("\r\n");
620
621 WriteLiteral("\r\n");
622
623 WriteLiteral("\r\n");
624
625 WriteLiteral("\r\n");
626
627 WriteLiteral("\r\n");
628
629
630 #line 310 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
631
632
633 #line default
634 #line hidden
635 WriteLiteral("\r\n");
636
637 WriteLiteral("\r\n");
638
639 WriteLiteral("\r\n");
640
641 WriteLiteral("\r\n");
642
643 WriteLiteral("\r\n\t</section>\r\n\r\n");
644
645
646 #line 334 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
647
648
649 #line default
650 #line hidden
651
652 #line 334 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
653 if (isVisualEditor)
654 {
655
656
657 #line default
658 #line hidden
659 WriteLiteral("\t\t<link");
660
661 WriteAttribute("href", Tuple.Create(" href=\"", 12523), Tuple.Create("\"", 12537)
662
663 #line 336 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
664 , Tuple.Create(Tuple.Create("", 12530), Tuple.Create<System.Object, System.Int32>(appcss
665
666 #line default
667 #line hidden
668 , 12530), false)
669 );
670
671 WriteLiteral(" rel=\"stylesheet\"");
672
673 WriteLiteral(" />\r\n");
674
675
676 #line 337 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
677
678
679
680 #line default
681 #line hidden
682 WriteLiteral("\t\t<header");
683
684 WriteLiteral(" style=\"padding: 25px;\"");
685
686 WriteLiteral(">\r\n\t\t\t<h1>Theme</h1>\r\n\t\t\t<h2");
687
688 WriteLiteral(" style=\"font-weight: normal;\"");
689
690 WriteLiteral(">");
691
692
693 #line 340 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
694 Write(Model.Title);
695
696
697 #line default
698 #line hidden
699 WriteLiteral("</h2>\r\n\t\t</header>\r\n");
700
701
702 #line 342 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
703 }
704
705
706 #line default
707 #line hidden
708 WriteLiteral("\r\n");
709
710 WriteLiteral("\t");
711
712
713 #line 344 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
714 Write(Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme"));
715
716
717 #line default
718 #line hidden
719 WriteLiteral("\r\n\r\n");
720
721
722 #line 346 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
723
724
725 #line default
726 #line hidden
727
728 #line 346 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
729 if (isVisualEditor)
730 {
731 if (font_configuration != null)
732 {
733 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
734 {
735
736
737 #line default
738 #line hidden
739 WriteLiteral("\t\t\t\t<link");
740
741 WriteAttribute("href", Tuple.Create(" href=\"", 13029), Tuple.Create("\"", 13053)
742
743 #line 352 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
744 , Tuple.Create(Tuple.Create("", 13036), Tuple.Create<System.Object, System.Int32>(item["FontLink"]
745
746 #line default
747 #line hidden
748 , 13036), false)
749 );
750
751 WriteLiteral(" rel=\"stylesheet\"");
752
753 WriteLiteral(">\r\n");
754
755
756 #line 353 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
757 }
758 }
759
760
761
762 #line default
763 #line hidden
764 WriteLiteral("\t\t<link");
765
766 WriteLiteral(" rel=\"stylesheet\"");
767
768 WriteLiteral(" href=\"https://pro.fontawesome.com/releases/v5.15.4/css/all.css\"");
769
770 WriteLiteral(" integrity=\"sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+k" +
771 "QU\"");
772
773 WriteLiteral(" crossorigin=\"anonymous\"");
774
775 WriteLiteral(">\r\n");
776
777
778 #line 357 "D:\dynamicweb.net\Solutions\Bluedesk\worldemp.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
779 }
780
781
782 #line default
783 #line hidden
784 WriteLiteral("</body>\r\n</html>\r\n");
785
786 }
787 }
788 }
789
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
48 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
49 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
50
51 @{
52
53 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration");
54 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>();
55
56 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false;
57
58 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : "";
59
60 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration;
61 EcomConfig EcommerceConfiguration = mc.EcomConfiguration;
62
63 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True";
64 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers;
65 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber;
66 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) {
67 WithVATBool = false;
68 }
69 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) {
70 WithVATBool = false;
71 }
72 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower();
73 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower();
74
75 bool IsNotContentManager = false;
76 bool isVisualEditor = Pageview.IsVisualEditorMode;
77
78 if (isVisualEditor)
79 {
80 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID;
81 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true);
82 }
83
84 BaseSettingsObj BaseSettings = new BaseSettingsObj();
85
86 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
87 HttpContext.Current.Session["BaseSettings"] = BaseSettings;
88
89 //if (HttpContext.Current.Session["BaseSettings"] == null)
90 //{
91
92 //}
93 //else
94 //{
95 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"];
96 // if (BaseSettings.AreaID != Pageview.AreaID)
97 // {
98 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
99 // HttpContext.Current.Session["BaseSettings"] = BaseSettings;
100 // }
101 //}
102
103 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration;
104 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons;
105
106 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
107
108 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain();
109 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName;
110 var langName = Pageview.Area.Culture;
111
112 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue();
113 var designRoot = BaseSettings.DesignRoot;
114
115 var phonenumber = BaseSettings.CorporateSettings.Phonenumber;
116 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty);
117 var emailadress = BaseSettings.CorporateSettings.Emailadress;
118 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right";
119 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm;
120 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor;
121
122 bool isOffline = false;
123
124 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime;
125 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime;
126 DateTime today = DateTime.Now;
127 var cHour = DateTime.Now.TimeOfDay;
128 int cDay = (int)DateTime.Now.DayOfWeek;
129 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5);
130 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None);
131 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture);
132 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat;
133 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay;
134 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd;
135 if (isNoValidDate || isOvertime)
136 {
137 isOffline = true;
138 }
139
140 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false;
141
142 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
143
144 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true);
145 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true);
146 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true);
147
148 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon;
149 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16;
150 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32;
151
152 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js");
153 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js");
154 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js");
155
156 //*** Start Scanapp configuration ***\\
157 bool hideHeader = false;
158 bool hideFooter = false;
159 bool hideBottombar = false;
160
161 if (HttpContext.Current.Session["ScanApp"] != null)
162 {
163 hideHeader = mc.ScanAppConfig.ShowHeader;
164 hideFooter = mc.ScanAppConfig.ShowFooter;
165 hideBottombar = mc.ScanAppConfig.ShowBottombar;
166 }
167 // END Scanapp configration **\\
168
169 }
170
171
172 <!DOCTYPE html>
173 <html prefix="og: http://ogp.me/ns#">
174 <head>
175 @*@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
176 @using System;
177 @using System.Web;
178 @using System.Linq;
179 @using System.Globalization;
180
181 @using Dynamicweb;
182 @using Dynamicweb.Content.Items;
183 @using Dynamicweb.Environment;
184 @using Dynamicweb.Frontend;
185 @using Dynamicweb.Frontend.Navigation;
186
187 @using Bluedesk.Tools.Generic;
188
189 @using Bluedesk.DynamicWeb.ItemTypes;
190 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
191
192 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
193 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
194 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
195 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
196 *@
197
198 </head>
199
200 <body>
201
202 <script type="text/javascript">
203
204 var stylesDump;
205
206 function onTryItClick(variable) {
207
208 var StyleID = variable + 'Style';
209 var contentID = variable + 'Content';
210 var frameID = variable + 'Frame';
211 var MasterConfigID = 'MasterConfig';
212
213 var style = document.getElementById(StyleID).innerHTML;
214 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
215 var content = document.getElementById(contentID).innerHTML;
216 var iframe = document.getElementById(frameID);
217
218 stylesDump = stylesDump + style;
219
220 var frameDoc = iframe.document;
221 if (iframe.contentWindow)
222 frameDoc = iframe.contentWindow.document;
223
224 frameDoc.open();
225 frameDoc.writeln(content);
226 frameDoc.writeln(MasterConfig);
227 frameDoc.writeln(stylesDump);
228 frameDoc.close();
229
230 document.getElementById(contentID).remove();
231
232 }
233
234 </script>
235
236 <section id="MasterConfig">
237 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
238 @using System;
239 @using System.Web;
240 @using System.Linq;
241 @using System.Globalization;
242
243 @using Dynamicweb;
244 @using Dynamicweb.Content.Items;
245 @using Dynamicweb.Environment;
246 @using Dynamicweb.Frontend;
247 @using Dynamicweb.Frontend.Navigation;
248
249 @using Bluedesk.Tools.Generic;
250
251 @using Bluedesk.DynamicWeb.ItemTypes;
252 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
253 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
254
255 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
256 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
257 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
258
259 @helper RenderCSSKeyAndValue(string Key, string Value)
260 {
261 if (!string.IsNullOrWhiteSpace(Value))
262 {
263 <text>@Key : @Value !important;</text>
264 }
265 }
266
267 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration)
268 {
269
270 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : "";
271 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : "";
272 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : "";
273 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : "";
274
275 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
276
277 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
278 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
279
280 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
281 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
282
283 <text>
284
285 --Position: @Position;
286
287 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding)
288
289 @RenderCSSKeyAndValue("--Top", Top)
290 @RenderCSSKeyAndValue("--Left", Left)
291 @RenderCSSKeyAndValue("--Right", Right)
292 @RenderCSSKeyAndValue("--Bottom", Bottom)
293
294 @RenderCSSKeyAndValue("--Color", Color)
295 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize)
296 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle)
297
298 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight)
299 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily)
300 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight)
301
302 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor)
303 @RenderCSSKeyAndValue("--BorderColor", BorderColor)
304 @RenderCSSKeyAndValue("--BorderSize", BorderSize)
305
306 </text>
307
308 }
309
310 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
311 @using System;
312 @using System.Web;
313 @using System.Linq;
314 @using System.Globalization;
315
316 @using Dynamicweb;
317 @using Dynamicweb.Content.Items;
318 @using Dynamicweb.Environment;
319 @using Dynamicweb.Frontend;
320 @using Dynamicweb.Frontend.Navigation;
321
322 @using Bluedesk.Tools.Generic;
323
324 @using Bluedesk.DynamicWeb.ItemTypes;
325 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
326
327 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
328 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
329 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
330 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
331
332 </section>
333
334 @if (isVisualEditor)
335 {
336 <link href="@appcss" rel="stylesheet" />
337
338 <header style="padding: 25px;">
339 <h1>Theme</h1>
340 <h2 style="font-weight: normal;">@Model.Title</h2>
341 </header>
342 }
343
344 @Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme")
345
346 @if (isVisualEditor)
347 {
348 if (font_configuration != null)
349 {
350 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
351 {
352 <link href="@item["FontLink"]" rel="stylesheet">
353 }
354 }
355
356 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous">
357 }
358 </body>
359 </html>
360