Error executing template "Designs/Wizaris/_parsed/NewsArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.b__159_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7204
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass4_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 852
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 766
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.b__157_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7186
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass4_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 852
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 766
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass4_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 874
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 766
   at CompiledRazorTemplates.Dynamic.RazorEngine_a57eace95b464ac6b4e83ec89f3bc137.Execute() in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7146
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @using System.Web; 4 @using Dynamicweb.Frontend 5 @using Dynamicweb.Frontend.Devices 6 @using Dynamicweb.Extensibility 7 @using Dynamicweb.Content 8 @using Dynamicweb.Security 9 @using Dynamicweb.Core 10 @using System 11 @using System.Web 12 @using System.IO 13 @using Dynamicweb.Rapido.Blocks 14 @using System.Net 15 @using Df.Dw 16 @using Dynamicweb.Security.UserManagement 17 18 @functions { 19 BlocksPage masterPage = BlocksPage.GetBlockPage("Master"); 20 21 string getFontFamily(params string[] items) 22 { 23 var itemParent = Pageview.AreaSettings; 24 foreach (var item in items) 25 { 26 itemParent = itemParent.GetItem(item); 27 if (itemParent == null) 28 { 29 return null; 30 } 31 } 32 33 var googleFont = itemParent.GetGoogleFont("FontFamily"); 34 if (googleFont == null) 35 { 36 return null; 37 } 38 return googleFont.Family.Replace(" ", "+"); 39 } 40 } 41 @* Include the custom components *@ 42 @using System.Text.RegularExpressions 43 @using System.Collections.Generic 44 @using System.Reflection 45 @using System.Web.UI.HtmlControls 46 @using Dynamicweb.News 47 @using Dynamicweb.Rapido.Blocks.Components 48 @using Dynamicweb.Rapido.Blocks.Components.Articles 49 @using Dynamicweb.Rapido.Blocks.Components.Documentation 50 @using Dynamicweb.Rapido.Blocks 51 52 @functions{ 53 public class Translations 54 { 55 public class General 56 { 57 public static string 58 Logo = "General_Logo", 59 GenerateAWB = "General_GenerateAWB", 60 WarrantyErrorField = "General_WarrantyErrorField", 61 Utilizator = "General_Utilizator", 62 SeeCatalog = "General_SeeCatalog", 63 SelectGuestReturnReason = "General_SelectGuestReturnReason", 64 AnErrorHasOccured = "General_AnErrorHasOccured", 65 DeliveryAgent = "General_DeliveryAgent", 66 SelectCountry = "General_SelectCountry", 67 DateInterval = "General_DateInterval", 68 CloseModal = "General_CloseModal", 69 ClosePanel = "General_ClosePanel", 70 SearchPage = "General_SearchPage", 71 Search = "General_Search", 72 CloseSearch = "General_CloseSearch", 73 All = "General_All", 74 View = "General_View", 75 ViewAll = "General_ViewAll", 76 ReadMore = "General_ReadMore", 77 More = "General_More", 78 Load = "General_Load", 79 Add = "General_Add", 80 Remove = "General_Remove", 81 Save = "General_Save", 82 Close = "General_Close", 83 Go = "General_Go", 84 Back = "General_Back", 85 Hi = "General_Hi", 86 Edit = "General_Edit", 87 Delete = "General_Delete", 88 DownloadExcel = "General_DownloadExcel", 89 Cancel = "General_Cancel", 90 SetDefault = "General_SetDefault", 91 Submit = "General_Submit", 92 SocialLinks = "General_SocialLinks", 93 MailingList = "General_MailingList", 94 YourEmailAddress = "General_YourEmailAddress", 95 SignUpMessage = "General_SignUpMessage", 96 SignUpForm = "General_SignUpForm", 97 YourSearchGave0Results = "General_YourSearchGave0Results", 98 Contact = "General_Contact", 99 Pages = "General_Pages", 100 NotAvailable = "General_NotAvailable", 101 Default = "General_Default", 102 Yes = "General_Yes", 103 No = "General_No", 104 Page = "General_Page", 105 Of = "General_Of", 106 FirstPage = "General_FirstPage", 107 LastPage = "General_LastPage", 108 ReturnToTop = "General_ReturnToTop", 109 Details = "General_Details", 110 Information = "General_Information", 111 Downloads = "General_Downloads", 112 Download = "General_Download", 113 GeneratePdf = "General_GeneratePdf", 114 DownloadPdf = "General_DownloadPdf", 115 Select = "General_Select", 116 SelectType = "General_SelectType", 117 Type = "General_Type", 118 RequestType = "General_RequestType", 119 Language = "General_Language", 120 Images = "General_Images", 121 Documents = "General_Documents", 122 Export = "General_Export", 123 ImagePurpose = "General_ImagePurpose", 124 Office = "General_Office", 125 Original = "General_Original", 126 Print = "General_Print", 127 Web = "General_Web", 128 ExportFormat = "General_ExportFormat", 129 Videos = "General_Videos", 130 AskForInfo = "General_AskForInfo", 131 DataSheet = "General_DataSheet", 132 LinkToPage = "General_LinkToPage", 133 Again = "General_Again", 134 Notice = "General_Notice", 135 Form = "General_Form", 136 TechnicalContact = "General_TechnicalContact", 137 Error = "General_Error", 138 Warning = "General_Warning", 139 Status = "General_Status", 140 State = "General_State", 141 NoDocumentsFound = "General_NoDocumentsFound", 142 CreditMemo = "General_CreditMemo", 143 History = "General_History", 144 Comment = "General_Comment", 145 AddComment = "General_AddComment", 146 EnterComment = "General_EnterComment", 147 NothingSelected = "General_NothingSelected", 148 Never = "General_Never", 149 Days = "General_Days", 150 Weeks = "General_Weeks", 151 Months = "General_Months", 152 IAcceptTheTermsAndConditions = "General_IAcceptTheTermsAndConditions", 153 TheTermsAndConditionsOfThisWebsite = "General_TheTermsAndConditionsOfThisWebsite", 154 ReadGeneralConditions = "General_ReadGeneralConditions", 155 SubscribeToNewsletter = "General_SubscribeToNewsletter", 156 Use = "General_Use", 157 Choose = "General_Choose", 158 Free = "General_Free", 159 Next = "General_Next", 160 GoTo = "General_GoTo", 161 NotFound = "General_NotFound", 162 AlreadyUsed = "General_AlreadyUsed", 163 IsNotActive = "General_IsNotActive", 164 Apply = "General_Apply", 165 NoItemsFound = "General_NoItemsFound", 166 GoToFrontPage = "General_GoToFrontPage", 167 LoginModalHeading = "General_LoginModalHeading", 168 LoginModalSubHeading = "General_LoginModalSubHeading", 169 ViewInBrowser = "General_ViewInBrowser", 170 CantSeeMessage = "General_CantSeeMessage", 171 Welcome = "General_Welcome", 172 Continue = "General_Continue", 173 UserIsActivated = "General_UserIsActivated", 174 Create = "General_Create", 175 ViewOffer = "General_ViewOffer", 176 CookiesHeader = "General_CookiesHeader", 177 CookiesText1 = "General_CookiesText1", 178 CookiesText2 = "General_CookiesText2", 179 CookiesDoNotAcceptCookies = "General_CookiesDoNotAcceptCookies", 180 CookiesOnlyAcceptFunctionalCookies = "General_OnlyAcceptFunctionalCookies", 181 CookiesAcceptAllCookies = "General_AcceptAllCookies", 182 RMADetailsEmail = "General_RMADetailsEmail", 183 RMAClientName = "General_RMAClientName", 184 RMADataCererii = "General_RMADataCererii", 185 RMATipCerere = "General_RMATipCerere", 186 RMAOrderInitial = "General_RMAOrderInitial", 187 RMAEmailText = "General_RMAEmailText"; 188 } 189 public class Account 190 { 191 public static string 192 LogIn = "Account_LogIn", 193 ReturnForm = "Account_ReturnForm", 194 Promotions = "Account_Promotions", 195 Resupply = "Account_Resupply", 196 WorkInProgressOrders = "Account_WorkInProgressOrders", 197 ExchangePartsRequests = "Account_ExchangePartsRequests", 198 DeliverYourselfOrders = "Account_DeliverYourselfOrders", 199 PickedUpFromStoreOrders = "Account_PickedUpFromStoreOrders", 200 OrdersDeliveredByYou = "Account_OrdersDeliveredByYou", 201 SignIn = "Account_SignIn", 202 SignOut = "Account_SignOut", 203 CreateAccount = "Account_CreateAccount", 204 ForgotYourPassword = "Account_ForgotYourPassword", 205 ResetYourPassword = "Account_ResetYourPassword", 206 RememberMe = "Account_RememberMe", 207 Password = "Account_Password", 208 Name = "Account_Name", 209 FirstName = "Account_FirstName", 210 LastName = "Account_LastName", 211 Description = "Address_Description", 212 Email = "Account_Email", 213 Username = "Account_Username", 214 Phone = "Account_Phone", 215 ZipCode = "Account_ZipCode", 216 City = "Account_City", 217 Country = "Account_Country", 218 CompanyName = "Account_CompanyName", 219 CompanyAddress = "Account_CompanyAddress", 220 CompanyCity = "Account_CompanyCity ", 221 CompanyZip = "Account_CompanyZip", 222 CompanyCountry = "Account_CompanyCountry", 223 CompanyID = "Account_CompanyID", 224 CompanyTIN = "Account_CompanyTIN", 225 CompanyVAT = "Account_CompanyVAT", 226 CompanyTermsOfPayment = "Account_CompanyTermsOfPayment", 227 Company = "Account_Company", 228 CustomerNumber = "Account_CustomerNumber", 229 StateRegion = "Account_StateRegion", 230 NewPassword = "Account_NewPassword", 231 OldPassword = "Account_OldPassword", 232 ConfirmPassword = "Account_ConfirmPassword", 233 BusinessNumber = "Account_BusinessNumber", 234 AlreadyACustomer = "Account_AlreadyACustomer", 235 MyProfile = "Account_MyProfile", 236 EditProfile = "Account_EditProfile", 237 MyOrders = "Account_MyOrders", 238 MyFavorites = "Account_MyFavorites", 239 MySavedCards = "Account_MySavedCards", 240 StopImpersonation = "Account_StopImpersonation", 241 Impersonate = "Account_Impersonate", 242 IsImpersonating = "Account_IsImpersonating", 243 StopImpresonationPageText ="Account_StopImpresonationPageText", 244 SelectUserToImpersonate = "Account_SelectUserToImpersonate", 245 SearchUser = "Account_SearchUser", 246 ViewListOfUsers = "Account_ViewListOfUsers", 247 PasswordLengthIsInvalid = "Account_PasswordLengthIsInvalid", 248 InvalidEmailOrPassword = "Account_InvalidEmailOrPassword", 249 LimitOfAllowedLoginAttempts = "Account_LimitOfAllowedLoginAttempts", 250 TheUserAccountIsTemporarilyLocked = "Account_TheUserAccountIsTemporarilyLocked", 251 ThePasswordHasExpired = "Account_ThePasswordHasExpired", 252 AnUnknownErrorOccured = "Account_AnUnknownErrorOccured", 253 CreateAccountIncentive = "Account_CreateAccountIncentive", 254 CreateAccountIncentiveWithoutStock = "Account_CreateAccountIncentiveWithoutStock", 255 SignUpToSeeTheStock = "Account_SignUpToSeeTheStock", 256 InsertYourEmailMsg = "Account_InsertYourEmailMsg", 257 UserNotFound = "Account_UserNotFound", 258 UsersFound = "Account_UsersFound", 259 SendPasswordRecovery = "Account_SendPasswordRecovery", 260 PasswordRecovery = "Account_PasswordRecovery", 261 SomethingWentWrong = "Account_SomethingWentWrong", 262 TryRecoverPassword = "Account_TryRecoverPassword", 263 TheRecoveryPasswordLinkOutOfDate = "Account_TheRecoveryPasswordLinkOutOfDate", 264 ChooseANewPassword = "Account_ChooseANewPassword", 265 PasswordChanged = "Account_PasswordChanged", 266 SentEmailWithALinks = "Account_SentEmailWithALinks", 267 SentEmailWithThePassword = "Account_SentEmailWithThePassword", 268 AStrongPassword = "Account_AStrongPassword", 269 WeHaveReceivedARequest = "Account_WeHaveReceivedARequest", 270 ClickToSetANewPassword = "Account_ClickToSetANewPassword", 271 IgnoreThisEmail = "Account_IgnoreThisEmail", 272 CompleteOrdersCount = "Account_CompleteOrdersCount", 273 CompanyCreditLimit = "Account_CompanyCreditLimit", 274 InvoiceValue = "Account_InvoiceValue", 275 CompanySold = "Account_CompanySold", 276 CompanyOverdue = "Account_CompanyOverdue", 277 OpenOrders = "Account_OpenOrders", 278 PlacedOrders = "Account_PlacedOrders", 279 ProductsOnSale = "Account_ProductsOnSale", 280 LoyaltyPoints = "Account_LoyaltyPoints", 281 RequestAccountStatements = "Account_RequestAccountStatements", 282 RequestComplaintForm = "Account_RequestComplaintForm", 283 CompanyCreditLimitInfo = "Account_CompanyCreditLimitInfo", 284 YourConsents = "Account_YourConsents", 285 YourPointBalance = "Account_YourPointBalance", 286 Address = "Account_Address", 287 Address2 = "Account_Address2", 288 Addresses = "Account_Addresses", 289 MyAddresses = "Account_MyAddresses", 290 ManageAddresses = "Account_ManageAddresses", 291 NoAddressFound = "Account_NoAddressFound", 292 DefaultLocation = "Account_DefaultLocation", 293 DefaultPayment = "Account_DefaultPayment", 294 PaymentTerm = "Account_PaymentTerm", 295 MainAddressCanNotBeDeleted = "Account_MainAddressCanNotBeDeleted", 296 YouCanNotDeleteADefaultAddress = "Account_YouCanNotDeleteADefaultAddress", 297 AddNewAddress = "Account_AddNewAddress", 298 DeliveryAddresses = "Account_DeliveryAddresses", 299 BillingAddresses = "Account_BillingAddresses", 300 NoAddressesFound = "Account_NoAddressesFound", 301 EditAddress = "Account_EditAddress", 302 AddAddress = "Account_AddAddress", 303 SaveAddress = "Account_SaveAnAddress", 304 StreetNumber = "Account_StreetNumber", 305 DeleteThisAddress = "Account_DeleteThisAddress", 306 NoRMAsListFound = "Account_NoRMAsListFound", 307 RMASelectTypeFirst = "Account_SelectRMATypeFirst", 308 CancelTheRequest = "Account_CancelTheRequest", 309 EmittedWarranties = "Account_EmittedWarranties", 310 ViewRma = "Account_ViewRma", 311 CancelRma = "Account_CancelRma", 312 CreateNewRequest = "Account_CreateNewRequest", 313 CreateRequest = "Account_CreateRequest", 314 CancelRequest = "Account_CancelRequest", 315 ViewRequest = "Account_ViewRequest", 316 RmaId = "Account_RmaId", 317 AdditionalInfo = "Account_AdditionalInfo", 318 CustomerComment = "Account_CustomerComment", 319 CustomerDetails = "Account_CustomerDetails", 320 NoFavoritesListsFound = "Account_NoFavoritesListsFound", 321 CreateNewList = "Account_CreateNewList", 322 AddNewList = "Account_AddNewList", 323 EditList = "Account_EditList", 324 SetAsDefault = "Account_SetAsDefault", 325 DeleteThisFavoriteList = "Account_DeleteThisFavoriteList", 326 PublishedTo = "Account_PublishedTo", 327 ReturnToList = "Account_ReturnToList", 328 ShouldTheListBePublic = "Account_ShouldTheListBePublic", 329 IsThisTheDefaultList = "Account_IsThisTheDefaultList", 330 CreateList = "Account_CreateList", 331 BackToProfile = "Account_BackToProfile", 332 YouAreAlmostThere = "Account_YouAreAlmostThere", 333 CheckYourEmailToConfirmYourUserProfile = "Account_CheckYourEmailToConfirmYourUserProfile", 334 ProfileComplete = "Account_ProfileComplete", 335 ProfileCompletePageText = "Account_ProfileCompletePageText", 336 CreateUserAccount = "Account_CreateUserAccount", 337 CreateYourNewAccount = "Account_CreateYourNewAccount", 338 YouAlreadyExistInOurSystemClickBelowToResetYourPassword = "Account_YouAlreadyExistInOurSystemClickBelowToResetYourPassword", 339 ResetPassword = "Account_ResetPassword", 340 PrivatePerson = "Account_PrivatePerson", 341 EmptyFields = "Account_CompleteAllFields", 342 PasswordsNoMatch = "Account_PasswordsDoNotMatch", 343 FillOldPasswordFirst = "Account_FillOldPasswordFirst", 344 PasswordFieldCannotBeEmpty = "Account_PasswordShouldNotBeEmpty", 345 PasswordCannotBeEmpty = "Account_PasswordCannotBeEmpty", 346 NewPasswordConfimShouldNotBeEmpty = "Account_NewPasswordConfimShouldNotBeEmpty", 347 NameCannotBeEmpty = "Account_NameCannotBeEmpty", 348 FirstNameCannotBeEmpty = "Account_FirstNameCannotBeEmpty", 349 LastNameCannotBeEmpty = "Account_LastNameCannotBeEmpty", 350 ConfirmAccount = "Account_ConfirmAccount", 351 ConfirmAccountEmailSubheader = "Account_ConfirmAccountEmailSubheader", 352 ConfirmAccountEmailHi = "Account_ConfirmAccountEmailHi", 353 ConfirmAccountEmailTextOne = "Account_ConfirmAccountEmailTextOne", 354 ConfirmAccountEmailTextTwo = "Account_ConfirmAccountEmailTextTwo", 355 ConfirmAccountEmailTextEnd = "Account_ConfirmAccountEmailTextEnd", 356 ActivatedEmailAccountTextOne = "Account_ActivatedEmailAccountTextOne", 357 ActivatedEmailClickButton = "Account_ActivatedEmailClickButton", 358 ActivatedEmailTextFooter = "Account_ActivatedEmailTextFooter", 359 ConfirmEmail = "Account_ConfirmEmail", 360 AddNewWarranty = "Account_AddNewWarranty", 361 CreateNewWarranty = "Account_CreateWarranty", 362 CreateNewService = "Account_CreateService", 363 CreateNewPartsExchange = "Account_CreatePartsExchange", 364 EmailCannotBeEmpty = "Account_EmailCannotBeEmpty"; 365 } 366 public class Products 367 { 368 public static string 369 SelectRating = "Products_SelectRating", 370 RatingHeadline = "Products_RatingHeadline", 371 LoginToReview = "Products_LoginToReview", 372 NoReviewsFound = "Products_NoReviewsFound", 373 ProductsGeneral = "Products_ProductsGeneral", 374 NotifyWhenBackOnStock = "Products_NotifyWhenBackOnStock", 375 NotifyWhenBackOnStockSent = "Products_NotifyWhenBackOnStockSent", 376 NotifyWhenBackOnStockRegistered = "Products_NotifyWhenBackOnStockRegistered", 377 NotifyWhenBackOnStockAlreadySent = "Products_NotifyWhenBackOnStockAlreadySent", 378 ExchangePartsFor = "Products_ExchangePartsFor", 379 Product = "Products_Product", 380 AnyProduct = "Product_AnyProduct", 381 ProductNo = "Products_ProductNo", 382 ProductCode = "Products_ProductCode", 383 Prod = "Products_Prod", 384 Price = "Products_Price", 385 Vat = "Products_Vat", 386 SearchProductsOrPages = "Products_SearchProductsOrPages", 387 SearchProducts = "Products_SearchProducts", 388 SearchResultFor = "Products_SearchResultFor", 389 Newest = "Products_Newest", 390 PriceHighLow = "Products_PriceHighLow", 391 PriceLowHigh = "Products_PriceLowHigh", 392 Stock = "Products_Stock", 393 TotalStock = "Products_TotalStock", 394 InStock = "Products_InStock", 395 OutOfStock = "Products_OutOfStock", 396 Delivery = "Products_Delivery", 397 SearchFavoriteProducts = "Products_SearchFavoriteProducts", 398 Filters = "Products_Filters", 399 SelectFilters = "Products_SelectFilters", 400 CloseFilters = "Products_CloseFilters", 401 RemoveFilters = "Products_RemoveFilters", 402 ResetAllFilters = "Products_ResetAllFilters", 403 ProductCategories = "Products_ProductCategories", 404 Categories = "Products_Categories", 405 ExclVAT = "Products_ExclVAT", 406 InclVAT = "Products_InclVAT", 407 BuyWithPoints = "Products_BuyWithPoints", 408 MoreOptionsAvailable = "Products_MoreOptionsAvailable", 409 ProductNumber = "Products_ProductNumber", 410 Brand = "Products_Brand", 411 Buc = "Products_Buc", 412 PleaseSelectVariant = "Products_PleaseSelectVariant", 413 Sort = "Products_Sort", 414 SortBy = "Products_SortBy", 415 Summary = "Products_Summary", 416 Description = "Products_Description", 417 Specifications = "Products_Specifications", 418 Reviews = "Products_Reviews", 419 GeneralReviews = "Products_GeneralReviews", 420 AddAReview = "Products_AddAReview", 421 ProductAssets = "Products_ProductAssets", 422 Variants = "Products_Variants", 423 VariantsList = "Products_VariantsList", 424 IncludingProducts = "Products_IncludingProducts", 425 MinimumQuantity = "Products_MinimumQuantity", 426 StepQuantity = "Products_StepQuantity", 427 PriceWithVat = "Products_PriceWithVat", 428 Quantity = "Products_Quantity", 429 TotalPrice = "Products_TotalPrice", 430 TotalWithVat = "Products_TotalWithVat", 431 RecentSearches = "Products_RecentSearches", 432 ItemNumber = "Products_ItemNumber", 433 UnitPrice = "Products_UnitPrice", 434 ViewFavorites = "Products_ViewFavorites", 435 ChooseList = "Products_ChooseList", 436 WasAddedToFavoriteList = "Product_WasAddedToFavoriteList", 437 WasRemovedFromFavoriteList = "Product_WasRemovedFromFavoriteList", 438 RemoveFromCurrentFavoriteList = "Product_RemoveFromCurrentFavoriteList", 439 NotEligibleForWarranty = "Product_NotEligibleForWarranty", 440 AddToFavoritesLabel = "Products_AddToFavoritesLabel", 441 AddToFavorites = "Products_AddToFavorites", 442 RemoveFromFavorites = "Products_RemoveFromFavorites", 443 OrCreateOne = "Products_OrCreateOne", 444 OrCreateOneAndAddTheProductToIt = "Products_OrCreateOneAndAddTheProductToIt", 445 NoListsCreateOneAbove = "Products_NoListsCreateOneAbove", 446 EnterAListName = "Products_EnterAListName", 447 ListWithSameNameAlreadyExists = "Products_ListWithSameNameExists", 448 SeeFavoriteList = "Products_SeeFavoriteList", 449 Compare = "Products_Compare", 450 AddToCompare = "Products_AddToCompare", 451 RemoveFromCompare = "Products_RemoveFromCompare", 452 ViewMore = "Products_ViewMore", 453 RecommendedPrice = "Products_RecommendedPrice", 454 YouSave = "Products_YouSave", 455 SalesUOM = "Products_SalesUOM", 456 AvailablilityDateMessage = "Product_AvailableIn", 457 MaximumQuantity = "Products_MaximumQuantity"; 458 459 } 460 public class Cart 461 { 462 public static string 463 CartGeneral = "Cart_CartGeneral", 464 DeleteProducts = "Cart_DeleteProducts", 465 SubtotalWithVAT = "Cart_SubtotalWithVAT", 466 SeeCart = "Cart_SeeCart", 467 UnavailableProducts = "Cart_UnavailableProducts", 468 SelectCountyForShipping = "Cart_SelectCountyForShipping", 469 SelectAddressForShipping = "Cart_SelectAddressForShipping", 470 CannotFinishOrder = "Cart_CannotFinishOrder", 471 PlacedOrderDate = "Cart_PlacedOrderDate", 472 MaxFinalizeDate = "Cart_MaxFinalizeDate", 473 WaitingMarketplaceOrders = "Cart_WaitingMarketplaceOrders", 474 ApprovedOrRejectedMarketplaceOrders = "Cart_ApprovedOrRejectedMarketplaceOrders", 475 MarketplaceNoOrdersWaitingFound = "Cart_NoMarketplaceOrdersWaitingFound", 476 MarketplaceNoOrdersAcceptedOrRejectedFound = "Cart_NoMarketplaceOrdersAcceptedOrRejectedFound", 477 DeliverOrder = "Cart_DeliverOrder", 478 OrderDetails = "Cart_OrderDetails", 479 ApproveOrder = "Cart_ApproveOrder", 480 ApprovedOrder = "Cart_ApprovedOrder", 481 RejectOrder = "Cart_RejectOrder", 482 RejectedOrder = "Cart_RejectedOrder", 483 DeliveredOrder = "Cart_DeliveredOrder", 484 SearchMarketplaceOrders = "Cart_SearchMarketplaceOrders", 485 SelectOneOrMoreExchangeParts = "Cart_ChooseOneOrMoreExchangeParts", 486 ShoppingCart = "Cart_ShoppingCart", 487 ProductIsAddedToTheCart = "Cart_ProductIsAddedToTheCart", 488 ProductsAreAddedToTheCart = "Cart_ProductsAreAddedToTheCart", 489 ContinueShopping = "Cart_ContinueShopping", 490 ProceedToCheckout = "Cart_ProceedToCheckout", 491 Earnings = "Cart_Earnings", 492 Points = "Cart_Points", 493 NoPointsFound = "Cart_NoPointsFound", 494 YourPointBalance = "Cart_YourPointBalance", 495 UsedPoints = "Cart_UsedPoints", 496 AddPoints = "Cart_AddPoints", 497 Variant = "Cart_Variant", 498 Unit = "Cart_Unit", 499 Qty = "Cart_Qty", 500 Subtotal = "Cart_Subtotal", 501 Total = "Cart_Total", 502 CannotOrder = "Cart_CannotOrder", 503 RemoveOrderline = "Cart_RemoveOrderline", 504 UpdateOrderline = "Cart_UpdateOrderline", 505 OrderlineRemoved = "Cart_OrderlineRemoved", 506 NotEnoughPointsToBuyThis = "Cart_NotEnoughPointsToBuyThis", 507 MaximumPointsText = "Cart_MaximumPointsText", 508 EmptyCart = "Cart_EmptyCart", 509 Shipping = "Cart_Shipping", 510 AddToCart = "Cart_AddToCart", 511 BuyAll = "Cart_BuyAll", 512 BuyFor = "Cart_BuyFor", 513 Order = "Cart_Order", 514 OrderID = "Cart_OrderID", 515 Date = "Cart_Date", 516 OrderNumber = "Cart_OrderNumber", 517 OrderNumberNav = "Cart_OrderNumberNav", 518 OrderDate = "Cart_OrderDate", 519 OrderValue = "Cart_OrderValue", 520 ViewOrder = "Cart_ViewOrder", 521 PONumber = "Cart_PONumber", 522 Reorder = "Cart_Reorder", 523 NoOrdersFound = "Cart_NoOrdersFound", 524 Invoice = "Cart_Invoice", 525 ChooseInvoice = "Cart_ChooseInvoice", 526 SearchInvoices = "Cart_SearchInvoices", 527 NoInvoicesFound = "Cart_NoInvoicesFound", 528 PleaseChooseAnInvoice = "Cart_ChooseAnInvoice", 529 InvoiceNumber = "Cart_InvoiceNumber", 530 InvoiceDate = "Cart_InvoiceDate", 531 TrackingNumber = "Cart_TrackingNumber", 532 DeliveryNote = "Cart_DeliveryNote", 533 ViewDeliveryNote = "Cart_ViewDeliveryNote", 534 SelectOrder = "Cart_SelectOrder", 535 Payment = "Cart_Payment", 536 PaymentMethod = "Cart_PaymentMethod", 537 ShippingMethod = "Cart_ShippingMethod", 538 SelectShipping = "Cart_SelectShipping", 539 SelectPayment = "Cart_SelectPayment", 540 BillingAddress = "Cart_BillingAddress", 541 SameBillingAsShipping = "Cart_BillingAsShipping", 542 ShippmentNumber = "Cart_ShippmentNumber", 543 ShippingAddress = "Cart_ShippingAddress", 544 AddAlternativeAdr = "Cart_AddAlternativeAdr", 545 SelectSavedAddress = "Cart_SelectSavedAddress", 546 PaymentAndShipping = "Cart_PaymentAndShipping", 547 RecurringEvery = "Cart_RecurringEvery", 548 RecurringStartDate = "Cart_RecurringStartDate", 549 RecurringEndDate = "Cart_RecurringEndDate", 550 StartDate = "Cart_StartDate", 551 OrderUsedGiftCards = "Cart_OrderUsedGiftCards", 552 GiftCardName = "Cart_GiftCardName", 553 GiftCardCode = "Cart_GiftCardCode", 554 ExpiryDate = "Cart_ExpiryDate", 555 InitialAmount = "Cart_InitialAmount", 556 UsedAmount = "Cart_UsedAmount", 557 RemainingBalance = "Cart_RemainingBalance", 558 Vouchers = "Cart_Vouchers", 559 Voucher = "Cart_Voucher", 560 HasBeenUsed = "Cart_HasBeenUsed ", 561 GiftCardAmount = "Cart_GiftCardAmount", 562 ShopInformation = "Cart_ShopInformation", 563 ShopName = "Cart_ShopName", 564 CardNo = "Cart_CardNo", 565 TransactionNo = "Cart_TransactionNo", 566 TransactionState = "Cart_TransactionState", 567 GiftcardsBoughtOnThisOrder = "Cart_GiftcardsBoughtOnThisOrder", 568 RecurringOrder = "Cart_RecurringOrder", 569 RecurringOrderSettings = "Cart_RecurringOrderSettings", 570 SaveUsedCard = "Cart_SaveUsedCard", 571 SavedCardName = "Cart_SavedCardName", 572 PayWithASavedCard = "Cart_PayWithASavedCard", 573 CreateRecurringOrder = "Cart_CreateRecurringOrder", 574 IWantMyOrderEvery = "Cart_IWantMyOrderEvery", 575 AndItShouldEndOn = "Cart_AndItShouldEndOn", 576 YouHaveNoItemsInTheCart = "Cart_YouHaveNoItemsInTheCart", 577 GoToCheckout = "Cart_GoToCheckout", 578 CreateQuoteRequest = "Cart_CreateQuoteRequest", 579 SubmitQuoteRequest = "Cart_SubmitQuoteRequest", 580 ReviewOrder = "Cart_ReviewOrder", 581 ReviewOrderLine = "Cart_ReviewOrderLine", 582 GetParcelShops = "Cart_GetParcelShops", 583 ChangeParcelShop = "Cart_ChangeParcelShop", 584 ChooseAParcelShop = "Cart_ChooseAParcelShop", 585 ConfirmOrder = "Cart_ConfirmOrder", 586 AppliedToOrder = "Cart_AppliedToOrder", 587 EnterVoucherCode = "Cart_EnterVoucherCode", 588 CartAddAlternativeAdr = "Cart_CartAddAlternativeAdr", 589 RequiresAnAddress = "Cart_RequiresAnAddress", 590 YouHavePlacedASubscription = "Cart_YouHavePlacedASubscription", 591 NoAddressSelected = "Cart_NoAddressSelected", 592 CompanyNrInmatriculare = "Cart_CompanyNrInmatriculare", 593 AddressForm = "Cart_AddressForm", 594 AddressWasSent = "Account_AddressWasSent", 595 CreateAccountReceiptMessage = "Cart_CreateAccountReceiptMessage", 596 ShippingAddressFieldError = "Account_ShippingAddressFieldError", 597 BillingAddressFieldError = "Account_BillingAddressFieldError", 598 ThereWasAnErrorPleaseTryAgain = "Cart_ThereWasAnErrorPleaseTryAgain", 599 OrderEmailShippingConfirmation = "Cart_OrderEmailShippingConfirmation", 600 OrderEmailText = "Crt_OrderEmailText", 601 CantBePickedUp = "Cart_CantBePickedUp", 602 CreateUserInCheckout = "Cart_CreateUserInCheckout", 603 ProductNoPickup = "Cart_ProductNoPickup", 604 SelectShippingAddress = "Cart_SelectShippingAddress", 605 DiscountStepMessage = "Cart_DiscountStepMessage", 606 ServiceRequestNumber = "Cart_ServiceRequestNumber", 607 InsertAccountEmail = "Cart_InsertAccountEmail", 608 InsertAccountPassword = "Cart_InsertAccountPassword", 609 NoParcelShopsSelected = "Cart_NoParcelShopsSelected", 610 ShippingDiscountMessage = "Cart_ShippingDiscountMessage", 611 NoParcelShopsInYourArea = "Cart_NoParcelShopsInYourArea", 612 SelectBillingAddress = "Cart_SelectBillingAddress", 613 RMAId = "Cart_RMAId", 614 RMAEmailNotification = "Cart_RMAEmailNotification", 615 OrderCompleted = "Cart_OrderCompleted", 616 ThankYouForYourOrder = "Cart_ThankYouForYourOrder"; 617 618 } 619 } 620 } 621 622 623 624 625 @{ 626 //Font settings 627 var fonts = new string[] { 628 getFontFamily("Layout", "HeaderFont"), 629 getFontFamily("Layout", "SubheaderFont"), 630 getFontFamily("Layout", "TertiaryHeaderFont"), 631 getFontFamily("Layout", "BodyText"), 632 getFontFamily("Layout", "Header", "ToolsFont"), 633 getFontFamily("Layout", "Header", "NavigationFont"), 634 getFontFamily("Layout", "MobileNavigation", "Font"), 635 getFontFamily("ProductList", "Facets", "HeaderFont"), 636 getFontFamily("ProductPage", "PriceFontDesign"), 637 getFontFamily("Ecommerce", "SaleSticker", "Font"), 638 getFontFamily("Ecommerce", "NewSticker", "Font"), 639 getFontFamily("Ecommerce", "CustomSticker", "Font") 640 }; 641 642 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 643 var googleAPIKey = areaInfo.GoogleMapsAPIKey; 644 var user = User.GetCurrentExtranetUser(); 645 var DesignFolder = Pageview.Layout.Design.Name; 646 bool useFontAwesomePro = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetBoolean("UseFontAwesomePro"); 647 string fontAwesomeCssLink = "/Files/Templates/Designs/"+DesignFolder+"/css/fonts/FontAwesomeFree/css/fontawesome-all.min.css"; 648 649 string autoCssLink = "/Files/Templates/Designs/"+DesignFolder+"/css/rapido/wizaris_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 650 string wizarisCssLink = "/Files/Templates/Designs/"+DesignFolder+"/css/Dotfusion/app.css?ticks=" + Model.Area.UpdatedDate.Ticks; 651 string ApplicationCssLink = "/Files/Templates/Designs/"+DesignFolder+"/dist/app.bundle.css?ticks=" + Model.Area.UpdatedDate.Ticks; 652 string ApplicationDeferCssLink = "/Files/Templates/Designs/"+DesignFolder+"/dist/defer.bundle.css?ticks=" + Model.Area.UpdatedDate.Ticks; 653 654 if (useFontAwesomePro) 655 { 656 fontAwesomeCssLink = "/Files/Templates/Designs/"+DesignFolder+"/css/fonts/FontAwesomePro/css/fontawesome-all.min.css"; 657 } 658 659 660 var response = System.Web.HttpContext.Current.Response; 661 //identify mobile app 662 bool isMobileApp = !String.IsNullOrEmpty(HttpContext.Current.Request["mobileApp"]) ? true : false; 663 HttpCookie mobileApp = new HttpCookie("MobileApp"); 664 string currentCookieOptInLevel = HttpContext.Current.Request["Dynamicweb.CookieOptInLevel"] != null ? HttpContext.Current.Request["Dynamicweb.CookieOptInLevel"].ToString() : "0"; 665 HttpCookie cookieOptInLevel = new HttpCookie("Dynamicweb.CookieOptInLevel"); 666 cookieOptInLevel.Value = isMobileApp ? "2" : currentCookieOptInLevel; 667 mobileApp.Value = isMobileApp ? "true" : "false"; 668 response.Cookies.Remove("MobileApp"); 669 670 if(isMobileApp) 671 { 672 673 response.Cookies.Add(mobileApp); 674 response.Cookies.Remove("Dynamicweb.CookieOptInLevel"); 675 response.Cookies.Add(cookieOptInLevel); 676 } 677 678 679 //force grid view on Mobile 680 if (Pageview.Device.ToString() == "Mobile") 681 { 682 HttpCookie forceGridView = new HttpCookie("View"); 683 forceGridView.Value = "Grid"; 684 response.Cookies.Remove("View"); 685 response.Cookies.Add(forceGridView); 686 } 687 688 689 } 690 691 @{ 692 Block master = new Block() 693 { 694 Id = "Master", 695 BlocksList = new List<Block> { 696 new Block { 697 Id = "MasterTopSnippets", 698 SortId = 10 699 }, 700 new Block { 701 Id = "MasterMain", 702 SortId = 20, 703 Template = RenderMain(), 704 SkipRenderBlocksList = true, 705 BlocksList = new List<Block> { 706 new Block { 707 Id = "MasterHeaderTop", 708 SortId = 1, 709 Template = RenderMasterTop(), 710 SkipRenderBlocksList = true 711 }, 712 new Block { 713 Id = "MasterHeader", 714 SortId = 10, 715 Template = RenderMasterHeader(), 716 SkipRenderBlocksList = true 717 }, 718 new Block { 719 Id = "MasterPageContent", 720 SortId = 20, 721 Template = RenderPageContent() 722 } 723 } 724 }, 725 new Block { 726 Id = "MasterFooter", 727 SortId = 30 728 }, 729 new Block { 730 Id = "MasterReferences", 731 SortId = 40 732 }, 733 new Block { 734 Id = "MasterBottomSnippets", 735 SortId = 50 736 } 737 } 738 }; 739 740 masterPage.Add(master); 741 } 742 743 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 744 @using System.Text.RegularExpressions 745 @using System.Collections.Generic 746 @using System.Reflection 747 @using System.Web.UI.HtmlControls 748 @using Dynamicweb.Rapido.Blocks.Components 749 @using Dynamicweb.Rapido.Blocks.Components.Articles 750 @using Dynamicweb.Rapido.Blocks.Components.Documentation 751 @using Dynamicweb.Rapido.Blocks 752 753 754 @*--- START: Base block renderers ---*@ 755 756 @helper RenderBlockList(List<Block> blocks) 757 { 758 blocks = blocks.OrderBy(item => item.SortId).ToList(); 759 760 foreach (Block item in blocks) 761 { 762 <!-- START: @item.Id --> 763 764 if (item.Design == null) 765 { 766 @RenderBlock(item) 767 } 768 else if (item.Design.RenderType == RenderType.None) { 769 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 770 771 <div class="@cssClass"> 772 @RenderBlock(item) 773 </div> 774 } 775 else if (item.Design.RenderType != RenderType.Hide) 776 { 777 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 778 779 if (!item.SkipRenderBlocksList) { 780 if (item.Design.RenderType == RenderType.Row) 781 { 782 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 783 @RenderBlock(item) 784 </div> 785 } 786 787 if (item.Design.RenderType == RenderType.Column) 788 { 789 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 790 string size = item.Design.Size ?? "12"; 791 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 792 793 <div class="col-@item.Design.Size grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 794 @RenderBlock(item) 795 </div> 796 } 797 798 if (item.Design.RenderType == RenderType.Table) 799 { 800 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 801 @RenderBlock(item) 802 </table> 803 } 804 805 if (item.Design.RenderType == RenderType.TableRow) 806 { 807 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 808 @RenderBlock(item) 809 </tr> 810 } 811 812 if (item.Design.RenderType == RenderType.TableColumn) 813 { 814 <td class="@cssClass dw-mod" id="Block__@item.Id"> 815 @RenderBlock(item) 816 </td> 817 } 818 819 if (item.Design.RenderType == RenderType.CardHeader) 820 { 821 <div class="card-header @cssClass dw-mod"> 822 @RenderBlock(item) 823 </div> 824 } 825 826 if (item.Design.RenderType == RenderType.CardBody) 827 { 828 <div class="card @cssClass dw-mod"> 829 @RenderBlock(item) 830 </div> 831 } 832 833 if (item.Design.RenderType == RenderType.CardFooter) 834 { 835 <div class="card-footer @cssClass dw-mod"> 836 @RenderBlock(item) 837 </div> 838 } 839 } 840 else 841 { 842 @RenderBlock(item) 843 } 844 } 845 846 <!-- END: @item.Id --> 847 } 848 } 849 850 @helper RenderBlock(Block item) 851 { 852 if (item.Template != null) 853 { 854 @BlocksPage.RenderTemplate(item.Template) 855 } 856 857 if (item.Component != null) 858 { 859 string methodName = item.Component.HelperName; 860 dynamic[] methodParameters = new dynamic[1]; 861 methodParameters[0] = item.Component; 862 Type methodType = this.GetType(); 863 MethodInfo generalMethod = methodType.GetMethod(methodName); 864 865 if (generalMethod != null) { 866 @generalMethod.Invoke(this, methodParameters).ToString(); 867 } else { 868 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked"); 869 } 870 } 871 872 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 873 { 874 @RenderBlockList(item.BlocksList) 875 } 876 } 877 878 @*--- END: Base block renderers ---*@ 879 880 881 @* Include the components *@ 882 @using Dynamicweb.Rapido.Blocks.Components 883 @using Dynamicweb.Rapido.Blocks.Components.General 884 @using Dynamicweb.Rapido.Blocks 885 886 887 @* Components *@ 888 @using System.Reflection 889 @using Dynamicweb.Rapido.Blocks.Components.General 890 891 892 @* Component *@ 893 894 @helper RenderIcon(Icon settings) { 895 if (settings != null) 896 { 897 dynamic[] methodParameters = new dynamic[1]; 898 methodParameters[0] = settings; 899 MethodInfo customMethod = this.GetType().GetMethod("RenderIconCustom"); 900 901 if (customMethod != null) 902 { 903 @customMethod.Invoke(this, methodParameters).ToString(); 904 } else { 905 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 906 907 if (settings.Name != null) 908 { 909 if (String.IsNullOrEmpty(settings.Label)) { 910 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 911 } else { 912 if (settings.LabelPosition == IconLabelPosition.Before) { 913 <span>@settings.Label <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i></span> 914 } else { 915 <span><i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> @settings.Label</span> 916 } 917 } 918 } 919 } 920 } 921 } 922 @using System.Reflection 923 @using Dynamicweb.Rapido.Blocks.Components.General 924 @using Dynamicweb.Rapido.Blocks.Components 925 926 927 @* Component *@ 928 929 @helper RenderButton(Button settings) { 930 dynamic[] methodParameters = new dynamic[1]; 931 methodParameters[0] = settings; 932 MethodInfo customMethod = this.GetType().GetMethod("RenderButtonCustom"); 933 934 if (customMethod != null) 935 { 936 @customMethod.Invoke(this, methodParameters).ToString(); 937 } 938 else 939 { 940 string target; 941 string disabled = settings.Disabled ? "disabled" : ""; 942 string buttonType = settings.ButtonType == ButtonType.Submit ? "submit" : "button"; 943 buttonType = settings.ButtonType == ButtonType.Reset ? "reset" : buttonType; 944 string buttonLayout = settings.ButtonLayout.ToString().ToLower(); 945 946 switch (settings.Target) 947 { 948 case LinkTargetType.Blank: 949 target = "_blank"; 950 break; 951 case LinkTargetType.Parent: 952 target = "_parent"; 953 break; 954 case LinkTargetType.Self: 955 target = "_self"; 956 break; 957 case LinkTargetType.Top: 958 target = "_top"; 959 break; 960 default: 961 target = "_self"; 962 break; 963 } 964 965 string onClickAction = settings.OnClick != null ? settings.OnClick : ""; 966 string noOpener = target == "_blank" ? "rel=\"noopener\"" : ""; 967 968 if (!String.IsNullOrEmpty(settings.ConfirmText)) 969 { 970 string modalId = settings.Id; 971 @RenderConfirmDialog(settings); 972 onClickAction = "document.getElementById('" + modalId + "ModalTrigger').checked = true"; 973 } 974 975 if (settings.Icon != null) 976 { 977 if (settings.IconPosition == null) { 978 settings.Icon.LabelPosition = IconLabelPosition.After; 979 } else { 980 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 981 } 982 if (settings.Icon.Label == null) { 983 settings.Icon.Label = settings.Title; 984 } 985 } 986 string content = settings.Icon == null ? settings.Title : Convert.ToString(RenderIcon(settings.Icon)); 987 988 if (!String.IsNullOrEmpty(settings.Link) && String.IsNullOrEmpty(settings.ConfirmText)) 989 { 990 <a href="@settings.Link" target="@target" @noOpener class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</a> 991 } 992 else 993 { 994 <button type="@buttonType" class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</button> 995 } 996 } 997 } 998 999 1000 @helper RenderConfirmDialog(Button settings) { 1001 dynamic[] methodParameters = new dynamic[1]; 1002 methodParameters[0] = settings; 1003 MethodInfo customMethod = this.GetType().GetMethod("RenderConfirmDialogCustom"); 1004 1005 if (customMethod != null) 1006 { 1007 @customMethod.Invoke(this, methodParameters).ToString(); 1008 } else { 1009 string modalTriggerId = settings.Id + "ModalTrigger"; 1010 1011 <!-- Trigger for the confirm modal --> 1012 <input type="checkbox" id="@modalTriggerId" class="modal-trigger" /> 1013 1014 <!-- Login modal --> 1015 <div class="modal-container"> 1016 <label for="@modalTriggerId" class="modal-overlay"></label> 1017 <div class="modal modal--xs"> 1018 <div class="modal__header"> 1019 <h2>@settings.ConfirmText</h2> 1020 </div> 1021 <div class="modal__body"> 1022 @RenderButton(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = settings.OnClick, CssClass = "u-full-width", Link = settings.Link }) 1023 </div> 1024 </div> 1025 </div> 1026 } 1027 } 1028 @using System.Reflection 1029 @using Dynamicweb.Rapido.Blocks.Components 1030 @using Dynamicweb.Rapido.Blocks.Components.General 1031 @using Dynamicweb.Rapido.Blocks 1032 1033 1034 @* Component *@ 1035 1036 @helper RenderRating(Rating settings) 1037 { 1038 dynamic[] methodParameters = new dynamic[1]; 1039 methodParameters[0] = settings; 1040 MethodInfo customMethod = this.GetType().GetMethod("RenderRatingCustom"); 1041 1042 if (customMethod != null) 1043 { 1044 @customMethod.Invoke(this, methodParameters).ToString(); 1045 } else { 1046 if (settings.Score > 0) 1047 { 1048 int rating = settings.Score; 1049 string iconType = "fa-star"; 1050 1051 switch (settings.Type.ToString()) { 1052 case "Stars": 1053 iconType = "fa-star"; 1054 break; 1055 case "Hearts": 1056 iconType = "fa-heart"; 1057 break; 1058 case "Lemons": 1059 iconType = "fa-lemon"; 1060 break; 1061 case "Bombs": 1062 iconType = "fa-bomb"; 1063 break; 1064 } 1065 1066 <div class="u-ta-right"> 1067 @for (int i = 0; i < settings.OutOf; i++) 1068 { 1069 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 1070 } 1071 </div> 1072 } 1073 } 1074 } 1075 @using System.Reflection 1076 @using Dynamicweb.Rapido.Blocks.Components.General 1077 @using Dynamicweb.Rapido.Blocks.Components 1078 1079 1080 @* Component *@ 1081 1082 @helper RenderFieldListOption(FieldListOption settings) { 1083 dynamic[] methodParameters = new dynamic[1]; 1084 methodParameters[0] = settings; 1085 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldListOptionCustom"); 1086 1087 if (customMethod != null) 1088 { 1089 @customMethod.Invoke(this, methodParameters).ToString(); 1090 } else { 1091 string disabled = settings.Disabled ? "disabled" : ""; 1092 string selected = settings.Checked ? "checked" : ""; 1093 1094 if (settings.Type.ToString() == "RadioButton") 1095 { 1096 <input class="form__control @disabled dw-mod" onchange="@settings.OnChange" onclick="@settings.OnClick" type="radio" name="@settings.Name" id="@settings.Id" value="@settings.Value" @selected @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1097 <label for="@settings.Id" class="u-inline @disabled dw-mod">@settings.Label</label> 1098 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1099 } 1100 1101 if (settings.Type.ToString() == "Checkbox") 1102 { 1103 @RenderCheckboxField(settings) 1104 } 1105 1106 if (settings.Type.ToString() == "SelectOption") 1107 { 1108 <option value="@settings.Value" id="@settings.Id" onclick="@settings.OnClick" class="@disabled" @disabled @selected @ComponentMethods.AddAttributes(settings.ExtraAttributes) >@settings.Name</option> 1109 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1110 } 1111 } 1112 } 1113 1114 @using System.Reflection 1115 @using Dynamicweb.Rapido.Blocks.Components.General 1116 @using Dynamicweb.Rapido.Blocks.Components 1117 1118 1119 @* Component *@ 1120 1121 @helper RenderNavigation(Navigation settings) { 1122 dynamic[] methodParameters = new dynamic[1]; 1123 methodParameters[0] = settings; 1124 MethodInfo customMethod = this.GetType().GetMethod("RenderNavigationCustom"); 1125 1126 if (customMethod != null) 1127 { 1128 @customMethod.Invoke(this, methodParameters).ToString(); 1129 } else { 1130 @RenderNavigation(new 1131 { 1132 id = settings.Id, 1133 cssclass = settings.CssClass, 1134 startLevel = settings.StartLevel, 1135 endlevel = settings.EndLevel, 1136 expandmode = settings.Expandmode, 1137 template = settings.Template 1138 }) 1139 } 1140 } 1141 @using System.Reflection 1142 @using Dynamicweb.Rapido.Blocks.Components.General 1143 @using Dynamicweb.Rapido.Blocks.Components 1144 1145 1146 @* Component *@ 1147 1148 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 1149 dynamic[] methodParameters = new dynamic[1]; 1150 methodParameters[0] = settings; 1151 MethodInfo customMethod = this.GetType().GetMethod("RenderBreadcrumbNavigationCustom"); 1152 1153 if (customMethod != null) 1154 { 1155 @customMethod.Invoke(this, methodParameters).ToString(); 1156 } else { 1157 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 1158 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 1159 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 1160 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 1161 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 1162 1163 @RenderNavigation(settings) 1164 } 1165 } 1166 @using System.Reflection 1167 @using Dynamicweb.Rapido.Blocks.Components.General 1168 1169 1170 @* Component *@ 1171 1172 @helper RenderHeading(Heading settings) { 1173 dynamic[] methodParameters = new dynamic[1]; 1174 methodParameters[0] = settings; 1175 MethodInfo customMethod = this.GetType().GetMethod("RenderHeadingCustom"); 1176 1177 if (customMethod != null) 1178 { 1179 @customMethod.Invoke(this, methodParameters).ToString(); 1180 } else { 1181 string startTag = "<h" + settings.Level.ToString() + " class=\"" + settings.CssClass + "\">"; 1182 string endTag = "</h" + settings.Level.ToString() + "\">"; 1183 1184 if (settings.Icon != null) 1185 { 1186 if (settings.IconPosition == null) { 1187 settings.Icon.LabelPosition = IconLabelPosition.After; 1188 } else { 1189 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 1190 } 1191 if (settings.Icon.Label == null) { 1192 settings.Icon.Label = settings.Title; 1193 } 1194 1195 @startTag@RenderIcon(settings.Icon)@endTag 1196 } else { 1197 @startTag@settings.Title@endTag 1198 } 1199 } 1200 } 1201 @using System.Reflection 1202 @using Dynamicweb.Rapido.Blocks.Components 1203 @using Dynamicweb.Rapido.Blocks.Components.General 1204 @using Dynamicweb.Rapido.Blocks 1205 1206 1207 @* Component *@ 1208 1209 @helper RenderImage(Image settings) 1210 { 1211 if (settings.Path != null) 1212 { 1213 dynamic[] methodParameters = new dynamic[1]; 1214 methodParameters[0] = settings; 1215 MethodInfo customMethod = this.GetType().GetMethod("RenderImageCustom"); 1216 1217 if (customMethod != null) 1218 { 1219 @customMethod.Invoke(this, methodParameters).ToString(); 1220 } else { 1221 <div> 1222 @if (settings.Link != null) 1223 { 1224 <a href="@settings.Link"> 1225 @RenderTheImage(settings); 1226 </a> 1227 } 1228 else 1229 { 1230 @RenderTheImage(settings); 1231 } 1232 </div> 1233 } 1234 } 1235 } 1236 1237 @functions { 1238 string getImagePathFromSettings(ImageSettings settings) 1239 { 1240 string result = ""; 1241 1242 if (settings != null) 1243 { 1244 result += settings.Width != 0 ? "Width=" + settings.Width + "&" : ""; 1245 result += settings.Height != 0 ? "Height=" + settings.Height + "&" : ""; 1246 result += "Crop=" + settings.Crop + "&"; 1247 result += "Compression=" + settings.Compression + "&"; 1248 result += "DoNotUpscale=" + settings.DoNotUpscale.ToString() + "&"; 1249 result += "FillCanvas=" + settings.FillCanvas.ToString() + "&"; 1250 } 1251 1252 return result; 1253 } 1254 } 1255 1256 @helper RenderTheImage(Image settings) 1257 { 1258 if (settings != null) 1259 { 1260 dynamic[] methodParameters = new dynamic[1]; 1261 methodParameters[0] = settings; 1262 MethodInfo customMethod = this.GetType().GetMethod("RenderTheImageCustom"); 1263 1264 if (customMethod != null) 1265 { 1266 @customMethod.Invoke(this, methodParameters).ToString(); 1267 } else { 1268 string placeholderImage = "/Files/Images/placeholder.gif"; 1269 string imageEngine = "/Admin/Public/GetImage.ashx?"; 1270 1271 string imageStyle = ""; 1272 1273 switch (settings.Style) 1274 { 1275 case ImageStyle.Ball: 1276 imageStyle = "grid__cell-img--ball"; 1277 break; 1278 } 1279 1280 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle) 1281 { 1282 if (settings.ImageDefault != null) 1283 { 1284 settings.ImageDefault.Height = settings.ImageDefault.Width; 1285 } 1286 if (settings.ImageMedium != null) 1287 { 1288 settings.ImageMedium.Height = settings.ImageMedium.Width; 1289 } 1290 if (settings.ImageSmall != null) 1291 { 1292 settings.ImageSmall.Height = settings.ImageSmall.Width; 1293 } 1294 } 1295 1296 string defaultImage = imageEngine; 1297 string imageSmall = ""; 1298 string imageMedium = ""; 1299 1300 if (settings.DisableImageEngine) { 1301 defaultImage = settings.Path; 1302 } else { 1303 if (settings.ImageDefault != null) 1304 { 1305 defaultImage += getImagePathFromSettings(settings.ImageDefault); 1306 1307 if (settings.Path.GetType() != typeof(string)) 1308 { 1309 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1310 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1311 } 1312 else 1313 { 1314 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 1315 } 1316 } 1317 1318 if (settings.ImageSmall != null) 1319 { 1320 imageSmall = "data-src-small=\"" + imageEngine; 1321 imageSmall += getImagePathFromSettings(settings.ImageSmall); 1322 1323 if (settings.Path.GetType() != typeof(string)) 1324 { 1325 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1326 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1327 } 1328 else 1329 { 1330 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 1331 } 1332 1333 imageSmall += "\""; 1334 } 1335 1336 if (settings.ImageMedium != null) 1337 { 1338 imageMedium = "data-src-medium=\"" + imageEngine; 1339 imageMedium += getImagePathFromSettings(settings.ImageMedium); 1340 1341 if (settings.Path.GetType() != typeof(string)) 1342 { 1343 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 1344 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 1345 } 1346 else 1347 { 1348 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 1349 } 1350 1351 imageMedium += "\""; 1352 } 1353 } 1354 1355 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1356 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 1357 if (!String.IsNullOrEmpty(settings.Title)) { optionalAttributes.Add("alt", settings.Title); } 1358 1359 if (settings.DisableLazyLoad) { 1360 <img class="grid__cell-img @imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1361 } else { 1362 <img class="grid__cell-img b-lazy @imageStyle @settings.CssClass dw-mod" src="@placeholderImage" data-src="@defaultImage" @imageSmall @imageMedium @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1363 } 1364 1365 if (settings.Caption != null) 1366 { 1367 <span class="image-caption dw-mod">@settings.Caption</span> 1368 } 1369 } 1370 } 1371 } 1372 @using System.Reflection 1373 @using Dynamicweb.Rapido.Blocks.Components.General 1374 @using Dynamicweb.Rapido.Blocks.Components 1375 1376 1377 @* Component *@ 1378 1379 @helper RenderTextField(TextField settings) { 1380 dynamic[] methodParameters = new dynamic[1]; 1381 methodParameters[0] = settings; 1382 MethodInfo customMethod = this.GetType().GetMethod("RenderTextFieldCustom"); 1383 1384 if (customMethod != null) 1385 { 1386 @customMethod.Invoke(this, methodParameters).ToString(); 1387 } else { 1388 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 1389 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1390 if (settings.Type == TextFieldType.Password) { optionalAttributes.Add("autocomplete", "off"); }; 1391 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 1392 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 1393 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 1394 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 1395 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 1396 1397 <div class="form__field-group dw-mod"> 1398 @if (!String.IsNullOrEmpty(settings.Label)) 1399 { 1400 <label for="@settings.Id">@settings.Label</label> 1401 } 1402 1403 <input type="@settings.Type" class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1404 1405 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1406 </div> 1407 } 1408 } 1409 @using System.Reflection 1410 @using Dynamicweb.Rapido.Blocks.Components.General 1411 @using Dynamicweb.Rapido.Blocks.Components 1412 1413 1414 @* Component *@ 1415 1416 @helper RenderNumberField(NumberField settings) { 1417 dynamic[] methodParameters = new dynamic[1]; 1418 methodParameters[0] = settings; 1419 MethodInfo customMethod = this.GetType().GetMethod("RenderNumberFieldCustom"); 1420 1421 if (customMethod != null) 1422 { 1423 @customMethod.Invoke(this, methodParameters).ToString(); 1424 } else { 1425 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1426 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 1427 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 1428 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 1429 if (settings.Max != 0) { optionalAttributes.Add("max", settings.Max.ToString()); } 1430 if (settings.Min != 0) { optionalAttributes.Add("min", settings.Min.ToString()); } 1431 if (settings.Step != 0) { optionalAttributes.Add("step", settings.Step.ToString()); } 1432 1433 <div class="form__field-group dw-mod"> 1434 @if (!String.IsNullOrEmpty(settings.Label)) 1435 { 1436 <div> 1437 <label for="@settings.Id">@settings.Label</label> 1438 </div> 1439 } 1440 1441 <input type="Number" class="u-w70px @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1442 1443 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1444 </div> 1445 } 1446 } 1447 @using System.Reflection 1448 @using Dynamicweb.Rapido.Blocks.Components.General 1449 @using Dynamicweb.Rapido.Blocks.Components 1450 1451 1452 @* Component *@ 1453 1454 @helper RenderTextareaField(TextareaField settings) { 1455 dynamic[] methodParameters = new dynamic[1]; 1456 methodParameters[0] = settings; 1457 MethodInfo customMethod = this.GetType().GetMethod("RenderTextareaFieldCustom"); 1458 1459 if (customMethod != null) 1460 { 1461 @customMethod.Invoke(this, methodParameters).ToString(); 1462 } else { 1463 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 1464 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1465 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 1466 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 1467 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 1468 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 1469 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 1470 if (settings.Rows != 0) { optionalAttributes.Add("rows", settings.Rows.ToString()); } 1471 1472 <div class="form__field-group dw-mod"> 1473 @if (!String.IsNullOrEmpty(@settings.Label)) 1474 { 1475 <label for="@settings.Id">@settings.Label</label> 1476 } 1477 1478 <textarea class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)></textarea> 1479 1480 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1481 </div> 1482 } 1483 } 1484 @using System.Reflection 1485 @using Dynamicweb.Rapido.Blocks.Components.General 1486 @using Dynamicweb.Rapido.Blocks.Components 1487 1488 1489 @* Component *@ 1490 1491 @helper RenderHiddenField(HiddenField settings) { 1492 dynamic[] methodParameters = new dynamic[1]; 1493 methodParameters[0] = settings; 1494 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 1495 1496 if (customMethod != null) 1497 { 1498 @customMethod.Invoke(this, methodParameters).ToString(); 1499 } else { 1500 <input type="hidden" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 1501 } 1502 } 1503 @using System.Reflection 1504 @using Dynamicweb.Rapido.Blocks.Components.General 1505 @using Dynamicweb.Rapido.Blocks.Components 1506 1507 1508 @* Component *@ 1509 1510 @helper RenderCheckboxField(dynamic settings) { 1511 dynamic[] methodParameters = new dynamic[1]; 1512 methodParameters[0] = settings; 1513 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxFieldCustom"); 1514 1515 if (customMethod != null) 1516 { 1517 @customMethod.Invoke(this, methodParameters).ToString(); 1518 } else { 1519 settings.Type = FieldListOptionType.Checkbox; 1520 string disabled = settings.Disabled ? "disabled" : ""; 1521 string required = settings.Required ? "required" : ""; 1522 string checkedString = settings.Checked == true ? "checked" : ""; 1523 string id = settings.Id != null ? settings.Id : settings.Label.Replace(" ", ""); 1524 1525 <div class="form__field-group dw-mod"> 1526 <input type="checkbox" class="form__control @settings.CssClass @disabled dw-mod" name="@settings.Name" id="@id" value="@settings.Value" onclick="@settings.OnClick" @disabled @required @checkedString @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1527 1528 @if (!String.IsNullOrEmpty(settings.Label)) 1529 { 1530 <label for="@id" class="@disabled dw-mod">@settings.Label</label> 1531 } 1532 1533 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1534 </div> 1535 } 1536 } 1537 @using System.Reflection 1538 @using Dynamicweb.Rapido.Blocks.Components.General 1539 @using Dynamicweb.Rapido.Blocks.Components 1540 1541 1542 @* Component *@ 1543 1544 @helper RenderCheckboxListField(CheckboxListField settings) { 1545 dynamic[] methodParameters = new dynamic[1]; 1546 methodParameters[0] = settings; 1547 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxListFieldCustom"); 1548 1549 if (customMethod != null) 1550 { 1551 @customMethod.Invoke(this, methodParameters).ToString(); 1552 } else { 1553 string disabled = settings.Disabled ? "disabled" : ""; 1554 1555 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled dw-mod" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1556 @if (!String.IsNullOrEmpty(settings.Label)) 1557 { 1558 <div class="u-bold u-margin-bottom">@settings.Label</div> 1559 } 1560 1561 @foreach (var item in settings.Options) 1562 { 1563 item.Type = FieldListOptionType.Checkbox; 1564 @RenderFieldListOption(item) 1565 } 1566 1567 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1568 </div> 1569 } 1570 } 1571 1572 @using System.Reflection 1573 @using Dynamicweb.Rapido.Blocks.Components.General 1574 @using Dynamicweb.Rapido.Blocks.Components 1575 1576 1577 @* Component *@ 1578 1579 @helper RenderSelectField(SelectField settings) { 1580 dynamic[] methodParameters = new dynamic[1]; 1581 methodParameters[0] = settings; 1582 MethodInfo customMethod = this.GetType().GetMethod("RenderSelectFieldCustom"); 1583 1584 if (customMethod != null) 1585 { 1586 @customMethod.Invoke(this, methodParameters).ToString(); 1587 } else { 1588 string disabled = settings.Disabled ? "disabled" : ""; 1589 string required = settings.Required ? "required" : ""; 1590 1591 if (settings.Default != null) 1592 { 1593 settings.Default.Type = FieldListOptionType.SelectOption; 1594 } 1595 1596 <div class="form__field-group u-full-width dw-mod"> 1597 @if (!String.IsNullOrEmpty(settings.Label)) 1598 { 1599 <label for="@settings.Id">@settings.Label</label> 1600 } 1601 1602 <div class="form__field-combi u-no-margin dw-mod"> 1603 <select id="@settings.Id" class="u-full-width @settings.CssClass dw-mod" onchange="@settings.OnChange" @ComponentMethods.AddAttributes(settings.ExtraAttributes) > 1604 @if (settings.Default.Value != null) 1605 { 1606 @RenderFieldListOption(settings.Default) 1607 } 1608 1609 @foreach (var item in settings.Options) 1610 { 1611 item.Type = FieldListOptionType.SelectOption; 1612 @RenderFieldListOption(item) 1613 } 1614 </select> 1615 @if (settings.ActionButton.Link != null || settings.ActionButton.OnClick != null) { 1616 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1617 @RenderButton(settings.ActionButton); 1618 } 1619 </div> 1620 1621 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1622 </div> 1623 } 1624 } 1625 @using System.Reflection 1626 @using Dynamicweb.Rapido.Blocks.Components.General 1627 @using Dynamicweb.Rapido.Blocks.Components 1628 1629 1630 @* Component *@ 1631 1632 @helper RenderRadioButtonField(RadioButtonField settings) { 1633 dynamic[] methodParameters = new dynamic[1]; 1634 methodParameters[0] = settings; 1635 MethodInfo customMethod = this.GetType().GetMethod("RenderRadioButtonFieldCustom"); 1636 1637 if (customMethod != null) 1638 { 1639 @customMethod.Invoke(this, methodParameters).ToString(); 1640 } else { 1641 string disabled = settings.Disabled ? "disabled" : ""; 1642 1643 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1644 @if (!String.IsNullOrEmpty(settings.Label)) 1645 { 1646 <div class="u-bold u-margin-bottom">@settings.Label</div> 1647 } 1648 1649 @foreach (var item in settings.Options) 1650 { 1651 item.Type = FieldListOptionType.RadioButton; 1652 1653 if (settings.Name != null) 1654 { 1655 item.Name = settings.Name; 1656 } 1657 1658 if (settings.RenderOptionsInline) 1659 { 1660 @RenderFieldListOption(item) 1661 } 1662 else 1663 { 1664 <div> 1665 @RenderFieldListOption(item) 1666 </div> 1667 } 1668 } 1669 1670 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1671 </div> 1672 } 1673 } 1674 @using System.Reflection 1675 @using Dynamicweb.Rapido.Blocks.Components.General 1676 @using Dynamicweb.Rapido.Blocks.Components 1677 1678 1679 @* Component *@ 1680 1681 @helper RenderNotificationMessage(NotificationMessage settings) { 1682 dynamic[] methodParameters = new dynamic[1]; 1683 methodParameters[0] = settings; 1684 MethodInfo customMethod = this.GetType().GetMethod("RenderNotificationMessageCustom"); 1685 1686 if (customMethod != null) 1687 { 1688 @customMethod.Invoke(this, methodParameters).ToString(); 1689 } else { 1690 if (!String.IsNullOrEmpty(settings.Message)) 1691 { 1692 string messageTypeClass = settings.MessageType.ToString().ToLower(); 1693 <div class="field-@messageTypeClass @settings.CssClass u-full-width dw-mod">@settings.Message</div> 1694 } 1695 } 1696 } 1697 @using System.Reflection 1698 @using Dynamicweb.Rapido.Blocks.Components.General 1699 1700 1701 @* Component *@ 1702 1703 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1704 dynamic[] methodParameters = new dynamic[1]; 1705 methodParameters[0] = settings; 1706 MethodInfo customMethod = this.GetType().GetMethod("RenderHandlebarsRootCustom"); 1707 1708 if (customMethod != null) 1709 { 1710 @customMethod.Invoke(this, methodParameters).ToString(); 1711 } else { 1712 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1713 1714 <div class="@settings.CssClass dw-mod js-handlebars-root" id="@settings.Id" data-template="@settings.ScriptTemplate" data-json-feed="@settings.FeedUrl" data-init-onload="@settings.InitOnLoad.ToString()" data-preloader="@settings.Preloader" @preRender> 1715 @if (settings.SubBlocks != null) { 1716 @RenderBlockList(settings.SubBlocks) 1717 } 1718 </div> 1719 } 1720 } 1721 @using System.Reflection 1722 @using Dynamicweb.Rapido.Blocks.Components.General 1723 @using Dynamicweb.Rapido.Blocks.Components 1724 @using System.Text.RegularExpressions 1725 1726 1727 @* Component *@ 1728 1729 @helper RenderSticker(Sticker settings) { 1730 dynamic[] methodParameters = new dynamic[1]; 1731 methodParameters[0] = settings; 1732 MethodInfo customMethod = this.GetType().GetMethod("RenderStickerCustom"); 1733 1734 if (customMethod != null) 1735 { 1736 @customMethod.Invoke(this, methodParameters).ToString(); 1737 } 1738 else 1739 { 1740 if (!String.IsNullOrEmpty(settings.Title)) { 1741 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1742 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1743 1744 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1745 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1746 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1747 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1748 optionalAttributes.Add("style", styleTag); 1749 } 1750 1751 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1752 } 1753 } 1754 } 1755 1756 @using System.Reflection 1757 @using Dynamicweb.Rapido.Blocks.Components.General 1758 @using Dynamicweb.Rapido.Blocks.Components 1759 1760 1761 @* Component *@ 1762 1763 @helper RenderStickersCollection(StickersCollection settings) { 1764 dynamic[] methodParameters = new dynamic[1]; 1765 methodParameters[0] = settings; 1766 MethodInfo customMethod = this.GetType().GetMethod("RenderStickersCollectionCustom"); 1767 1768 if (customMethod != null) 1769 { 1770 @customMethod.Invoke(this, methodParameters).ToString(); 1771 } 1772 else 1773 { 1774 if (settings.Stickers.Count > 0) { 1775 string position = settings.Position != null ? "" + "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower() : ""; 1776 1777 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1778 @foreach (Sticker sticker in settings.Stickers) 1779 { 1780 @RenderSticker(sticker) 1781 } 1782 </div> 1783 } 1784 } 1785 } 1786 1787 @using System.Reflection 1788 @using Dynamicweb.Rapido.Blocks.Components.General 1789 @using Dynamicweb.Rapido.Blocks.Components 1790 1791 1792 1793 @* Component *@ 1794 1795 @helper RenderField(Field settings) { 1796 dynamic[] methodParameters = new dynamic[1]; 1797 methodParameters[0] = settings; 1798 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldCustom"); 1799 1800 if (customMethod != null) 1801 { 1802 @customMethod.Invoke(this, methodParameters).ToString(); 1803 } else { 1804 switch (settings.FieldType) 1805 { 1806 case FieldType.Checkbox: 1807 CheckboxField checkbox = new CheckboxField 1808 { 1809 Label = settings.Label, 1810 Id = settings.Id, 1811 Name = settings.Label.Replace(" ", ""), 1812 Value = settings.Value, 1813 Checked = Convert.ToBoolean(settings.Placeholder), 1814 OnClick = settings.OnClick, 1815 Disabled = settings.Disabled, 1816 Required = settings.Required, 1817 CssClass = settings.CssClass, 1818 ExtraAttributes = settings.ExtraAttributes, 1819 ErrorMessage = settings.ErrorMessage 1820 }; 1821 1822 @RenderCheckboxField(checkbox) 1823 break; 1824 case FieldType.Email: 1825 TextField emailField = new TextField 1826 { 1827 Label = settings.Label != null ? settings.Label : Translate("Email"), 1828 Id = settings.Id, 1829 Value = settings.Value, 1830 OnClick = settings.OnClick, 1831 Disabled = settings.Disabled, 1832 Required = settings.Required, 1833 CssClass = settings.CssClass, 1834 ExtraAttributes = settings.ExtraAttributes, 1835 ErrorMessage = settings.ErrorMessage, 1836 Placeholder = settings.Placeholder, 1837 Type = TextFieldType.Email 1838 }; 1839 1840 @RenderTextField(emailField) 1841 break; 1842 case FieldType.Hidden: 1843 HiddenField hiddenField = new HiddenField 1844 { 1845 Label = settings.Label, 1846 Id = settings.Id, 1847 Value = settings.Value, 1848 Disabled = settings.Disabled, 1849 Required = settings.Required, 1850 CssClass = settings.CssClass, 1851 ExtraAttributes = settings.ExtraAttributes, 1852 ErrorMessage = settings.ErrorMessage 1853 }; 1854 1855 @RenderHiddenField(hiddenField) 1856 break; 1857 case FieldType.Integer: 1858 NumberField numberField = new NumberField 1859 { 1860 Label = settings.Label, 1861 Id = settings.Id, 1862 Value = settings.Value.GetType() == typeof(int) ? Convert.ToInt32(settings.Value) : 1, 1863 OnClick = settings.OnClick, 1864 Disabled = settings.Disabled, 1865 Required = settings.Required, 1866 CssClass = settings.CssClass, 1867 ExtraAttributes = settings.ExtraAttributes, 1868 ErrorMessage = settings.ErrorMessage, 1869 Step = 1 1870 }; 1871 1872 @RenderNumberField(numberField) 1873 break; 1874 case FieldType.Password: 1875 TextField passwordField = new TextField 1876 { 1877 Label = settings.Label != null ? settings.Label : Translate("Password"), 1878 Id = settings.Id, 1879 Value = settings.Value, 1880 OnClick = settings.OnClick, 1881 Disabled = settings.Disabled, 1882 Required = settings.Required, 1883 CssClass = settings.CssClass, 1884 ExtraAttributes = settings.ExtraAttributes, 1885 ErrorMessage = settings.ErrorMessage, 1886 Placeholder = settings.Placeholder, 1887 Type = TextFieldType.Password 1888 }; 1889 1890 @RenderTextField(passwordField) 1891 break; 1892 case FieldType.Reset: 1893 Button resetField = new Button 1894 { 1895 Title = settings.Label != null ? settings.Label : Translate("Reset"), 1896 Id = settings.Id, 1897 OnClick = settings.OnClick, 1898 Disabled = settings.Disabled, 1899 CssClass = settings.CssClass, 1900 ExtraAttributes = settings.ExtraAttributes, 1901 ButtonLayout = ButtonLayout.Secondary, 1902 ButtonType = ButtonType.Reset 1903 }; 1904 1905 @RenderButton(resetField) 1906 break; 1907 case FieldType.Submit: 1908 Button submitField = new Button 1909 { 1910 Title = settings.Label != null ? settings.Label : Translate("Submit"), 1911 Id = settings.Id, 1912 OnClick = settings.OnClick, 1913 Disabled = settings.Disabled, 1914 CssClass = settings.CssClass, 1915 ExtraAttributes = settings.ExtraAttributes, 1916 ButtonLayout = ButtonLayout.Primary, 1917 ButtonType = ButtonType.Submit 1918 }; 1919 1920 @RenderButton(submitField) 1921 break; 1922 case FieldType.Tel: 1923 TextField telField = new TextField 1924 { 1925 Label = settings.Label != null ? settings.Label : Translate("Phone"), 1926 Id = settings.Id, 1927 Value = settings.Value, 1928 OnClick = settings.OnClick, 1929 Disabled = settings.Disabled, 1930 Required = settings.Required, 1931 CssClass = settings.CssClass, 1932 ExtraAttributes = settings.ExtraAttributes, 1933 ErrorMessage = settings.ErrorMessage, 1934 Placeholder = settings.Placeholder, 1935 Type = TextFieldType.Tel 1936 }; 1937 1938 @RenderTextField(telField) 1939 break; 1940 case FieldType.Text: 1941 TextField textField = new TextField 1942 { 1943 Label = settings.Label, 1944 Id = settings.Id, 1945 Value = settings.Value, 1946 OnClick = settings.OnClick, 1947 Disabled = settings.Disabled, 1948 Required = settings.Required, 1949 CssClass = settings.CssClass, 1950 ExtraAttributes = settings.ExtraAttributes, 1951 ErrorMessage = settings.ErrorMessage, 1952 Placeholder = settings.Placeholder, 1953 Type = TextFieldType.Text 1954 }; 1955 1956 @RenderTextField(textField) 1957 break; 1958 case FieldType.Textarea: 1959 TextareaField textareaField = new TextareaField 1960 { 1961 Label = settings.Label, 1962 Id = settings.Id, 1963 Value = settings.Value, 1964 OnClick = settings.OnClick, 1965 Disabled = settings.Disabled, 1966 Required = settings.Required, 1967 CssClass = settings.CssClass, 1968 ExtraAttributes = settings.ExtraAttributes, 1969 ErrorMessage = settings.ErrorMessage, 1970 Placeholder = settings.Placeholder 1971 }; 1972 1973 @RenderTextareaField(textareaField) 1974 break; 1975 default: 1976 TextField defaultField = new TextField 1977 { 1978 Label = settings.Label, 1979 Id = settings.Id, 1980 Value = settings.Value, 1981 OnClick = settings.OnClick, 1982 Disabled = settings.Disabled, 1983 Required = settings.Required, 1984 CssClass = settings.CssClass, 1985 ExtraAttributes = settings.ExtraAttributes, 1986 ErrorMessage = settings.ErrorMessage, 1987 Placeholder = settings.Placeholder, 1988 Type = TextFieldType.Text 1989 }; 1990 1991 @RenderTextField(defaultField) 1992 break; 1993 } 1994 } 1995 } 1996 1997 1998 @using Dynamicweb.Frontend 1999 @using System.Reflection 2000 @using Dynamicweb.Content.Items 2001 @using System.Web.UI.HtmlControls 2002 @using Dynamicweb.Rapido.Blocks.Components 2003 @using Dynamicweb.Rapido.Blocks 2004 2005 2006 @* Components for the articles *@ 2007 @using System.Reflection 2008 @using Dynamicweb.Rapido.Blocks.Components.Articles 2009 2010 2011 @* Component for the articles *@ 2012 2013 @helper RenderArticleBanner(dynamic settings) { 2014 dynamic[] methodParameters = new dynamic[1]; 2015 methodParameters[0] = settings; 2016 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerCustom"); 2017 2018 if (customMethod != null) 2019 { 2020 @customMethod.Invoke(this, methodParameters).ToString(); 2021 } else { 2022 string filterClasses = "image-filter image-filter--darken"; 2023 settings.Layout = ArticleHeaderLayout.Banner; 2024 2025 if (settings.Image != null) 2026 { 2027 if (settings.Image.Path != null) 2028 { 2029 @*<section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2030 <div class="background-image @filterClasses dw-mod">*@ 2031 @*<div class="background-image__wrapper @filterClasses dw-mod">*@ 2032 <div class="image"> 2033 @{ 2034 //settings.Image.CssClass += "background-image__cover dw-mod"; 2035 } 2036 @*@RenderImage(settings.Image)*@ 2037 <img src="/Admin/Public/GetImage.ashx?Width=1920&amp;Height=1080&amp;Crop=5&amp;Compression=95&amp;DoNotUpscale=True&amp;FillCanvas=False&amp;Image=@settings.Image.Path" /> 2038 </div> 2039 @*</div> 2040 <div class="center-container dw-mod"> 2041 <div class="grid"> 2042 <div class="grid__col-md-8 grid__col-xs-12 paragraph-container paragraph-container--height-lg"> 2043 <div class="u-left-middle"> 2044 <div>*@ 2045 if (!String.IsNullOrEmpty(settings.Heading)) 2046 { 2047 @*<h1 class="article__header article__header--giant dw-mod" style="color: @settings.TextColor">@settings.Heading</h1>*@ 2048 <h1 class="headline">@settings.Heading</h1> 2049 } 2050 if (!String.IsNullOrEmpty(settings.Subheading)) 2051 { 2052 @*<div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div>*@ 2053 <div class="subtitle">@settings.Subheading</div> 2054 } 2055 if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 2056 { 2057 <div class="info">@settings.Author @settings.Date</div> 2058 } 2059 if (!String.IsNullOrEmpty(settings.Link)) { 2060 @RenderButton(new Button { Link= settings.Link, Title= settings.LinkText, ButtonLayout= settings.ButtonLayout }) 2061 } 2062 /*</div> 2063 </div> 2064 </div>*/ 2065 if (settings.ExternalParagraphId != 0) 2066 { 2067 @*<div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod"> 2068 <div class="u-color-light-gray--bg u-color-dark dw-mod">*@ 2069 @RenderParagraphContent(settings.ExternalParagraphId) 2070 /*</div> 2071 </div> */ 2072 } 2073 /*</div> 2074 </div> 2075 </section>*/ 2076 } 2077 else 2078 { 2079 settings.Layout = ArticleHeaderLayout.Clean; 2080 @RenderArticleCleanHeader(settings); 2081 } 2082 } 2083 else 2084 { 2085 settings.Layout = ArticleHeaderLayout.Clean; 2086 @RenderArticleCleanHeader(settings); 2087 } 2088 } 2089 } 2090 @using System.Reflection 2091 @using Dynamicweb.Rapido.Blocks.Components 2092 @using Dynamicweb.Rapido.Blocks.Components.General 2093 @using Dynamicweb.Rapido.Blocks.Components.Articles 2094 @using Dynamicweb.Rapido.Blocks 2095 @using Df.Dw 2096 2097 2098 @* Component for the articles *@ 2099 2100 @helper RenderArticleHeader(ArticleHeader settings) { 2101 dynamic[] methodParameters = new dynamic[1]; 2102 methodParameters[0] = settings; 2103 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleHeaderCustom"); 2104 2105 if (customMethod != null) 2106 { 2107 @customMethod.Invoke(this, methodParameters).ToString(); 2108 } else { 2109 switch (settings.Layout) 2110 { 2111 case ArticleHeaderLayout.Clean: 2112 @RenderArticleCleanHeader(settings); 2113 break; 2114 case ArticleHeaderLayout.Split: 2115 @RenderArticleSplitHeader(settings); 2116 break; 2117 case ArticleHeaderLayout.Banner: 2118 @RenderArticleBannerHeader(settings); 2119 break; 2120 case ArticleHeaderLayout.Overlay: 2121 @RenderArticleOverlayHeader(settings); 2122 break; 2123 default: 2124 @RenderArticleCleanHeader(settings); 2125 break; 2126 } 2127 } 2128 } 2129 2130 @helper RenderArticleCleanHeader(ArticleHeader settings) { 2131 dynamic[] methodParameters = new dynamic[1]; 2132 methodParameters[0] = settings; 2133 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleCleanHeaderCustom"); 2134 2135 if (customMethod != null) 2136 { 2137 @customMethod.Invoke(this, methodParameters).ToString(); 2138 } 2139 else 2140 { 2141 //string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2142 2143 @*<div class="grid__col-md-@contentColumns grid__col-sm-12 u-padding--lg">*@ 2144 if (settings.Category.HasValue() || settings.Author.HasValue() || settings.Date.HasValue() || settings.RatingOutOf != 0) 2145 { 2146 if (settings.Category.HasValue()) 2147 { 2148 <div class="category" style="color: @settings.CategoryColor">@settings.Category</div> 2149 } 2150 2151 if (settings.Author.HasValue() || settings.Date.HasValue()) 2152 { 2153 <small class="info">@settings.Author @settings.Date</small> 2154 } 2155 if (settings.RatingOutOf != 0) 2156 { 2157 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2158 } 2159 } 2160 2161 if (settings.Heading.HasValue()) 2162 { 2163 <h1 class="headline">@settings.Heading</h1> 2164 } 2165 if (settings.Image != null) 2166 { 2167 if (settings.Image.Path != null) 2168 { 2169 <div class="image"> 2170 @*@RenderImage(settings.Image)*@ 2171 <img src="/Admin/Public/GetImage.ashx?Width=1920&amp;Height=1080&amp;Crop=5&amp;Compression=95&amp;DoNotUpscale=True&amp;FillCanvas=False&amp;Image=@settings.Image.Path" /> 2172 </div> 2173 } 2174 } 2175 if (settings.Subheading.HasValue()) 2176 { 2177 <div class="subtitle">@settings.Subheading</div> 2178 } 2179 if (settings.Link.HasValue()) 2180 { 2181 <div class="button"> 2182 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2183 </div> 2184 } 2185 @*</div>*@ 2186 2187 if (settings.ExternalParagraphId != 0) 2188 { 2189 @RenderParagraphContent(settings.ExternalParagraphId) 2190 } 2191 } 2192 } 2193 2194 @helper RenderArticleSplitHeader(ArticleHeader settings) { 2195 dynamic[] methodParameters = new dynamic[1]; 2196 methodParameters[0] = settings; 2197 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSplitHeaderCustom"); 2198 2199 if (customMethod != null) 2200 { 2201 @customMethod.Invoke(this, methodParameters).ToString(); 2202 } 2203 else 2204 { 2205 //string headerColumnWidth = settings.ExternalParagraphId != 0 ? "4" : "6"; 2206 2207 if (settings.Image != null) 2208 { 2209 if (settings.Image.Path != null) 2210 { 2211 @*<section class="multiple-paragraphs-container paragraph-container--full-width"> 2212 <div class="grid"> 2213 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-xl"> 2214 <div class="u-left-middle u-padding--lg"> 2215 <div>*@ 2216 if (settings.Category.HasValue()) 2217 { 2218 <div class="article__category" style="color: @settings.CategoryColor">@settings.Category</div> 2219 } 2220 if (settings.Heading.HasValue()) 2221 { 2222 <h1 class="headline">@settings.Heading</h1> 2223 } 2224 if (settings.Subheading.HasValue()) 2225 { 2226 <div class="subtitle">@settings.Subheading</div> 2227 } 2228 if (settings.Author.HasValue() || settings.Date.HasValue()) 2229 { 2230 <small class="info">@settings.Author @settings.Date</small> 2231 } 2232 if (settings.RatingOutOf != 0) 2233 { 2234 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2235 } 2236 if (settings.Link.HasValue()) { 2237 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2238 } 2239 @*</div> 2240 </div> 2241 </div>*@ 2242 2243 <div class="image"> 2244 @* <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto" style="background-image:url(/Admin/Public/GetImage.ashx?width=1800&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=@settings.Image.Path); background-position: center center; background-size: cover;"></div>*@ 2245 <img src="/Admin/Public/GetImage.ashx?Width=1920&amp;Height=1080&amp;Crop=5&amp;Compression=95&amp;DoNotUpscale=True&amp;FillCanvas=False&amp;Image=@settings.Image.Path" /> 2246 </div> 2247 2248 if (settings.ExternalParagraphId != 0) 2249 { 2250 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto u-color-light-gray--bg"> 2251 @RenderParagraphContent(settings.ExternalParagraphId) 2252 </div> 2253 } 2254 @*</div> 2255 </section>*@ 2256 } 2257 } 2258 else 2259 { 2260 @RenderArticleCleanHeader(settings); 2261 } 2262 } 2263 } 2264 2265 @helper RenderArticleOverlayHeader(ArticleHeader settings) { 2266 dynamic[] methodParameters = new dynamic[1]; 2267 methodParameters[0] = settings; 2268 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleOverlayHeaderCustom"); 2269 2270 if (customMethod != null) 2271 { 2272 @customMethod.Invoke(this, methodParameters).ToString(); 2273 } 2274 else 2275 { 2276 //string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 2277 //string contentAlignment = settings.TextLayout == ArticleHeaderTextLayout.Center ? "grid--justify-center" : ""; 2278 2279 if (settings.Image != null) 2280 { 2281 if (settings.Image.Path != null) 2282 { 2283 if (settings.ExternalParagraphId == 0) 2284 { 2285 @*<section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 2286 <div class="background-image image-filter image-filter--darken">*@ 2287 <div class="image"> 2288 @{ 2289 //settings.Image.CssClass += "background-image__cover"; 2290 } 2291 @*@RenderImage(settings.Image)*@ 2292 <img src="/Admin/Public/GetImage.ashx?Width=1920&amp;Height=1080&amp;Crop=5&amp;Compression=95&amp;DoNotUpscale=True&amp;FillCanvas=False&amp;Image=@settings.Image.Path" /> 2293 </div> 2294 @*</div> 2295 <div class="center-container"> 2296 <div class="grid @contentAlignment"> 2297 <div class="grid__col-md-@contentColumns grid__col-xs-12 paragraph-container paragraph-container--height-xl u-no-padding">*@ 2298 if (settings.Heading.HasValue()) 2299 { 2300 <h1 class="headline" style="color: @settings.TextColor">@settings.Heading</h1> 2301 } 2302 if (settings.Subheading.HasValue()) 2303 { 2304 @*style="color: @settings.TextColor" *@ 2305 <div class="subtitle">@settings.Subheading</div> 2306 } 2307 2308 if (settings.Author.HasValue() || settings.Date.HasValue()) 2309 { 2310 <small class="info" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 2311 } 2312 if (settings.RatingOutOf != 0) 2313 { 2314 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 2315 } 2316 if (settings.Link.HasValue()) 2317 { 2318 @RenderButton(new Button { Link= settings.Link, Title= settings.LinkText, ButtonLayout= settings.ButtonLayout }) 2319 } 2320 @*</div> 2321 </div> 2322 </div> 2323 </section>*@ 2324 } 2325 else 2326 { 2327 @RenderArticleBanner(settings); 2328 } 2329 } 2330 } 2331 else 2332 { 2333 @RenderArticleCleanHeader(settings); 2334 } 2335 } 2336 } 2337 2338 @helper RenderArticleBannerHeader(dynamic settings) { 2339 dynamic[] methodParameters = new dynamic[1]; 2340 methodParameters[0] = settings; 2341 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerHeaderCustom"); 2342 2343 if (customMethod != null) 2344 { 2345 @customMethod.Invoke(this, methodParameters).ToString(); 2346 } 2347 else 2348 { 2349 @RenderArticleBanner(settings); 2350 } 2351 } 2352 @using System.Reflection 2353 @using System.Text.RegularExpressions; 2354 @using Dynamicweb.Frontend 2355 @using Dynamicweb.Content.Items 2356 @using Dynamicweb.Rapido.Blocks.Components 2357 @using Dynamicweb.Rapido.Blocks.Components.Articles 2358 @using Dynamicweb.Rapido.Blocks 2359 2360 @* Component for the articles *@ 2361 2362 @helper RenderArticleBodyRow(ArticleBodyRow settings) 2363 { 2364 dynamic[] methodParameters = new dynamic[1]; 2365 methodParameters[0] = settings; 2366 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBodyRowCustom"); 2367 2368 if (customMethod != null) 2369 { 2370 @customMethod.Invoke(this, methodParameters).ToString(); 2371 } else { 2372 //string position = settings.TopLayout == "overlay" ? "article__overlay-offset" : ""; 2373 //string contentAlignment = settings.TextLayout == "center" ? "grid--justify-center" : ""; 2374 2375 @*<div class="col-12 @contentAlignment @position">*@ 2376 @RenderBlockList(settings.SubBlocks) 2377 /*</div>*/ 2378 } 2379 } 2380 @using System.Reflection 2381 @using Dynamicweb.Rapido.Blocks.Components 2382 @using Dynamicweb.Rapido.Blocks.Components.General 2383 @using Dynamicweb.Rapido.Blocks.Components.Articles 2384 @using Dynamicweb.Rapido.Blocks 2385 2386 @* Component for the articles *@ 2387 2388 @helper RenderArticleImage(ArticleImage settings) 2389 { 2390 dynamic[] methodParameters = new dynamic[1]; 2391 methodParameters[0] = settings; 2392 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleImageCustom"); 2393 2394 if (customMethod != null) 2395 { 2396 @customMethod.Invoke(this, methodParameters).ToString(); 2397 } 2398 else 2399 { 2400 if (settings.Image != null) 2401 { 2402 if (settings.Image.Path != null) 2403 { 2404 <div class="u-margin-bottom--lg"> 2405 @*@RenderImage()*@ 2406 <img class="img-fluid lazyload" loading="lazy" src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image=@settings.Image.Path" alt="" /> 2407 </div> 2408 } 2409 } 2410 } 2411 } 2412 @using System.Reflection 2413 @using Dynamicweb.Rapido.Blocks.Components 2414 @using Dynamicweb.Rapido.Blocks.Components.Articles 2415 2416 2417 @* Component for the articles *@ 2418 2419 @helper RenderArticleSubHeader(ArticleSubHeader settings) 2420 { 2421 dynamic[] methodParameters = new dynamic[1]; 2422 methodParameters[0] = settings; 2423 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSubHeaderCustom"); 2424 2425 if (customMethod != null) 2426 { 2427 @customMethod.Invoke(this, methodParameters).ToString(); 2428 } else { 2429 if (!String.IsNullOrEmpty(settings.Title)) 2430 { 2431 <h2 class="article__header">@settings.Title</h2> 2432 } 2433 } 2434 } 2435 @using System.Reflection 2436 @using Dynamicweb.Rapido.Blocks.Components 2437 @using Dynamicweb.Rapido.Blocks.Components.Articles 2438 @using Dynamicweb.Rapido.Blocks 2439 2440 2441 @* Component for the articles *@ 2442 2443 @helper RenderArticleText(ArticleText settings) 2444 { 2445 dynamic[] methodParameters = new dynamic[1]; 2446 methodParameters[0] = settings; 2447 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 2448 2449 if (customMethod != null) 2450 { 2451 @customMethod.Invoke(this, methodParameters).ToString(); 2452 } else { 2453 if (!String.IsNullOrEmpty(settings.Text)) 2454 { 2455 //string greatTextClass = settings.EnableLargeText == true ? "article__paragraph--great-text" : ""; 2456 2457 @settings.Text 2458 } 2459 } 2460 } 2461 @using System.Reflection 2462 @using Dynamicweb.Rapido.Blocks.Components 2463 @using Dynamicweb.Rapido.Blocks.Components.Articles 2464 @using Dynamicweb.Rapido.Blocks 2465 2466 2467 @* Component for the articles *@ 2468 2469 @helper RenderArticleQuote(ArticleQuote settings) 2470 { 2471 dynamic[] methodParameters = new dynamic[1]; 2472 methodParameters[0] = settings; 2473 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleQuoteCustom"); 2474 2475 if (customMethod != null) 2476 { 2477 @customMethod.Invoke(this, methodParameters).ToString(); 2478 } else { 2479 string text = Regex.Replace(settings.Text, "<.*?>", String.Empty); 2480 2481 <div class="grid u-padding-bottom--lg"> 2482 @if (settings.Image != null) 2483 { 2484 if (settings.Image.Path != null) { 2485 <div class="grid__col-3"> 2486 <div class="grid__cell-img"> 2487 @{ 2488 settings.Image.Title = !String.IsNullOrEmpty(settings.Image.Title) ? settings.Image.Title : settings.Author; 2489 settings.Image.CssClass += " article__image article__image--ball"; 2490 settings.Image.ImageDefault.Width = 200; 2491 settings.Image.ImageDefault.Height = 200; 2492 } 2493 @RenderImage(settings.Image) 2494 </div> 2495 </div> 2496 } 2497 } 2498 <div class="grid__col-auto"> 2499 @if (!String.IsNullOrEmpty(settings.Text)) 2500 { 2501 <div class="article__quote dw-mod"> 2502 <i class="fas fa-quote-right u-margin-bottom--lg"></i> 2503 @settings.Text 2504 <i class="fas fa-quote-right"></i> 2505 </div> 2506 } 2507 @if (!String.IsNullOrEmpty(settings.Author)) 2508 { 2509 <div class="article__quote-author dw-mod"> 2510 - @settings.Author 2511 </div> 2512 } 2513 </div> 2514 </div> 2515 } 2516 } 2517 @using System.Reflection 2518 @using Dynamicweb.Rapido.Blocks.Components 2519 @using Dynamicweb.Rapido.Blocks.Components.Articles 2520 @using Dynamicweb.Rapido.Blocks 2521 2522 @* Component for the articles *@ 2523 2524 @helper RenderArticleInfoTable(ArticleInfoTable settings) 2525 { 2526 dynamic[] methodParameters = new dynamic[1]; 2527 methodParameters[0] = settings; 2528 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleInfoTableCustom"); 2529 2530 if (customMethod != null) 2531 { 2532 @customMethod.Invoke(this, methodParameters).ToString(); 2533 } else { 2534 <table class="table table--clean"> 2535 @foreach (var row in settings.Rows) 2536 { 2537 string iconColor = row.IconColor != null ? row.IconColor : "u-brand-color-two"; 2538 2539 <tr> 2540 @if (!String.IsNullOrEmpty(row.Icon)) 2541 { 2542 <td class="u-w32px"><i class="@row.Icon fa-2x @row.IconColor"></i></td> 2543 } 2544 <td class="u-no-margin-on-p-elements"> 2545 <div class="u-bold">@row.Title</div> 2546 @if (!String.IsNullOrEmpty(row.SubTitle)) 2547 { 2548 if (row.Link == null) 2549 { 2550 <div>@row.SubTitle</div> 2551 } 2552 else 2553 { 2554 <a href="@row.Link" class="u-color-inherit">@row.SubTitle</a> 2555 } 2556 } 2557 </td> 2558 </tr> 2559 } 2560 </table> 2561 } 2562 } 2563 @using System.Reflection 2564 @using Dynamicweb.Rapido.Blocks.Components 2565 @using Dynamicweb.Rapido.Blocks.Components.Articles 2566 @using Dynamicweb.Rapido.Blocks 2567 2568 @* Component for the articles *@ 2569 2570 @helper RenderArticleGalleryModal(ArticleGalleryModal settings) 2571 { 2572 dynamic[] methodParameters = new dynamic[1]; 2573 methodParameters[0] = settings; 2574 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 2575 2576 if (customMethod != null) 2577 { 2578 @customMethod.Invoke(this, methodParameters).ToString(); 2579 } 2580 else 2581 { 2582 <input type="checkbox" id="ParagraphGalleryModalTrigger" class="modal-trigger" /> 2583 <div class="modal-container"> 2584 <label for="ParagraphGalleryModalTrigger" id="ParagraphGalleryModalOverlay" class="modal-overlay"></label> 2585 <div class="modal modal--full" id="ParagraphGalleryModal"> 2586 <div class="modal__body modal__body--full"> 2587 <div class="modal__image-min-size-wrapper"> 2588 <img src="/Files/Images/placeholder.gif" id="ParagraphGallery" class="modal--full__img dw-mod" alt=""> 2589 </div> 2590 <div class="modal__images-counter" id="ParagraphGallery_counter"></div> 2591 <button class="modal__prev-btn dw-mod" id="ParagraphGallery_prev" onclick="Gallery.prevImage('ParagraphGallery')" type="button"> 2592 <i class="far fa-angle-left"></i> 2593 </button> 2594 <button class="modal__next-btn dw-mod" id="ParagraphGallery_next" onclick="Gallery.nextImage('ParagraphGallery')" type="button"> 2595 <i class="far fa-angle-right"></i> 2596 </button> 2597 </div> 2598 <label class="modal__close-btn" for="ParagraphGalleryModalTrigger"></label> 2599 </div> 2600 </div> 2601 } 2602 } 2603 @using System.Reflection 2604 @using Dynamicweb.Rapido.Blocks.Components 2605 @using Dynamicweb.Rapido.Blocks.Components.Articles 2606 @using Dynamicweb.Rapido.Blocks 2607 2608 2609 @* Component for the articles *@ 2610 2611 @helper RenderArticleRelated(ArticleRelated settings) 2612 { 2613 string cardClass = Pageview.Device.ToString() != "Tablet" ? "card u-color-light--bg u-full-height" : ""; 2614 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "card-footer u-color-light--bg" : ""; 2615 2616 <section class="col-12 related"> 2617 <h2 class="article__header">@settings.Title</h2> 2618 2619 <div class="js-handlebars-root" id="@settings.Title.Replace(" ", String.Empty)" data-template="RelatedSimpleTemplate" data-json-feed="/Default.aspx?ID=@settings.FeedPageId&@settings.Query&ExcludeItemID=@settings.CurrentPageId&PageSize=@settings.PageSize"></div> 2620 2621 <script id="RelatedSimpleTemplate" type="text/x-template"> 2622 {{#.}} 2623 <div class="grid"> 2624 {{#Cases}} 2625 <div class="col-4"> 2626 <a href="{{link}}"> 2627 {{#if image}} 2628 <div class="flex-img image-hover__wrapper"> 2629 <img class="img-fluid lazyload" loading="lazy" src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image={{image}}" alt="{{title}}" /> 2630 </div> 2631 {{/if}} 2632 2633 <div class="card"> 2634 <h3 class="article-list__item-header">{{title}}</h3> 2635 <p class="article__short-summary">{{summary}}</p> 2636 </div> 2637 </a> 2638 </div> 2639 {{/Cases}} 2640 </div> 2641 {{/.}} 2642 </script> 2643 </section> 2644 } 2645 @using System.Reflection 2646 @using Dynamicweb.Rapido.Blocks.Components 2647 @using Dynamicweb.Rapido.Blocks.Components.Articles 2648 @using Dynamicweb.Rapido.Blocks 2649 2650 2651 @* Component for the articles *@ 2652 2653 @helper RenderArticleMenu(ArticleMenu settings) 2654 { 2655 dynamic[] methodParameters = new dynamic[1]; 2656 methodParameters[0] = settings; 2657 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuCustom"); 2658 2659 if (customMethod != null) 2660 { 2661 @customMethod.Invoke(this, methodParameters).ToString(); 2662 } else { 2663 if (!String.IsNullOrEmpty(settings.Title)) { 2664 <div class="u-margin u-border-bottom"> 2665 <h3 class="u-no-margin">@settings.Title</h3> 2666 </div> 2667 } 2668 2669 <ul class="menu-left u-margin-bottom dw-mod"> 2670 @foreach (var item in settings.Items) 2671 { 2672 @RenderArticleMenuItem(item) 2673 } 2674 </ul> 2675 } 2676 } 2677 2678 @helper RenderArticleMenuItem(ArticleMenuItem settings) 2679 { 2680 dynamic[] methodParameters = new dynamic[1]; 2681 methodParameters[0] = settings; 2682 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuItemCustom"); 2683 2684 if (customMethod != null) 2685 { 2686 @customMethod.Invoke(this, methodParameters).ToString(); 2687 } else { 2688 string link = !String.IsNullOrEmpty(settings.Link) ? settings.Link : "#"; 2689 2690 if (!String.IsNullOrEmpty(settings.Title)) { 2691 <li class="menu-left__item dw-mod"> 2692 <a href="@link" onclick="@settings.OnClick" class="menu-left__link dw-mod">@settings.Title</a> 2693 </li> 2694 } 2695 } 2696 } 2697 @using System.Reflection 2698 @using Dynamicweb.Rapido.Blocks.Components 2699 @using Dynamicweb.Rapido.Blocks.Components.Articles 2700 @using Dynamicweb.Rapido.Blocks 2701 2702 @* Component for the articles *@ 2703 2704 @helper RenderArticleList(ArticleList settings) 2705 { 2706 dynamic[] methodParameters = new dynamic[1]; 2707 methodParameters[0] = settings; 2708 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCustom"); 2709 2710 if (customMethod != null) 2711 { 2712 @customMethod.Invoke(this, methodParameters).ToString(); 2713 } else { 2714 if (Pageview != null) 2715 { 2716 bool isParagraph = Pageview.CurrentParagraph != null ? true : false; 2717 string[] sortArticlesListBy = new string[2]; 2718 2719 if (isParagraph) { 2720 sortArticlesListBy = Pageview.CurrentParagraph.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString()) ? Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2721 } 2722 else { 2723 sortArticlesListBy = Pageview.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.Item["SortArticlesListBy"].ToString()) ? Pageview.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2724 } 2725 2726 string sourcePage = settings.SourcePage != null ? settings.SourcePage : Pageview.ID.ToString(); 2727 2728 @RenderItemList(new 2729 { 2730 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 2731 ListSourceType = settings.SourceType, 2732 ListSourcePage = sourcePage, 2733 ItemFieldsList = "*", 2734 Filter = settings.Filter, 2735 ListOrderBy = sortArticlesListBy[0], 2736 ListOrderByDirection = sortArticlesListBy[1], 2737 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 2738 ListSecondOrderByDirection = "ASC", 2739 IncludeAllChildItems = true, 2740 ListTemplate = settings.Template, 2741 ListPageSize = settings.PageSize.ToString() 2742 }); 2743 } 2744 } 2745 } 2746 @using System.Reflection 2747 @using Dynamicweb.Rapido.Blocks.Components.Articles 2748 2749 2750 @* Component for the articles *@ 2751 2752 @helper RenderArticleSummary(ArticleSummary settings) 2753 { 2754 dynamic[] methodParameters = new dynamic[1]; 2755 methodParameters[0] = settings; 2756 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSummaryCustom"); 2757 2758 if (customMethod != null) 2759 { 2760 @customMethod.Invoke(this, methodParameters).ToString(); 2761 } else { 2762 if (!String.IsNullOrEmpty(settings.Text)) 2763 { 2764 <div class="article__summary dw-mod">@settings.Text</div> 2765 } 2766 } 2767 } 2768 @using System.Reflection 2769 @using Dynamicweb.Rapido.Blocks.Components 2770 @using Dynamicweb.Rapido.Blocks.Components.Articles 2771 @using Dynamicweb.Rapido.Blocks 2772 2773 @* Component for the articles *@ 2774 2775 @helper RenderArticleListCategoryFilter(ArticleListCategoryFilter settings) 2776 { 2777 dynamic[] methodParameters = new dynamic[1]; 2778 methodParameters[0] = settings; 2779 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCategoryFilterCustom"); 2780 2781 if (customMethod != null) 2782 { 2783 @customMethod.Invoke(this, methodParameters).ToString(); 2784 } else { 2785 string pageId = Pageview.ID.ToString(); 2786 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("sourcePage")) ? HttpContext.Current.Request.QueryString.Get("sourcePage") : Translate("All"); 2787 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2788 2789 foreach (var option in settings.Categories) 2790 { 2791 selectedFilter = selectedFilter == option.Value ? option.Key : selectedFilter; 2792 } 2793 2794 if (selectedFilter == pageId) 2795 { 2796 selectedFilter = Translate("All"); 2797 } 2798 2799 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2800 { 2801 <div class="u-pull--right u-margin-left"> 2802 <div class="collection u-no-margin"> 2803 <h5>@Translate("Category")</h5> 2804 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2805 <div class="dropdown u-w180px dw-mod"> 2806 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2807 <div class="dropdown__content dw-mod"> 2808 @foreach (var option in settings.Categories) 2809 { 2810 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2811 } 2812 </div> 2813 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2814 </div> 2815 </div> 2816 </div> 2817 } 2818 else 2819 { 2820 <div class="u-full-width u-margin-bottom"> 2821 <h5 class="u-no-margin">@Translate("Category")</h5> 2822 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2823 <div class="dropdown u-full-width dw-mod"> 2824 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2825 <div class="dropdown__content dw-mod"> 2826 @foreach (var option in settings.Categories) 2827 { 2828 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2829 } 2830 </div> 2831 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2832 </div> 2833 </div> 2834 } 2835 } 2836 } 2837 @using System.Reflection 2838 @using Dynamicweb.Rapido.Blocks.Components 2839 @using Dynamicweb.Rapido.Blocks.Components.Articles 2840 @using Dynamicweb.Rapido.Blocks 2841 2842 @* Component for the articles *@ 2843 2844 @helper RenderArticleListFilter(ArticleListFilter settings) 2845 { 2846 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get(settings.SystemName)) ? HttpContext.Current.Request.QueryString.Get(settings.SystemName) : Translate("All"); 2847 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2848 2849 if (settings.Options != null) 2850 { 2851 foreach (var option in settings.Options) 2852 { 2853 selectedFilter = selectedFilter == option.Value ? option.Name : selectedFilter; 2854 } 2855 2856 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2857 { 2858 <div class="u-pull--right u-margin-left"> 2859 <div class="collection u-no-margin"> 2860 <h5>@settings.Label</h5> 2861 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 2862 <div class="dropdown u-w180px dw-mod"> 2863 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 2864 <div class="dropdown__content dw-mod"> 2865 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 2866 @foreach (var option in settings.Options) 2867 { 2868 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 2869 } 2870 </div> 2871 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 2872 </div> 2873 </div> 2874 </div> 2875 } 2876 else 2877 { 2878 <div class="u-full-width u-margin-bottom"> 2879 <h5 class="u-no-margin">@settings.Label</h5> 2880 <input type="checkbox" id="@(settings.SystemName)Selector" class="dropdown-trigger" /> 2881 <div class="dropdown u-full-width w-mod"> 2882 <label class="dropdown__header dropdown__btn dw-mod" for="@(settings.SystemName)Selector">@Translate(selectedFilter)</label> 2883 <div class="dropdown__content dw-mod"> 2884 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')">@Translate("All")</div> 2885 @foreach (var option in settings.Options) 2886 { 2887 <div class="dropdown__item" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')">@Translate(option.Name)</div> 2888 } 2889 </div> 2890 <label class="dropdown-trigger-off" for="@(settings.SystemName)Selector"></label> 2891 </div> 2892 </div> 2893 } 2894 } 2895 } 2896 @using System.Reflection 2897 @using Dynamicweb.Rapido.Blocks.Components 2898 @using Dynamicweb.Rapido.Blocks.Components.Articles 2899 @using Dynamicweb.Rapido.Blocks 2900 2901 @* Component for the articles *@ 2902 2903 @helper RenderArticleListSearch(ArticleListSearch settings) 2904 { 2905 dynamic[] methodParameters = new dynamic[1]; 2906 methodParameters[0] = settings; 2907 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListSearchCustom"); 2908 2909 if (customMethod != null) 2910 { 2911 @customMethod.Invoke(this, methodParameters).ToString(); 2912 } else { 2913 string searchString = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("Title")) ? HttpContext.Current.Request.QueryString.Get("Title").Trim('*') : ""; 2914 string className = "u-w340px u-pull--right u-margin-left"; 2915 2916 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 2917 { 2918 className = "u-full-width"; 2919 } 2920 2921 <div class="typeahead u-color-inherit u-margin-bottom dw-mod @className"> 2922 <input type="text" class="typeahead-search-field u-no-margin dw-mod" placeholder="@Translate("Search in list")" value="@searchString" id="ArticleListSearchInput" onchange="QueryArray.setParameterInCurrentURL('Title', '*' + document.getElementById('ArticleListSearchInput').value + '*')"> 2923 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod"><i class="fas fa-search"></i></button> 2924 </div> 2925 } 2926 } 2927 @using System.Reflection 2928 @using Dynamicweb.Rapido.Blocks.Components 2929 @using Dynamicweb.Rapido.Blocks.Components.Articles 2930 @using Dynamicweb.Rapido.Blocks 2931 2932 @* Component for the articles *@ 2933 2934 @helper RenderArticleListNoResultsInfo(ArticleListNoResultsInfo settings) 2935 { 2936 dynamic[] methodParameters = new dynamic[1]; 2937 methodParameters[0] = settings; 2938 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListNoResultsInfoCustom"); 2939 2940 if (customMethod != null) 2941 { 2942 @customMethod.Invoke(this, methodParameters).ToString(); 2943 } else { 2944 <div class="u-margin-top--lg u-bold u-ta-center u-bold">@Translate(settings.Message)</div> 2945 } 2946 } 2947 @using System.Reflection 2948 @using Dynamicweb.Rapido.Blocks.Components 2949 @using Dynamicweb.Rapido.Blocks.Components.General 2950 @using Dynamicweb.Rapido.Blocks.Components.Articles 2951 @using Dynamicweb.Rapido.Blocks 2952 @using System.Text.RegularExpressions 2953 2954 @* Component for the articles *@ 2955 2956 @helper RenderArticleListItem(ArticleListItem settings) 2957 { 2958 switch (settings.Type) { 2959 case ArticleListItemType.Card: 2960 @RenderArticleListItemCard(settings); 2961 break; 2962 case ArticleListItemType.List: 2963 @RenderArticleListItemList(settings); 2964 break; 2965 case ArticleListItemType.Simple: 2966 @RenderArticleListItemSimple(settings); 2967 break; 2968 default: 2969 @RenderArticleListItemCard(settings); 2970 break; 2971 } 2972 } 2973 2974 @helper RenderArticleListItemCard(ArticleListItem settings) { 2975 <a href="@settings.Link" class="u-full-height u-color-light--bg"> 2976 <div class="u-color-light--bg u-no-padding dw-mod"> 2977 @if (settings.Logo != null) 2978 { 2979 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 2980 settings.Logo.ImageDefault.Crop = 5; 2981 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 2982 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 2983 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 2984 @if (settings.Stickers != null) 2985 { 2986 if (settings.Stickers.Position != StickersListPosition.Custom) 2987 { 2988 @RenderStickersCollection(settings.Stickers); 2989 } 2990 } 2991 @RenderImage(settings.Logo) 2992 </div> 2993 } else if (settings.Image != null) 2994 { 2995 <div class="flex-img image-hover__wrapper u-position-relative dw-mod"> 2996 @if (settings.Stickers != null) 2997 { 2998 if (settings.Stickers.Position != StickersListPosition.Custom) 2999 { 3000 @RenderStickersCollection(settings.Stickers); 3001 } 3002 } 3003 @*@RenderImage(settings.Image)*@ 3004 <img class="img-fluid lazyload" loading="lazy" src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image=@settings.Image.Path" alt="" /> 3005 </div> 3006 } 3007 </div> 3008 3009 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3010 { 3011 <div class="card u-color-light--bg dw-mod"> 3012 @if (settings.Stickers != null) 3013 { 3014 if (settings.Stickers.Position == StickersListPosition.Custom) 3015 { 3016 @RenderStickersCollection(settings.Stickers); 3017 } 3018 } 3019 @if (!String.IsNullOrEmpty(settings.Title)) 3020 { 3021 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3022 } 3023 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3024 { 3025 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3026 } 3027 @if (!String.IsNullOrEmpty(settings.Summary)) 3028 { 3029 <p class="article__short-summary dw-mod">@settings.Summary</p> 3030 } 3031 </div> 3032 } 3033 </a> 3034 } 3035 3036 @helper RenderArticleListItemList(ArticleListItem settings) { 3037 <a href="@settings.Link"> 3038 <div class="grid u-color-light--bg u-no-padding dw-mod"> 3039 <div class="grid__col-md-3"> 3040 <div class="u-color-light--bg u-no-padding dw-mod"> 3041 @if (settings.Logo != null) 3042 { 3043 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 3044 settings.Logo.ImageDefault.Crop = 5; 3045 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 3046 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 3047 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 3048 @if (settings.Stickers != null) 3049 { 3050 if (settings.Stickers.Position != StickersListPosition.Custom) 3051 { 3052 @RenderStickersCollection(settings.Stickers); 3053 } 3054 } 3055 @RenderImage(settings.Logo) 3056 </div> 3057 } else if (settings.Image != null) 3058 { 3059 <div class="flex-img image-hover__wrapper dw-mod"> 3060 @if (settings.Stickers != null) 3061 { 3062 if (settings.Stickers.Position != StickersListPosition.Custom) 3063 { 3064 @RenderStickersCollection(settings.Stickers); 3065 } 3066 } 3067 @RenderImage(settings.Image) 3068 </div> 3069 } 3070 </div> 3071 </div> 3072 3073 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 3074 { 3075 <div class="grid__col-md-9"> 3076 @if (!String.IsNullOrEmpty(settings.Title)) 3077 { 3078 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 3079 } 3080 @if (settings.Stickers != null) 3081 { 3082 if (settings.Stickers.Position == StickersListPosition.Custom) 3083 { 3084 @RenderStickersCollection(settings.Stickers); 3085 } 3086 } 3087 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3088 { 3089 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 3090 } 3091 @if (!String.IsNullOrEmpty(settings.Summary)) 3092 { 3093 <p class="article__short-summary dw-mod">@settings.Summary</p> 3094 } 3095 </div> 3096 } 3097 </div> 3098 </a> 3099 } 3100 3101 @helper RenderArticleListItemSimple(ArticleListItem settings) { 3102 <div class="col-4"> 3103 <a href="@settings.Link"> 3104 @if (!String.IsNullOrEmpty(settings.Title)) 3105 { 3106 <div class="article-list-item__header">@settings.Title</div> 3107 } 3108 @if (!String.IsNullOrEmpty(settings.SubTitle)) 3109 { 3110 <div class="article-list__item-micro-info">@settings.SubTitle</div> 3111 } 3112 </a> 3113 </div> 3114 } 3115 @using System.Reflection 3116 @using Dynamicweb.Rapido.Blocks.Components.Articles 3117 3118 3119 @* Component for the articles *@ 3120 3121 @helper RenderArticleAuthorAndDate(ArticleAuthorAndDate settings) 3122 { 3123 dynamic[] methodParameters = new dynamic[1]; 3124 methodParameters[0] = settings; 3125 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleAuthorAndDateCustom"); 3126 3127 if (customMethod != null) 3128 { 3129 @customMethod.Invoke(this, methodParameters).ToString(); 3130 } else { 3131 <small class="article__subscription"> 3132 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3133 { 3134 <text>@Translate("Written")</text> 3135 } 3136 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3137 { 3138 <text>@Translate("by") @settings.Author</text> 3139 } 3140 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3141 { 3142 <text>@Translate("on") @settings.Date</text> 3143 } 3144 </small> 3145 } 3146 } 3147 @using System.Reflection 3148 @using Dynamicweb.Rapido.Blocks.Components.Articles 3149 3150 3151 @* Component for the articles *@ 3152 3153 @helper RenderArticleLink(ArticleLink settings) 3154 { 3155 dynamic[] methodParameters = new dynamic[1]; 3156 methodParameters[0] = settings; 3157 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleLinkCustom"); 3158 3159 if (customMethod != null) 3160 { 3161 @customMethod.Invoke(this, methodParameters).ToString(); 3162 } else { 3163 if (!String.IsNullOrEmpty(settings.Title)) 3164 { 3165 <div class="grid__cell"> 3166 @RenderButton(settings) 3167 </div> 3168 } 3169 } 3170 } 3171 @using System.Reflection 3172 @using Dynamicweb.Rapido.Blocks 3173 @using Dynamicweb.Rapido.Blocks.Components.Articles 3174 @using Dynamicweb.Rapido.Blocks.Components.General 3175 3176 3177 @* Component for the articles *@ 3178 3179 @helper RenderArticleCarousel(ArticleCarousel settings) 3180 { 3181 dynamic[] methodParameters = new dynamic[1]; 3182 methodParameters[0] = settings; 3183 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 3184 3185 if (customMethod != null) 3186 { 3187 @customMethod.Invoke(this, methodParameters).ToString(); 3188 } else { 3189 <div class="grid"> 3190 <div class="grid__col-12"> 3191 <div class="carousel" id="carousel_@settings.Id"> 3192 <div class="carousel__container js-carousel-slides dw-mod"> 3193 @RenderBlockList(settings.SubBlocks) 3194 </div> 3195 </div> 3196 </div> 3197 </div> 3198 @SnippetStart("BottomJS") 3199 <script> 3200 document.addEventListener("DOMContentLoaded", function () { 3201 new CarouselModule("#carousel_@settings.Id", { 3202 slideTime: 0, 3203 dots: true 3204 }); 3205 }); 3206 </script> 3207 @SnippetEnd("BottomJS") 3208 } 3209 } 3210 3211 @helper RenderArticleCarouselSlide(ArticleCarouselSlide settings) 3212 { 3213 dynamic[] methodParameters = new dynamic[1]; 3214 methodParameters[0] = settings; 3215 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 3216 3217 if (customMethod != null) 3218 { 3219 @customMethod.Invoke(this, methodParameters).ToString(); 3220 } 3221 else 3222 { 3223 string imageEngine = "/Admin/Public/GetImage.ashx?"; 3224 3225 string defaultImage = settings.ImageSettings != null ? imageEngine : settings.Image; 3226 if (settings.ImageSettings != null) 3227 { 3228 defaultImage += settings.ImageSettings.Width != 0 ? "Width=" + settings.ImageSettings.Width + "&" : ""; 3229 defaultImage += settings.ImageSettings.Height != 0 ? "Height=" + settings.ImageSettings.Height + "&" : ""; 3230 defaultImage += "Crop=" + settings.ImageSettings.Crop + "&"; 3231 defaultImage += "Compression=" + settings.ImageSettings.Compression + "&"; 3232 defaultImage += "DoNotUpscale=" + settings.ImageSettings.DoNotUpscale.ToString() + "&"; 3233 defaultImage += "FillCanvas=" + settings.ImageSettings.FillCanvas.ToString() + "&"; 3234 } 3235 defaultImage += "&Image=" + settings.Image; 3236 3237 <div class="carousel__slide u-min-h300px u-flex dw-mod" style="background-size:cover; background-image:url('@defaultImage')"> 3238 <a class="article-carousel-item__wrap" href="@settings.Link" title="@settings.Title"> 3239 <h2 class="article-list__item-header u-truncate-text u-color-light dw-mod">@settings.Title</h2> 3240 <div class="article-list__item-info"> 3241 @if (settings.Stickers != null) 3242 { 3243 settings.Stickers.Position = StickersListPosition.Custom; 3244 @RenderStickersCollection(settings.Stickers); 3245 } 3246 3247 <small class="u-margin-top--lg u-color-light"> 3248 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3249 { 3250 <text>@Translate("Written")</text> 3251 } 3252 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3253 { 3254 <text>@Translate("by") @settings.Author</text> 3255 } 3256 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3257 { 3258 <text>@Translate("on") @settings.Date</text> 3259 } 3260 </small> 3261 </div> 3262 3263 <h3 class="article__short-summary u-color-light">@settings.Summary</h3> 3264 </a> 3265 @if (settings.UseFilters == true) 3266 { 3267 <div class="background-image image-filter image-filter--darken dw-mod"></div> 3268 } 3269 </div> 3270 } 3271 } 3272 @using System.Text.RegularExpressions 3273 @using Dynamicweb.Rapido.Blocks.Components 3274 @using Dynamicweb.Rapido.Blocks.Components.General 3275 @using Dynamicweb.Rapido.Blocks.Components.Articles 3276 @using Dynamicweb.Rapido.Blocks 3277 3278 @* Component for the articles *@ 3279 3280 @helper RenderArticleVideo(ArticleVideo settings) 3281 { 3282 dynamic[] methodParameters = new dynamic[1]; 3283 methodParameters[0] = settings; 3284 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 3285 3286 if (customMethod != null) 3287 { 3288 @customMethod.Invoke(this, methodParameters).ToString(); 3289 } else { 3290 if (settings.Url != null) 3291 { 3292 //getting video ID from youtube URL 3293 string videoCode = settings.Url; 3294 Regex regex = new Regex(@".be\/(.[^?]*)"); 3295 Match match = regex.Match(videoCode); 3296 string videoId = ""; 3297 if (match.Success) 3298 { 3299 videoId = match.Groups[1].Value; 3300 } 3301 else 3302 { 3303 regex = new Regex(@"v=([^&]+)"); 3304 match = regex.Match(videoCode); 3305 if (match.Success) 3306 { 3307 videoId = match.Groups[1].Value; 3308 } 3309 } 3310 3311 int autoPlay = settings.AutoPlay == "true" ? 1 : 0; 3312 3313 <div class="video-wrapper"> 3314 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Guid.NewGuid().ToString("N"))" data-auto-play="@autoPlay" data-enable-controls="1"></div> 3315 </div> 3316 } 3317 } 3318 } 3319 3320 3321 3322 @* Simple helpers *@ 3323 3324 @*Requires the Gallery ItemType that comes with Rapido*@ 3325 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) { 3326 if (gallery != null && gallery.Count > 0) 3327 { 3328 int count = 1; 3329 3330 foreach (var item in gallery) 3331 { 3332 if (item.GetFile("ImagePath") != null) 3333 { 3334 string image = item.GetFile("ImagePath").PathUrlEncoded; 3335 string imagePrefix = "/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image="; 3336 int imagesCount = gallery.Count; 3337 3338 if (count == 1) 3339 { 3340 <label class="gallery" for="ParagraphGalleryModalTrigger" onclick="Gallery.openImage(this.querySelector('.js-gallery'))"> 3341 <span class="gallery__main-image"> 3342 <img src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" class="flex-img js-gallery" alt="" data-for="ParagraphGallery" data-image="@imagePrefix@image" /> 3343 </span> 3344 <span class="gallery__image-counter"> 3345 <i class="fas fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 3346 <span class="gallery__image-counter__text">@Translate("See all") <i class="fas fa-angle-right"></i></span> 3347 </span> 3348 </label> 3349 } 3350 else 3351 { 3352 <div class="u-hidden js-gallery" data-for="ParagraphGallery" data-image="@imagePrefix@image"></div> 3353 } 3354 3355 count++; 3356 } 3357 } 3358 @RenderArticleGalleryModal(new ArticleGalleryModal()) 3359 } 3360 } 3361 3362 @helper RenderMobileFilters(List<Block> subBlocks) 3363 { 3364 if (subBlocks.Count > 0) 3365 { 3366 <div class="grid__col-12"> 3367 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 3368 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 3369 @RenderBlockList(subBlocks) 3370 </div> 3371 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 3372 <label for="CheckFilters" class="btn btn--secondary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label> 3373 </div> 3374 } 3375 } 3376 3377 @if (File.Exists(HttpContext.Current.Server.MapPath("/Components/Custom/Custom__Components.cshtml"))) 3378 { 3379 <text>@using Dynamicweb.Rapido.Blocks.Components.General 3380 </text> 3381 } 3382 3383 @* Include the Blocks for the page *@ 3384 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3385 3386 @using System 3387 @using System.Web 3388 @using Df.Dw 3389 @using Dynamicweb.Rapido.Blocks.Extensibility 3390 @using Dynamicweb.Rapido.Blocks 3391 @*using System.Collections.Generic *@ 3392 3393 @{ 3394 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 3395 3396 Block tagManager = new Block() 3397 { 3398 Id = "TagManager", 3399 SortId = 1, 3400 Template = RenderGoogleTagManager() 3401 }; 3402 3403 Block facebookPixel = new Block() 3404 { 3405 Id = "FacebookPixel", 3406 SortId = 2, 3407 Template = RenderFacebookPixel() 3408 }; 3409 3410 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 3411 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 3412 } 3413 3414 @helper RenderGoogleTagManager() { 3415 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3416 3417 if (areaInfo.GoogleTagManagerID.HasValue()) 3418 { 3419 <script> 3420 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 3421 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 3422 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 3423 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 3424 })(window,document,'script','dataLayer','@areaInfo.GoogleTagManagerID'); 3425 </script> 3426 <!-- Google Tag Manager (noscript) --> 3427 <noscript> 3428 <iframe src="https://www.googletagmanager.com/ns.html?id=@areaInfo.GoogleTagManagerID" 3429 height="0" width="0" style="display:none;visibility:hidden"></iframe> 3430 </noscript> 3431 <!-- End Google Tag Manager (noscript) --> 3432 } 3433 } 3434 3435 @helper RenderFacebookPixel() { 3436 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3437 3438 if (areaInfo.FacebookPixelID.HasValue()) 3439 { 3440 <!-- Facebook Pixel Code --> 3441 <script> 3442 !function(f,b,e,v,n,t,s) 3443 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 3444 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 3445 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 3446 n.queue=[];t=b.createElement(e);t.async=!0; 3447 t.src=v;s=b.getElementsByTagName(e)[0]; 3448 s.parentNode.insertBefore(t,s)}(window, document,'script', 3449 'https://connect.facebook.net/en_US/fbevents.js'); 3450 fbq('init', '@areaInfo.FacebookPixelID'); 3451 fbq('track', 'PageView'); 3452 </script> 3453 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@areaInfo.FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 3454 } 3455 } 3456 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3457 3458 @using System 3459 @using System.Web 3460 @using Dynamicweb.Rapido.Blocks 3461 @using Dynamicweb.Rapido.Blocks.Extensibility 3462 @using Dynamicweb.Security.UserManagement 3463 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 3464 @* using System.Collections.Generic *@ 3465 3466 @{ 3467 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 3468 3469 Block loginModal = new Block() 3470 { 3471 Id = "LoginModal", 3472 SortId = 10, 3473 Template = LoginModal() 3474 }; 3475 3476 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 3477 } 3478 3479 @helper LoginModal() { 3480 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3481 string userSignedInErrorText = ""; 3482 string loginJsonPage = GetPageIdByNavigationTag("LoginJSON").ToString(); 3483 var cultureInfo = Pageview.Area; 3484 var countryService = new Dynamicweb.Ecommerce.International.CountryService(); 3485 var DesignFolder = Pageview.Layout.Design.Name; 3486 3487 if (Model.LogOnFailed) { 3488 switch (Model.LogOnFailedReason) 3489 { 3490 case LogOnFailedReason.PasswordLengthInvalid: 3491 userSignedInErrorText = Translate(Translations.Account.PasswordLengthIsInvalid); 3492 break; 3493 case LogOnFailedReason.IncorrectLogin: 3494 userSignedInErrorText = Translate(Translations.Account.InvalidEmailOrPassword); 3495 break; 3496 case LogOnFailedReason.ExceededFailedLogOnLimit: 3497 userSignedInErrorText = Translate(Translations.Account.LimitOfAllowedLoginAttempts); 3498 break; 3499 case LogOnFailedReason.LoginLocked: 3500 userSignedInErrorText = Translate(Translations.Account.TheUserAccountIsTemporarilyLocked); 3501 break; 3502 case LogOnFailedReason.PasswordExpired: 3503 userSignedInErrorText = Translate(Translations.Account.ThePasswordHasExpired); 3504 break; 3505 default: 3506 userSignedInErrorText = Translate(Translations.Account.AnUnknownErrorOccured); 3507 break; 3508 } 3509 } 3510 3511 3512 <!-- Trigger for the login modal --> 3513 <df-modal id="SignInModal" class="login-container"> 3514 <span class="login__form-wrapper"> 3515 <div class="content__login"> 3516 <div class="content__login-img"> 3517 <a href="@areaInfo.FirstPageLink"> 3518 <img class="logo__img" src="@areaInfo.FooterLogo" alt="@Translate(Translations.General.Logo)" /> 3519 </a> 3520 </div> 3521 <div class="content__login-text"><h3>@Translate(Translations.General.LoginModalHeading)</h3> 3522 <h5>@Translate(Translations.General.LoginModalSubHeading)</h5> 3523 </div> 3524 </div> 3525 <div class="form__section"> 3526 <div class="tab"> 3527 <div class="tablinks" data-tab="Login"><h3>@Translate(Translations.Account.LogIn)</h3></div> 3528 <div class="tablinks" data-tab="CreateAccount"><h3>@Translate(Translations.Account.CreateAccount)</h3></div> 3529 </div> 3530 <div id="Login" class="tab-content"> 3531 <form method="post" id="Modal__LoginForm" class="u-no-margin login-form" data-json-page="/Default.aspx?ID=@loginJsonPage"> 3532 <input type="hidden" name="ID" value="@areaInfo.PageId" /> 3533 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 3534 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 3535 <df-input class="item" type="text" name="username" id="Modal__username" label="@Translate(Translations.Account.Username)" value="" required></df-input> 3536 <df-input class="item" type="password" name="password" id="Modal__password" label="@Translate(Translations.Account.Password)" value="" required></df-input> 3537 <div class="field-error dw-mod">@userSignedInErrorText</div> 3538 3539 3540 <df-checkbox class="item" name="Autologin" id="Modal__Autologin" value="True" checked><span>@Translate(Translations.Account.RememberMe)</span></df-checkbox> 3541 3542 <div class="login__actions"> 3543 <button type="submit" class="btn-fill--brand mb-2" name="LoginAction" value="Login">@Translate(Translations.Account.SignIn)</button> 3544 <a href="@areaInfo.ForgotPasswordPageLink" class="forgot--password">@Translate(Translations.Account.ForgotYourPassword)</a> 3545 </div> 3546 3547 </form> 3548 </div> 3549 <div id="CreateAccount" class="tab-content"> 3550 <form name="UserManagementEditForm" id="Modal__UserManagementEditForm" method="post" action="@areaInfo.LinkStart@areaInfo.CreateAccountPage.ID" class="items-vertical create-account-form" data-empty-fields="@Translate(Translations.Account.EmptyFields)" data-password-match="@Translate(Translations.Account.PasswordsNoMatch)"> 3551 <input type="hidden" name="UserManagementForm" value="1"> 3552 <input type="hidden" name="CreateUser" value="true"> 3553 <input type="hidden" name="UserManagement_Form_CountryCode" value="@cultureInfo.EcomCountryCode"> 3554 <input type="hidden" name="UserManagement_Form_Country" value="@countryService.GetCountry(cultureInfo.EcomCountryCode).Name"> 3555 <input type="hidden" name="UserManagement_Form_Currency" value="@cultureInfo.EcomCurrencyId"> 3556 <input type="hidden" name="UserManagement_Form_ShopId" value="@cultureInfo.EcomShopId"> 3557 <input type="checkbox" class="hidden" name="UserManagement_Form_DisableLivePrices" value="1" checked="checked"> 3558 <input class="firstname-and-lastname" type="hidden" name="UserManagement_Form_Name" value=""> 3559 3560 3561 <df-input class="item" type="text" name="UserManagement_Form_LastName" label="@Translate(Translations.Account.LastName)" data-error-message="@Translate(Translations.Account.LastNameCannotBeEmpty)" value="" required></df-input> 3562 <df-input class="item" type="text" name="UserManagement_Form_FirstName" label="@Translate(Translations.Account.FirstName)" data-error-message="@Translate(Translations.Account.FirstNameCannotBeEmpty)" value="" required></df-input> 3563 3564 <df-input class="item" type="email" name="UserManagement_Form_Email" id="Modal__UserManagement_Form_Email" label="@Translate(Translations.Account.Email)" value="" required data-error-message="@Translate(Translations.Account.EmailCannotBeEmpty)"></df-input> 3565 <df-input class="item" type="password" name="UserManagement_Form_NewPassword" id="Modal__UserManagement_Form_NewPassword" label="@Translate(Translations.Account.Password)" value="" required data-error-message="@Translate(Translations.Account.PasswordFieldCannotBeEmpty)"></df-input> 3566 <df-input class="item" type="password" name="UserManagement_Form_NewPasswordConfirm" id="Modal__UserManagement_Form_NewPasswordConfirm" label="@Translate(Translations.Account.ConfirmPassword)" value="" required data-error-message="@Translate(Translations.Account.NewPasswordConfimShouldNotBeEmpty)"></df-input> 3567 3568 <div class="display-flex terms__conditions item"> 3569 <df-checkbox data-accept-terms="@Translate("Accept T&C")" value="yes" id="EcomOrderCustomerAcceptedLogin" name="EcomOrderCustomerAccepted"><span></span></df-checkbox> 3570 <a href="@areaInfo.LinkStart@areaInfo.TermsAndConditions.ID&LayoutTemplate=Designs/@DesignFolder/clean.cshtml" class="openTAndC"><span>@Translate(Translations.General.IAcceptTheTermsAndConditions)</span></a> 3571 </div> 3572 3573 3574 <df-modal id="TermsAndCondModalLogin"> 3575 <span> 3576 </span> 3577 </df-modal> 3578 3579 <button type="submit" class="btn-fill--brand" id="submitter">@Translate(Translations.Account.CreateYourNewAccount)</button> 3580 3581 </form> 3582 </div> 3583 </div> 3584 3585 </span> 3586 </df-modal> 3587 3588 } 3589 3590 3591 3592 3593 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3594 3595 @using System 3596 @using System.Web 3597 @using Dynamicweb.Rapido.Blocks.Extensibility 3598 @using Dynamicweb.Rapido.Blocks 3599 @* using System.Collections.Generic *@ 3600 3601 @functions { 3602 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 3603 } 3604 3605 @{ 3606 bool mobileOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("mobileOnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3607 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 3608 bool mobileHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 3609 bool mobileHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart") || mobileOnlyPreview; 3610 3611 Block mobileHeader = new Block() 3612 { 3613 Id = "MobileTop", 3614 SortId = 10, 3615 Template = RenderMobileTop(), 3616 SkipRenderBlocksList = true 3617 }; 3618 mobileHeaderBlocksPage.Add("MasterReferences", mobileHeader); 3619 3620 Block mobileContactContainer = new Block() 3621 { 3622 Id = "MobileContactContainer", 3623 SortId = 90, 3624 Template = RenderMobileContactContainer(), 3625 SkipRenderBlocksList = true 3626 }; 3627 mobileHeaderBlocksPage.Add("MasterReferences", mobileContactContainer); 3628 3629 Block mobileHeaderNavigation = new Block() 3630 { 3631 Id = "MobileHeaderNavigation", 3632 SortId = 10, 3633 Template = RenderMobileHeaderNavigation(), 3634 SkipRenderBlocksList = true, 3635 Design = new Design 3636 { 3637 CssClass = "nav--primary M" 3638 }, 3639 // BlocksList = new List<Block> { 3640 // new Block { 3641 // Id = "MobileHeaderNavigationTrigger", 3642 // SortId = 10, 3643 // Template = RenderMobileHeaderNavigationTrigger() 3644 // } 3645 // } 3646 }; 3647 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3648 3649 Block mobileHeaderLogo = new Block() 3650 { 3651 Id = "MobileHeaderLogo", 3652 SortId = 20, 3653 Template = RenderMobileHeaderLogo(), 3654 SkipRenderBlocksList = true 3655 }; 3656 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3657 3658 Block mobileHeaderActions = new Block() 3659 { 3660 Id = "MobileHeaderActions", 3661 SortId = 30, 3662 Template = RenderMobileTopActions(), 3663 SkipRenderBlocksList = true 3664 }; 3665 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3666 3667 if (mobileHideSearch == false) 3668 { 3669 Block mobileHeaderSearch = new Block 3670 { 3671 Id = "MobileHeaderSearch", 3672 SortId = 10 3673 }; 3674 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3675 } 3676 3677 Block mobileHeaderMiniCart; 3678 3679 // if (!mobileHideCart) 3680 // { 3681 mobileHeaderMiniCart = new Block 3682 { 3683 Id = "MobileHeaderMiniCart", 3684 SortId = 20, 3685 Template = RenderMobileMiniCart() 3686 }; 3687 3688 Block miniCartCounterScriptTemplatev2 = new Block 3689 { 3690 Id = "MiniCartCounterScriptTemplate", 3691 Template = RenderMiniCartCounterContentRefactored() 3692 }; 3693 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplatev2); 3694 // } 3695 // else 3696 // { 3697 // mobileHeaderMiniCart = new Block 3698 // { 3699 // Id = "MobileHeaderMiniCart", 3700 // SortId = 20 3701 // }; 3702 // } 3703 3704 // user 3705 Block mobileHeaderUser = new Block 3706 { 3707 Id = "MobileHeaderUser", 3708 SortId = 10, 3709 Template = RenderMobileUser() 3710 }; 3711 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderUser); 3712 // end user 3713 3714 3715 if (!mobileHideSearch) 3716 { 3717 Block mobileHamburger = new Block 3718 { 3719 Id = "MobileHamburger", 3720 SortId = 40, 3721 Template = RenderMobileHamburger() 3722 }; 3723 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHamburger); 3724 } 3725 3726 3727 if (!mobileHideSearch) 3728 { 3729 Block mobileBottomSearch = new Block 3730 { 3731 Id = "MobileBottomSearch", 3732 SortId = 50, 3733 Template = RenderMobileSearch() 3734 }; 3735 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileBottomSearch); 3736 } 3737 3738 3739 3740 3741 // if (!mobileHideSearch) 3742 // { 3743 // Block mobileHeaderSearchBar = new Block() 3744 // { 3745 // Id = "MobileHeaderSearchBar", 3746 // SortId = 30, 3747 // Template = RenderMobileTopSearchBar(), 3748 // Design = new Design 3749 // { 3750 // CssClass = "nav--wrapper SC" 3751 // } 3752 // }; 3753 // mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3754 // } 3755 3756 switch (mobileTopLayout) 3757 { 3758 case "nav-left": 3759 mobileHeaderNavigation.SortId = 10; 3760 mobileHeaderLogo.SortId = 20; 3761 mobileHeaderActions.SortId = 30; 3762 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3763 break; 3764 case "nav-right": 3765 mobileHeaderLogo.SortId = 10; 3766 mobileHeaderActions.SortId = 20; 3767 mobileHeaderNavigation.SortId = 30; 3768 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3769 break; 3770 case "nav-search-left": 3771 mobileHeaderNavigation.SortId = 10; 3772 mobileHeaderLogo.SortId = 20; 3773 mobileHeaderActions.SortId = 30; 3774 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3775 break; 3776 case "search-left": 3777 mobileHeaderActions.SortId = 10; 3778 mobileHeaderLogo.SortId = 20; 3779 mobileHeaderNavigation.SortId = 30; 3780 mobileHeaderMiniCart.SortId = 0; 3781 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3782 break; 3783 } 3784 3785 if (!mobileOnlyPreview) 3786 { 3787 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", new Block { 3788 Id = "CartInitialization", 3789 Template = RenderMobileCartInitialization() 3790 }); 3791 } 3792 } 3793 3794 @helper RenderMobileCartInitialization() 3795 { 3796 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3797 <script> 3798 window.cartId = "@miniCartFeedPageId"; 3799 </script> 3800 } 3801 3802 @helper RenderMobileTop() { 3803 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3804 @RenderBlockList(subBlocks) 3805 } 3806 3807 @helper RenderMobileHeaderNavigation() { 3808 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3809 <ul class="menu"> 3810 @RenderBlockList(subBlocks) 3811 </ul> 3812 } 3813 3814 @helper RenderMobileHeaderNavigationTrigger() { 3815 <li> 3816 <label for="MobileNavTrigger" class="mobile-nav-trigger-button"></label> 3817 </li> 3818 } 3819 3820 @helper RenderMobileHeaderLogo() { 3821 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3822 3823 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 3824 //string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3825 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3826 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3827 3828 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3829 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3830 { 3831 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3832 } 3833 3834 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3835 { 3836 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3837 } 3838 else 3839 { 3840 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3841 } 3842 3843 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3844 var DesignFolder = Pageview.Layout.Design.Name; 3845 3846 <div class="mobile__logo"> 3847 <a href="/Default.aspx?ID=@firstPageId" class="mobile__logo__item"> <img src="@mobileLogo" alt="@businessName"/> </a> 3848 3849 @* <div class="icons"> *@ 3850 @* <div class="item"> *@ 3851 @* <button type="button" class="btn-icon" data-role="contact-mobile"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/mobile-contact.svg"></ion-icon></button> *@ 3852 @* </div> *@ 3853 @* </div> *@ 3854 </div> 3855 3856 3857 @RenderBlockList(subBlocks) 3858 } 3859 3860 @helper RenderMobileContactContainer() { 3861 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3862 var DesignFolder = Pageview.Layout.Design.Name; 3863 <div class="mobile-contact__container"> 3864 <div class="mobile-contact__content"> 3865 @if (!string.IsNullOrEmpty(areaInfo.ContactNumber)) 3866 { 3867 <a href="tel:@areaInfo.ContactNumber" class="btn btn-fill--dark"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/call.svg"></ion-icon><span>@areaInfo.ContactNumber</span></a> 3868 } 3869 @if (!string.IsNullOrEmpty(areaInfo.ContactEmail)) 3870 { 3871 <a href="mailto:@areaInfo.ContactEmail" class="btn btn-fill--dark"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/mail.svg"></ion-icon><span>@areaInfo.ContactEmail</span></a> 3872 } 3873 </div> 3874 </div> 3875 } 3876 3877 @helper RenderMobileTopActions() { 3878 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3879 3880 <div class="mobile__actions"> 3881 <div class="mobile__actions__content"> 3882 @RenderBlockList(subBlocks) 3883 </div> 3884 3885 </div> 3886 } 3887 3888 3889 @helper RenderMobileTopUser() { 3890 3891 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3892 string userInitials = ""; 3893 int pageId = Model.TopPage.ID; 3894 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3895 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 3896 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 3897 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 3898 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 3899 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 3900 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3901 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 3902 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 3903 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 3904 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 3905 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 3906 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 3907 3908 string linkStart = "/Default.aspx?ID="; 3909 if (Model.CurrentUser.ID <= 0) 3910 { 3911 linkStart += signInProfilePageId + "&RedirectPageId="; 3912 } 3913 3914 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3915 string myProfilePageLink = linkStart + myProfilePageId; 3916 string myOrdersPageLink = linkStart + myOrdersPageId; 3917 string myFavoritesPageLink = linkStart + myFavoritesPageId; 3918 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 3919 3920 string profileIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue : "fa fa-user"; 3921 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 3922 3923 if (Model.CurrentUser.ID != 0) 3924 { 3925 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 3926 { 3927 string[] names = Model.CurrentUser.Name.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); 3928 userInitials += Model.CurrentUser.Name.Substring(0, 1); 3929 3930 if (names.Length > 1) 3931 { 3932 userInitials += names[names.Length - 1].Substring(0, 1); 3933 } 3934 } 3935 else 3936 { 3937 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 3938 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 3939 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 3940 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 3941 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 3942 } 3943 } 3944 3945 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 3946 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 3947 3948 <li class="mobile-user"> 3949 <div class="@menuLinkClass"> 3950 @if (Model.CurrentUser.ID <= 0) 3951 { 3952 <label for="SignInModalTrigger"><ion-icon src="/Files/Templates/Designs/Wizaris/icons/default/account.svg"></ion-icon></label> 3953 } 3954 else 3955 { 3956 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><ion-icon src="/Files/Templates/Designs/Wizaris/icons/default/account.svg"></ion-icon></a> 3957 } 3958 </div> 3959 </li> 3960 } 3961 3962 @helper RenderMobileTopSearch() { 3963 <li> 3964 <label for="MobileSearchTrigger"> 3965 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 3966 </label> 3967 </li> 3968 } 3969 3970 @helper RenderMobileMiniCart() { 3971 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3972 // int cartPageId = GetPageIdByNavigationTag("CartPage"); 3973 // double cartProductsCount = Model.Cart.TotalProductsCount; 3974 var DesignFolder = Pageview.Layout.Design.Name; 3975 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 3976 string cartProductsTotalPriceReformated = Model.Cart.TotalPrice != null ? FormatPriceDecimals(Model.Cart.TotalPrice.Price.Formatted) : ""; 3977 <button class="mobile__minicart__trigger btn-icon" data-role="minicart-trigger"> 3978 <div id="cartCounterMobile" class="minicart__counter__content" data-template="MiniCartCounterContent" data-json="/Default.aspx?ID=@miniCartFeedPageId"> 3979 <div class="minicart__counter__icon mt-1"> 3980 <sup>@cartProductsCount</sup> 3981 <div class="ico"> 3982 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 3983 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 3984 <path d="M176,384c17.7,0,32,14.3,32,32s-14.3,32-32,32s-32-14.3-32-32S158.3,384,176,384z M400,384c17.7,0,32,14.3,32,32 3985 s-14.3,32-32,32s-32-14.3-32-32S382.3,384,400,384z M456.8,120.8c-4.6-5.6-11.4-8.8-18.6-8.8H133.9l-6.1-34.8 3986 c-1.3-7.6-8-13.2-15.8-13.2H48c-8.8,0-16,7.2-16,16s7.2,16,16,16h50.6l45.7,258.8c1.3,7.6,8,13.2,15.8,13.2h256c8.8,0,16-7.2,16-16 3987 s-7.2-16-16-16H173.4l-5.6-32h241.7c11.4,0,21.3-8.1,23.6-19.3l28.8-144C463.2,133.7,461.4,126.3,456.8,120.8z"/> 3988 </svg> 3989 </div> 3990 </div> 3991 @if(!string.IsNullOrEmpty(cartProductsTotalPriceReformated)) { 3992 <div class="minicart__counter__info"> 3993 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 3994 <div class="minicart__counter__price">@cartProductsTotalPriceReformated</div> 3995 </div> 3996 } 3997 </div> 3998 </button> 3999 4000 } 4001 4002 @helper RenderMobileTopSearchBar() 4003 { 4004 string searchFeedId = ""; 4005 string searchSecondFeedId = ""; 4006 int groupsFeedId; 4007 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 4008 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 4009 string resultPageLink; 4010 string searchPlaceholder; 4011 string searchType = "product-search"; 4012 string searchTemplate; 4013 string searchContentTemplate = ""; 4014 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4015 bool showGroups = true; 4016 4017 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 4018 { 4019 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4020 resultPageLink = contentSearchPageLink; 4021 searchPlaceholder = Translate("Search page"); 4022 groupsFeedId = 0; 4023 searchType = "content-search"; 4024 searchTemplate = "SearchPagesTemplate"; 4025 showGroups = false; 4026 } 4027 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 4028 { 4029 searchFeedId = productsPageId + "&feed=true"; 4030 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4031 resultPageLink = Converter.ToString(productsPageId); 4032 searchPlaceholder = Translate("Search products or pages"); 4033 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4034 searchType = "combined-search"; 4035 searchTemplate = "SearchProductsTemplateWrap"; 4036 searchContentTemplate = "SearchPagesTemplateWrap"; 4037 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4038 } 4039 else 4040 { 4041 resultPageLink = Converter.ToString(productsPageId); 4042 searchFeedId = productsPageId + "&feed=true"; 4043 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4044 searchPlaceholder = Translate("Search products"); 4045 searchTemplate = "SearchProductsTemplate"; 4046 searchType = "product-search"; 4047 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4048 } 4049 4050 4051 4052 <div class="search S"> 4053 @* <input type="checkbox" id="MobileSearchTrigger" /> 4054 <div data-page-size="@(searchType == "combined-search" ? 4 : 8)" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageLink" data-search-type="@searchType"> *@ 4055 <input type="text" class="js-typeahead-search-field u-w160px u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 4056 @* @if (string.IsNullOrEmpty(searchSecondFeedId)) 4057 { 4058 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 4059 } 4060 else 4061 { 4062 <div> 4063 <div id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 4064 <div id="MobileContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 4065 </div> 4066 } *@ 4067 <button type="button"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 4068 @* </div> *@ 4069 </div> 4070 <div class="nav--header C"> 4071 <ul class="menu"> 4072 <li> 4073 <label for="MobileSearchTrigger"> 4074 <i class="fas fa-times fa-1_5x"></i> 4075 </label> 4076 </li> 4077 </ul> 4078 </div> 4079 } 4080 4081 @helper RenderMiniCartCounterContentRefactored() 4082 { 4083 var DesignFolder = Pageview.Layout.Design.Name; 4084 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4085 <script id="MiniCartCounterContent" type="text/x-template"> 4086 {{#.}} 4087 4088 <div class="minicart__counter__icon mt-1"> 4089 <sup>{{numberofproducts}}</sup> 4090 <div class="ico"> 4091 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4092 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4093 <path d="M176,384c17.7,0,32,14.3,32,32s-14.3,32-32,32s-32-14.3-32-32S158.3,384,176,384z M400,384c17.7,0,32,14.3,32,32 4094 s-14.3,32-32,32s-32-14.3-32-32S382.3,384,400,384z M456.8,120.8c-4.6-5.6-11.4-8.8-18.6-8.8H133.9l-6.1-34.8 4095 c-1.3-7.6-8-13.2-15.8-13.2H48c-8.8,0-16,7.2-16,16s7.2,16,16,16h50.6l45.7,258.8c1.3,7.6,8,13.2,15.8,13.2h256c8.8,0,16-7.2,16-16 4096 s-7.2-16-16-16H173.4l-5.6-32h241.7c11.4,0,21.3-8.1,23.6-19.3l28.8-144C463.2,133.7,461.4,126.3,456.8,120.8z"/> 4097 </svg> 4098 </div> 4099 </div> 4100 {{#ifCond totalprice '!==' ''}} 4101 <div class="minicart__counter__info"> 4102 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 4103 <div class="minicart__counter__price">{{{totalprice}}}</div> 4104 </div> 4105 {{/ifCond}} 4106 4107 4108 {{/.}} 4109 </script> 4110 } 4111 4112 @helper RenderMobileHamburger() { 4113 var DesignFolder = Pageview.Layout.Design.Name; 4114 @* <div class="hamburger-wrapper"> *@ 4115 @* <div id="hamburger-menu"> *@ 4116 @* <span class="hamburger-menu-global menu-top"></span> *@ 4117 @* <span class="hamburger-menu-global menu-middle"></span> *@ 4118 @* <span class="hamburger-menu-global menu-bottom"></span> *@ 4119 @* </div> *@ 4120 @* </div> *@ 4121 <button type="button" class="mobile__navigation__trigger btn-icon" data-role="open-mobile-menu" aria-label="Open menu"> 4122 <div class="ico hidden" data-state="on"> 4123 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4124 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4125 <path d="M88,136h336v32H88V136z M88,240h336v32H88V240z M88,344h336v32H88V344z"/> 4126 </svg> 4127 </div> 4128 <div class="ico" data-state="off"> 4129 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4130 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4131 <path d="M88,136h336v32H88V136z M88,240h336v32H88V240z M88,344h336v32H88V344z"/> 4132 </svg> 4133 </div> 4134 </button> 4135 } 4136 4137 4138 @helper RenderMobileSearch() { 4139 var DesignFolder = Pageview.Layout.Design.Name; 4140 <button class="mobile__search__trigger btn-icon" type="button" data-role="open-mobile-search" aria-label="Open search"> <div class="ico mt-ico"><svg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'><path d='M456.69,421.39,362.6,327.3a173.81,173.81,0,0,0,34.84-104.58C397.44,126.38,319.06,48,222.72,48S48,126.38,48,222.72s78.38,174.72,174.72,174.72A173.81,173.81,0,0,0,327.3,362.6l94.09,94.09a25,25,0,0,0,35.3-35.3ZM97.92,222.72a124.8,124.8,0,1,1,124.8,124.8A124.95,124.95,0,0,1,97.92,222.72Z'/></svg></div></button> 4141 } 4142 4143 @helper RenderListItemMobile(string link, string text, string icon = null, string cssClass = "") { 4144 <div class="item"> 4145 <a href="@link" class="btn btn-fill--brand"> 4146 @if (icon.HasValue()){<ion-icon src="@icon"></ion-icon>}<span>@text</span> 4147 </a> 4148 </div> 4149 } 4150 4151 @helper RenderMobileUser() { 4152 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4153 var user = User.GetCurrentExtranetUser(); 4154 var DesignFolder = Pageview.Layout.Design.Name; 4155 var customerOrdersPageId = user.IsB2b() ? GetPageIdByNavigationTag("CustomerOrders") : GetPageIdByNavigationTag("CustomerPlacedOrders"); 4156 4157 if (!areaInfo.NavigationItemsHideSignIn) 4158 { 4159 4160 if (user == null) 4161 { 4162 4163 <div class="mobile__profile"> 4164 <button type="button" class="btn-icon mobile__profile__trigger" aria-label="Open profile action menu"> 4165 <div class="ico"> 4166 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M332.64,64.58C313.18,43.57,286,32,256,32c-30.16,0-57.43,11.5-76.8,32.38-19.58,21.11-29.12,49.8-26.88,80.78C156.76,206.28,203.27,256,256,256s99.16-49.71,103.67-110.82C361.94,114.48,352.34,85.85,332.64,64.58Z"/><path d="M432,480H80A31,31,0,0,1,55.8,468.87c-6.5-7.77-9.12-18.38-7.18-29.11C57.06,392.94,83.4,353.61,124.8,326c36.78-24.51,83.37-38,131.2-38s94.42,13.5,131.2,38c41.4,27.6,67.74,66.93,76.18,113.75,1.94,10.73-.68,21.34-7.18,29.11A31,31,0,0,1,432,480Z"/></svg> 4167 </div> 4168 </button> 4169 <div class="mobile__profile__details"> 4170 <div class="list"> 4171 <div class="item"> <a href="@areaInfo.LinkStart@areaInfo.SignInProfilePage.ID" class="btn btn-fill--brand header__profile__login btn-login" title="@Translate(Translations.Account.LogIn)" data-tab="Login"><ion-icon name="log-out-outline"></ion-icon><span>@Translate(Translations.Account.LogIn)</span></a> </div> 4172 4173 @if (!areaInfo.HideCreateAccountLink) 4174 4175 { 4176 <div class="item"> 4177 4178 <a href="@areaInfo.LinkStart@areaInfo.CreateAccountPage.ID" class="btn btn-fill--accent btn-create-account" data-tab="CreateAccount"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/account_add.svg"></ion-icon><span>@Translate(Translations.Account.CreateAccount)</span></a> 4179 </div> 4180 } 4181 4182 </div> 4183 </div> 4184 </div> 4185 } 4186 else { 4187 <div class="mobile__profile"> 4188 <button type="button" class="btn-icon mobile__profile__trigger" aria-label="Open profile action menu"> 4189 <sup>@user.GetInitials()</sup> 4190 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/account.svg"></ion-icon> 4191 </button> 4192 <div class="mobile__profile__details"> 4193 <div class="list"> 4194 <div class="item"> <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@areaInfo.PageId" class="btn btn-border--dark mobile__profile__logout" title="@Translate(Translations.Account.SignOut)"><ion-icon name="log-out-outline"></ion-icon><span>@Translate(Translations.Account.SignOut)</span></a> </div> 4195 4196 @if (!areaInfo.HideMyProfileLink) 4197 { 4198 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.CustomerDashboardPage.ID, Translate(Translations.Account.MyProfile), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/account.svg") 4199 } 4200 @if (!areaInfo.HideMyOrdersLink) 4201 { 4202 @RenderListItemMobile(areaInfo.LinkStart + customerOrdersPageId, Translate(Translations.Account.MyOrders), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/view-details.svg") 4203 } 4204 @if (!areaInfo.HideMyFavorites) 4205 { 4206 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.MyFavoritesPage.ID, Translate(Translations.Account.MyFavorites), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/favorites-on.svg") 4207 } 4208 @if (!areaInfo.HideMySavedCardsLink) 4209 { 4210 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.SavedCardsPage.ID, Translate(Translations.Account.MySavedCards), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/card.svg") 4211 } 4212 4213 4214 </div> 4215 </div> 4216 4217 </div> 4218 4219 4220 4221 } 4222 } 4223 4224 } 4225 4226 4227 4228 4229 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4230 4231 @using System 4232 @using System.Web 4233 @using Dynamicweb.Rapido.Blocks.Extensibility 4234 @using Dynamicweb.Rapido.Blocks 4235 @* using System.Collections.Generic *@ 4236 4237 @functions { 4238 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 4239 } 4240 4241 @{ 4242 bool mobileNavigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4243 bool mobileHideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4244 bool mobileHideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4245 bool mobileHideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4246 bool mobileHideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4247 bool mobileHideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4248 4249 Block mobileNavigation = new Block() 4250 { 4251 Id = "MobileNavigation", 4252 SortId = 10, 4253 Template = MobileNavigation(), 4254 SkipRenderBlocksList = true 4255 }; 4256 mobileNavigationBlocksPage.Add("MasterReferences", mobileNavigation); 4257 4258 // if (Model.CurrentUser.ID > 0 && !mobileHideMyProfileLink) 4259 // { 4260 // Block mobileNavigationSignIn = new Block 4261 // { 4262 // Id = "MobileNavigationSignIn", 4263 // SortId = 10, 4264 // Template = RenderMobileNavigationSignIn() 4265 // }; 4266 // mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 4267 // } 4268 4269 Block mobileNavigationMenu = new Block 4270 { 4271 Id = "MobileNavigationMenu", 4272 SortId = 20, 4273 Template = RenderMobileNavigationMenu() 4274 }; 4275 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 4276 4277 Block mobileNavigationActions = new Block 4278 { 4279 Id = "MobileNavigationActions", 4280 SortId = 30, 4281 Template = RenderMobileNavigationActions(), 4282 SkipRenderBlocksList = true 4283 }; 4284 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4285 4286 if (!mobileNavigationItemsHideSignIn) 4287 { 4288 if (Model.CurrentUser.ID <= 0) 4289 { 4290 Block mobileNavigationSignInAction = new Block 4291 { 4292 Id = "MobileNavigationSignInAction", 4293 SortId = 10, 4294 Template = RenderMobileNavigationSignInAction() 4295 }; 4296 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4297 4298 if (!mobileHideCreateAccountLink) 4299 { 4300 Block mobileNavigationCreateAccountAction = new Block 4301 { 4302 Id = "MobileNavigationCreateAccountAction", 4303 SortId = 20, 4304 Template = RenderMobileNavigationCreateAccountAction() 4305 }; 4306 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4307 } 4308 } 4309 else 4310 { 4311 if (!mobileHideMyOrdersLink) 4312 { 4313 Block mobileNavigationOrdersAction = new Block 4314 { 4315 Id = "MobileNavigationOrdersAction", 4316 SortId = 20, 4317 Template = RenderMobileNavigationOrdersAction() 4318 }; 4319 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4320 } 4321 if (!mobileHideMyFavoritesLink) 4322 { 4323 Block mobileNavigationFavoritesAction = new Block 4324 { 4325 Id = "MobileNavigationFavoritesAction", 4326 SortId = 30, 4327 Template = RenderMobileNavigationFavoritesAction() 4328 }; 4329 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4330 } 4331 if (!mobileHideMySavedCardsLink) 4332 { 4333 Block mobileNavigationSavedCardsAction = new Block 4334 { 4335 Id = "MobileNavigationFavoritesAction", 4336 SortId = 30, 4337 Template = RenderMobileNavigationSavedCardsAction() 4338 }; 4339 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4340 } 4341 4342 Block mobileNavigationSignOutAction = new Block 4343 { 4344 Id = "MobileNavigationSignOutAction", 4345 SortId = 40, 4346 Template = RenderMobileNavigationSignOutAction() 4347 }; 4348 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4349 } 4350 } 4351 4352 if (Model.Languages.Count > 1) 4353 { 4354 Block mobileNavigationLanguagesAction = new Block 4355 { 4356 Id = "MobileNavigationLanguagesAction", 4357 SortId = 50, 4358 Template = RenderMobileNavigationLanguagesAction() 4359 }; 4360 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 4361 } 4362 } 4363 4364 4365 @helper MobileNavigation() 4366 { 4367 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4368 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4369 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4370 4371 <!-- Trigger for mobile navigation --> 4372 @* <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> *@ 4373 4374 <!-- Mobile navigation --> 4375 @RenderBlockList(subBlocks) 4376 4377 @* <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> *@ 4378 } 4379 4380 @helper RenderMobileNavigationSignIn() 4381 { 4382 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4383 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4384 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4385 string myProfilePageLink = linkStart + myProfilePageId; 4386 string userName = Model.CurrentUser.FirstName ?? ""; 4387 userName += " " + (Model.CurrentUser.LastName ?? ""); 4388 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 4389 4390 <ul class="RenderMobileNavigationSignIn"> 4391 <li> 4392 <a href="@myProfilePageLink"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @userName</a> 4393 </li> 4394 </ul> 4395 } 4396 4397 @helper RenderMobileNavigationMenu() 4398 { 4399 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4400 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4401 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "4"; 4402 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4403 int startLevel = renderPagesInToolBar ? 1 : 0; 4404 <div class="mobile__navigation"> 4405 @RenderNavigation(new 4406 { 4407 id = "mobilenavigation", 4408 cssclass = "nav", 4409 startLevel = @startLevel, 4410 ecomStartLevel = @startLevel + 1, 4411 endlevel = @levels, 4412 expandmode = "all", 4413 template = @menuTemplate 4414 }) 4415 4416 @if (renderPagesInToolBar) 4417 { 4418 @RenderNavigation(new 4419 { 4420 id = "topToolsMobileNavigation", 4421 cssclass = "nav", 4422 template = "ToolsMenuForMobile.xslt" 4423 }) 4424 } 4425 </div> 4426 <div class="mobile__navigation__backdrop"></div> 4427 } 4428 4429 @helper RenderMobileNavigationActions() 4430 { 4431 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4432 4433 @* <ul class="menu-mobile"> *@ 4434 @* @RenderBlockList(subBlocks) *@ 4435 @* </ul> *@ 4436 } 4437 4438 @helper RenderMobileNavigationSignInAction() 4439 { 4440 <li class="menu-mobile__item"> 4441 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign in")</label> 4442 </li> 4443 } 4444 4445 @helper RenderMobileNavigationCreateAccountAction() 4446 { 4447 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4448 4449 <li class="menu-mobile__item"> 4450 <a href="/Default.aspx?ID=@createAccountPageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Create account")</a> 4451 </li> 4452 } 4453 4454 @helper RenderMobileNavigationProfileAction() 4455 { 4456 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4457 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4458 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4459 string myProfilePageLink = linkStart + myProfilePageId; 4460 4461 <li class="menu-mobile__item"> 4462 <a href="@myProfilePageLink"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 4463 </li> 4464 } 4465 4466 @helper RenderMobileNavigationOrdersAction() 4467 { 4468 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4469 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4470 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4471 string myOrdersPageLink = linkStart + myOrdersPageId; 4472 string ordersIcon = "fas fa-list"; 4473 4474 <li> 4475 <a href="@myOrdersPageLink"><i class="@ordersIcon menu-mobile__link-icon"></i> @Translate("My Orders")</a> 4476 </li> 4477 } 4478 4479 @helper RenderMobileNavigationFavoritesAction() 4480 { 4481 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4482 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4483 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4484 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4485 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 4486 4487 4488 <li> 4489 <a href="@myFavoritesPageLink"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 4490 </li> 4491 } 4492 4493 @helper RenderMobileNavigationSavedCardsAction() 4494 { 4495 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4496 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4497 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4498 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4499 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 4500 4501 <li> 4502 <a href="@mySavedCardsPageLink"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 4503 </li> 4504 } 4505 4506 @helper RenderMobileNavigationSignOutAction() 4507 { 4508 int pageId = Model.TopPage.ID; 4509 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 4510 4511 <li> 4512 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 4513 </li> 4514 } 4515 4516 @helper RenderMobileNavigationLanguagesAction() 4517 { 4518 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4519 4520 string selectedLanguage = ""; 4521 foreach (var lang in Model.Languages) 4522 { 4523 if (lang.IsCurrent) 4524 { 4525 selectedLanguage = lang.Name; 4526 } 4527 } 4528 4529 <li> 4530 @if (isSlidesDesign) 4531 { 4532 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 4533 } 4534 else 4535 { 4536 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 4537 } 4538 <div> 4539 <label for="MobileMenuCheck_Language"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 4540 <label for="MobileMenuCheck_Language"></label> 4541 </div> 4542 <ul> 4543 @if (isSlidesDesign) 4544 { 4545 <li> 4546 <div> 4547 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 4548 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 4549 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link">@Translate("Back")</label> 4550 </div> 4551 </li> 4552 } 4553 @foreach (var lang in Model.Languages) 4554 { 4555 <li> 4556 <a href="/Default.aspx?ID=@lang.Page.ID">@lang.Name</a> 4557 </li> 4558 } 4559 </ul> 4560 </li> 4561 } 4562 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4563 4564 @using System 4565 @using System.Web 4566 @using Df.Dw 4567 @using Dynamicweb.Rapido.Blocks.Extensibility 4568 @using Dynamicweb.Rapido.Blocks 4569 @* using System.Collections.Generic *@ 4570 4571 @functions { 4572 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 4573 } 4574 4575 @{ 4576 4577 Block masterTools = new Block() 4578 { 4579 Id = "MasterDesktopTools", 4580 SortId = 30, 4581 Template = RenderDesktopTools(), 4582 SkipRenderBlocksList = true, 4583 BlocksList = new List<Block> 4584 { 4585 new Block { 4586 Id = "MasterDesktopToolsText", 4587 SortId = 10, 4588 Template = RenderDesktopToolsText() 4589 }, 4590 new Block { 4591 Id = "MasterDesktopToolsNavigation", 4592 SortId = 20, 4593 Template = RenderDesktopToolsNavigation() 4594 } 4595 } 4596 }; 4597 headerBlocksPage.Add("MasterHeader", masterTools); 4598 4599 4600 Block masterDesktopExtra = new Block() 4601 { 4602 Id = "MasterDesktopExtra", 4603 SortId = 20, 4604 Template = RenderDesktopExtra(), 4605 SkipRenderBlocksList = true, 4606 Design = new Design 4607 { 4608 CssClass = "nav--wrapper SC" 4609 } 4610 }; 4611 headerBlocksPage.Add("MasterHeader", masterDesktopExtra); 4612 4613 Block masterDesktopNavigation = new Block() 4614 { 4615 Id = "MasterDesktopNavigation", 4616 SortId = 40, 4617 Template = RenderDesktopNavigation(), 4618 SkipRenderBlocksList = true 4619 4620 }; 4621 headerBlocksPage.Add("MasterHeader", masterDesktopNavigation); 4622 } 4623 4624 @* Include the Blocks for the page *@ 4625 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4626 4627 @using System 4628 @using System.Web 4629 @using Dynamicweb.Rapido.Blocks.Extensibility 4630 @using Dynamicweb.Rapido.Blocks 4631 4632 @{ 4633 Block masterDesktopLogo = new Block 4634 { 4635 Id = "MasterDesktopLogo", 4636 SortId = 10, 4637 Template = RenderDesktopLogo(), 4638 Design = new Design 4639 { 4640 CssClass = "logo L" 4641 } 4642 }; 4643 4644 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopLogo); 4645 } 4646 4647 4648 @helper RenderDesktopLogo() 4649 { 4650 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4651 var logo = ""; 4652 if (Path.GetExtension(areaInfo.Logo).ToLower() != ".svg") 4653 { 4654 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(areaInfo.LogoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + areaInfo.Logo; 4655 } 4656 else 4657 { 4658 logo = HttpUtility.UrlDecode(areaInfo.Logo); 4659 } 4660 4661 <a href="/"> 4662 <img class="logo__img" src="@areaInfo.Logo" alt="@Translate(Translations.General.Logo)" /> 4663 </a> 4664 } 4665 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4666 4667 @using System 4668 @using System.Web 4669 @using Dynamicweb.Rapido.Blocks.Extensibility 4670 @using Dynamicweb.Rapido.Blocks 4671 @using Dynamicweb.Frontend.Navigation 4672 @using WebGrease.Css.Extensions 4673 4674 @{ 4675 Block masterDesktopMenu = new Block 4676 { 4677 Id = "MasterDesktopMenu", 4678 SortId = 10, 4679 Template = RenderDesktopMenu() 4680 }; 4681 4682 BlocksPage.GetBlockPage("Master").Add("MasterDesktopNavigation", masterDesktopMenu); 4683 } 4684 4685 @helper RenderDesktopMenu() 4686 { 4687 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4688 var productsPageId = areaInfo.ProductsPage.ID; 4689 var navigationSettingsMain = new Dynamicweb.Frontend.Navigation.NavigationSettings() 4690 { 4691 StartLevel = 1, 4692 StopLevel = 5, 4693 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 4694 }; 4695 NavigationTreeViewModel navigation2 = GetNavigation(navigationSettingsMain); 4696 var megaMenuNodeList = navigation2.Nodes.FirstOrDefault(n => n.PageId == productsPageId) != null ? navigation2.Nodes.FirstOrDefault(n => n.PageId == productsPageId).Nodes : new List<NavigationTreeNodeViewModel>(); 4697 4698 if (areaInfo.IsMegaMenu) 4699 { 4700 if(megaMenuNodeList.Any()) 4701 { 4702 @ShowNavigationTreeMegamenu(navigation2.Nodes.First(n => n.PageId == productsPageId).Nodes.ToList(), 1) 4703 } 4704 } 4705 else 4706 { 4707 @ShowNavigationTreeDropdown(navigation2.Nodes.ToList(), 1) 4708 } 4709 } 4710 4711 @helper ShowNavigationTreeMegamenu(IList<NavigationTreeNodeViewModel> nodes, int level) 4712 { 4713 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4714 var DesignFolder = Pageview.Layout.Design.Name; 4715 <ul class="@(level == 1 ? "nav" : "megamenu__nav") menu-level@(level)"> 4716 @if (level == 1) { 4717 @* <li class="home"><a href="@areaInfo.FirstPageLink"><i class="@areaInfo.HomeIcon"></i></a></li> *@ 4718 <li class="home"><a href="/" aria-label="home"> 4719 <div class="ico"> 4720 <svg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'><path d='M261.56,101.28a8,8,0,0,0-11.06,0L66.4,277.15a8,8,0,0,0-2.47,5.79L63.9,448a32,32,0,0,0,32,32H192a16,16,0,0,0,16-16V328a8,8,0,0,1,8-8h80a8,8,0,0,1,8,8l0,136a16,16,0,0,0,16,16h96.06a32,32,0,0,0,32-32l0-165.06a8,8,0,0,0-2.47-5.79Z'/><path d='M490.91,244.15l-74.8-71.56,0-108.59a16,16,0,0,0-16-16h-48a16,16,0,0,0-16,16l0,32L278.19,40.62C272.77,35.14,264.71,32,256,32h0c-8.68,0-16.72,3.14-22.14,8.63L21.16,244.13c-6.22,6-7,15.87-1.34,22.37A16,16,0,0,0,43,267.56L250.5,69.28a8,8,0,0,1,11.06,0L469.08,267.56a16,16,0,0,0,22.59-.44C497.81,260.76,497.3,250.26,490.91,244.15Z'/></svg> 4721 </div> 4722 </a></li> 4723 } 4724 @for (int i = 0; i < nodes.Count; ++i) 4725 { 4726 var node = nodes[i]; 4727 var children = node.Nodes.ToList(); 4728 4729 <li class="@(level == 1 && children.Any() ? "megamenu__nav" : "")"> 4730 <a href="@node.Link" class="megamenu__category--@level">@node.Name</a> 4731 @if (children.Any()) 4732 { 4733 if (level == 1) 4734 { 4735 <div class="megamenu__container" style="--columns: repeat(3,1fr) auto"> 4736 @for (int j = 0; j < 4; ++j) 4737 { 4738 @ShowNavigationTreeMegamenu(children.Where((n, index) => index % 4 == j).ToList(), level + 1) 4739 } 4740 </div> 4741 } 4742 else 4743 { 4744 @ShowNavigationTreeMegamenu(children, level + 1) 4745 } 4746 } 4747 </li> 4748 } 4749 </ul> 4750 } 4751 4752 @helper ShowNavigationTreeDropdown(IList<NavigationTreeNodeViewModel> nodes, int level) 4753 { 4754 <ul class="@(level == 1 ? "" : "menu")"> 4755 @for (int i = 0; i < nodes.Count; ++i) 4756 { 4757 var node = nodes[i]; 4758 var children = node.Nodes.ToList(); 4759 4760 <li class="menu__item @(node.InPath ? "menu__item--active" : "")"> 4761 <a href="@node.Link" class="menu-dropdown__link">@node.Name</a> 4762 @if (children.Any()) 4763 { 4764 <div class="level@(level)"> 4765 @ShowNavigationTreeDropdown(children, level + 1) 4766 </div> 4767 } 4768 </li> 4769 } 4770 </ul> 4771 } 4772 4773 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4774 4775 @using System 4776 @using System.Web 4777 @using Dynamicweb.Rapido.Blocks.Extensibility 4778 @using Dynamicweb.Rapido.Blocks 4779 4780 @{ 4781 Block masterDesktopActionsMenu = new Block 4782 { 4783 Id = "MasterDesktopActionsMenu", 4784 SortId = 20, 4785 Template = RenderDesktopActionsMenu(), 4786 SkipRenderBlocksList = true, 4787 Design = new Design 4788 { 4789 CssClass = "nav--header C" 4790 } 4791 4792 }; 4793 BlocksPage.GetBlockPage("Master").Add("MasterDesktopExtra", masterDesktopActionsMenu); 4794 } 4795 4796 @helper RenderDesktopActionsMenu() 4797 { 4798 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 4799 4800 @RenderBlockList(subBlocks) 4801 } 4802 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4803 4804 @using System 4805 @using System.Web 4806 @using Dynamicweb.Rapido.Blocks.Extensibility 4807 @using Dynamicweb.Rapido.Blocks 4808 @* using Dynamicweb.Core; 4809 @using System.Text.RegularExpressions *@ 4810 4811 @{ 4812 Block masterDesktopActionsMenuLanguageSelector = new Block 4813 { 4814 Id = "MasterDesktopActionsMenuLanguageSelector", 4815 SortId = 30, 4816 Template = RenderLanguageSelector() 4817 }; 4818 4819 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuLanguageSelector); 4820 } 4821 4822 @helper RenderLanguageSelector() 4823 { 4824 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4825 4826 if (Model.Languages.Count > 1) 4827 { 4828 4829 <div> 4830 <i class="@areaInfo.LanguageIcon"></i> 4831 </div> 4832 <div> 4833 @foreach (var lang in Model.Languages) 4834 { 4835 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>" + lang.Name; 4836 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 4837 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 4838 4839 if (areaInfo.LanguageViewType == "flag-culture") 4840 { 4841 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 4842 } 4843 4844 if (areaInfo.LanguageViewType == "flag") 4845 { 4846 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 4847 } 4848 4849 if (areaInfo.LanguageViewType == "name") 4850 { 4851 langInfo = lang.Name; 4852 } 4853 4854 if (areaInfo.LanguageViewType == "culture") 4855 { 4856 langInfo = cultureName; 4857 } 4858 4859 <div> 4860 <a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID">@langInfo</a> 4861 </div> 4862 } 4863 </div> 4864 } 4865 } 4866 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4867 4868 @using System 4869 @using System.Web 4870 @using Df.Dw 4871 @using Df.Dw.Rapido 4872 @using Dynamicweb.Rapido.Blocks.Extensibility 4873 @using Dynamicweb.Rapido.Blocks 4874 @using Dynamicweb.Security.UserManagement 4875 @{ 4876 Block masterDesktopActionsMenuSignIn = new Block 4877 { 4878 Id = "MasterDesktopActionsMenuSignIn", 4879 SortId = 20, 4880 Template = RenderSignIn() 4881 }; 4882 4883 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuSignIn); 4884 4885 Block masterDesktopActionsMenuAgentInfo = new Block 4886 { 4887 Id = "MasterDesktopActionsMenuAgentInfo", 4888 SortId = 1, 4889 Template = RenderAgentInfo() 4890 }; 4891 4892 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuAgentInfo); 4893 4894 } 4895 4896 @helper RenderSignIn() 4897 { 4898 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4899 var user = User.GetCurrentExtranetUser(); 4900 var DesignFolder = Pageview.Layout.Design.Name; 4901 var customerOrdersPageId = user.IsB2b() ? GetPageIdByNavigationTag("CustomerOrders") : GetPageIdByNavigationTag("CustomerPlacedOrders"); 4902 4903 if (!areaInfo.NavigationItemsHideSignIn) 4904 { 4905 4906 if (user == null) 4907 { 4908 string message = Translate("Contacteaza-ne"); 4909 4910 4911 4912 if (!areaInfo.HideCreateAccountLink) 4913 { 4914 <a href="@areaInfo.LinkStart@areaInfo.CreateAccountPage.ID" class="btn btn-fill--accent btn-create-account mr-2" data-tab="CreateAccount">@Translate(Translations.Account.CreateAccount)</a> 4915 } 4916 <div class="header__profile"> 4917 <button type="button" class="btn-icon header__profile__icon" aria-label="Open profile action menu"> 4918 <div class="ico"> 4919 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M332.64,64.58C313.18,43.57,286,32,256,32c-30.16,0-57.43,11.5-76.8,32.38-19.58,21.11-29.12,49.8-26.88,80.78C156.76,206.28,203.27,256,256,256s99.16-49.71,103.67-110.82C361.94,114.48,352.34,85.85,332.64,64.58Z"/><path d="M432,480H80A31,31,0,0,1,55.8,468.87c-6.5-7.77-9.12-18.38-7.18-29.11C57.06,392.94,83.4,353.61,124.8,326c36.78-24.51,83.37-38,131.2-38s94.42,13.5,131.2,38c41.4,27.6,67.74,66.93,76.18,113.75,1.94,10.73-.68,21.34-7.18,29.11A31,31,0,0,1,432,480Z"/></svg> 4920 </div> 4921 </button> 4922 <div class="header__profile__details "> 4923 <div class="list"> 4924 <div class="item"> <a href="@areaInfo.LinkStart@areaInfo.SignInProfilePage.ID" class="header__profile__login btn-login" title="@Translate(Translations.Account.LogIn)" data-tab="Login"><ion-icon name="log-out-outline"></ion-icon><span>@Translate(Translations.Account.LogIn)</span></a> </div> 4925 </div> 4926 </div> 4927 </div> 4928 4929 4930 4931 4932 <text> 4933 @SnippetStart("Messenger") 4934 <script type="text/javascript"> 4935 (function () { 4936 var options = { 4937 whatsapp: "@areaInfo.ContactNumber", // WhatsApp number 4938 call_to_action: "@message", // Call to action 4939 position: "right", // Position may be 'right' or 'left' 4940 }; 4941 var proto = document.location.protocol, host = "getbutton.io", url = proto + "//static." + host; 4942 var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js'; 4943 s.onload = function () { WhWidgetSendButton.init(host, proto, options); }; 4944 var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); 4945 })(); 4946 </script> 4947 @SnippetEnd("Messenger") 4948 </text> 4949 4950 } else { 4951 <div class="header__profile"> 4952 <button type="button" class="btn-icon header__profile__icon" aria-label="Open profile action menu"> 4953 <sup>@user.GetInitials()</sup> 4954 <div class="ico"> 4955 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M332.64,64.58C313.18,43.57,286,32,256,32c-30.16,0-57.43,11.5-76.8,32.38-19.58,21.11-29.12,49.8-26.88,80.78C156.76,206.28,203.27,256,256,256s99.16-49.71,103.67-110.82C361.94,114.48,352.34,85.85,332.64,64.58Z"/><path d="M432,480H80A31,31,0,0,1,55.8,468.87c-6.5-7.77-9.12-18.38-7.18-29.11C57.06,392.94,83.4,353.61,124.8,326c36.78-24.51,83.37-38,131.2-38s94.42,13.5,131.2,38c41.4,27.6,67.74,66.93,76.18,113.75,1.94,10.73-.68,21.34-7.18,29.11A31,31,0,0,1,432,480Z"/></svg> 4956 </div> 4957 </button> 4958 <div class="header__profile__details "> 4959 <div class="list"> 4960 4961 @if (!areaInfo.HideMyProfileLink) 4962 { 4963 @RenderListItem(areaInfo.LinkStart + areaInfo.CustomerDashboardPage.ID, Translate(Translations.Account.MyProfile), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/account.svg") 4964 } 4965 @if (!areaInfo.HideMyOrdersLink) 4966 { 4967 @RenderListItem(areaInfo.LinkStart + customerOrdersPageId, Translate(Translations.Account.MyOrders), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/view-details.svg") 4968 } 4969 @if (!areaInfo.HideSignInFavorites) 4970 { 4971 @RenderListItem(areaInfo.LinkStart + areaInfo.MyFavoritesPage.ID, Translate(Translations.Account.MyFavorites), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/favorites-on.svg") 4972 } 4973 @if (!areaInfo.HideMySavedCardsLink) 4974 { 4975 @RenderListItem(areaInfo.LinkStart + areaInfo.SavedCardsPage.ID, Translate(Translations.Account.MySavedCards), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/card.svg") 4976 } 4977 @*if (!areaInfo.HideMyProfileLink || !areaInfo.HideMyOrdersLink || !areaInfo.HideMyFavorites || !areaInfo.HideMySavedCardsLink) 4978 { 4979 @RenderSeparator() 4980 }*@ 4981 4982 @*RenderListItem("/Admin/Public/ExtranetLogoff.aspx?ID=" + areaInfo.PageId, Translate(Translations.Account.SignOut))*@ 4983 4984 @*RenderSeparator()*@ 4985 4986 4987 4988 @if(user != null){ 4989 //var agents = user.GetUsersThatCanSetMeAsSecondary();//.Where(x=>x.Groups.Contains(y=>y.ID == 8404)); 4990 var agents = user.GetUsersAndGroupsThatCanSetMeAsSecondary().OfType<User>().Where(u => !string.IsNullOrEmpty(u.CustomFieldValues.First(f => string.Equals(f.CustomField.SystemName, "AccessUser_TeamCode", StringComparison.OrdinalIgnoreCase)).Value as string)); 4991 4992 string message = Translate("Contacteaza-ne"); 4993 if (agents.Any()) 4994 { 4995 foreach (var agent in agents.Take(1)) 4996 { 4997 var userGroups = agent.Groups.Select(x=>x.ID).ToList(); 4998 4999 string secondaryUserName = agent.Name != null && agent.Name != "" ? agent.Name : ""; 5000 string secondaryUserPhone = agent.Phone != null && agent.Phone != "" ? agent.Phone : ""; 5001 string secondaryUserEmail = agent.Email != null && agent.Email != "" ? agent.Email : ""; 5002 string secondaryUserImage = agent.Image != null && agent.Image != "" ? agent.Image : "/Files/Images/no-user.jpg"; 5003 string secondaryUserInitials = agent.GetInitials(); 5004 5005 string imageresizeURL = "/Admin/Public/GetImage.ashx?width=150&amp;height=150&amp;crop=0&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image="; 5006 secondaryUserImage = secondaryUserImage.HasValue() ? String.Format("<div class=\"margin-bottom-1rem\"><img class=\"grid__cell-img--left b-lazy b-loaded\" src=\"{0}{1}\"></div>", imageresizeURL, secondaryUserImage) : ""; 5007 secondaryUserName = secondaryUserName.HasValue() ? String.Format("<div><h5>{0}</h5></div>", secondaryUserName) : ""; 5008 secondaryUserPhone = secondaryUserPhone.HasValue() ? String.Format("<div><a class=\"df-agent-info\" href='tel:{0}'>{0}</a></div>", secondaryUserPhone) : ""; 5009 secondaryUserEmail = secondaryUserEmail.HasValue() ? String.Format("<div><a class=\"df-agent-info\" href='mailto:{0}'>{0}</a></div>", secondaryUserEmail) : ""; 5010 5011 5012 //if(isSales){ 5013 <text> 5014 @SnippetStart("SalesAgentProfileComplete") 5015 <div class="df-agent-card"> 5016 <h4 class="margin-bottom-1rem">@Translate("Agent", "Agent")</h4> 5017 @secondaryUserImage 5018 @secondaryUserName 5019 @secondaryUserPhone 5020 @secondaryUserEmail 5021 </div> 5022 @SnippetEnd("SalesAgentProfileComplete") 5023 5024 @SnippetStart("SalesAgentProfileSimple") 5025 <div class="agent"> 5026 <button type="button" class="btn-icon agent__icon" aria-label="Open sales agent action menu"> 5027 @*<sup>@secondaryUserInitials</sup>*@ 5028 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/help-circle-sharp.svg"></ion-icon> 5029 </button> 5030 <div class="agent__details "> 5031 <div class="list"> 5032 <div class="agent-info"> 5033 <div class="item h5 agent__name">@agent.Name</div> 5034 @RenderListItem("tel:"+agent.Phone ,agent.Phone,"/Files/Templates/Designs/"+ DesignFolder + "/icons/default/call.svg") 5035 @RenderListItem("mailto:"+agent.Email ,agent.Email,"/Files/Templates/Designs/"+ DesignFolder + "/icons/default/mail.svg") 5036 </div> 5037 </div> 5038 </div> 5039 </div> 5040 @SnippetEnd("SalesAgentProfileSimple") 5041 </text> 5042 //} 5043 string messengerPhone = agent.Phone != "" ? agent.Phone : areaInfo.ContactNumber; 5044 <text> 5045 @SnippetStart("Messenger") 5046 <script type="text/javascript"> 5047 (function () { 5048 var options = { 5049 whatsapp: "@messengerPhone", // WhatsApp number 5050 call_to_action: "@message", // Call to action 5051 position: "right", // Position may be 'right' or 'left' 5052 }; 5053 var proto = document.location.protocol, host = "getbutton.io", url = proto + "//static." + host; 5054 var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js'; 5055 s.onload = function () { WhWidgetSendButton.init(host, proto, options); }; 5056 var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); 5057 })(); 5058 </script> 5059 @SnippetEnd("Messenger") 5060 </text> 5061 5062 } 5063 } 5064 } 5065 <div class="item"> <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@areaInfo.PageId" class="header__profile__logout" title="@Translate(Translations.Account.SignOut)"><ion-icon name="log-out-outline"></ion-icon><span>@Translate(Translations.Account.SignOut)</span></a> </div> 5066 5067 </div> 5068 </div> 5069 5070 </div> 5071 5072 5073 5074 } 5075 5076 5077 } 5078 } 5079 5080 @helper RenderAgentInfo() 5081 { 5082 <text> 5083 @RenderSnippet("SalesAgentProfileSimple") 5084 </text> 5085 } 5086 5087 @helper RenderListItem(string link = "", string text = "", string icon = null, string cssClass = "") { 5088 if(text.HasValue()){ 5089 <div class="item"> 5090 <a href="@link" class=""> 5091 @if (icon.HasValue()){<ion-icon src="@icon"></ion-icon>}<span>@text</span> 5092 </a> 5093 </div> 5094 } 5095 } 5096 5097 @helper RenderSeparator() 5098 { 5099 <li>&nbsp;</li> 5100 } 5101 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5102 5103 @using System 5104 @using System.Web 5105 @using Dynamicweb.Rapido.Blocks.Extensibility 5106 @using Dynamicweb.Rapido.Blocks 5107 @{ 5108 Block masterDesktopActionsMenuFavorites = new Block 5109 { 5110 Id = "MasterDesktopActionsMenuFavorites", 5111 SortId = 30, 5112 Template = RenderFavorites() 5113 }; 5114 5115 if (!areaInfo.HideMyFavorites && user != null) 5116 { 5117 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuFavorites); 5118 } 5119 } 5120 5121 @helper RenderFavorites() 5122 { 5123 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5124 5125 <a href="@areaInfo.LinkStart@areaInfo.MyFavoritesPage.ID"> 5126 <i class="@areaInfo.FavoritesIcon"></i> 5127 </a> 5128 } 5129 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5130 5131 @using System 5132 @using System.Web 5133 @using Dynamicweb.Rapido.Blocks.Extensibility 5134 @using Dynamicweb.Rapido.Blocks 5135 5136 @functions 5137 { 5138 public static string FormatPriceDecimals (string formattedPrice) 5139 { 5140 if(formattedPrice != "") 5141 { 5142 if(formattedPrice.IndexOf(",") > 0 && formattedPrice.IndexOf(" ") > 0) 5143 { 5144 formattedPrice = formattedPrice.Replace(",", ",<sup>"); 5145 formattedPrice = formattedPrice.Replace(" ", "</sup> "); 5146 } 5147 } 5148 return formattedPrice; 5149 } 5150 } 5151 5152 @{ 5153 5154 bool onlyPreview = areaInfo.OnlyPreviewForAnonymous && user == null; 5155 if (!onlyPreview && !areaInfo.HideCart) 5156 { 5157 Block minicartCounter = new Block 5158 { 5159 Id = "MiniCartHeaderTrigger", 5160 Template = RenderMiniCartHeaderTrigger(), 5161 SortId = 50, 5162 }; 5163 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", minicartCounter); 5164 5165 } 5166 } 5167 5168 @helper RenderMiniCartHeaderTrigger() 5169 { 5170 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5171 var DesignFolder = Pageview.Layout.Design.Name; 5172 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 5173 string cartProductsTotalPriceReformated = Model.Cart.TotalPrice != null ? FormatPriceDecimals(Model.Cart.TotalPrice.Price.Formatted) : ""; 5174 5175 <button class="header__minicart minicart--toggler btn-icon" data-role="minicart-trigger"> 5176 @if(areaInfo.ShowPrice) { 5177 <div id="cartCounter" class="minicart__counter__content" data-template="MiniCartCounterContent" data-json="@areaInfo.LinkStart@areaInfo.MiniCartFeedPage.ID"> 5178 <div class="minicart__counter__icon"> 5179 <sup>@cartProductsCount</sup> 5180 <div class="ico"> 5181 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 5182 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 5183 <path d="M176,384c17.7,0,32,14.3,32,32s-14.3,32-32,32s-32-14.3-32-32S158.3,384,176,384z M400,384c17.7,0,32,14.3,32,32 5184 s-14.3,32-32,32s-32-14.3-32-32S382.3,384,400,384z M456.8,120.8c-4.6-5.6-11.4-8.8-18.6-8.8H133.9l-6.1-34.8 5185 c-1.3-7.6-8-13.2-15.8-13.2H48c-8.8,0-16,7.2-16,16s7.2,16,16,16h50.6l45.7,258.8c1.3,7.6,8,13.2,15.8,13.2h256c8.8,0,16-7.2,16-16 5186 s-7.2-16-16-16H173.4l-5.6-32h241.7c11.4,0,21.3-8.1,23.6-19.3l28.8-144C463.2,133.7,461.4,126.3,456.8,120.8z"/> 5187 </svg> 5188 </div> 5189 </div> 5190 @if(!string.IsNullOrEmpty(cartProductsTotalPriceReformated)) { 5191 <div class="minicart__counter__info"> 5192 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 5193 <div class="minicart__counter__price">@cartProductsTotalPriceReformated</div> 5194 </div> 5195 } 5196 5197 </div> 5198 } 5199 </button> 5200 5201 5202 } 5203 5204 5205 5206 5207 5208 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5209 5210 @using System 5211 @using System.Web 5212 @using Dynamicweb.Rapido.Blocks.Extensibility 5213 @using Dynamicweb.Rapido.Blocks 5214 @{ 5215 Block masterDesktopActionsMenuDownloadCart = new Block 5216 { 5217 Id = "MasterDesktopActionsMenuDownloadCart", 5218 SortId = 35, 5219 Template = RenderDownloadCart() 5220 }; 5221 5222 if (areaInfo.ShowDownloadCartLink && user != null) 5223 { 5224 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuDownloadCart); 5225 } 5226 } 5227 5228 @helper RenderDownloadCart() 5229 { 5230 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5231 5232 <a href="@areaInfo.LinkStart@areaInfo.DownloadCartPage.ID"> 5233 <i class="fas fa-cart-arrow-down fa-1_5x"></i> 5234 </a> 5235 } 5236 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5237 5238 @using System 5239 @using System.Web 5240 @using Df.Dw 5241 @using Dynamicweb.Rapido.Blocks.Extensibility 5242 @using Dynamicweb.Rapido.Blocks 5243 5244 @functions { 5245 public class SearchConfiguration 5246 { 5247 public string 5248 searchFeedId, 5249 searchSecondFeedId, 5250 resultPageLink, 5251 searchPlaceholder, 5252 searchType, 5253 searchTemplate, 5254 searchContentTemplate, 5255 searchValue; 5256 5257 public bool 5258 showGroups; 5259 5260 public int 5261 groupsFeedId; 5262 5263 public SearchConfiguration() 5264 { 5265 searchFeedId = ""; 5266 searchSecondFeedId = ""; 5267 searchType = "product-search"; 5268 searchContentTemplate = ""; 5269 showGroups = true; 5270 } 5271 } 5272 } 5273 @{ 5274 Block masterSearchBar = new Block 5275 { 5276 Id = "MasterSearchBar", 5277 SortId = 10, 5278 Template = RenderSearch("bar"), 5279 Design = new Design 5280 { 5281 CssClass = "search S" 5282 } 5283 }; 5284 5285 Block masterSearchAction = new Block 5286 { 5287 Id = "MasterDesktopActionsMenuSearch", 5288 SortId = 10, 5289 Template = RenderSearch() 5290 }; 5291 5292 BlocksPage.GetBlockPage("Master").Add("MasterDesktopExtra", masterSearchBar); 5293 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterSearchAction); 5294 } 5295 5296 @helper RenderSearch(string type = "mini-search") 5297 { 5298 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5299 5300 SearchConfiguration searchConfiguration = null; 5301 5302 switch (areaInfo.SearchType) { 5303 case "contentSearch": 5304 searchConfiguration = new SearchConfiguration() { 5305 searchFeedId = areaInfo.ContentSearchFeedPage + "&Areaid=" + areaInfo.AreaId + "&pagesOnly=true", 5306 resultPageLink = areaInfo.LinkStart + areaInfo.ContentSearchFeedPage.ID, 5307 searchPlaceholder = Translate(Translations.General.SearchPage), 5308 groupsFeedId = 0, 5309 searchType = "content-search", 5310 searchTemplate = "SearchPagesTemplate", 5311 showGroups = false 5312 }; 5313 break; 5314 case "combinedSearch": 5315 searchConfiguration = new SearchConfiguration() { 5316 searchFeedId = areaInfo.ProductsPage.ID + "&feed=true", 5317 searchSecondFeedId = areaInfo.ContentSearchFeedPage.ID + "&Areaid=" + areaInfo.AreaId + "&pagesOnly=true", 5318 resultPageLink = Converter.ToString(areaInfo.ProductsPage.ID), 5319 searchPlaceholder = Translate(Translations.Products.SearchProductsOrPages), 5320 groupsFeedId = areaInfo.ProductGroupsFeedPage.ID, 5321 searchType = "combined-search", 5322 searchTemplate = "SearchProductsTemplateWrap", 5323 searchContentTemplate = "SearchPagesTemplateWrap", 5324 showGroups = areaInfo.ShowGroupsSelector 5325 }; 5326 break; 5327 default: //productSearch 5328 searchConfiguration = new SearchConfiguration() { 5329 resultPageLink = GetPageIdByNavigationTag("SearchResults").ToString(), 5330 searchFeedId = GetPageIdByNavigationTag("ProductSearch").ToString() + "&feed=true", 5331 groupsFeedId = areaInfo.ProductGroupsFeedPage.ID, 5332 searchPlaceholder = Translate(Translations.Products.SearchProducts), 5333 searchTemplate = "SearchProductsTemplate", 5334 searchType = "product-search", 5335 showGroups = areaInfo.ShowGroupsSelector 5336 }; 5337 break; 5338 } 5339 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 5340 5341 if (type == "mini-search") { 5342 @* RenderMiniSearch(searchConfiguration) *@ 5343 } else { 5344 @RenderSearchBar(searchConfiguration) 5345 } 5346 } 5347 5348 @helper RenderSearchBar(SearchConfiguration options) 5349 { 5350 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5351 var categoriesFeed = GetPageIdByNavigationTag("SearchCategoriesFeed"); 5352 var DesignFolder = Pageview.Layout.Design.Name; 5353 if (options.showGroups) 5354 { 5355 <button type="button" data-group-id="all">@Translate(Translations.General.All)</button> 5356 <ul id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-recent-searched-template="RecentSearchesTemplate" data-json-feed="/Default.aspx?ID=@options.groupsFeedId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 5357 } 5358 5359 <div id="headerSearch" class="typeahead"> 5360 <button type="button" class="btn-icon" data-role="close-typeahead"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/close-raw.svg"></ion-icon></button> 5361 <div class="typeahead__input"> 5362 <df-input type="text" class="c0" value="@options.searchValue" label="@options.searchPlaceholder"></df-input> 5363 <button type="button" class="btn-icon clear-search hidden c1"><ion-icon src="/Files/Templates/Designs/Atomico/icons/default/close.svg"></ion-icon></button> 5364 <button type="button" class="btn-icon typeahead__loading"><ion-icon name="refresh-circle"></ion-icon></button> 5365 @* <div class="typeahead__select c2" data-template="SearchCategoriesTemplate" data-json="/Default.aspx?ID=@categoriesFeed"></div> *@ 5366 <button type="button" id="SubmitSearch" class="typeahead__submit btn-icon c3" data-results-page="/Default.aspx?ID=@options.resultPageLink"> 5367 <div class="ico mt-ico"><svg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'><path d='M456.69,421.39,362.6,327.3a173.81,173.81,0,0,0,34.84-104.58C397.44,126.38,319.06,48,222.72,48S48,126.38,48,222.72s78.38,174.72,174.72,174.72A173.81,173.81,0,0,0,327.3,362.6l94.09,94.09a25,25,0,0,0,35.3-35.3ZM97.92,222.72a124.8,124.8,0,1,1,124.8,124.8A124.95,124.95,0,0,1,97.92,222.72Z'/></svg></div> 5368 </button> 5369 5370 </div> 5371 5372 @if (!options.searchSecondFeedId.HasValue()) 5373 { 5374 <div class="typeahead__results"> 5375 <ul id="ProductSearchBarContent" class="list" data-template="@options.searchTemplate" data-recent-searched-template="RecentSearchesTemplate" data-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly&pagesize=10" data-init-onload="false"></ul> 5376 </div> 5377 } 5378 else 5379 { 5380 <div class="typeapead__results two-columns"> 5381 <div id="ProductSearchBarContent" data-template="@options.searchTemplate" data-init-onload="false"></div> 5382 <div id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-init-onload="false"></div> 5383 </div> 5384 } 5385 @* <div class="typeahead__backdrop hidden"></div> *@ 5386 5387 </div> 5388 5389 5390 } 5391 5392 @helper RenderMiniSearch(SearchConfiguration options) 5393 { 5394 <div onmouseover="document.getElementById('headerSearch').focus()"> 5395 5396 <df-input id="headerSearch" type="text" value="@options.searchValue" label="@options.searchPlaceholder" mask="^[A-Za-z]+$"></df-input> 5397 @if (!options.searchSecondFeedId.HasValue()) 5398 { 5399 <ul id="ProductSearchBarContent" data-template="@options.searchTemplate" data-recent-searched-template="RecentSearchesTemplate" data-json-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 5400 } 5401 else 5402 { 5403 <div class="dropdown"> 5404 <div id="ProductSearchBarContent" data-template="@options.searchTemplate" data-feed="/Default.aspx?ID=@options.searchFeedId&feedType=productsOnly&pagesize=10" data-recent-searched-template="RecentSearchesTemplate" data-init-onload="false"></div> 5405 <div id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-json-feed="/Default.aspx?ID=@options.searchSecondFeedId" data-init-onload="false"></div> 5406 </div> 5407 } 5408 </div> 5409 } 5410 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/"+DesignFolder+"/MasterBlocks/HeaderBlocks/Custom__Blocks.cshtml"))) 5411 { 5412 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5413 5414 @using System 5415 @using System.Web 5416 @using Dynamicweb.Rapido.Blocks.Extensibility 5417 @using Dynamicweb.Rapido.Blocks 5418 </text> 5419 } 5420 5421 5422 @helper RenderDesktopTools() 5423 { 5424 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 5425 5426 if (subBlocks.Count > 0) 5427 { 5428 <div class="m">@RenderBlockList(subBlocks)</div> 5429 } 5430 } 5431 5432 @helper RenderDesktopToolsText() 5433 { 5434 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5435 var DesignFolder = Pageview.Layout.Design.Name; 5436 5437 <div class="nav--tertiary m1"> 5438 <span class="flex-wrap align-items-center"> 5439 <div class="ico mr-1 mt-ico"> 5440 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M391,480c-19.52,0-46.94-7.06-88-30-49.93-28-88.55-53.85-138.21-103.38C116.91,298.77,93.61,267.79,61,208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82,73.38,58.16,62.65,74.11,52A176.3,176.3,0,0,1,102.75,36.8c1-.43,1.93-.84,2.76-1.21,4.95-2.23,12.45-5.6,21.95-2,6.34,2.38,12,7.25,20.86,16,18.17,17.92,43,57.83,52.16,77.43,6.15,13.21,10.22,21.93,10.23,31.71,0,11.45-5.76,20.28-12.75,29.81-1.31,1.79-2.61,3.5-3.87,5.16-7.61,10-9.28,12.89-8.18,18.05,2.23,10.37,18.86,41.24,46.19,68.51s57.31,42.85,67.72,45.07c5.38,1.15,8.33-.59,18.65-8.47,1.48-1.13,3-2.3,4.59-3.47,10.66-7.93,19.08-13.54,30.26-13.54h.06c9.73,0,18.06,4.22,31.86,11.18,18,9.08,59.11,33.59,77.14,51.78,8.77,8.84,13.66,14.48,16.05,20.81,3.6,9.53.21,17-2,22-.37.83-.78,1.74-1.21,2.75a176.49,176.49,0,0,1-15.29,28.58c-10.63,15.9-21.4,28.21-39.38,36.58A67.42,67.42,0,0,1,391,480Z"/></svg> 5441 </div> 5442 @areaInfo.ContactNumber 5443 </span> 5444 <a href="mailto:@areaInfo.ContactEmail" class="line-height-reset"><div class="ico mr-1 mt-ico"> 5445 <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M424,80H88a56.06,56.06,0,0,0-56,56V376a56.06,56.06,0,0,0,56,56H424a56.06,56.06,0,0,0,56-56V136A56.06,56.06,0,0,0,424,80Zm-14.18,92.63-144,112a16,16,0,0,1-19.64,0l-144-112a16,16,0,1,1,19.64-25.26L256,251.73,390.18,147.37a16,16,0,0,1,19.64,25.26Z"/></svg> 5446 </div> <span>@areaInfo.ContactEmail</span></a> 5447 </div> 5448 } 5449 5450 @helper RenderDesktopToolsNavigation() 5451 { 5452 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5453 5454 if (areaInfo.RenderPagesInToolBar) 5455 { 5456 <div class="nav--secondary m2"> 5457 @RenderNavigation(new 5458 { 5459 id = "topToolsNavigation", 5460 template = "TopMenu.xslt" 5461 }) 5462 </div> 5463 } 5464 } 5465 5466 @helper RenderDesktopNavigation() 5467 { 5468 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 5469 <nav class="nav--primary M"> 5470 @RenderBlockList(subBlocks) 5471 </nav> 5472 } 5473 5474 @helper RenderDesktopExtra() 5475 { 5476 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 5477 5478 if (subBlocks.Count > 0) 5479 { 5480 @RenderBlockList(subBlocks) 5481 } 5482 } 5483 5484 5485 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5486 5487 @using System 5488 @using System.Web 5489 @using Dynamicweb.Rapido.Blocks.Extensibility 5490 @using Dynamicweb.Rapido.Blocks 5491 @* using System.Collections.Generic *@ 5492 @{ 5493 Block impersonationBar = new Block 5494 { 5495 Id = "ImpersonationBar", 5496 SortId = 1, 5497 Template = RenderImpersonationBar() 5498 }; 5499 5500 if (user != null && Model.SecondaryUsers.Count > 0) 5501 5502 { 5503 BlocksPage.GetBlockPage("Master").Add("MasterHeaderTop", impersonationBar); 5504 } 5505 } 5506 5507 @helper RenderImpersonationBar() 5508 { 5509 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5510 var user = User.GetCurrentExtranetUser(); 5511 var secondaryUser = user.CurrentSecondaryUser; 5512 var DesignFolder = Pageview.Layout.Design.Name; 5513 5514 <div class="impersonation"> 5515 <div class="impersonation-bar"> 5516 @if (secondaryUser != null && secondaryUser.ID > 0) 5517 { 5518 string username = ""; 5519 if (!string.IsNullOrEmpty(secondaryUser.FirstName) && !string.IsNullOrEmpty(secondaryUser.LastName)) 5520 { 5521 username = secondaryUser.FirstName + " " + secondaryUser.LastName; 5522 } 5523 else if (!string.IsNullOrEmpty(secondaryUser.Name)) 5524 { 5525 username = secondaryUser.Name; 5526 } 5527 else if (!string.IsNullOrEmpty(secondaryUser.Email)) 5528 { 5529 username = secondaryUser.Email; 5530 } 5531 else 5532 { 5533 username = secondaryUser.UserName; 5534 } 5535 <div class="display-flex"> 5536 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/impersonation.svg"></ion-icon> 5537 5538 @username <text>&nbsp;</text>@Translate(Translations.Account.IsImpersonating)<text>&nbsp;</text> @Pageview.User.UserName 5539 <form method="post"> 5540 <input type="submit" name="DwExtranetRemoveSecondaryUser" value="@Translate(Translations.Account.StopImpersonation)"> 5541 </form> 5542 </div> 5543 } 5544 else 5545 { 5546 <div class="display-flex"> 5547 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/impersonation.svg"></ion-icon> 5548 <a href="@areaInfo.LinkStart@areaInfo.ImpersonationPage.ID" title="@Translate(Translations.Account.ViewListOfUsers)">@Translate(Translations.Account.ViewListOfUsers)</a> 5549 </div> 5550 } 5551 </div> 5552 </div> 5553 } 5554 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5555 5556 @using System 5557 @using System.Web 5558 @using Dynamicweb.Rapido.Blocks.Extensibility 5559 @using Dynamicweb.Rapido.Blocks 5560 @* using System.Collections.Generic *@ 5561 5562 @{ 5563 //Already defined in Master 5564 //var DesignFolder = Pageview.Layout.Design.Name; 5565 } 5566 5567 @{ 5568 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 5569 5570 Block orderLines = new Block 5571 { 5572 Id = "MiniCartOrderLines", 5573 SkipRenderBlocksList = true, 5574 5575 BlocksList = new List<Block> 5576 { 5577 new Block { 5578 Id = "MiniCartOrderLinesList", 5579 SortId = 20, 5580 Design = new Design 5581 { 5582 CssClass = "minicart__orderlines list" 5583 }, 5584 Template = RenderMiniCartOrderLinesList() 5585 } 5586 } 5587 }; 5588 5589 Block orderlinesScriptTemplates = new Block 5590 { 5591 Id = "OrderlinesScriptTemplates" 5592 }; 5593 5594 if (areaInfo.OrderlinesView == "table") 5595 { 5596 orderLines.Template = RenderMiniCartOrderLinesTable(); 5597 orderLines.BlocksList.Add( 5598 new Block { 5599 Id = "MiniCartOrderlinesTableHeader", 5600 SortId = 10, 5601 Template = RenderMiniCartOrderLinesHeader() 5602 } 5603 ); 5604 5605 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 5606 } 5607 else 5608 { 5609 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 5610 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 5611 } 5612 5613 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 5614 5615 Block miniCartScriptTemplates = new Block() 5616 { 5617 Id = "MasterMiniCartTemplates", 5618 SortId = 1, 5619 Template = RenderMiniCartScriptTemplates(), 5620 SkipRenderBlocksList = true, 5621 BlocksList = new List<Block> 5622 { 5623 orderLines, 5624 new Block { 5625 Id = "MiniCartFooter", 5626 Template = RenderMiniCartFooter(), 5627 SortId = 50, 5628 SkipRenderBlocksList = true, 5629 BlocksList = new List<Block> 5630 { 5631 new Block { 5632 Id = "MiniCartFees", 5633 Template = RenderMiniCartFees(), 5634 SortId = 30 5635 }, 5636 // new Block { 5637 // Id = "MiniCartPoints", 5638 // Template = RenderMiniCartPoints(), 5639 // SortId = 40 5640 // }, 5641 new Block { 5642 Id = "MiniCartTotal", 5643 Template = RenderMiniCartTotal(), 5644 SortId = 50 5645 }, 5646 new Block { 5647 Id = "MiniCartActions", 5648 Template = RenderMiniCartActions(), 5649 SortId = 60 5650 } 5651 } 5652 } 5653 } 5654 }; 5655 5656 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 5657 5658 Block MiniCartPanel = new Block 5659 { 5660 Id = "MiniCartPanel", 5661 SkipRenderBlocksList = true, 5662 Template = RenderMiniCartPanelDesign(), 5663 }; 5664 5665 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets",MiniCartPanel); 5666 5667 } 5668 5669 @helper RenderMiniCartScriptsTableTemplates() 5670 { 5671 <script id="MiniCartOrderline" type="text/x-template"> 5672 {{#unless isEmpty}} 5673 <tr> 5674 <td><a href="{{link}}" class="{{hideimage}}"><img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"></a></td> 5675 <td> 5676 <a href="{{link}}" title="{{name}}">{{name}}</a> 5677 {{#if variantname}} 5678 <a href="{{link}}">{{variantname}}</a> 5679 {{/if}} 5680 {{#if unitname}} 5681 <div>{{unitname}}</div> 5682 {{/if}} 5683 </td> 5684 <td>{{quantity}}</td> 5685 <td> 5686 {{#if pointsTotal}} 5687 <span>{{pointsTotal}}</span> @Translate(Translations.Cart.Points) 5688 {{else}} 5689 {{totalprice}} 5690 {{/if}} 5691 </td> 5692 </tr> 5693 {{/unless}} 5694 </script> 5695 5696 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5697 {{#unless isEmpty}} 5698 <tr> 5699 <td>&nbsp;</td> 5700 <td><div>{{name}}</div></td> 5701 <td>&nbsp;</td> 5702 <td>{{totalprice}}</td> 5703 </tr> 5704 {{/unless}} 5705 </script> 5706 } 5707 5708 @helper RenderMiniCartScriptsListTemplates() 5709 { 5710 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5711 var DesignFolder = Pageview.Layout.Design.Name; 5712 5713 <script id="MiniCartOrderline" type="text/x-template"> 5714 {{#unless isEmpty}} 5715 <div class="item"> 5716 <div class="item__image"> 5717 <a href="{{link}}" class="{{hideimage}}"> 5718 <img src="/Admin/Public/GetImage.ashx?width=100&height=100&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"> 5719 </a> 5720 </div> 5721 <div class="item__content"> 5722 <div class="c0"> 5723 <div class="item__number">{{productnumber}}</div> 5724 <a href="{{link}}" class="item__title" data-tooltip-content="{{name}}">{{name}}</a> 5725 {{#if variantname}} 5726 <div>@Translate(Translations.Cart.Variant): {{variantname}}</div> 5727 {{/if}} 5728 {{#if unitname}} 5729 <div>@Translate(Translations.Cart.Unit): {{unitname}}</div> 5730 {{/if}} 5731 <div class="item__orderline__info"><span class="mr-5">@Translate(Translations.Cart.Qty):</span> <span class="item__quantity">{{quantity}}</span> <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/close-raw.svg"></ion-icon> <span class="item__unitprice">{{{unitprice}}}</span></div> 5732 5733 <div class="item__actions"> 5734 <button type="button" class="btn-icon" data-role="delete-orderline" message-success="@Translate(Translations.Cart.OrderlineRemoved)" title="@Translate(Translations.Cart.RemoveOrderline)" data-url="/Default.aspx?ID=@areaInfo.MiniCartFeedPage.ID&CartCmd=DelOrderLine&key={{orderLineId}}&redirect=false" 5735 data-url-del="/Default.aspx?ID=@areaInfo.MiniCartFeedPage.ID&CartCmd=UpdateOrderlines&QuantityOrderLine{{orderLineId}}=0&redirect=false"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/delete.svg"></ion-icon><span>@Translate(Translations.General.Remove)</span></button> 5736 </div> 5737 </div> 5738 <div class="c1"> 5739 <div class="item__price"> 5740 {{#if pointsTotal}} 5741 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate(Translations.Cart.Points) 5742 {{else}} 5743 {{{totalprice}}} 5744 5745 {{/if}} 5746 </div> 5747 5748 </div> 5749 </div> 5750 </div> 5751 {{/unless}} 5752 </script> 5753 5754 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5755 {{#unless isEmpty}} 5756 <div class="item item--discount"> 5757 <div class="item__title item__title--discount"><img src="/Admin/Public/GetImage.ashx?width=30&height=30&crop=5&Compression=75&image=/Files/{{image}}" width="30px" height="auto" /> <span>{{name}}</span></div> 5758 <div class="item__price item__price--discount">{{{totalprice}}}</div> 5759 </div> 5760 {{/unless}} 5761 </script> 5762 } 5763 5764 @helper RenderMiniCartScriptTemplates() 5765 { 5766 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 5767 5768 <script id="MiniCartContent" type="text/x-template"> 5769 {{#.}} 5770 {{#ifCond discountStepMessage '!==' ""}} 5771 <div class="cart__step__discount">{{discountStepMessage}}</div> 5772 {{/ifCond}} 5773 {{#each ErrorMessages}} 5774 <div class="{{cssClass}}">{{text}}</div> 5775 {{/each}} 5776 {{#unless isEmpty}} 5777 @RenderBlockList(subBlocks) 5778 {{/unless}} 5779 {{/.}} 5780 </script> 5781 } 5782 5783 @helper RenderMiniCartOrderLinesTable() 5784 { 5785 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5786 5787 <div> 5788 <table> 5789 @RenderBlockList(subBlocks) 5790 </table> 5791 </div> 5792 } 5793 5794 @helper RenderMiniCartOrderLinesBlocks() 5795 { 5796 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5797 5798 <div> 5799 @RenderBlockList(subBlocks) 5800 </div> 5801 } 5802 5803 @helper RenderMiniCartOrderLinesHeader() 5804 { 5805 <thead> 5806 <tr> 5807 <td>&nbsp;</td> 5808 <td>@Translate(Translations.Products.Product)</td> 5809 <td>@Translate(Translations.Cart.Qty)</td> 5810 <td width="120">@Translate(Translations.Products.Price)</td> 5811 </tr> 5812 </thead> 5813 } 5814 5815 @helper RenderMiniCartOrderLinesList() 5816 { 5817 <text> 5818 {{#OrderLines}} 5819 {{#ifCond template "===" "CartOrderline"}} 5820 {{>MiniCartOrderline}} 5821 {{/ifCond}} 5822 {{#ifCond template "===" "CartOrderlineMobile"}} 5823 {{>MiniCartOrderline}} 5824 {{/ifCond}} 5825 {{#ifCond template "===" "CartOrderlineDiscount"}} 5826 {{>MiniCartOrderlineDiscount}} 5827 {{/ifCond}} 5828 {{/OrderLines}} 5829 </text> 5830 } 5831 5832 @helper RenderMiniCartFees() 5833 { 5834 <div class="minicart__fees"> 5835 {{#ifCond isPayMethodEmpty "==" false}} 5836 <div class="minicart__payment"> 5837 <div>@Translate(Translations.Cart.Payment): <span>{{paymentmethod}}</span></div> 5838 <div>{{paymentfee}}</div> 5839 </div> 5840 {{/ifCond}} 5841 {{#ifCond isShipMethodEmpty "==" false}} 5842 <div class="minicart__shipping"> 5843 <div>@Translate(Translations.Cart.Shipping): <span>{{shippingmethod}}</span></div> 5844 <div>{{shippingfee}}</div> 5845 </div> 5846 {{/ifCond}} 5847 </div> 5848 } 5849 5850 @helper RenderMiniCartFooter() 5851 { 5852 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 5853 5854 <div class="sticky--bottom"> 5855 @RenderBlockList(subBlocks) 5856 </div> 5857 } 5858 5859 @helper RenderMiniCartActions() 5860 { 5861 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5862 var DesignFolder = Pageview.Layout.Design.Name; 5863 <div class="minicart__actions"> 5864 @* <button type="button" class="btn-border--dark" title="@Translate(Translations.Cart.EmptyCart)" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate(Translations.Cart.EmptyCart)</button> *@ 5865 <button type="button" class="btn-icon" data-role="empty-cart" data-url="/Default.aspx?ID=@areaInfo.MiniCartFeedPage.ID&cartcmd=emptycart&redirect=false" message-success="@Translate(Translations.Cart.EmptyCart)" title="@Translate(Translations.Cart.EmptyCart)" data-tooltip-content="@Translate(Translations.Cart.EmptyCart)"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/delete.svg"></ion-icon><span class="visible-xs">@Translate(Translations.Cart.DeleteProducts)</span></button> 5866 <a class="btn btn-fill--buy" href="@areaInfo.LinkStart@areaInfo.CartPage.ID" title="@Translate(Translations.Cart.ProceedToCheckout)"><span>@Translate(Translations.Cart.ProceedToCheckout)</span></a> 5867 <button type="button" data-role="minicart-trigger" class="btn btn-fill--dark btn-continue-shopping">@Translate(Translations.Cart.ContinueShopping) </button> 5868 </div> 5869 5870 } 5871 5872 @helper RenderMiniCartPoints() 5873 { 5874 <text> 5875 {{#if earnings}} 5876 <div class="minicart__points"> 5877 <div>@Translate(Translations.Cart.Earnings)</div> 5878 <div> 5879 <span>{{earnings}}</span> @Translate(Translations.Cart.Points) 5880 </div> 5881 </div> 5882 {{/if}} 5883 </text> 5884 } 5885 5886 @helper RenderMiniCartTotal() 5887 { 5888 <div class="minicart__summary list"> 5889 <div class="item"> 5890 <div>@Translate(Translations.Cart.Total)</div> 5891 <div class="minicart__total">{{{totalprice}}}</div> 5892 </div> 5893 5894 </div> 5895 } 5896 5897 5898 @helper RenderMiniCartPanelDesign() 5899 { 5900 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5901 var DesignFolder = Pageview.Layout.Design.Name; 5902 5903 <div class="minicart" id="minicart"> 5904 <div class="minicart__header sticky--top"> 5905 <button class="btn-icon minicart__close" data-role="minicart-trigger"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/close-raw.svg"></ion-icon></button> 5906 <h3 class="minicart__heading">@Translate(Translations.Cart.ShoppingCart)</h3> 5907 </div> 5908 5909 <div id="miniCartContent" data-template="MiniCartContent" data-json="@areaInfo.LinkStart@areaInfo.MiniCartFeedPage.ID&feedType=MiniCart"></div> 5910 </div> 5911 } 5912 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5913 5914 @using System 5915 @using System.Web 5916 @using Dynamicweb.Rapido.Blocks.Extensibility 5917 @using Dynamicweb.Rapido.Blocks 5918 5919 @{ 5920 if (!areaInfo.OnlyPreviewForAnonymous && !string.IsNullOrEmpty(areaInfo.AddToCartNotificationType)) { 5921 if (areaInfo.AddToCartNotificationType == "modal") 5922 { 5923 Block addToCartNotificationModal = new Block 5924 { 5925 Id = "AddToCartNotificationModal", 5926 Template = RenderAddToCartNotificationModal() 5927 }; 5928 5929 Block addToCartNotificationScript = new Block 5930 { 5931 Id = "AddToCartNotificationScript", 5932 Template = RenderAddToCartNotificationModalScript() 5933 }; 5934 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 5935 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5936 } 5937 else if (areaInfo.AddToCartNotificationType == "toggle" && !areaInfo.AddToCartHideCartIcon && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 5938 { 5939 Block addToCartNotificationScript = new Block 5940 { 5941 Id = "AddToCartNotificationScript", 5942 Template = RenderAddToCartNotificationToggleScript() 5943 }; 5944 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5945 } 5946 } 5947 } 5948 5949 @helper RenderAddToCartNotificationModal() 5950 { 5951 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 5952 } 5953 5954 @helper RenderAddToCartNotificationModalScript() 5955 { 5956 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5957 5958 <script id="LastAddedProductTemplate" type="text/x-template"> 5959 <!-- Trigger for the login modal --> 5960 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 5961 5962 <!-- Login modal --> 5963 <div class="modal-container"> 5964 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 5965 <div class="modal modal--md"> 5966 <div class="modal__header"> 5967 <h2>@Translate(Translations.Cart.ProductIsAddedToTheCart)</h2> 5968 </div> 5969 <div class="modal__body"> 5970 <a href="{{productInfo.link}}"> 5971 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 5972 </a> 5973 <span>{{quantity}}</span> x 5974 <div>{{productInfo.name}}</div> 5975 {{#if productInfo.variantName}} 5976 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 5977 {{/if}} 5978 {{#if productInfo.unitName}} 5979 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 5980 {{/if}} 5981 </div> 5982 <div class="modal__footer"> 5983 <label for="LastAddedProductModalTrigger">@Translate(Translations.Cart.ContinueShopping)</label> 5984 <a href="@areaInfo.LinkStart@areaInfo.CartPage.ID">@Translate(Translations.Cart.ProceedToCheckout)</a> 5985 </div> 5986 <label for="LastAddedProductModalTrigger"></label> 5987 </div> 5988 </div> 5989 </script> 5990 <script> 5991 document.addEventListener('addToCart', function (event) { 5992 Cart.ShowLastAddedProductModal(event.detail); 5993 }); 5994 </script> 5995 } 5996 5997 @helper RenderAddToCartNotificationToggleScript() 5998 { 5999 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6000 <script> 6001 document.addEventListener('addToCart', function () { 6002 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@areaInfo.MiniCartFeedPage.ID'); 6003 }); 6004 </script> 6005 } 6006 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6007 6008 @using System 6009 @using System.Web 6010 @using Df.Dw 6011 @using Dynamicweb.Rapido.Blocks.Extensibility 6012 @using Dynamicweb.Rapido.Blocks 6013 @using Df.Dw.Rapido 6014 @* using System.Collections.Generic *@ 6015 6016 @functions { 6017 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 6018 } 6019 6020 @{ 6021 Block masterFooterContent = new Block() 6022 { 6023 Id = "MasterFooterContent", 6024 SortId = 10, 6025 Template = RenderFooter(areaInfo), 6026 SkipRenderBlocksList = true 6027 }; 6028 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 6029 6030 Block masterFooter1 = new Block() 6031 { 6032 Id = "MasterFooter1", 6033 SortId = 10, 6034 Design = new Design 6035 { 6036 Size = "12", 6037 RenderType = RenderType.Column, 6038 CssClass = "c1" 6039 } 6040 }; 6041 footerBlocksPage.Add("MasterFooterContent", masterFooter1); 6042 6043 Block masterFooter2 = new Block() 6044 { 6045 Id = "MasterFooter2", 6046 SortId = 20, 6047 Design = new Design 6048 { 6049 Size = "12", 6050 RenderType = RenderType.Column, 6051 CssClass = "c2" 6052 } 6053 }; 6054 footerBlocksPage.Add("MasterFooterContent", masterFooter2); 6055 6056 Block masterFooter3 = new Block() 6057 { 6058 Id = "MasterFooter3", 6059 SortId = 30, 6060 Design = new Design 6061 { 6062 Size = "12", 6063 RenderType = RenderType.Column, 6064 CssClass = "c3" 6065 } 6066 }; 6067 footerBlocksPage.Add("MasterFooterContent", masterFooter3); 6068 6069 Block masterFooter4 = new Block() 6070 { 6071 Id = "MasterFooter4", 6072 SortId = 40, 6073 Design = new Design 6074 { 6075 Size = "12", 6076 RenderType = RenderType.Column, 6077 CssClass = "c4" 6078 } 6079 }; 6080 footerBlocksPage.Add("MasterFooterContent", masterFooter4); 6081 6082 Block masterFooter5 = new Block() 6083 { 6084 Id = "MasterFooter5", 6085 SortId = 50, 6086 Design = new Design 6087 { 6088 Size = "12", 6089 RenderType = RenderType.Column, 6090 CssClass = "c5" 6091 } 6092 }; 6093 footerBlocksPage.Add("MasterFooterContent", masterFooter5); 6094 6095 Block masterFooter6 = new Block() 6096 { 6097 Id = "MasterFooter6", 6098 SortId = 60, 6099 Design = new Design 6100 { 6101 Size = "12", 6102 RenderType = RenderType.Column, 6103 CssClass = "c6" 6104 } 6105 }; 6106 footerBlocksPage.Add("MasterFooterContent", masterFooter6); 6107 6108 Block masterFooter7 = new Block() 6109 { 6110 Id = "MasterFooter7", 6111 SortId = 70, 6112 Design = new Design 6113 { 6114 Size = "12", 6115 RenderType = RenderType.Column, 6116 CssClass = "c7" 6117 } 6118 }; 6119 footerBlocksPage.Add("MasterFooterContent", masterFooter7); 6120 6121 Block masterFooter8 = new Block() 6122 { 6123 Id = "MasterFooter8", 6124 SortId = 80, 6125 Design = new Design 6126 { 6127 Size = "12", 6128 RenderType = RenderType.Column, 6129 CssClass = "c8" 6130 } 6131 }; 6132 footerBlocksPage.Add("MasterFooterContent", masterFooter8); 6133 6134 6135 //content Blocks 6136 Block masterFooterLogo = new Block 6137 { 6138 Id = "FooterLogo", 6139 SortId = 10, 6140 Template = RenderFooterLogo(areaInfo), 6141 Design = new Design{ 6142 CssClass = "footer__logo" 6143 } 6144 }; 6145 6146 Block masterFooterAddress = new Block 6147 { 6148 Id = "FooterAddress", 6149 SortId = 10, 6150 Template = RenderFooterAddress(areaInfo), 6151 Design = new Design{ 6152 CssClass = "footer__address" 6153 } 6154 }; 6155 6156 Block masterFooterColumnOne = new Block 6157 { 6158 Id = "MasterFooterColumnOne", 6159 SortId = 10, 6160 Template = RenderFooterColumn(areaInfo.FooterColumnOneHeader, areaInfo.FooterColumnOneContent, areaInfo.FooterColumnOneLinks, "footer__column-one") 6161 }; 6162 6163 Block masterFooterColumnTwo = new Block 6164 { 6165 Id = "MasterFooterColumnTwo", 6166 SortId = 20, 6167 Template = RenderFooterColumn(areaInfo.FooterColumnTwoHeader, areaInfo.FooterColumnTwoContent, areaInfo.FooterColumnTwoLinks, "footer__column-two") 6168 }; 6169 6170 Block masterFooterColumnThree = new Block 6171 { 6172 Id = "MasterFooterColumnThree", 6173 SortId = 30, 6174 Template = RenderFooterColumn(areaInfo.FooterColumnThreeHeader, areaInfo.FooterColumnThreeContent, areaInfo.FooterColumnThreeLinks, "footer__column-three") 6175 }; 6176 6177 Block masterFooterNewsletterSignUp = new Block 6178 { 6179 Id = "MasterFooterNewsletterSignUp", 6180 SortId = 9, 6181 Template = RenderFooterNewsletterSignUp(areaInfo), 6182 Design = new Design{ 6183 CssClass = "footer__newsletter" 6184 } 6185 }; 6186 6187 Block masterFooterSocialLinks = new Block 6188 { 6189 Id = "MasterFooterSocialLinks", 6190 SortId = 50, 6191 Template = RenderFooterSocialLinks(areaInfo), 6192 Design = new Design{ 6193 CssClass = "footer__social" 6194 } 6195 }; 6196 6197 Block masterFooterPayments = new Block 6198 { 6199 Id = "MasterFooterPayments", 6200 SortId = 60, 6201 Template = RenderFooterPayments(areaInfo), 6202 Design = new Design{ 6203 CssClass = "footer__payments" 6204 } 6205 }; 6206 6207 Block masterFooterCopyright = new Block 6208 { 6209 Id = "MasterFooterCopyright", 6210 SortId = 70, 6211 Design = new Design{ 6212 CssClass = "footer__copyright" 6213 } 6214 }; 6215 6216 Block compareModal = new Block 6217 { 6218 Id = "MasterFooterModalCompare", 6219 SortId = 80, 6220 Template = RenderCompareModule(), 6221 Design = new Design 6222 { 6223 Size = "12", 6224 RenderType = RenderType.Column 6225 }, 6226 SkipRenderBlocksList = true 6227 }; 6228 footerBlocksPage.Add("MasterFooterContent", compareModal); 6229 6230 6231 //Begin configuration of blocks 6232 string footerLayout = areaInfo.FooterLayout; 6233 6234 switch (footerLayout) 6235 { 6236 case "1": 6237 masterFooter1.Design.Size = "3"; 6238 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6239 footerBlocksPage.Add("MasterFooter1", masterFooterAddress); 6240 footerBlocksPage.RemoveBlock(masterFooterSocialLinks); 6241 footerBlocksPage.Add("MasterFooter1", masterFooterPayments); 6242 6243 masterFooter2.Design.Size = "3"; 6244 footerBlocksPage.Add("MasterFooter2", masterFooterColumnOne); 6245 6246 masterFooter3.Design.Size = "3"; 6247 footerBlocksPage.Add("MasterFooter3", masterFooterColumnTwo); 6248 6249 masterFooter4.Design.Size = "3"; 6250 footerBlocksPage.Add("MasterFooter4", masterFooterColumnThree); 6251 footerBlocksPage.Add("MasterFooter4", masterFooterSocialLinks); 6252 6253 footerBlocksPage.Add("MasterFooter5", masterFooterCopyright); 6254 6255 footerBlocksPage.RemoveBlock(masterFooter6); 6256 footerBlocksPage.RemoveBlock(masterFooter7); 6257 footerBlocksPage.RemoveBlock(masterFooter8); 6258 break; 6259 6260 case "2": 6261 masterFooter1.Design.Size = "12"; 6262 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6263 footerBlocksPage.Add("MasterFooter1", masterFooterSocialLinks); 6264 6265 masterFooter2.Design.Size = "3"; 6266 footerBlocksPage.Add("MasterFooter2", masterFooterAddress); 6267 footerBlocksPage.Add("MasterFooter2", masterFooterPayments); 6268 6269 masterFooter3.Design.Size = "3"; 6270 footerBlocksPage.Add("MasterFooter3", masterFooterColumnOne); 6271 6272 masterFooter4.Design.Size = "3"; 6273 footerBlocksPage.Add("MasterFooter4", masterFooterColumnTwo); 6274 6275 masterFooter5.Design.Size = "3"; 6276 footerBlocksPage.Add("MasterFooter5", masterFooterColumnThree); 6277 6278 footerBlocksPage.Add("MasterFooter6", masterFooterCopyright); 6279 6280 footerBlocksPage.RemoveBlock(masterFooter7); 6281 footerBlocksPage.RemoveBlock(masterFooter8); 6282 break; 6283 6284 default: 6285 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6286 footerBlocksPage.Add("MasterFooter1", masterFooterAddress); 6287 footerBlocksPage.Add("MasterFooter1", masterFooterSocialLinks); 6288 footerBlocksPage.Add("MasterFooter1", masterFooterPayments); 6289 6290 masterFooter2.Design.Size = "3"; 6291 footerBlocksPage.Add("MasterFooter2", masterFooterColumnOne); 6292 6293 masterFooter3.Design.Size = "3"; 6294 footerBlocksPage.Add("MasterFooter3", masterFooterColumnTwo); 6295 6296 masterFooter4.Design.Size = "3"; 6297 footerBlocksPage.Add("MasterFooter4", masterFooterColumnThree); 6298 6299 footerBlocksPage.Add("MasterFooter5", masterFooterCopyright); 6300 footerBlocksPage.RemoveBlock(masterFooter6); 6301 footerBlocksPage.RemoveBlock(masterFooter7); 6302 footerBlocksPage.RemoveBlock(masterFooter8); 6303 break; 6304 } 6305 } 6306 6307 @helper RenderFooter(Df.Dw.Rapido.AreaInfo areaInfo) { 6308 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 6309 string footerClass = "footer__theme-" + areaInfo.FooterLayout; 6310 bool isMobileApp = !String.IsNullOrEmpty(HttpContext.Current.Request["mobileApp"]) ? true : false; 6311 6312 if(!isMobileApp){ 6313 <footer class="footer vars section__container container @footerClass"> 6314 <div class="footer__content section__content grid"> 6315 @RenderBlockList(subBlocks) 6316 </div> 6317 </footer> 6318 @RenderFooterCopyright(areaInfo) 6319 } 6320 } 6321 6322 6323 @helper RenderFooterLogo(Df.Dw.Rapido.AreaInfo areaInfo) 6324 { 6325 var footerLogo = ""; 6326 if (Path.GetExtension(areaInfo.FooterLogo).ToLower() != ".svg") 6327 { 6328 footerLogo = "/Admin/Public/GetImage.ashx?height=60&amp;crop=5&amp;Compression=75&amp;image=" + areaInfo.FooterLogo; 6329 } 6330 else 6331 { 6332 footerLogo = HttpUtility.UrlDecode(areaInfo.FooterLogo); 6333 } 6334 6335 <div class="logo L"> 6336 <a href="@areaInfo.FirstPageLink"> 6337 <img class="logo__img" src="@areaInfo.FooterLogo" alt="@Translate(Translations.General.Logo)" /> 6338 </a> 6339 </div> 6340 } 6341 @helper RenderFooterColumn(string header, string content, IList<ItemViewModel> links, string className = "column") { 6342 if (content.HasValue() || header.HasValue()) 6343 { 6344 <div class="@className"> 6345 @if (header.HasValue()) 6346 { 6347 <h5 class="footer__heading h5">@header</h5> 6348 } 6349 6350 @if(links.Any()){ 6351 <ul class="footer-links"> 6352 @foreach(var pageLink in links){ 6353 string link = pageLink.GetString("Link"); 6354 string title = pageLink.GetString("Title"); 6355 string icon = pageLink.GetString("Icon"); 6356 string newWindow = pageLink.GetBoolean("NewWindow") ? " target=\"_blank\"" : ""; 6357 <li class="footer-links__item"> 6358 @if (!string.IsNullOrEmpty(newWindow)) 6359 { 6360 <a href="@link" @newWindow rel="noreferrer" class="footer-links__link">@icon @title</a> 6361 } 6362 else 6363 { 6364 <a href="@link" class="footer-links__link">@icon @title</a> 6365 } 6366 6367 </li> 6368 } 6369 </ul> 6370 }else{ 6371 <div class="content"> 6372 @content 6373 </div> 6374 } 6375 </div> 6376 } 6377 } 6378 6379 @helper RenderFooterNewsletterSignUp(Df.Dw.Rapido.AreaInfo areaInfo) { 6380 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 6381 { 6382 6383 <div class="newsletter"> 6384 <h5 class="footer__heading h5">@Translate(Translations.General.MailingList)</h5> 6385 <div class="footer__content"> 6386 <form class="form" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 6387 <input name="ID" value="@areaInfo.NewsletterSignUpPage.ID" type="hidden" /> 6388 <label for="NewsletterEmail">@Translate(Translations.General.SignUpMessage)</label> 6389 <div class="form__field-combi newsletter__input"> 6390 <df-input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate(Translations.General.YourEmailAddress)' value="" ></df-input> 6391 <button type="submit" id="Submitter">@Translate(Translations.General.Go)</button> 6392 </div> 6393 </form> 6394 </div> 6395 </div> 6396 } 6397 } 6398 6399 @helper RenderFooterSocialLinks(Df.Dw.Rapido.AreaInfo areaInfo) { 6400 var DesignFolder = Pageview.Layout.Design.Name; 6401 if (areaInfo.FooterSocialLinks != null && areaInfo.FooterSocialLinks.Count > 0) 6402 { 6403 6404 <div class="contact"> 6405 @*<h5 class="footer__heading h5">@Translate(Translations.General.SocialLinks)</h5> *@ 6406 6407 <div class="contact__social-media"> 6408 @foreach (var socialitem in areaInfo.FooterSocialLinks) 6409 { 6410 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 6411 string socialIconImage = socialIcon.SelectedValue; 6412 string socialIconTitle = socialIcon.SelectedName; 6413 string socialLink = socialitem.GetString("Link"); 6414 6415 <a href="@socialLink" target="_blank" title="@socialIconTitle" rel="noopener" class=""><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/@socialIconImage"></ion-icon></a> 6416 } 6417 6418 </div> 6419 </div> 6420 } 6421 } 6422 6423 @helper RenderFooterPayments(Df.Dw.Rapido.AreaInfo areaInfo) { 6424 <div class="payment--icons"> 6425 @foreach (var payment in areaInfo.FooterPayments) 6426 { 6427 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 6428 string paymentImage = null; 6429 string paymentTitle = paymentItem.SelectedName; 6430 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 6431 if (selected != null) 6432 { 6433 paymentImage = selected.Icon; 6434 } 6435 6436 <img class="b-lazy" src="/Admin/Public/GetImage.ashx?height=40&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 6437 } 6438 </div> 6439 } 6440 6441 @helper RenderFooterCopyright(Df.Dw.Rapido.AreaInfo areaInfo) { 6442 <div class="section__container container copyright"> 6443 <div class="section__content"> 6444 <div class="col-12"> 6445 @areaInfo.FooterCopyrightText 6446 </div> 6447 </div> 6448 </div> 6449 } 6450 6451 @helper RenderFooterAddress(Df.Dw.Rapido.AreaInfo areaInfo) 6452 { 6453 <div class="company-address"> 6454 <p>@areaInfo.CompanyAddressStreetAddress, @areaInfo.CompanyAddressPostalCode</p> 6455 <p>@areaInfo.CompanyAddressCity, @areaInfo.CompanyAddressRegion</p> 6456 <p>@areaInfo.CompanyAddressCountry</p> 6457 <p>@areaInfo.ContactEmail</p> 6458 <p>@areaInfo.ContactNumber</p> 6459 </div> 6460 6461 } 6462 6463 @helper RenderCompareModule() { 6464 var compareMaxItems = Pageview.Device.ToString() == "Mobile" ? "2" : "3"; 6465 var DesignFolder = Pageview.Layout.Design.Name; 6466 <div class="row compareWrapper hidden" 6467 data-compare-new-list="@Translate("Compare new list")" 6468 data-compare-keep-list="@Translate("Compare keep list")" 6469 data-compare-different-group="@Translate("Compare product is in different group")" 6470 data-compare-list-full="@Translate("Compare list is full")" data-compare-max-items="@compareMaxItems"> 6471 6472 <div class="compareHeader"> 6473 <span> @Translate("Compare products")</span> 6474 <button id="collapseCompareWrapper" class="btn-icon" title="@Translate("Compare products")"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/compare.svg"></ion-icon></button> 6475 </div> 6476 6477 <div class="compareList"></div> 6478 <div class="compareButton"><a class="btn btn-border--dark" id="df-compare" data-initial-link="/Default.aspx?ID=@GetPageIdByNavigationTag("ProductsPage")&compare=" href="/Default.aspx?ID=@GetPageIdByNavigationTag("ProductsPage")&compare=">@Translate("Compare products")</a></div> 6479 <div class="compareButtonClose"><a class="btn btn-border--dark close-compare-list full-width">@Translate("Close compare list")</a></div> 6480 </div> 6481 } 6482 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6483 6484 @using System 6485 @using System.Web 6486 @using Dynamicweb.Rapido.Blocks.Extensibility 6487 @using Dynamicweb.Rapido.Blocks 6488 @using Dynamicweb.Ecommerce.Common 6489 @* using System.Collections.Generic *@ 6490 6491 @{ 6492 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 6493 6494 Block masterScriptReferences = new Block() 6495 { 6496 Id = "MasterScriptReferences", 6497 SortId = 1, 6498 Template = RenderMasterScriptReferences() 6499 }; 6500 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 6501 } 6502 6503 @helper RenderMasterScriptReferences() { 6504 @* <script src="/Files/Templates/Designs/Wizaris/dist/js/app.min.js"></script> *@ 6505 @* PushPromise("/Files/Templates/Designs/Wizaris/dist/js/app.min.js"); *@ 6506 6507 @RenderSnippet("Script") 6508 } 6509 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6510 6511 @using System 6512 @using System.Web 6513 @using Df.Dw 6514 @using Dynamicweb.Rapido.Blocks.Extensibility 6515 @using Dynamicweb.Rapido.Blocks 6516 @* using System.Collections.Generic *@ 6517 6518 @{ 6519 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 6520 bool isFavoriteList = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("ListID")); 6521 6522 if (!areaInfo.NavigationItemsHideSearch || isFavoriteList) 6523 { 6524 Block masterSearchScriptTemplates = new Block() 6525 { 6526 Id = "MasterSearchScriptTemplates", 6527 SortId = 1, 6528 Template = RenderSearchScriptTemplates() 6529 }; 6530 6531 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 6532 } 6533 } 6534 6535 @helper RenderSearchScriptTemplates() 6536 { 6537 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6538 var user = User.GetCurrentExtranetUser(); 6539 bool onlyPreview = areaInfo.OnlyPreviewForAnonymous && user == null; 6540 var DesignFolder = Pageview.Layout.Design.Name; 6541 var userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 6542 6543 <div class="stock-notif-translates" 6544 data-notification-already-sent="@Translate(Translations.Products.NotifyWhenBackOnStockAlreadySent)" 6545 data-notification-registered="@Translate(Translations.Products.NotifyWhenBackOnStockRegistered)"></div> 6546 6547 <script id="SearchGroupsTemplate" type="text/x-template"> 6548 {{#.}} 6549 <li class="dropdown__item" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 6550 {{/.}} 6551 </script> 6552 6553 <script id="SearchProductsTemplate" type="text/x-template"> 6554 {{#each this}} 6555 {{#Product}} 6556 {{#ifCond template "!==" "SearchMore"}} 6557 <li class="item"> 6558 @if (areaInfo.FacebookPixelID.HasValue()) 6559 { 6560 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 6561 } 6562 @if (areaInfo.GoogleTagManagerID.HasValue()) 6563 { 6564 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 6565 } 6566 6567 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="item__title" title="{{name}}"> 6568 <div class="{{noimage}} item__image"><img class="b-lazy" src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" data-src="" alt="{{name}}"></div> 6569 6570 <div class="item__name">{{name}}</div> 6571 @if (areaInfo.ShowPrice && !onlyPreview) 6572 { 6573 if (areaInfo.PointShopOnly) 6574 { 6575 <text> 6576 {{#if havePointPrice}} 6577 <span>{{points}}</span> @Translate(Translations.Cart.Points) 6578 {{else}} 6579 <small>@Translate(Translations.General.NotAvailable)</small> 6580 {{/if}} 6581 {{#unless canBePurchasedWithPoints}} 6582 {{#if havePointPrice}} 6583 <small>@Translate(Translations.Cart.NotEnoughPointsToBuyThis)</small> 6584 {{/if}} 6585 {{/unless}} 6586 </text> 6587 } 6588 else 6589 { 6590 <div class="span-2 py-1">{{price}}</div> 6591 } 6592 } 6593 6594 </a> 6595 <div class="item__actions"> 6596 @if (areaInfo.ProductListShowCartButton && !onlyPreview) { 6597 if (areaInfo.PointShopOnly) 6598 { 6599 <button type="button" class="btn-icon--dark {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 6600 onclick="Cart.AddToCart(event, { 6601 id: '{{productId}}', 6602 quantity: 1, 6603 buyForPoints: true, 6604 productInfo: {{productInfo}} 6605 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 6606 <ion-icon name="arrow-forward"></ion-icon> 6607 </button> 6608 } else { 6609 6610 <text>{{#ifCond stockValue '>' 0}}</text> 6611 <form> 6612 <input type="hidden" name="ProductID" value="{{productId}}" /> 6613 @*<input type="hidden" name="Quantity" value="1" />*@ 6614 <input type="hidden" name="ID" value="@areaInfo.MiniCartFeedPage.ID.ToString()" /> 6615 <input type="hidden" name="redirect" value="false" /> 6616 <input type="hidden" name="CartCmd" value="add" /> 6617 <df-quantity name="Quantity" value="1" class="item__quantity"></df-quantity> 6618 <button type="button" class="btn-icon {{hideBuyOptions}} item__addToCart" data-role="add-to-cart" message-success="@Translate(Translations.Cart.ProductIsAddedToTheCart)"> 6619 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/cart.svg"></ion-icon> 6620 </button> 6621 </form> 6622 <text>{{else}}</text> 6623 @* Logic : if user is anonymous , we show the modal asking for email: otherwise the email is retrieved from account *@ 6624 if (userIsLoggedIn) 6625 { 6626 var notifyWhenBackOnStockLink = "/Default.aspx?ID=" + GetPageIdByNavigationTag("ProductsPage") + "&ProductID={{productId}}&VariantID={{variantId}}" + "&cartcmd=createnotificationforthisproduct"; 6627 <text>{{#ifCond notificationRegistered '==' false}}</text> 6628 <button type="button" class="btn-fill--accent icon-right search-result-notify-when-back-in-stock" data-create-notify="{{notifyWhenBackOnStockLink}}" data-notified="false" data-user-logged-in="true" data-tooltip-content="@Translate(Translations.Products.NotifyWhenBackOnStock)"> 6629 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6630 </button> 6631 <text>{{else}}</text> 6632 <button type="button" class="btn-fill--accent icon-right search-result-notify-when-back-in-stock" data-notified="true" data-user-logged-in="true" data-tooltip-content="@Translate(Translations.Products.NotifyWhenBackOnStockSent)"> 6633 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6634 </button> 6635 <text>{{/ifCond}}</text> 6636 } 6637 else 6638 { 6639 <text>{{#ifCond notificationRegistered '==' false}}</text> 6640 <button type="button" class="btn-fill--accent icon-right search-result-notify-when-back-in-stock" data-notified onclick="openModal({id:'notifyWhenBackOnStock{{productId}}'})" data-tooltip-content="@Translate(Translations.Products.NotifyWhenBackOnStock)"> 6641 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6642 </button> 6643 <df-modal id="notifyWhenBackOnStock{{productId}}" 6644 data-product-name="{{name}}" 6645 heading="@Translate(Translations.Products.NotifyWhenBackOnStock)"> 6646 <span> 6647 {{#ifCond notificationRegistered '==' false}} 6648 <form name="{{productId}}" action="/Default.aspx?ID=@GetPageIdByNavigationTag("ProductsPage")" class="full-width notify-stock-form"> 6649 <input type="hidden" name="ProductID" id="ProductID" value="{{productId}}" /> 6650 <input type="hidden" name="VariantID" id="VariantID" value="{{variantId}}" /> 6651 <input type="hidden" name="CartCmd" id="CartCmd" value="createnotificationforthisproduct" /> 6652 <df-input type="email" class="mb-3" id="NotificationEmail" name="NotificationEmail" placeholder="@Translate(Translations.General.YourEmailAddress)"></df-input> 6653 <button type="submit" class="create-stock-notification-request btn-fill--brand">@Translate(Translations.Account.CreateRequest)</button> 6654 </form> 6655 {{else}} 6656 <p>@Translate(Translations.Products.NotifyWhenBackOnStockAlreadySent)</p> 6657 {{/ifCond}} 6658 </span> 6659 </df-modal> 6660 <text>{{else}}</text> 6661 <button type="button" class="btn-fill--accent icon-right search-result-notify-when-back-in-stock" data-notified="true" data-user-logged-in="false" data-tooltip-content="@Translate(Translations.Products.NotifyWhenBackOnStockSent)"> 6662 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6663 </button> 6664 <text>{{/ifCond}}</text> 6665 } 6666 <text>{{/ifCond}}</text> 6667 6668 6669 6670 } 6671 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn-icon--dark item__goToProduct {{hideViewMore}}" title="@Translate(Translations.General.View)"><ion-icon name="arrow-forward"></ion-icon></a> 6672 } 6673 else if (areaInfo.ProductListShowViewButton) 6674 { 6675 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn js-ignore-click-outside" title="@Translate(Translations.General.View)">@Translate(Translations.General.View)</a> 6676 } 6677 @if (areaInfo.ProductListShowAddToDownloadButton) 6678 { 6679 <button type="button" class="btn js-add-to-downloads" title="@Translate(Translations.General.Add)" data-product-id="{{productId}}"> 6680 <i class="fas fa-plus js-button-icon"></i> 6681 </button> 6682 } 6683 </div> 6684 </li> 6685 {{/ifCond}} 6686 {{#ifCond template "===" "SearchMore"}} 6687 @*{{>SearchMoreProducts}}*@ 6688 <li class="item item--full {{stickToBottom}}"> 6689 <button type="button" class="btn-icon typeahead__submit icon-right" data-results-page="/Default.aspx?ID=@areaInfo.ProductsPage.ID"><ion-icon src="/Files/Templates/Designs/Atomico/icons/default/view-list.svg"></ion-icon><span>@Translate(Translations.General.ViewAll)</span></button> 6690 </li> 6691 {{/ifCond}} 6692 {{/Product}} 6693 {{else}} 6694 <li class="dropdown__item"> 6695 @Translate(Translations.General.YourSearchGave0Results) 6696 </li> 6697 {{/each}} 6698 </script> 6699 6700 <script id="RecentSearchesTemplate" type="text/x-template"> 6701 <li class="recent-searches-header"> 6702 <h4>@Translate(Translations.Products.RecentSearches)</h4> 6703 <button class="clear-recent-searches"> Clear </button> 6704 </li> 6705 {{#each RecentSearches}} 6706 <li> {{this}} </li> 6707 {{/each}} 6708 </script> 6709 6710 <script id="SearchCategoriesTemplate" type="text/x-template"> 6711 <df-select id="headerSearch__categories" name="headerSearch__categories" value="" label="@Translate(Translations.Products.Categories)"> 6712 {{#each this}} 6713 <df-option value="{{id}}" label="{{name}}"><span>{{name}}</span></df-option> 6714 {{/each}} 6715 </df-select> 6716 6717 </script> 6718 6719 <script id="SearchMoreProducts" type="text/x-template"> 6720 <li class="dropdown__item {{stickToBottom}}"> 6721 <button type="button" class="btn" data-results-page="/Default.aspx?ID=@areaInfo.ProductsPage.ID"> @Translate(Translations.General.ViewAll)</button> 6722 </li> 6723 </script> 6724 6725 <script id="SearchMorePages" type="text/x-template"> 6726 <li class="dropdown__item {{stickToBottom}}"> 6727 <button type="button" class="btn" data-results-page="/Default.aspx?ID=@areaInfo.ProductsPage.ID"> @Translate(Translations.General.ViewAll)</button> 6728 </li> 6729 </script> 6730 6731 <script id="SearchPagesTemplate" type="text/x-template"> 6732 {{#each .}} 6733 {{#ifCond template "!==" "SearchMore"}} 6734 <li class="dropdown__item"> 6735 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link"> 6736 <i class="fa {{icon}}"></i> 6737 <div class="js-typeahead-name">{{name}}</div> 6738 </a> 6739 </li> 6740 {{/ifCond}} 6741 {{#ifCond template "===" "SearchMore"}} 6742 {{>SearchMorePages}} 6743 {{/ifCond}} 6744 {{else}} 6745 <li> 6746 @Translate(Translations.General.YourSearchGave0Results) 6747 </li> 6748 {{/each}} 6749 </script> 6750 6751 <script id="SearchPagesTemplateWrap" type="text/x-template"> 6752 <div class="dropdown__column-header">@Translate(Translations.General.Pages)</div> 6753 <ul class="dropdown__list"> 6754 {{>SearchPagesTemplate}} 6755 </ul> 6756 </script> 6757 6758 <script id="SearchProductsTemplateWrap" type="text/x-template"> 6759 <div>@Translate(Translations.Products.ProductsGeneral)</div> 6760 <ul> 6761 {{>SearchProductsTemplate}} 6762 </ul> 6763 </script> 6764 6765 6766 } 6767 6768 6769 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6770 6771 @using System 6772 @using System.Web 6773 @using Df.Dw 6774 @using Dynamicweb.Rapido.Blocks.Extensibility 6775 @using Dynamicweb.Rapido.Blocks 6776 @* using System.Collections.Generic *@ 6777 6778 @{ 6779 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 6780 6781 Block primaryBottomSnippets = new Block() 6782 { 6783 Id = "MasterJavascriptInitializers", 6784 SortId = 100, 6785 Template = RenderPrimaryBottomSnippets() 6786 }; 6787 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 6788 } 6789 6790 @helper RenderPrimaryBottomSnippets() { 6791 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6792 6793 if (areaInfo.IsWireframeMode) 6794 { 6795 <script> 6796 Wireframe.Init(true); 6797 </script> 6798 } 6799 6800 6801 if (areaInfo.GoogleTagManagerID.HasValue()) 6802 { 6803 <script> 6804 document.addEventListener('addToCart', function(event) { 6805 var googleImpression = event.detail.productInfo.googleImpression; 6806 dataLayer.push({ 6807 'event': 'addToCart', 6808 'ecommerce': { 6809 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 6810 'add': { 6811 'products': [{ 6812 'name': googleImpression.name, 6813 'id': googleImpression.id, 6814 'price': googleImpression.price, 6815 'brand': googleImpression.brand, 6816 'category': googleImpression.category, 6817 'variant': googleImpression.variant, 6818 'quantity': event.detail.quantity 6819 }] 6820 } 6821 } 6822 }); 6823 }); 6824 </script> 6825 } 6826 6827 //if digitalwarehouse 6828 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 6829 { 6830 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 6831 6832 if (!cartContextId.HasValue()) { 6833 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 6834 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 6835 cartContextId = cartSettings.OrderContextID; 6836 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 6837 } 6838 6839 <script> 6840 let downloadCart = new DownloadCart({ 6841 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 6842 contextId: "@cartContextId", 6843 addButtonText: "@Translate(Translations.General.Add)", 6844 removeButtonText: "@Translate(Translations.General.Remove)" 6845 }); 6846 </script> 6847 } 6848 <!--@Javascripts--> 6849 6850 @RenderSnippet("Messenger") 6851 } 6852 6853 6854 6855 6856 @if (File.Exists(HttpContext.Current.Server.MapPath("Files/Templates/Designs/@DesignFolder/MasterBlocks/Custom__Blocks.cshtml"))) 6857 { 6858 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6859 6860 @using System 6861 @using System.Web 6862 @using Dynamicweb.Rapido.Blocks 6863 @using Dynamicweb.Rapido.Blocks.Extensibility 6864 @* using System.Collections.Generic *@ 6865 6866 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6867 6868 @using System 6869 @using System.Web 6870 @using Df.Dw 6871 @using Dynamicweb.Rapido.Blocks.Extensibility 6872 @using Dynamicweb.Rapido.Blocks 6873 @* using System.Collections.Generic *@ 6874 6875 6876 @{ 6877 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 6878 { 6879 Block masterToolsCustom = new Block() 6880 { 6881 Id = "MasterDesktopTools", 6882 SortId = 30, 6883 Template = RenderDesktopToolsCustom(), 6884 SkipRenderBlocksList = true, 6885 BlocksList = new List<Block> 6886 { 6887 new Block { 6888 Id = "MasterDesktopToolsText", 6889 SortId = 10, 6890 Template = RenderDesktopToolsTextCustom() 6891 }, 6892 new Block { 6893 Id = "MasterDesktopToolsNavigation", 6894 SortId = 20, 6895 Template = RenderDesktopToolsNavigationCustom() 6896 } 6897 } 6898 }; 6899 headerBlocksPage.ReplaceBlock(masterToolsCustom); 6900 } 6901 } 6902 6903 @helper RenderDesktopToolsCustom() 6904 { 6905 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 6906 6907 if (subBlocks.Count > 0) 6908 { 6909 <div class="m">@RenderBlockList(subBlocks)</div> 6910 } 6911 } 6912 6913 @helper RenderDesktopToolsTextCustom() 6914 { 6915 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6916 6917 if (areaInfo.ToolsText.HasValue()) 6918 { 6919 <div class="nav--tertiary m1"> 6920 <span><i class="@areaInfo.PhoneIcon"></i> @areaInfo.ContactNumber</span> 6921 <span><i class="@areaInfo.EmailIcon"></i> @areaInfo.ContactEmail</span> 6922 </div> 6923 } 6924 } 6925 6926 @helper RenderDesktopToolsNavigationCustom() 6927 { 6928 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6929 6930 @* if (areaInfo.RenderPagesInToolBar) 6931 { *@ 6932 <div class="nav--secondary m2"> 6933 @* @RenderNavigation(new 6934 { 6935 id = "topToolsNavigation", 6936 template = "TopMenu.xslt" 6937 }) *@ 6938 Urmareste comanda 6939 @RenderLanguageSelectorCustom() 6940 </div> 6941 @* } *@ 6942 } 6943 6944 @helper RenderLanguageSelectorCustom() 6945 { 6946 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6947 6948 if (Model.Languages.Count > 1) 6949 { 6950 6951 <div> 6952 <i class="@areaInfo.LanguageIcon"></i> 6953 </div> 6954 <div> 6955 @foreach (var lang in Model.Languages) 6956 { 6957 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>" + lang.Name; 6958 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 6959 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 6960 6961 if (areaInfo.LanguageViewType == "flag-culture") 6962 { 6963 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 6964 } 6965 6966 if (areaInfo.LanguageViewType == "flag") 6967 { 6968 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 6969 } 6970 6971 if (areaInfo.LanguageViewType == "name") 6972 { 6973 langInfo = lang.Name; 6974 } 6975 6976 if (areaInfo.LanguageViewType == "culture") 6977 { 6978 langInfo = cultureName; 6979 } 6980 6981 <div> 6982 <a href="@areaInfo.LinkStart@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID">@langInfo</a> 6983 </div> 6984 } 6985 </div> 6986 } 6987 }</text> 6988 } 6989 6990 6991 @functions { 6992 public class ManifestIcon 6993 { 6994 public string 6995 src, 6996 type, 6997 sizes; 6998 } 6999 7000 public class Manifest 7001 { 7002 public string 7003 name, 7004 short_name, 7005 start_url, 7006 display, 7007 background_color, 7008 theme_color; 7009 public List<ManifestIcon> icons; 7010 } 7011 } 7012 7013 @{ 7014 if (areaInfo.AppName != null && areaInfo.AppIcon != null) { 7015 Manifest manifest = new Manifest 7016 { 7017 name = areaInfo.AppName, 7018 short_name = areaInfo.AppShortName != null ? areaInfo.AppShortName : areaInfo.AppName, 7019 start_url = "/", 7020 display = "standalone", 7021 background_color = areaInfo.AppBackgroundColor, 7022 theme_color = areaInfo.AppThemeColor 7023 }; 7024 7025 manifest.icons = new List<ManifestIcon> { 7026 new ManifestIcon { 7027 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7028 sizes = "192x192", 7029 type = "image/png" 7030 }, 7031 new ManifestIcon { 7032 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7033 sizes = "512x512", 7034 type = "image/png" 7035 }, 7036 new ManifestIcon { 7037 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7038 sizes = "1024x1024", 7039 type = "image/png" 7040 } 7041 }; 7042 7043 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/"+DesignFolder+"/manifest.json"); 7044 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 7045 string currentManifest = File.ReadAllText(manifestFilePath); 7046 7047 if (manifestJSON != currentManifest) 7048 { 7049 File.WriteAllText(manifestFilePath, manifestJSON); 7050 } 7051 } 7052 } 7053 7054 7055 @{ 7056 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 7057 var brandColors = swatches.GetColorSwatch(1); 7058 string brandColorOne = brandColors.Palette["BrandColor1"]; 7059 string currentLang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 7060 7061 7062 } 7063 7064 <!DOCTYPE html> 7065 7066 <html lang="@currentLang"> 7067 <head> 7068 <link rel="dns-prefetch" href="//fonts.googleapis.com"> 7069 <link rel="dns-prefetch" href="https://use.typekit.net"> 7070 <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> 7071 <link rel="preconnect" href="https://use.typekit.net" crossorigin> 7072 <!-- Global site tag (gtag.js) - Google Analytics --> 7073 <script defer src="https://www.googletagmanager.com/gtag/js?id=UA-162570117-1"></script> 7074 <script> 7075 window.dataLayer = window.dataLayer || []; 7076 function gtag(){dataLayer.push(arguments);} 7077 gtag('js', new Date()); 7078 7079 gtag('config', 'UA-162570117-1'); 7080 </script> 7081 7082 7083 7084 7085 <!-- Rapido version 3.1.1 --> 7086 <meta charset="utf-8"/> 7087 <title>@areaInfo.AreaTitle</title> 7088 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7089 <meta name="robots" content="index, follow"> 7090 <meta name="theme-color" content="@areaInfo.AppThemeColor"/> 7091 7092 @{ 7093 if (!Model.MetaTags.Contains("og:image")) 7094 { 7095 if(Model.PropertyItem.GetFile("OpenGraphImage") != null) 7096 { 7097 Pageview.Meta.AddTag("og:image", string.Format("{0}://{1}{2}", Dynamicweb.Context.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, Model.PropertyItem.GetFile("OpenGraphImage"))); 7098 } 7099 } 7100 7101 if (!Model.MetaTags.Contains("og:description")) { 7102 Pageview.Meta.AddTag("og:description", Model.Description); 7103 } 7104 7105 Pageview.Meta.AddTag("og:title", Model.Title); 7106 Pageview.Meta.AddTag("og:site_name", Model.Name); 7107 Pageview.Meta.AddTag("og:url", HttpContext.Current.Request.Url.ToString()); 7108 Pageview.Meta.AddTag("og:type", "Website"); 7109 Pageview.Meta.AddTag("fb:page_id", Model.ID.ToString()); 7110 } 7111 7112 @Model.MetaTags 7113 7114 7115 <!-- Favicon --> 7116 <link href="@areaInfo.LogoFavicon" rel="icon" type="image/png"> 7117 7118 @* <link relnpm="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"> *@ 7119 7120 @* Libraries *@ 7121 <!-- Google fonts --> 7122 @{ 7123 var family = string.Join("%7C", fonts.Where(x => !string.IsNullOrEmpty(x)).Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 7124 } 7125 @* <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> *@ 7126 <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet"> 7127 <link rel="stylesheet" href="https://use.typekit.net/mki7ofu.css" > 7128 <link rel="stylesheet" id="variablesCss" href="@autoCssLink" type="text/css"> 7129 7130 7131 @* <link rel="stylesheet" href="@wizarisCssLink" type="text/css"> *@ 7132 <link rel="stylesheet" type="text/css" href="@ApplicationCssLink"> 7133 <link rel="stylesheet" type="text/css" href="@ApplicationDeferCssLink"> 7134 7135 7136 @if (areaInfo.AppName.HasValue()) 7137 { 7138 <link rel="manifest" href="/Files/Templates/Designs/@DesignFolder/manifest.json"> 7139 PushPromise("/Files/Templates/Designs/@DesignFolder/manifest.json"); 7140 } 7141 </head> 7142 7143 <body @areaInfo.HeaderSticky @areaInfo.PageBackground> 7144 7145 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 7146 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 7147 7148 @helper RenderMasterTop() 7149 { 7150 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 7151 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeaderTop").OrderBy(item => item.SortId).ToList(); 7152 7153 <div class="@areaInfo.CenterContainer"> 7154 @RenderBlockList(subBlocks) 7155 </div> 7156 } 7157 @helper RenderMasterHeader() 7158 { 7159 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 7160 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 7161 7162 <header class="header @areaInfo.CenterContainer @areaInfo.CustomHeaderClass" id="Top"> 7163 @{ 7164 bool editParameterSection = !String.IsNullOrEmpty(HttpContext.Current.Request["edit"]) ? true : false; 7165 } 7166 @if (editParameterSection) 7167 { 7168 <div class="local-config"> 7169 <button type="button" class="switcher" name="style-1" value="1">1</button> 7170 <button type="button" class="switcher" name="style-1" value="2">2</button> 7171 <button type="button" class="switcher" name="style-1" value="3">3</button> 7172 <button type="button" class="switcher" name="style-1" value="4">4</button> 7173 <button type="button" class="switcher" name="style-1" value="5">5</button> 7174 <button type="button" class="switcher" name="style-1" value="6">6</button> 7175 </div> 7176 } 7177 7178 @RenderBlockList(subBlocks) 7179 </header> 7180 } 7181 7182 @helper RenderMain() 7183 { 7184 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 7185 7186 @RenderBlockList(subBlocks) 7187 } 7188 7189 @helper RenderPageContent() 7190 { 7191 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7192 7193 7194 @using Dynamicweb.Rapido.Blocks.Components 7195 @using Dynamicweb.Rapido.Blocks.Components.Articles 7196 @using Dynamicweb.Rapido.Blocks.Components.General 7197 @using Dynamicweb.Rapido.Blocks 7198 7199 @functions { 7200 BlocksPage articlePage = BlocksPage.GetBlockPage("NewsArticle"); 7201 } 7202 7203 @{ 7204 string image = !String.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").PathUrlEncoded : ""; 7205 7206 ArticleHeader topBanner = new ArticleHeader 7207 { 7208 Layout = ArticleHeaderLayout.Clean, 7209 Image = new Image { Path = image }, 7210 Heading = Model.Item.GetString("Title"), 7211 Subheading = Model.Item.GetString("Summary"), 7212 TextColor = "#fff", 7213 Category = Model.Item.GetString("Author"), 7214 Date = Model.Item.GetString("Date"), 7215 ButtonLayout = ButtonLayout.Primary, 7216 TextLayout = ArticleHeaderTextLayout.Full 7217 }; 7218 7219 ButtonLayout buttonDesign; 7220 Enum.TryParse<ButtonLayout>(Model.Item.GetString("ButtonDesign"), out buttonDesign); 7221 if (Enum.GetName(typeof(ButtonLayout), buttonDesign).ToLower() == "none") 7222 { 7223 buttonDesign = ButtonLayout.Primary; 7224 } 7225 7226 Block articleContainer = new Block 7227 { 7228 Id = "ArticleContainer", 7229 SortId = 10, 7230 Design = new Design 7231 { 7232 RenderType = RenderType.Row 7233 }, 7234 BlocksList = new List<Block> { 7235 new Block { 7236 Id = "ArticleBody", 7237 SortId = 20, 7238 Design = new Design { 7239 RenderType = RenderType.Column, 7240 Size = "8" 7241 }, 7242 BlocksList = new List<Block> { 7243 new Block { 7244 Id = "ArticleBodyRow", 7245 SortId = 10, 7246 Design = new Design { 7247 RenderType = RenderType.Row 7248 }, 7249 BlocksList = new List<Block> { 7250 new Block { 7251 Id = "ArticleHeader", 7252 SortId = 10, 7253 Component = topBanner, 7254 Design = new Design { 7255 RenderType = RenderType.Column, 7256 Size = "12", 7257 HidePadding = true, 7258 CssClass = "article-head" 7259 } 7260 }, 7261 new Block { 7262 Id = "ArticleText", 7263 SortId = 20, 7264 Component = new ArticleText { Text = Model.Item.GetString("Text") }, 7265 Design = new Design { 7266 RenderType = RenderType.Column, 7267 Size = "12", 7268 CssClass = "u-padding--lg" 7269 } 7270 }, 7271 new Block { 7272 Id = "ArticleLink", 7273 SortId = 30, 7274 Component = new ArticleLink { Link = Model.Item.GetString("Link"), Title = Model.Item.GetString("LinkText"), ButtonLayout = buttonDesign }, 7275 Design = new Design { 7276 RenderType = RenderType.Column, 7277 Size = "12", 7278 CssClass = "u-padding--lg u-ta-right" 7279 } 7280 } 7281 } 7282 } 7283 } 7284 } 7285 } 7286 }; 7287 articlePage.Add(articleContainer); 7288 7289 if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 7290 { 7291 Block breadcrumb = new Block 7292 { 7293 Id = "ArticleBreadcrumb", 7294 SortId = 10, 7295 Component = new BreadcrumbNavigation { }, 7296 Design = new Design 7297 { 7298 RenderType = RenderType.Column, 7299 Size = "12" 7300 } 7301 }; 7302 articlePage.Add("ArticleContainer", breadcrumb); 7303 } 7304 } 7305 7306 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 7307 @RenderBlockList(articlePage.BlocksRoot.BlocksList) 7308 </text> 7309 } 7310 @RenderSnippet("BottomJS") 7311 7312 7313 7314 7315 <script type="module" src="https://unpkg.com/ionicons@5.0.0/dist/ionicons/ionicons.esm.js" defer></script> 7316 @* TODO: Florin: mutate callurile de axios in fisier JS *@ 7317 <script src="https://cdn.jsdelivr.net/npm/noty@3.1.4/lib/noty.min.js" defer></script> 7318 <script src="https://cdn.jsdelivr.net/npm/handlebars@4.7.6/dist/handlebars.min.js" defer></script> 7319 <script src="https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js" defer></script> 7320 <script src="https://cdn.jsdelivr.net/npm/flatpickr" defer></script> 7321 <script src="https://cdn.jsdelivr.net/npm/js-image-zoom/js-image-zoom.min.js" defer></script> 7322 <script src="https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js" defer></script> 7323 <script src="https://unpkg.com/@("@popperjs")/core@2" defer></script> 7324 <script src="https://unpkg.com/tippy.js@6" defer></script> 7325 7326 <script src="/Files/Templates/Designs/@DesignFolder/js/translations/translations_21.js" defer></script> 7327 @if (!string.IsNullOrEmpty(googleAPIKey)) 7328 { 7329 <script src="https://maps.googleapis.com/maps/api/js?key=@googleAPIKey&libraries=places&language=@currentLang" defer></script> 7330 } 7331 @* <script type="module" src="/Files/Templates/Designs/@DesignFolder/js/app.js"></script> *@ 7332 @* <script type="module" src="/Files/Templates/Designs/@DesignFolder/dist/app.bundle.js"></script> *@ 7333 @{ 7334 string scriptBundle = "/Files/Templates/Designs/"+DesignFolder+"/dist/app.bundle.js?ticks=" + Model.Area.UpdatedDate.Ticks; 7335 } 7336 <script src="@scriptBundle" defer></script> 7337 7338 7339 <script> 7340 7341 7342 window.googleEnchantImpressionClick = function (googleImpression) { 7343 if (typeof dataLayer !== 'undefined') { 7344 dataLayer.push({ 7345 'event': 'productClick', 7346 'ecommerce': { 7347 'click': { 7348 'actionField': { 7349 'list': googleImpression.list 7350 }, 7351 // Optional list property. 7352 'products': [{ 7353 'name': googleImpression.name, 7354 // Name or ID is required. 7355 'id': googleImpression.id, 7356 'price': googleImpression.price, 7357 'brand': googleImpression.brand, 7358 'category': googleImpression.category, 7359 'variant': googleImpression.variant, 7360 'position': googleImpression.position 7361 }] 7362 } 7363 }, 7364 'eventCallback': function () { 7365 console.log('callback from googleImpression' , googleImpression) 7366 // document.location = googleImpression.url; 7367 } 7368 }); 7369 } 7370 }; 7371 </script> 7372 7373 7374 </body> 7375 </html> 7376 7377