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 312 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 314 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 317 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 323 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 315 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 318 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 325 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 326 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 320 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 321 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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\koksgroup.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 319 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 313 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 331 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 328 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
99 using Bluedesk.DynamicWeb.ItemTypes.Configuration;
100101 #line default
102 #line hidden
103104 #line 329 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
105 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
106107 #line default
108 #line hidden
109110 #line 49 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
111 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
112113 #line default
114 #line hidden
115116 #line 330 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
117 using Bluedesk.DynamicWeb.ItemTypes.Extensions;
118119 #line default
120 #line hidden
121122123 public class RazorEngine_dfa2366b9b7e408bbaaf35eec3793a42 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> {
124125 #line hidden
126127 #line 260 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 => {
133134 #line 261 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
135136 if (!string.IsNullOrWhiteSpace(Value))
137 {
138139140 #line default
141 #line hidden
142 WriteLiteralTo(__razor_helper_writer, "\t\t");
143144145 #line 264 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
146 WriteTo(__razor_helper_writer, Key);
147148149 #line default
150 #line hidden
151 WriteLiteralTo(__razor_helper_writer, " : ");
152153154 #line 264 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
155 WriteTo(__razor_helper_writer, Value);
156157158 #line default
159 #line hidden
160 WriteLiteralTo(__razor_helper_writer, " !important;");
161162 WriteLiteralTo(__razor_helper_writer, "\r\n");
163164165 #line 265 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
166 }
167168169 #line default
170 #line hidden
171 });
172173 #line 266 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
174 }
175 #line default
176 #line hidden
177178179 #line 268 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.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 => {
185186 #line 269 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
187188189 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" : "";
193194 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
195196 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
197 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
198199 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
200 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
201202203204 #line default
205 #line hidden
206 WriteLiteralTo(__razor_helper_writer, "\t");
207208 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t\t--Position:\t\t");
209210211 #line 286 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
212 WriteTo(__razor_helper_writer, Position);
213214215 #line default
216 #line hidden
217 WriteLiteralTo(__razor_helper_writer, ";\r\n\r\n");
218219 WriteLiteralTo(__razor_helper_writer, "\t\t");
220221222 #line 288 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
223 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding));
224225226 #line default
227 #line hidden
228 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
229230 WriteLiteralTo(__razor_helper_writer, "\t\t");
231232233 #line 290 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
234 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Top", Top));
235236237 #line default
238 #line hidden
239 WriteLiteralTo(__razor_helper_writer, "\r\n");
240241 WriteLiteralTo(__razor_helper_writer, "\t\t");
242243244 #line 291 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
245 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Left", Left));
246247248 #line default
249 #line hidden
250 WriteLiteralTo(__razor_helper_writer, "\r\n");
251252 WriteLiteralTo(__razor_helper_writer, "\t\t");
253254255 #line 292 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
256 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Right", Right));
257258259 #line default
260 #line hidden
261 WriteLiteralTo(__razor_helper_writer, "\r\n");
262263 WriteLiteralTo(__razor_helper_writer, "\t\t");
264265266 #line 293 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
267 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Bottom", Bottom));
268269270 #line default
271 #line hidden
272 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
273274 WriteLiteralTo(__razor_helper_writer, "\t\t");
275276277 #line 295 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
278 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Color", Color));
279280281 #line default
282 #line hidden
283 WriteLiteralTo(__razor_helper_writer, "\r\n");
284285 WriteLiteralTo(__razor_helper_writer, "\t\t");
286287288 #line 296 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
289 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize));
290291292 #line default
293 #line hidden
294 WriteLiteralTo(__razor_helper_writer, "\r\n");
295296 WriteLiteralTo(__razor_helper_writer, "\t\t");
297298299 #line 297 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
300 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle));
301302303 #line default
304 #line hidden
305 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
306307 WriteLiteralTo(__razor_helper_writer, "\t\t");
308309310 #line 299 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
311 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight));
312313314 #line default
315 #line hidden
316 WriteLiteralTo(__razor_helper_writer, "\r\n");
317318 WriteLiteralTo(__razor_helper_writer, "\t\t");
319320321 #line 300 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
322 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily));
323324325 #line default
326 #line hidden
327 WriteLiteralTo(__razor_helper_writer, "\r\n");
328329 WriteLiteralTo(__razor_helper_writer, "\t\t");
330331332 #line 301 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
333 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight));
334335336 #line default
337 #line hidden
338 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n");
339340 WriteLiteralTo(__razor_helper_writer, "\t\t");
341342343 #line 303 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
344 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor));
345346347 #line default
348 #line hidden
349 WriteLiteralTo(__razor_helper_writer, "\r\n");
350351 WriteLiteralTo(__razor_helper_writer, "\t\t");
352353354 #line 304 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
355 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderColor", BorderColor));
356357358 #line default
359 #line hidden
360 WriteLiteralTo(__razor_helper_writer, "\r\n");
361362 WriteLiteralTo(__razor_helper_writer, "\t\t");
363364365 #line 305 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
366 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderSize", BorderSize));
367368369 #line default
370 #line hidden
371 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t");
372373 WriteLiteralTo(__razor_helper_writer, "\r\n");
374375376 #line 308 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
377378379380 #line default
381 #line hidden
382 });
383384 #line 309 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
385 }
386 #line default
387 #line hidden
388389390 public RazorEngine_dfa2366b9b7e408bbaaf35eec3793a42() {
391 }
392393 public override void Execute() {
394 WriteLiteral("\r\n");
395396397 #line 13 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
398 Write(Title("Configuration page template"));
399400401 #line default
402 #line hidden
403 WriteLiteral("\r\n\r\n");
404405406 #line 15 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
407408 var websitesettings = Dynamicweb.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id);
409 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
410411 var designRoot = "/Files/Templates/Designs/" + Pageview.Area.Layout.Design.Name;
412 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
413414 bool isThemeMaster = true;
415416 bool isVisualEditor = Dynamicweb.Context.Current.Request.GetBoolean("visualedit");
417418419 #line default
420 #line hidden
421 WriteLiteral("\r\n\r\n");
422423 WriteLiteral("\r\n");
424425 WriteLiteral("\r\n");
426427 WriteLiteral("\r\n");
428429 WriteLiteral("\r\n");
430431 WriteLiteral("\r\n");
432433 WriteLiteral("\r\n");
434435436 #line 51 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
437438439 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration");
440 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>();
441442 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false;
443444 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : "";
445446 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration;
447 EcomConfig EcommerceConfiguration = mc.EcomConfiguration;
448449 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();
460461 bool IsNotContentManager = false;
462 bool isVisualEditor = Pageview.IsVisualEditorMode;
463464 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 }
469470 BaseSettingsObj BaseSettings = new BaseSettingsObj();
471472 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
473 HttpContext.Current.Session["BaseSettings"] = BaseSettings;
474475 //if (HttpContext.Current.Session["BaseSettings"] == null)
476 //{
477478 //}
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 //}
488489 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration;
490 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons;
491492 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
493494 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain();
495 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName;
496 var langName = Pageview.Area.Culture;
497498 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue();
499 var designRoot = BaseSettings.DesignRoot;
500501 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;
507508 bool isOffline = false;
509510 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 }
525526 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false;
527528 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
529530 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);
533534 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;
537538 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");
541542 //*** Start Scanapp configuration ***\\
543 bool hideHeader = false;
544 bool hideFooter = false;
545 bool hideBottombar = false;
546547 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 **\\
554555 string areaIdClass = $"area-id-{Pageview.Area.ID}";
556557558 #line default
559 #line hidden
560 WriteLiteral("\r\n\r\n\r\n<!DOCTYPE html>\r\n<html");
561562 WriteLiteral(" prefix=\"og: http://ogp.me/ns#\"");
563564 WriteLiteral(">\r\n<head>\r\n\t");
565566 WriteLiteral("\r\n\r\n</head>\r\n\r\n<body>\r\n\r\n\t<script");
567568 WriteLiteral(" type=\"text/javascript\"");
569570 WriteLiteral(@">
571572 var stylesDump;
573574 function onTryItClick(variable) {
575576 var StyleID = variable + 'Style';
577 var contentID = variable + 'Content';
578 var frameID = variable + 'Frame';
579 var MasterConfigID = 'MasterConfig';
580581 var style = document.getElementById(StyleID).innerHTML;
582 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
583 var content = document.getElementById(contentID).innerHTML;
584 var iframe = document.getElementById(frameID);
585586 stylesDump = stylesDump + style;
587588 var frameDoc = iframe.document;
589 if (iframe.contentWindow)
590 frameDoc = iframe.contentWindow.document;
591592 frameDoc.open();
593 frameDoc.writeln(content);
594 frameDoc.writeln(MasterConfig);
595 frameDoc.writeln(stylesDump);
596 frameDoc.close();
597598 document.getElementById(contentID).remove();
599600 }
601602 </script>
603604 <section");
605606 WriteLiteral(" id=\"MasterConfig\"");
607608 WriteLiteral(">\r\n");
609610611 #line 238 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
612613614 #line default
615 #line hidden
616 WriteLiteral("\r\n");
617618 WriteLiteral("\r\n");
619620 WriteLiteral("\r\n");
621622 WriteLiteral("\r\n");
623624 WriteLiteral("\r\n");
625626 WriteLiteral("\r\n");
627628 WriteLiteral("\r\n");
629630631 #line 311 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
632633634 #line default
635 #line hidden
636 WriteLiteral("\r\n");
637638 WriteLiteral("\r\n");
639640 WriteLiteral("\r\n");
641642 WriteLiteral("\r\n");
643644 WriteLiteral("\r\n\t</section>\r\n\r\n");
645646647 #line 335 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
648649650 #line default
651 #line hidden
652653 #line 335 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
654 if (isVisualEditor)
655 {
656657658 #line default
659 #line hidden
660 WriteLiteral("\t\t<link");
661662 WriteAttribute("href", Tuple.Create(" href=\"", 12578), Tuple.Create("\"", 12592)
663664 #line 337 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
665 , Tuple.Create(Tuple.Create("", 12585), Tuple.Create<System.Object, System.Int32>(appcss
666667 #line default
668 #line hidden
669 , 12585), false)
670 );
671672 WriteLiteral(" rel=\"stylesheet\"");
673674 WriteLiteral(" />\r\n");
675676677 #line 338 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
678679680681 #line default
682 #line hidden
683 WriteLiteral("\t\t<header");
684685 WriteLiteral(" style=\"padding: 25px;\"");
686687 WriteLiteral(">\r\n\t\t\t<h1>Theme</h1>\r\n\t\t\t<h2");
688689 WriteLiteral(" style=\"font-weight: normal;\"");
690691 WriteLiteral(">");
692693694 #line 341 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
695 Write(Model.Title);
696697698 #line default
699 #line hidden
700 WriteLiteral("</h2>\r\n\t\t</header>\r\n");
701702703 #line 343 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
704 }
705706707 #line default
708 #line hidden
709 WriteLiteral("\r\n");
710711 WriteLiteral("\t");
712713714 #line 345 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
715 Write(Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme"));
716717718 #line default
719 #line hidden
720 WriteLiteral("\r\n\r\n");
721722723 #line 347 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
724725726 #line default
727 #line hidden
728729 #line 347 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
730 if (isVisualEditor)
731 {
732 if (font_configuration != null)
733 {
734 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
735 {
736737738 #line default
739 #line hidden
740 WriteLiteral("\t\t\t\t<link");
741742 WriteAttribute("href", Tuple.Create(" href=\"", 13084), Tuple.Create("\"", 13108)
743744 #line 353 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
745 , Tuple.Create(Tuple.Create("", 13091), Tuple.Create<System.Object, System.Int32>(item["FontLink"]
746747 #line default
748 #line hidden
749 , 13091), false)
750 );
751752 WriteLiteral(" rel=\"stylesheet\"");
753754 WriteLiteral(">\r\n");
755756757 #line 354 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
758 }
759 }
760761762763 #line default
764 #line hidden
765 WriteLiteral("\t\t<link");
766767 WriteLiteral(" rel=\"stylesheet\"");
768769 WriteLiteral(" href=\"https://pro.fontawesome.com/releases/v5.15.4/css/all.css\"");
770771 WriteLiteral(" integrity=\"sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+k" +
772 "QU\"");
773774 WriteLiteral(" crossorigin=\"anonymous\"");
775776 WriteLiteral(">\r\n");
777778779 #line 358 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml"
780 }
781782783 #line default
784 #line hidden
785 WriteLiteral("</body>\r\n</html>\r\n");
786787 }
788 }
789 }
790
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 //}
102103 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration;
104 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons;
105106 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
107108 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain();
109 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName;
110 var langName = Pageview.Area.Culture;
111112 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue();
113 var designRoot = BaseSettings.DesignRoot;
114115 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;
121122 bool isOffline = false;
123124 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 }
139140 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false;
141142 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
143144 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);
147148 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;
151152 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");
155156 //*** Start Scanapp configuration ***\\
157 bool hideHeader = false;
158 bool hideFooter = false;
159 bool hideBottombar = false;
160161 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 **\\
168169 string areaIdClass = $"area-id-{Pageview.Area.ID}";
170 }
171172173 <!DOCTYPE html>
174 <html prefix="og: http://ogp.me/ns#">
175 <head>
176 @*@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
177 @using System;
178 @using System.Web;
179 @using System.Linq;
180 @using System.Globalization;
181182 @using Dynamicweb;
183 @using Dynamicweb.Content.Items;
184 @using Dynamicweb.Environment;
185 @using Dynamicweb.Frontend;
186 @using Dynamicweb.Frontend.Navigation;
187188 @using Bluedesk.Tools.Generic;
189190 @using Bluedesk.DynamicWeb.ItemTypes;
191 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
192193 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
194 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
195 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
196 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
197 *@
198199 </head>
200201 <body>
202203 <script type="text/javascript">
204205 var stylesDump;
206207 function onTryItClick(variable) {
208209 var StyleID = variable + 'Style';
210 var contentID = variable + 'Content';
211 var frameID = variable + 'Frame';
212 var MasterConfigID = 'MasterConfig';
213214 var style = document.getElementById(StyleID).innerHTML;
215 var MasterConfig = document.getElementById(MasterConfigID).innerHTML;
216 var content = document.getElementById(contentID).innerHTML;
217 var iframe = document.getElementById(frameID);
218219 stylesDump = stylesDump + style;
220221 var frameDoc = iframe.document;
222 if (iframe.contentWindow)
223 frameDoc = iframe.contentWindow.document;
224225 frameDoc.open();
226 frameDoc.writeln(content);
227 frameDoc.writeln(MasterConfig);
228 frameDoc.writeln(stylesDump);
229 frameDoc.close();
230231 document.getElementById(contentID).remove();
232233 }
234235 </script>
236237 <section id="MasterConfig">
238 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
239 @using System;
240 @using System.Web;
241 @using System.Linq;
242 @using System.Globalization;
243244 @using Dynamicweb;
245 @using Dynamicweb.Content.Items;
246 @using Dynamicweb.Environment;
247 @using Dynamicweb.Frontend;
248 @using Dynamicweb.Frontend.Navigation;
249250 @using Bluedesk.Tools.Generic;
251252 @using Bluedesk.DynamicWeb.ItemTypes;
253 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
254 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
255256 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
257 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
258 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
259260 @helper RenderCSSKeyAndValue(string Key, string Value)
261 {
262 if (!string.IsNullOrWhiteSpace(Value))
263 {
264 <text>@Key : @Value !important;</text>
265 }
266 }
267268 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration)
269 {
270271 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : "";
272 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : "";
273 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : "";
274 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : "";
275276 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
277278 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
279 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
280281 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
282 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
283284 <text>
285286 --Position: @Position;
287288 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding)
289290 @RenderCSSKeyAndValue("--Top", Top)
291 @RenderCSSKeyAndValue("--Left", Left)
292 @RenderCSSKeyAndValue("--Right", Right)
293 @RenderCSSKeyAndValue("--Bottom", Bottom)
294295 @RenderCSSKeyAndValue("--Color", Color)
296 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize)
297 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle)
298299 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight)
300 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily)
301 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight)
302303 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor)
304 @RenderCSSKeyAndValue("--BorderColor", BorderColor)
305 @RenderCSSKeyAndValue("--BorderSize", BorderSize)
306307 </text>
308309 }
310311 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
312 @using System;
313 @using System.Web;
314 @using System.Linq;
315 @using System.Globalization;
316317 @using Dynamicweb;
318 @using Dynamicweb.Content.Items;
319 @using Dynamicweb.Environment;
320 @using Dynamicweb.Frontend;
321 @using Dynamicweb.Frontend.Navigation;
322323 @using Bluedesk.Tools.Generic;
324325 @using Bluedesk.DynamicWeb.ItemTypes;
326 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
327328 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
329 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
330 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
331 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
332333 </section>
334335 @if (isVisualEditor)
336 {
337 <link href="@appcss" rel="stylesheet" />
338339 <header style="padding: 25px;">
340 <h1>Theme</h1>
341 <h2 style="font-weight: normal;">@Model.Title</h2>
342 </header>
343 }
344345 @Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme")
346347 @if (isVisualEditor)
348 {
349 if (font_configuration != null)
350 {
351 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
352 {
353 <link href="@item["FontLink"]" rel="stylesheet">
354 }
355 }
356357 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous">
358 }
359 </body>
360 </html>
361