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_38ba077007dc4a0e82d4975cb8b6bc79.b__159_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7230
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.b__157_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7212
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.<>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_38ba077007dc4a0e82d4975cb8b6bc79.Execute() in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\NewsArticle.parsed.cshtml:line 7172
   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 @* 3427 <!-- Google Tag Manager (noscript) --> 3428 <noscript> 3429 <iframe src="https://www.googletagmanager.com/ns.html?id=@areaInfo.GoogleTagManagerID" 3430 height="0" width="0" style="display:none;visibility:hidden"></iframe> 3431 </noscript> 3432 <!-- End Google Tag Manager (noscript) --> 3433 *@ 3434 } 3435 } 3436 3437 @helper RenderFacebookPixel() { 3438 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3439 3440 if (areaInfo.FacebookPixelID.HasValue()) 3441 { 3442 <!-- Facebook Pixel Code --> 3443 <script> 3444 !function(f,b,e,v,n,t,s) 3445 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 3446 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 3447 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 3448 n.queue=[];t=b.createElement(e);t.async=!0; 3449 t.src=v;s=b.getElementsByTagName(e)[0]; 3450 s.parentNode.insertBefore(t,s)}(window, document,'script', 3451 'https://connect.facebook.net/en_US/fbevents.js'); 3452 fbq('init', '@areaInfo.FacebookPixelID'); 3453 fbq('track', 'PageView'); 3454 </script> 3455 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@areaInfo.FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 3456 } 3457 } 3458 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3459 3460 @using System 3461 @using System.Web 3462 @using Dynamicweb.Rapido.Blocks 3463 @using Dynamicweb.Rapido.Blocks.Extensibility 3464 @using Dynamicweb.Security.UserManagement 3465 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 3466 @* using System.Collections.Generic *@ 3467 3468 @{ 3469 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 3470 3471 Block loginModal = new Block() 3472 { 3473 Id = "LoginModal", 3474 SortId = 10, 3475 Template = LoginModal() 3476 }; 3477 3478 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 3479 } 3480 3481 @helper LoginModal() { 3482 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3483 string userSignedInErrorText = ""; 3484 string loginJsonPage = GetPageIdByNavigationTag("LoginJSON").ToString(); 3485 var cultureInfo = Pageview.Area; 3486 var countryService = new Dynamicweb.Ecommerce.International.CountryService(); 3487 var DesignFolder = Pageview.Layout.Design.Name; 3488 3489 if (Model.LogOnFailed) { 3490 switch (Model.LogOnFailedReason) 3491 { 3492 case LogOnFailedReason.PasswordLengthInvalid: 3493 userSignedInErrorText = Translate(Translations.Account.PasswordLengthIsInvalid); 3494 break; 3495 case LogOnFailedReason.IncorrectLogin: 3496 userSignedInErrorText = Translate(Translations.Account.InvalidEmailOrPassword); 3497 break; 3498 case LogOnFailedReason.ExceededFailedLogOnLimit: 3499 userSignedInErrorText = Translate(Translations.Account.LimitOfAllowedLoginAttempts); 3500 break; 3501 case LogOnFailedReason.LoginLocked: 3502 userSignedInErrorText = Translate(Translations.Account.TheUserAccountIsTemporarilyLocked); 3503 break; 3504 case LogOnFailedReason.PasswordExpired: 3505 userSignedInErrorText = Translate(Translations.Account.ThePasswordHasExpired); 3506 break; 3507 default: 3508 userSignedInErrorText = Translate(Translations.Account.AnUnknownErrorOccured); 3509 break; 3510 } 3511 } 3512 3513 3514 <!-- Trigger for the login modal --> 3515 <df-modal id="SignInModal" class="login-container"> 3516 <span class="login__form-wrapper"> 3517 <div class="content__login"> 3518 <div class="content__login-img"> 3519 <a href="@areaInfo.FirstPageLink"> 3520 <img class="logo__img" src="@areaInfo.FooterLogo" alt="@Translate(Translations.General.Logo)" /> 3521 </a> 3522 </div> 3523 <div class="content__login-text"><h3>@Translate(Translations.General.LoginModalHeading)</h3> 3524 <h5>@Translate(Translations.General.LoginModalSubHeading)</h5> 3525 </div> 3526 </div> 3527 <div class="form__section"> 3528 <div class="tab"> 3529 <div class="tablinks" data-tab="Login"><h3>@Translate(Translations.Account.LogIn)</h3></div> 3530 <div class="tablinks" data-tab="CreateAccount"><h3>@Translate(Translations.Account.CreateAccount)</h3></div> 3531 </div> 3532 <div id="Login" class="tab-content"> 3533 <form method="post" id="Modal__LoginForm" class="u-no-margin login-form" data-json-page="/Default.aspx?ID=@loginJsonPage"> 3534 <input type="hidden" name="ID" value="@areaInfo.PageId" /> 3535 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 3536 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 3537 <df-input class="item" type="text" name="username" id="Modal__username" label="@Translate(Translations.Account.Username)" value="" required></df-input> 3538 <df-input class="item" type="password" name="password" id="Modal__password" label="@Translate(Translations.Account.Password)" value="" required></df-input> 3539 <div class="field-error dw-mod">@userSignedInErrorText</div> 3540 3541 3542 <df-checkbox class="item" name="Autologin" id="Modal__Autologin" value="True" checked><span>@Translate(Translations.Account.RememberMe)</span></df-checkbox> 3543 3544 <div class="login__actions"> 3545 <button type="submit" class="btn-fill--brand mb-2" name="LoginAction" value="Login">@Translate(Translations.Account.SignIn)</button> 3546 <a href="@areaInfo.ForgotPasswordPageLink" class="forgot--password">@Translate(Translations.Account.ForgotYourPassword)</a> 3547 </div> 3548 3549 </form> 3550 </div> 3551 <div id="CreateAccount" class="tab-content"> 3552 <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)"> 3553 <input type="hidden" name="UserManagementForm" value="1"> 3554 <input type="hidden" name="CreateUser" value="true"> 3555 <input type="hidden" name="UserManagement_Form_CountryCode" value="@cultureInfo.EcomCountryCode"> 3556 <input type="hidden" name="UserManagement_Form_Country" value="@countryService.GetCountry(cultureInfo.EcomCountryCode).Name"> 3557 <input type="hidden" name="UserManagement_Form_Currency" value="@cultureInfo.EcomCurrencyId"> 3558 <input type="hidden" name="UserManagement_Form_ShopId" value="@cultureInfo.EcomShopId"> 3559 <input type="checkbox" class="hidden" name="UserManagement_Form_DisableLivePrices" value="1" checked="checked"> 3560 <input class="firstname-and-lastname" type="hidden" name="UserManagement_Form_Name" value=""> 3561 3562 3563 <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> 3564 <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> 3565 3566 <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> 3567 <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> 3568 <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> 3569 3570 <div class="display-flex terms__conditions item"> 3571 <df-checkbox data-accept-terms="@Translate("Accept T&C")" value="yes" id="EcomOrderCustomerAcceptedLogin" name="EcomOrderCustomerAccepted"><span></span></df-checkbox> 3572 <a href="@areaInfo.LinkStart@areaInfo.TermsAndConditions.ID&LayoutTemplate=Designs/@DesignFolder/clean.cshtml" class="openTAndC"><span>@Translate(Translations.General.IAcceptTheTermsAndConditions)</span></a> 3573 </div> 3574 3575 3576 <df-modal id="TermsAndCondModalLogin"> 3577 <span> 3578 </span> 3579 </df-modal> 3580 3581 <button type="submit" class="btn-fill--brand" id="submitter">@Translate(Translations.Account.CreateYourNewAccount)</button> 3582 3583 </form> 3584 </div> 3585 </div> 3586 3587 </span> 3588 </df-modal> 3589 3590 } 3591 3592 3593 3594 3595 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3596 3597 @using System 3598 @using System.Web 3599 @using Dynamicweb.Rapido.Blocks.Extensibility 3600 @using Dynamicweb.Rapido.Blocks 3601 @* using System.Collections.Generic *@ 3602 3603 @functions { 3604 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 3605 } 3606 3607 @{ 3608 bool mobileOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("mobileOnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3609 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"; 3610 bool mobileHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 3611 bool mobileHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart") || mobileOnlyPreview; 3612 3613 Block mobileHeader = new Block() 3614 { 3615 Id = "MobileTop", 3616 SortId = 10, 3617 Template = RenderMobileTop(), 3618 SkipRenderBlocksList = true 3619 }; 3620 mobileHeaderBlocksPage.Add("MasterReferences", mobileHeader); 3621 3622 Block mobileContactContainer = new Block() 3623 { 3624 Id = "MobileContactContainer", 3625 SortId = 90, 3626 Template = RenderMobileContactContainer(), 3627 SkipRenderBlocksList = true 3628 }; 3629 mobileHeaderBlocksPage.Add("MasterReferences", mobileContactContainer); 3630 3631 Block mobileHeaderNavigation = new Block() 3632 { 3633 Id = "MobileHeaderNavigation", 3634 SortId = 10, 3635 Template = RenderMobileHeaderNavigation(), 3636 SkipRenderBlocksList = true, 3637 Design = new Design 3638 { 3639 CssClass = "nav--primary M" 3640 }, 3641 // BlocksList = new List<Block> { 3642 // new Block { 3643 // Id = "MobileHeaderNavigationTrigger", 3644 // SortId = 10, 3645 // Template = RenderMobileHeaderNavigationTrigger() 3646 // } 3647 // } 3648 }; 3649 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3650 3651 Block mobileHeaderLogo = new Block() 3652 { 3653 Id = "MobileHeaderLogo", 3654 SortId = 20, 3655 Template = RenderMobileHeaderLogo(), 3656 SkipRenderBlocksList = true 3657 }; 3658 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3659 3660 Block mobileHeaderActions = new Block() 3661 { 3662 Id = "MobileHeaderActions", 3663 SortId = 30, 3664 Template = RenderMobileTopActions(), 3665 SkipRenderBlocksList = true 3666 }; 3667 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3668 3669 if (mobileHideSearch == false) 3670 { 3671 Block mobileHeaderSearch = new Block 3672 { 3673 Id = "MobileHeaderSearch", 3674 SortId = 10 3675 }; 3676 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3677 } 3678 3679 Block mobileHeaderMiniCart; 3680 3681 // if (!mobileHideCart) 3682 // { 3683 mobileHeaderMiniCart = new Block 3684 { 3685 Id = "MobileHeaderMiniCart", 3686 SortId = 20, 3687 Template = RenderMobileMiniCart() 3688 }; 3689 3690 Block miniCartCounterScriptTemplatev2 = new Block 3691 { 3692 Id = "MiniCartCounterScriptTemplate", 3693 Template = RenderMiniCartCounterContentRefactored() 3694 }; 3695 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplatev2); 3696 // } 3697 // else 3698 // { 3699 // mobileHeaderMiniCart = new Block 3700 // { 3701 // Id = "MobileHeaderMiniCart", 3702 // SortId = 20 3703 // }; 3704 // } 3705 3706 // user 3707 Block mobileHeaderUser = new Block 3708 { 3709 Id = "MobileHeaderUser", 3710 SortId = 10, 3711 Template = RenderMobileUser() 3712 }; 3713 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderUser); 3714 // end user 3715 3716 3717 if (!mobileHideSearch) 3718 { 3719 Block mobileHamburger = new Block 3720 { 3721 Id = "MobileHamburger", 3722 SortId = 40, 3723 Template = RenderMobileHamburger() 3724 }; 3725 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHamburger); 3726 } 3727 3728 3729 if (!mobileHideSearch) 3730 { 3731 Block mobileBottomSearch = new Block 3732 { 3733 Id = "MobileBottomSearch", 3734 SortId = 50, 3735 Template = RenderMobileSearch() 3736 }; 3737 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileBottomSearch); 3738 } 3739 3740 3741 3742 3743 // if (!mobileHideSearch) 3744 // { 3745 // Block mobileHeaderSearchBar = new Block() 3746 // { 3747 // Id = "MobileHeaderSearchBar", 3748 // SortId = 30, 3749 // Template = RenderMobileTopSearchBar(), 3750 // Design = new Design 3751 // { 3752 // CssClass = "nav--wrapper SC" 3753 // } 3754 // }; 3755 // mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3756 // } 3757 3758 switch (mobileTopLayout) 3759 { 3760 case "nav-left": 3761 mobileHeaderNavigation.SortId = 10; 3762 mobileHeaderLogo.SortId = 20; 3763 mobileHeaderActions.SortId = 30; 3764 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3765 break; 3766 case "nav-right": 3767 mobileHeaderLogo.SortId = 10; 3768 mobileHeaderActions.SortId = 20; 3769 mobileHeaderNavigation.SortId = 30; 3770 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3771 break; 3772 case "nav-search-left": 3773 mobileHeaderNavigation.SortId = 10; 3774 mobileHeaderLogo.SortId = 20; 3775 mobileHeaderActions.SortId = 30; 3776 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3777 break; 3778 case "search-left": 3779 mobileHeaderActions.SortId = 10; 3780 mobileHeaderLogo.SortId = 20; 3781 mobileHeaderNavigation.SortId = 30; 3782 mobileHeaderMiniCart.SortId = 0; 3783 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3784 break; 3785 } 3786 3787 if (!mobileOnlyPreview) 3788 { 3789 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", new Block { 3790 Id = "CartInitialization", 3791 Template = RenderMobileCartInitialization() 3792 }); 3793 } 3794 } 3795 3796 @helper RenderMobileCartInitialization() 3797 { 3798 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3799 <script> 3800 window.cartId = "@miniCartFeedPageId"; 3801 </script> 3802 } 3803 3804 @helper RenderMobileTop() { 3805 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3806 @RenderBlockList(subBlocks) 3807 } 3808 3809 @helper RenderMobileHeaderNavigation() { 3810 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3811 <ul class="menu"> 3812 @RenderBlockList(subBlocks) 3813 </ul> 3814 } 3815 3816 @helper RenderMobileHeaderNavigationTrigger() { 3817 <li> 3818 <label for="MobileNavTrigger" class="mobile-nav-trigger-button"></label> 3819 </li> 3820 } 3821 3822 @helper RenderMobileHeaderLogo() { 3823 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3824 3825 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"; 3826 //string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3827 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3828 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3829 3830 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3831 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3832 { 3833 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3834 } 3835 3836 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3837 { 3838 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3839 } 3840 else 3841 { 3842 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3843 } 3844 3845 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3846 var DesignFolder = Pageview.Layout.Design.Name; 3847 3848 <div class="mobile__logo"> 3849 <a href="/Default.aspx?ID=@firstPageId" class="mobile__logo__item"> <img src="@mobileLogo" alt="@businessName"/> </a> 3850 3851 @* <div class="icons"> *@ 3852 @* <div class="item"> *@ 3853 @* <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> *@ 3854 @* </div> *@ 3855 @* </div> *@ 3856 </div> 3857 3858 3859 @RenderBlockList(subBlocks) 3860 } 3861 3862 @helper RenderMobileContactContainer() { 3863 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 3864 var DesignFolder = Pageview.Layout.Design.Name; 3865 <div class="mobile-contact__container"> 3866 <div class="mobile-contact__content"> 3867 @if (!string.IsNullOrEmpty(areaInfo.ContactNumber)) 3868 { 3869 <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> 3870 } 3871 @if (!string.IsNullOrEmpty(areaInfo.ContactEmail)) 3872 { 3873 <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> 3874 } 3875 </div> 3876 </div> 3877 } 3878 3879 @helper RenderMobileTopActions() { 3880 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3881 3882 <div class="mobile__actions"> 3883 <div class="mobile__actions__content"> 3884 @RenderBlockList(subBlocks) 3885 </div> 3886 3887 </div> 3888 } 3889 3890 3891 @helper RenderMobileTopUser() { 3892 3893 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3894 string userInitials = ""; 3895 int pageId = Model.TopPage.ID; 3896 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3897 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 3898 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 3899 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 3900 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 3901 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 3902 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3903 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 3904 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 3905 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 3906 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 3907 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 3908 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 3909 3910 string linkStart = "/Default.aspx?ID="; 3911 if (Model.CurrentUser.ID <= 0) 3912 { 3913 linkStart += signInProfilePageId + "&RedirectPageId="; 3914 } 3915 3916 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3917 string myProfilePageLink = linkStart + myProfilePageId; 3918 string myOrdersPageLink = linkStart + myOrdersPageId; 3919 string myFavoritesPageLink = linkStart + myFavoritesPageId; 3920 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 3921 3922 string profileIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue : "fa fa-user"; 3923 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"; 3924 3925 if (Model.CurrentUser.ID != 0) 3926 { 3927 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 3928 { 3929 string[] names = Model.CurrentUser.Name.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); 3930 userInitials += Model.CurrentUser.Name.Substring(0, 1); 3931 3932 if (names.Length > 1) 3933 { 3934 userInitials += names[names.Length - 1].Substring(0, 1); 3935 } 3936 } 3937 else 3938 { 3939 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 3940 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 3941 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 3942 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 3943 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 3944 } 3945 } 3946 3947 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 3948 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 3949 3950 <li class="mobile-user"> 3951 <div class="@menuLinkClass"> 3952 @if (Model.CurrentUser.ID <= 0) 3953 { 3954 <label for="SignInModalTrigger"><ion-icon src="/Files/Templates/Designs/Wizaris/icons/default/account.svg"></ion-icon></label> 3955 } 3956 else 3957 { 3958 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><ion-icon src="/Files/Templates/Designs/Wizaris/icons/default/account.svg"></ion-icon></a> 3959 } 3960 </div> 3961 </li> 3962 } 3963 3964 @helper RenderMobileTopSearch() { 3965 <li> 3966 <label for="MobileSearchTrigger"> 3967 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 3968 </label> 3969 </li> 3970 } 3971 3972 @helper RenderMobileMiniCart() { 3973 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3974 // int cartPageId = GetPageIdByNavigationTag("CartPage"); 3975 // double cartProductsCount = Model.Cart.TotalProductsCount; 3976 var DesignFolder = Pageview.Layout.Design.Name; 3977 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 3978 string cartProductsTotalPriceReformated = Model.Cart.TotalPrice != null ? FormatPriceDecimals(Model.Cart.TotalPrice.Price.Formatted) : ""; 3979 <button class="mobile__minicart__trigger btn-icon" data-role="minicart-trigger"> 3980 <div id="cartCounterMobile" class="minicart__counter__content" data-template="MiniCartCounterContent" data-json="/Default.aspx?ID=@miniCartFeedPageId"> 3981 <div class="minicart__counter__icon mt-1"> 3982 <sup>@cartProductsCount</sup> 3983 <div class="ico"> 3984 <svg version="1.1" id="MobileMiniCart" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 3985 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 3986 <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 3987 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 3988 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 3989 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"/> 3990 </svg> 3991 </div> 3992 </div> 3993 @if(!string.IsNullOrEmpty(cartProductsTotalPriceReformated)) { 3994 <div class="minicart__counter__info"> 3995 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 3996 <div class="minicart__counter__price">@cartProductsTotalPriceReformated</div> 3997 </div> 3998 } 3999 </div> 4000 </button> 4001 4002 } 4003 4004 @helper RenderMobileTopSearchBar() 4005 { 4006 string searchFeedId = ""; 4007 string searchSecondFeedId = ""; 4008 int groupsFeedId; 4009 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 4010 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 4011 string resultPageLink; 4012 string searchPlaceholder; 4013 string searchType = "product-search"; 4014 string searchTemplate; 4015 string searchContentTemplate = ""; 4016 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4017 bool showGroups = true; 4018 4019 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 4020 { 4021 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4022 resultPageLink = contentSearchPageLink; 4023 searchPlaceholder = Translate("Search page"); 4024 groupsFeedId = 0; 4025 searchType = "content-search"; 4026 searchTemplate = "SearchPagesTemplate"; 4027 showGroups = false; 4028 } 4029 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 4030 { 4031 searchFeedId = productsPageId + "&feed=true"; 4032 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4033 resultPageLink = Converter.ToString(productsPageId); 4034 searchPlaceholder = Translate("Search products or pages"); 4035 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4036 searchType = "combined-search"; 4037 searchTemplate = "SearchProductsTemplateWrap"; 4038 searchContentTemplate = "SearchPagesTemplateWrap"; 4039 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4040 } 4041 else 4042 { 4043 resultPageLink = Converter.ToString(productsPageId); 4044 searchFeedId = productsPageId + "&feed=true"; 4045 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4046 searchPlaceholder = Translate("Search products"); 4047 searchTemplate = "SearchProductsTemplate"; 4048 searchType = "product-search"; 4049 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4050 } 4051 4052 4053 4054 <div class="search S"> 4055 @* <input type="checkbox" id="MobileSearchTrigger" /> 4056 <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"> *@ 4057 <input type="text" class="js-typeahead-search-field u-w160px u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 4058 @* @if (string.IsNullOrEmpty(searchSecondFeedId)) 4059 { 4060 <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> 4061 } 4062 else 4063 { 4064 <div> 4065 <div id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 4066 <div id="MobileContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 4067 </div> 4068 } *@ 4069 <button type="button"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 4070 @* </div> *@ 4071 </div> 4072 <div class="nav--header C"> 4073 <ul class="menu"> 4074 <li> 4075 <label for="MobileSearchTrigger"> 4076 <i class="fas fa-times fa-1_5x"></i> 4077 </label> 4078 </li> 4079 </ul> 4080 </div> 4081 } 4082 4083 @helper RenderMiniCartCounterContentRefactored() 4084 { 4085 var DesignFolder = Pageview.Layout.Design.Name; 4086 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4087 <script id="MiniCartCounterContent" type="text/x-template"> 4088 {{#.}} 4089 4090 <div class="minicart__counter__icon mt-1"> 4091 <sup>{{numberofproducts}}</sup> 4092 <div class="ico"> 4093 <svg version="1.1" id="MiniCartCounter" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4094 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4095 <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 4096 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 4097 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 4098 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"/> 4099 </svg> 4100 </div> 4101 </div> 4102 {{#ifCond totalprice '!==' ''}} 4103 <div class="minicart__counter__info"> 4104 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 4105 <div class="minicart__counter__price">{{{totalprice}}}</div> 4106 </div> 4107 {{/ifCond}} 4108 4109 4110 {{/.}} 4111 </script> 4112 } 4113 4114 @helper RenderMobileHamburger() { 4115 var DesignFolder = Pageview.Layout.Design.Name; 4116 @* <div class="hamburger-wrapper"> *@ 4117 @* <div id="hamburger-menu"> *@ 4118 @* <span class="hamburger-menu-global menu-top"></span> *@ 4119 @* <span class="hamburger-menu-global menu-middle"></span> *@ 4120 @* <span class="hamburger-menu-global menu-bottom"></span> *@ 4121 @* </div> *@ 4122 @* </div> *@ 4123 <button type="button" class="mobile__navigation__trigger btn-icon" data-role="open-mobile-menu" aria-label="Open menu"> 4124 <div class="ico hidden" data-state="on"> 4125 <svg version="1.1" id="MobileNavigation_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4126 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4127 <path d="M88,136h336v32H88V136z M88,240h336v32H88V240z M88,344h336v32H88V344z"/> 4128 </svg> 4129 </div> 4130 <div class="ico" data-state="off"> 4131 <svg version="1.1" id="MobileNavigation_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4132 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 4133 <path d="M88,136h336v32H88V136z M88,240h336v32H88V240z M88,344h336v32H88V344z"/> 4134 </svg> 4135 </div> 4136 </button> 4137 } 4138 4139 4140 @helper RenderMobileSearch() { 4141 var DesignFolder = Pageview.Layout.Design.Name; 4142 <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> 4143 } 4144 4145 @helper RenderListItemMobile(string link, string text, string icon = null, string cssClass = "") { 4146 <div class="item"> 4147 <a href="@link" class="btn btn-fill--brand"> 4148 @if (icon.HasValue()){<ion-icon src="@icon"></ion-icon>}<span>@text</span> 4149 </a> 4150 </div> 4151 } 4152 4153 @helper RenderMobileUser() { 4154 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4155 var user = User.GetCurrentExtranetUser(); 4156 var DesignFolder = Pageview.Layout.Design.Name; 4157 var customerOrdersPageId = user.IsB2b() ? GetPageIdByNavigationTag("CustomerOrders") : GetPageIdByNavigationTag("CustomerPlacedOrders"); 4158 4159 if (!areaInfo.NavigationItemsHideSignIn) 4160 { 4161 4162 if (user == null) 4163 { 4164 4165 <div class="mobile__profile"> 4166 <button type="button" class="btn-icon mobile__profile__trigger" aria-label="Open profile action menu"> 4167 <div class="ico"> 4168 <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> 4169 </div> 4170 </button> 4171 <div class="mobile__profile__details"> 4172 <div class="list"> 4173 <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> 4174 4175 @if (!areaInfo.HideCreateAccountLink) 4176 4177 { 4178 <div class="item"> 4179 4180 <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> 4181 </div> 4182 } 4183 4184 </div> 4185 </div> 4186 </div> 4187 } 4188 else { 4189 <div class="mobile__profile"> 4190 <button type="button" class="btn-icon mobile__profile__trigger" aria-label="Open profile action menu"> 4191 <sup>@user.GetInitials()</sup> 4192 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/account.svg"></ion-icon> 4193 </button> 4194 <div class="mobile__profile__details"> 4195 <div class="list"> 4196 <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> 4197 4198 @if (!areaInfo.HideMyProfileLink) 4199 { 4200 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.CustomerDashboardPage.ID, Translate(Translations.Account.MyProfile), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/account.svg") 4201 } 4202 @if (!areaInfo.HideMyOrdersLink) 4203 { 4204 @RenderListItemMobile(areaInfo.LinkStart + customerOrdersPageId, Translate(Translations.Account.MyOrders), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/view-details.svg") 4205 } 4206 @if (!areaInfo.HideMyFavorites) 4207 { 4208 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.MyFavoritesPage.ID, Translate(Translations.Account.MyFavorites), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/favorites-on.svg") 4209 } 4210 @if (!areaInfo.HideMySavedCardsLink) 4211 { 4212 @RenderListItemMobile(areaInfo.LinkStart + areaInfo.SavedCardsPage.ID, Translate(Translations.Account.MySavedCards), "/Files/Templates/Designs/" + DesignFolder + "/icons/default/card.svg") 4213 } 4214 4215 4216 </div> 4217 </div> 4218 4219 </div> 4220 4221 4222 4223 } 4224 } 4225 4226 } 4227 4228 4229 4230 4231 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4232 4233 @using System 4234 @using System.Web 4235 @using Dynamicweb.Rapido.Blocks.Extensibility 4236 @using Dynamicweb.Rapido.Blocks 4237 @* using System.Collections.Generic *@ 4238 4239 @functions { 4240 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 4241 } 4242 4243 @{ 4244 bool mobileNavigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4245 bool mobileHideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4246 bool mobileHideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4247 bool mobileHideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4248 bool mobileHideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4249 bool mobileHideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4250 4251 Block mobileNavigation = new Block() 4252 { 4253 Id = "MobileNavigation", 4254 SortId = 10, 4255 Template = MobileNavigation(), 4256 SkipRenderBlocksList = true 4257 }; 4258 mobileNavigationBlocksPage.Add("MasterReferences", mobileNavigation); 4259 4260 // if (Model.CurrentUser.ID > 0 && !mobileHideMyProfileLink) 4261 // { 4262 // Block mobileNavigationSignIn = new Block 4263 // { 4264 // Id = "MobileNavigationSignIn", 4265 // SortId = 10, 4266 // Template = RenderMobileNavigationSignIn() 4267 // }; 4268 // mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 4269 // } 4270 4271 Block mobileNavigationMenu = new Block 4272 { 4273 Id = "MobileNavigationMenu", 4274 SortId = 20, 4275 Template = RenderMobileNavigationMenu() 4276 }; 4277 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 4278 4279 Block mobileNavigationActions = new Block 4280 { 4281 Id = "MobileNavigationActions", 4282 SortId = 30, 4283 Template = RenderMobileNavigationActions(), 4284 SkipRenderBlocksList = true 4285 }; 4286 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4287 4288 if (!mobileNavigationItemsHideSignIn) 4289 { 4290 if (Model.CurrentUser.ID <= 0) 4291 { 4292 Block mobileNavigationSignInAction = new Block 4293 { 4294 Id = "MobileNavigationSignInAction", 4295 SortId = 10, 4296 Template = RenderMobileNavigationSignInAction() 4297 }; 4298 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4299 4300 if (!mobileHideCreateAccountLink) 4301 { 4302 Block mobileNavigationCreateAccountAction = new Block 4303 { 4304 Id = "MobileNavigationCreateAccountAction", 4305 SortId = 20, 4306 Template = RenderMobileNavigationCreateAccountAction() 4307 }; 4308 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4309 } 4310 } 4311 else 4312 { 4313 if (!mobileHideMyOrdersLink) 4314 { 4315 Block mobileNavigationOrdersAction = new Block 4316 { 4317 Id = "MobileNavigationOrdersAction", 4318 SortId = 20, 4319 Template = RenderMobileNavigationOrdersAction() 4320 }; 4321 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4322 } 4323 if (!mobileHideMyFavoritesLink) 4324 { 4325 Block mobileNavigationFavoritesAction = new Block 4326 { 4327 Id = "MobileNavigationFavoritesAction", 4328 SortId = 30, 4329 Template = RenderMobileNavigationFavoritesAction() 4330 }; 4331 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4332 } 4333 if (!mobileHideMySavedCardsLink) 4334 { 4335 Block mobileNavigationSavedCardsAction = new Block 4336 { 4337 Id = "MobileNavigationFavoritesAction", 4338 SortId = 30, 4339 Template = RenderMobileNavigationSavedCardsAction() 4340 }; 4341 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4342 } 4343 4344 Block mobileNavigationSignOutAction = new Block 4345 { 4346 Id = "MobileNavigationSignOutAction", 4347 SortId = 40, 4348 Template = RenderMobileNavigationSignOutAction() 4349 }; 4350 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4351 } 4352 } 4353 4354 if (Model.Languages.Count > 1) 4355 { 4356 Block mobileNavigationLanguagesAction = new Block 4357 { 4358 Id = "MobileNavigationLanguagesAction", 4359 SortId = 50, 4360 Template = RenderMobileNavigationLanguagesAction() 4361 }; 4362 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 4363 } 4364 } 4365 4366 4367 @helper MobileNavigation() 4368 { 4369 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4370 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4371 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4372 4373 <!-- Trigger for mobile navigation --> 4374 @* <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> *@ 4375 4376 <!-- Mobile navigation --> 4377 @RenderBlockList(subBlocks) 4378 4379 @* <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> *@ 4380 } 4381 4382 @helper RenderMobileNavigationSignIn() 4383 { 4384 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4385 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4386 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4387 string myProfilePageLink = linkStart + myProfilePageId; 4388 string userName = Model.CurrentUser.FirstName ?? ""; 4389 userName += " " + (Model.CurrentUser.LastName ?? ""); 4390 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 4391 4392 <ul class="RenderMobileNavigationSignIn"> 4393 <li> 4394 <a href="@myProfilePageLink"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @userName</a> 4395 </li> 4396 </ul> 4397 } 4398 4399 @helper RenderMobileNavigationMenu() 4400 { 4401 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4402 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4403 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "4"; 4404 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4405 int startLevel = renderPagesInToolBar ? 1 : 0; 4406 <div class="mobile__navigation"> 4407 @RenderNavigation(new 4408 { 4409 id = "mobilenavigation", 4410 cssclass = "nav", 4411 startLevel = @startLevel, 4412 ecomStartLevel = @startLevel + 1, 4413 endlevel = @levels, 4414 expandmode = "all", 4415 template = @menuTemplate 4416 }) 4417 4418 @if (renderPagesInToolBar) 4419 { 4420 @RenderNavigation(new 4421 { 4422 id = "topToolsMobileNavigation", 4423 cssclass = "nav", 4424 template = "ToolsMenuForMobile.xslt" 4425 }) 4426 } 4427 </div> 4428 <div class="mobile__navigation__backdrop"></div> 4429 } 4430 4431 @helper RenderMobileNavigationActions() 4432 { 4433 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4434 4435 @* <ul class="menu-mobile"> *@ 4436 @* @RenderBlockList(subBlocks) *@ 4437 @* </ul> *@ 4438 } 4439 4440 @helper RenderMobileNavigationSignInAction() 4441 { 4442 <li class="menu-mobile__item"> 4443 <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> 4444 </li> 4445 } 4446 4447 @helper RenderMobileNavigationCreateAccountAction() 4448 { 4449 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4450 4451 <li class="menu-mobile__item"> 4452 <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> 4453 </li> 4454 } 4455 4456 @helper RenderMobileNavigationProfileAction() 4457 { 4458 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4459 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4460 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4461 string myProfilePageLink = linkStart + myProfilePageId; 4462 4463 <li class="menu-mobile__item"> 4464 <a href="@myProfilePageLink"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 4465 </li> 4466 } 4467 4468 @helper RenderMobileNavigationOrdersAction() 4469 { 4470 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4471 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4472 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4473 string myOrdersPageLink = linkStart + myOrdersPageId; 4474 string ordersIcon = "fas fa-list"; 4475 4476 <li> 4477 <a href="@myOrdersPageLink"><i class="@ordersIcon menu-mobile__link-icon"></i> @Translate("My Orders")</a> 4478 </li> 4479 } 4480 4481 @helper RenderMobileNavigationFavoritesAction() 4482 { 4483 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4484 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4485 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4486 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4487 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"; 4488 4489 4490 <li> 4491 <a href="@myFavoritesPageLink"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 4492 </li> 4493 } 4494 4495 @helper RenderMobileNavigationSavedCardsAction() 4496 { 4497 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4498 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4499 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4500 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4501 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"; 4502 4503 <li> 4504 <a href="@mySavedCardsPageLink"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 4505 </li> 4506 } 4507 4508 @helper RenderMobileNavigationSignOutAction() 4509 { 4510 int pageId = Model.TopPage.ID; 4511 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"; 4512 4513 <li> 4514 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 4515 </li> 4516 } 4517 4518 @helper RenderMobileNavigationLanguagesAction() 4519 { 4520 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4521 4522 string selectedLanguage = ""; 4523 foreach (var lang in Model.Languages) 4524 { 4525 if (lang.IsCurrent) 4526 { 4527 selectedLanguage = lang.Name; 4528 } 4529 } 4530 4531 <li> 4532 @if (isSlidesDesign) 4533 { 4534 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 4535 } 4536 else 4537 { 4538 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 4539 } 4540 <div> 4541 <label for="MobileMenuCheck_Language"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 4542 <label for="MobileMenuCheck_Language"></label> 4543 </div> 4544 <ul> 4545 @if (isSlidesDesign) 4546 { 4547 <li> 4548 <div> 4549 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 4550 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 4551 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link">@Translate("Back")</label> 4552 </div> 4553 </li> 4554 } 4555 @foreach (var lang in Model.Languages) 4556 { 4557 <li> 4558 <a href="/Default.aspx?ID=@lang.Page.ID">@lang.Name</a> 4559 </li> 4560 } 4561 </ul> 4562 </li> 4563 } 4564 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4565 4566 @using System 4567 @using System.Web 4568 @using Df.Dw 4569 @using Dynamicweb.Rapido.Blocks.Extensibility 4570 @using Dynamicweb.Rapido.Blocks 4571 @* using System.Collections.Generic *@ 4572 4573 @functions { 4574 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 4575 } 4576 4577 @{ 4578 4579 Block masterTools = new Block() 4580 { 4581 Id = "MasterDesktopTools", 4582 SortId = 30, 4583 Template = RenderDesktopTools(), 4584 SkipRenderBlocksList = true, 4585 BlocksList = new List<Block> 4586 { 4587 new Block { 4588 Id = "MasterDesktopToolsText", 4589 SortId = 10, 4590 Template = RenderDesktopToolsText() 4591 }, 4592 new Block { 4593 Id = "MasterDesktopToolsNavigation", 4594 SortId = 20, 4595 Template = RenderDesktopToolsNavigation() 4596 } 4597 } 4598 }; 4599 headerBlocksPage.Add("MasterHeader", masterTools); 4600 4601 4602 Block masterDesktopExtra = new Block() 4603 { 4604 Id = "MasterDesktopExtra", 4605 SortId = 20, 4606 Template = RenderDesktopExtra(), 4607 SkipRenderBlocksList = true, 4608 Design = new Design 4609 { 4610 CssClass = "nav--wrapper SC" 4611 } 4612 }; 4613 headerBlocksPage.Add("MasterHeader", masterDesktopExtra); 4614 4615 Block masterDesktopNavigation = new Block() 4616 { 4617 Id = "MasterDesktopNavigation", 4618 SortId = 40, 4619 Template = RenderDesktopNavigation(), 4620 SkipRenderBlocksList = true 4621 4622 }; 4623 headerBlocksPage.Add("MasterHeader", masterDesktopNavigation); 4624 } 4625 4626 @* Include the Blocks for the page *@ 4627 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4628 4629 @using System 4630 @using System.Web 4631 @using Dynamicweb.Rapido.Blocks.Extensibility 4632 @using Dynamicweb.Rapido.Blocks 4633 4634 @{ 4635 Block masterDesktopLogo = new Block 4636 { 4637 Id = "MasterDesktopLogo", 4638 SortId = 10, 4639 Template = RenderDesktopLogo(), 4640 Design = new Design 4641 { 4642 CssClass = "logo L" 4643 } 4644 }; 4645 4646 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopLogo); 4647 } 4648 4649 4650 @helper RenderDesktopLogo() 4651 { 4652 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4653 var logo = ""; 4654 if (Path.GetExtension(areaInfo.Logo).ToLower() != ".svg") 4655 { 4656 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(areaInfo.LogoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + areaInfo.Logo; 4657 } 4658 else 4659 { 4660 logo = HttpUtility.UrlDecode(areaInfo.Logo); 4661 } 4662 4663 <a href="/"> 4664 <img class="logo__img" src="@areaInfo.Logo" alt="@Translate(Translations.General.Logo)" /> 4665 </a> 4666 } 4667 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4668 4669 @using System 4670 @using System.Web 4671 @using Dynamicweb.Rapido.Blocks.Extensibility 4672 @using Dynamicweb.Rapido.Blocks 4673 @using Dynamicweb.Frontend.Navigation 4674 @using WebGrease.Css.Extensions 4675 4676 @{ 4677 Block masterDesktopMenu = new Block 4678 { 4679 Id = "MasterDesktopMenu", 4680 SortId = 10, 4681 Template = RenderDesktopMenu() 4682 }; 4683 4684 BlocksPage.GetBlockPage("Master").Add("MasterDesktopNavigation", masterDesktopMenu); 4685 } 4686 4687 @helper RenderDesktopMenu() 4688 { 4689 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4690 var productsPageId = areaInfo.ProductsPage.ID; 4691 var navigationSettingsMain = new Dynamicweb.Frontend.Navigation.NavigationSettings() 4692 { 4693 StartLevel = 1, 4694 StopLevel = 5, 4695 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 4696 }; 4697 NavigationTreeViewModel navigation2 = GetNavigation(navigationSettingsMain); 4698 var megaMenuNodeList = navigation2.Nodes.FirstOrDefault(n => n.PageId == productsPageId) != null ? navigation2.Nodes.FirstOrDefault(n => n.PageId == productsPageId).Nodes : new List<NavigationTreeNodeViewModel>(); 4699 4700 if (areaInfo.IsMegaMenu) 4701 { 4702 if(megaMenuNodeList.Any()) 4703 { 4704 @ShowNavigationTreeMegamenu(navigation2.Nodes.First(n => n.PageId == productsPageId).Nodes.ToList(), 1) 4705 } 4706 } 4707 else 4708 { 4709 @ShowNavigationTreeDropdown(navigation2.Nodes.ToList(), 1) 4710 } 4711 } 4712 4713 @helper ShowNavigationTreeMegamenu(IList<NavigationTreeNodeViewModel> nodes, int level) 4714 { 4715 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4716 var DesignFolder = Pageview.Layout.Design.Name; 4717 <ul class="@(level == 1 ? "nav" : "megamenu__nav") menu-level@(level)"> 4718 @if (level == 1) { 4719 @* <li class="home"><a href="@areaInfo.FirstPageLink"><i class="@areaInfo.HomeIcon"></i></a></li> *@ 4720 <li class="home"><a href="/" aria-label="home"> 4721 <div class="ico"> 4722 <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> 4723 </div> 4724 </a></li> 4725 } 4726 @for (int i = 0; i < nodes.Count; ++i) 4727 { 4728 var node = nodes[i]; 4729 var children = node.Nodes.ToList(); 4730 4731 <li class="@(level == 1 && children.Any() ? "megamenu__nav" : "")"> 4732 <a href="@node.Link" class="megamenu__category--@level">@node.Name</a> 4733 @if (children.Any()) 4734 { 4735 if (level == 1) 4736 { 4737 <div class="megamenu__container" style="--columns: repeat(3,1fr) auto"> 4738 @for (int j = 0; j < 4; ++j) 4739 { 4740 @ShowNavigationTreeMegamenu(children.Where((n, index) => index % 4 == j).ToList(), level + 1) 4741 } 4742 </div> 4743 } 4744 else 4745 { 4746 @ShowNavigationTreeMegamenu(children, level + 1) 4747 } 4748 } 4749 </li> 4750 } 4751 </ul> 4752 } 4753 4754 @helper ShowNavigationTreeDropdown(IList<NavigationTreeNodeViewModel> nodes, int level) 4755 { 4756 <ul class="@(level == 1 ? "" : "menu")"> 4757 @for (int i = 0; i < nodes.Count; ++i) 4758 { 4759 var node = nodes[i]; 4760 var children = node.Nodes.ToList(); 4761 4762 <li class="menu__item @(node.InPath ? "menu__item--active" : "")"> 4763 <a href="@node.Link" class="menu-dropdown__link">@node.Name</a> 4764 @if (children.Any()) 4765 { 4766 <div class="level@(level)"> 4767 @ShowNavigationTreeDropdown(children, level + 1) 4768 </div> 4769 } 4770 </li> 4771 } 4772 </ul> 4773 } 4774 4775 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4776 4777 @using System 4778 @using System.Web 4779 @using Dynamicweb.Rapido.Blocks.Extensibility 4780 @using Dynamicweb.Rapido.Blocks 4781 4782 @{ 4783 Block masterDesktopActionsMenu = new Block 4784 { 4785 Id = "MasterDesktopActionsMenu", 4786 SortId = 20, 4787 Template = RenderDesktopActionsMenu(), 4788 SkipRenderBlocksList = true, 4789 Design = new Design 4790 { 4791 CssClass = "nav--header C" 4792 } 4793 4794 }; 4795 BlocksPage.GetBlockPage("Master").Add("MasterDesktopExtra", masterDesktopActionsMenu); 4796 } 4797 4798 @helper RenderDesktopActionsMenu() 4799 { 4800 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 4801 4802 @RenderBlockList(subBlocks) 4803 } 4804 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4805 4806 @using System 4807 @using System.Web 4808 @using Dynamicweb.Rapido.Blocks.Extensibility 4809 @using Dynamicweb.Rapido.Blocks 4810 @* using Dynamicweb.Core; 4811 @using System.Text.RegularExpressions *@ 4812 4813 @{ 4814 Block masterDesktopActionsMenuLanguageSelector = new Block 4815 { 4816 Id = "MasterDesktopActionsMenuLanguageSelector", 4817 SortId = 30, 4818 Template = RenderLanguageSelector() 4819 }; 4820 4821 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuLanguageSelector); 4822 } 4823 4824 @helper RenderLanguageSelector() 4825 { 4826 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4827 4828 if (Model.Languages.Count > 1) 4829 { 4830 4831 <div> 4832 <i class="@areaInfo.LanguageIcon"></i> 4833 </div> 4834 <div> 4835 @foreach (var lang in Model.Languages) 4836 { 4837 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>" + lang.Name; 4838 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 4839 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 4840 4841 if (areaInfo.LanguageViewType == "flag-culture") 4842 { 4843 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 4844 } 4845 4846 if (areaInfo.LanguageViewType == "flag") 4847 { 4848 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 4849 } 4850 4851 if (areaInfo.LanguageViewType == "name") 4852 { 4853 langInfo = lang.Name; 4854 } 4855 4856 if (areaInfo.LanguageViewType == "culture") 4857 { 4858 langInfo = cultureName; 4859 } 4860 4861 <div> 4862 <a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID">@langInfo</a> 4863 </div> 4864 } 4865 </div> 4866 } 4867 } 4868 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4869 4870 @using System 4871 @using System.Web 4872 @using Df.Dw 4873 @using Df.Dw.Rapido 4874 @using Dynamicweb.Rapido.Blocks.Extensibility 4875 @using Dynamicweb.Rapido.Blocks 4876 @using Dynamicweb.Security.UserManagement 4877 @{ 4878 Block masterDesktopActionsMenuSignIn = new Block 4879 { 4880 Id = "MasterDesktopActionsMenuSignIn", 4881 SortId = 20, 4882 Template = RenderSignIn() 4883 }; 4884 4885 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuSignIn); 4886 4887 Block masterDesktopActionsMenuAgentInfo = new Block 4888 { 4889 Id = "MasterDesktopActionsMenuAgentInfo", 4890 SortId = 1, 4891 Template = RenderAgentInfo() 4892 }; 4893 4894 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuAgentInfo); 4895 4896 } 4897 4898 @helper RenderSignIn() 4899 { 4900 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 4901 var user = User.GetCurrentExtranetUser(); 4902 var DesignFolder = Pageview.Layout.Design.Name; 4903 var customerOrdersPageId = user.IsB2b() ? GetPageIdByNavigationTag("CustomerOrders") : GetPageIdByNavigationTag("CustomerPlacedOrders"); 4904 4905 if (!areaInfo.NavigationItemsHideSignIn) 4906 { 4907 4908 if (user == null) 4909 { 4910 string message = Translate("Contacteaza-ne"); 4911 4912 4913 4914 if (!areaInfo.HideCreateAccountLink) 4915 { 4916 <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> 4917 } 4918 <div class="header__profile"> 4919 <button type="button" class="btn-icon header__profile__icon" aria-label="Open profile action menu"> 4920 <div class="ico"> 4921 <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> 4922 </div> 4923 </button> 4924 <div class="header__profile__details "> 4925 <div class="list"> 4926 <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> 4927 </div> 4928 </div> 4929 </div> 4930 4931 4932 4933 4934 <text> 4935 @SnippetStart("Messenger") 4936 <script type="text/javascript"> 4937 (function () { 4938 var options = { 4939 whatsapp: "@areaInfo.ContactNumber", // WhatsApp number 4940 call_to_action: "@message", // Call to action 4941 position: "right", // Position may be 'right' or 'left' 4942 }; 4943 var proto = document.location.protocol, host = "getbutton.io", url = proto + "//static." + host; 4944 var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js'; 4945 s.onload = function () { WhWidgetSendButton.init(host, proto, options); }; 4946 var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); 4947 })(); 4948 </script> 4949 @SnippetEnd("Messenger") 4950 </text> 4951 4952 } else { 4953 <div class="header__profile"> 4954 <button type="button" class="btn-icon header__profile__icon" aria-label="Open profile action menu"> 4955 <sup>@user.GetInitials()</sup> 4956 <div class="ico"> 4957 <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> 4958 </div> 4959 </button> 4960 <div class="header__profile__details "> 4961 <div class="list"> 4962 4963 @if (!areaInfo.HideMyProfileLink) 4964 { 4965 @RenderListItem(areaInfo.LinkStart + areaInfo.CustomerDashboardPage.ID, Translate(Translations.Account.MyProfile), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/account.svg") 4966 } 4967 @if (!areaInfo.HideMyOrdersLink) 4968 { 4969 @RenderListItem(areaInfo.LinkStart + customerOrdersPageId, Translate(Translations.Account.MyOrders), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/view-details.svg") 4970 } 4971 @if (!areaInfo.HideSignInFavorites) 4972 { 4973 @RenderListItem(areaInfo.LinkStart + areaInfo.MyFavoritesPage.ID, Translate(Translations.Account.MyFavorites), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/favorites-on.svg") 4974 } 4975 @if (!areaInfo.HideMySavedCardsLink) 4976 { 4977 @RenderListItem(areaInfo.LinkStart + areaInfo.SavedCardsPage.ID, Translate(Translations.Account.MySavedCards), "/Files/Templates/Designs/"+ DesignFolder + "/icons/default/card.svg") 4978 } 4979 @*if (!areaInfo.HideMyProfileLink || !areaInfo.HideMyOrdersLink || !areaInfo.HideMyFavorites || !areaInfo.HideMySavedCardsLink) 4980 { 4981 @RenderSeparator() 4982 }*@ 4983 4984 @*RenderListItem("/Admin/Public/ExtranetLogoff.aspx?ID=" + areaInfo.PageId, Translate(Translations.Account.SignOut))*@ 4985 4986 @*RenderSeparator()*@ 4987 4988 4989 4990 @if(user != null){ 4991 //var agents = user.GetUsersThatCanSetMeAsSecondary();//.Where(x=>x.Groups.Contains(y=>y.ID == 8404)); 4992 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)); 4993 4994 string message = Translate("Contacteaza-ne"); 4995 if (agents.Any()) 4996 { 4997 foreach (var agent in agents.Take(1)) 4998 { 4999 var userGroups = agent.Groups.Select(x=>x.ID).ToList(); 5000 5001 string secondaryUserName = agent.Name != null && agent.Name != "" ? agent.Name : ""; 5002 string secondaryUserPhone = agent.Phone != null && agent.Phone != "" ? agent.Phone : ""; 5003 string secondaryUserEmail = agent.Email != null && agent.Email != "" ? agent.Email : ""; 5004 string secondaryUserImage = agent.Image != null && agent.Image != "" ? agent.Image : "/Files/Images/no-user.jpg"; 5005 string secondaryUserInitials = agent.GetInitials(); 5006 5007 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="; 5008 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) : ""; 5009 secondaryUserName = secondaryUserName.HasValue() ? String.Format("<div><h5>{0}</h5></div>", secondaryUserName) : ""; 5010 secondaryUserPhone = secondaryUserPhone.HasValue() ? String.Format("<div><a class=\"df-agent-info\" href='tel:{0}'>{0}</a></div>", secondaryUserPhone) : ""; 5011 secondaryUserEmail = secondaryUserEmail.HasValue() ? String.Format("<div><a class=\"df-agent-info\" href='mailto:{0}'>{0}</a></div>", secondaryUserEmail) : ""; 5012 5013 5014 //if(isSales){ 5015 <text> 5016 @SnippetStart("SalesAgentProfileComplete") 5017 <div class="df-agent-card"> 5018 <h4 class="margin-bottom-1rem">@Translate("Agent", "Agent")</h4> 5019 @secondaryUserImage 5020 @secondaryUserName 5021 @secondaryUserPhone 5022 @secondaryUserEmail 5023 </div> 5024 @SnippetEnd("SalesAgentProfileComplete") 5025 5026 @SnippetStart("SalesAgentProfileSimple") 5027 <div class="agent"> 5028 <button type="button" class="btn-icon agent__icon" aria-label="Open sales agent action menu"> 5029 @*<sup>@secondaryUserInitials</sup>*@ 5030 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/help-circle-sharp.svg"></ion-icon> 5031 </button> 5032 <div class="agent__details "> 5033 <div class="list"> 5034 <div class="agent-info"> 5035 <div class="item h5 agent__name">@agent.Name</div> 5036 @RenderListItem("tel:"+agent.Phone ,agent.Phone,"/Files/Templates/Designs/"+ DesignFolder + "/icons/default/call.svg") 5037 @RenderListItem("mailto:"+agent.Email ,agent.Email,"/Files/Templates/Designs/"+ DesignFolder + "/icons/default/mail.svg") 5038 </div> 5039 </div> 5040 </div> 5041 </div> 5042 @SnippetEnd("SalesAgentProfileSimple") 5043 </text> 5044 //} 5045 string messengerPhone = agent.Phone != "" ? agent.Phone : areaInfo.ContactNumber; 5046 <text> 5047 @SnippetStart("Messenger") 5048 <script type="text/javascript"> 5049 (function () { 5050 var options = { 5051 whatsapp: "@messengerPhone", // WhatsApp number 5052 call_to_action: "@message", // Call to action 5053 position: "right", // Position may be 'right' or 'left' 5054 }; 5055 var proto = document.location.protocol, host = "getbutton.io", url = proto + "//static." + host; 5056 var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js'; 5057 s.onload = function () { WhWidgetSendButton.init(host, proto, options); }; 5058 var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); 5059 })(); 5060 </script> 5061 @SnippetEnd("Messenger") 5062 </text> 5063 5064 } 5065 } 5066 } 5067 <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> 5068 5069 </div> 5070 </div> 5071 5072 </div> 5073 5074 5075 5076 } 5077 5078 5079 } 5080 } 5081 5082 @helper RenderAgentInfo() 5083 { 5084 <text> 5085 @RenderSnippet("SalesAgentProfileSimple") 5086 </text> 5087 } 5088 5089 @helper RenderListItem(string link = "", string text = "", string icon = null, string cssClass = "") { 5090 if(text.HasValue()){ 5091 <div class="item"> 5092 <a href="@link" class=""> 5093 @if (icon.HasValue()){<ion-icon src="@icon"></ion-icon>}<span>@text</span> 5094 </a> 5095 </div> 5096 } 5097 } 5098 5099 @helper RenderSeparator() 5100 { 5101 <li>&nbsp;</li> 5102 } 5103 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5104 5105 @using System 5106 @using System.Web 5107 @using Dynamicweb.Rapido.Blocks.Extensibility 5108 @using Dynamicweb.Rapido.Blocks 5109 @{ 5110 Block masterDesktopActionsMenuFavorites = new Block 5111 { 5112 Id = "MasterDesktopActionsMenuFavorites", 5113 SortId = 30, 5114 Template = RenderFavorites() 5115 }; 5116 5117 if (!areaInfo.HideMyFavorites && user != null) 5118 { 5119 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuFavorites); 5120 } 5121 } 5122 5123 @helper RenderFavorites() 5124 { 5125 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5126 5127 <a href="@areaInfo.LinkStart@areaInfo.MyFavoritesPage.ID"> 5128 <i class="@areaInfo.FavoritesIcon"></i> 5129 </a> 5130 } 5131 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5132 5133 @using System 5134 @using System.Web 5135 @using Dynamicweb.Rapido.Blocks.Extensibility 5136 @using Dynamicweb.Rapido.Blocks 5137 5138 @functions 5139 { 5140 public static string FormatPriceDecimals (string formattedPrice) 5141 { 5142 if(formattedPrice != "") 5143 { 5144 if(formattedPrice.IndexOf(",") > 0 && formattedPrice.IndexOf(" ") > 0) 5145 { 5146 formattedPrice = formattedPrice.Replace(",", ",<sup>"); 5147 formattedPrice = formattedPrice.Replace(" ", "</sup> "); 5148 } 5149 } 5150 return formattedPrice; 5151 } 5152 } 5153 5154 @{ 5155 5156 bool onlyPreview = areaInfo.OnlyPreviewForAnonymous && user == null; 5157 if (!onlyPreview && !areaInfo.HideCart) 5158 { 5159 Block minicartCounter = new Block 5160 { 5161 Id = "MiniCartHeaderTrigger", 5162 Template = RenderMiniCartHeaderTrigger(), 5163 SortId = 50, 5164 }; 5165 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", minicartCounter); 5166 5167 } 5168 } 5169 5170 @helper RenderMiniCartHeaderTrigger() 5171 { 5172 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5173 var DesignFolder = Pageview.Layout.Design.Name; 5174 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 5175 string cartProductsTotalPriceReformated = Model.Cart.TotalPrice != null ? FormatPriceDecimals(Model.Cart.TotalPrice.Price.Formatted) : ""; 5176 5177 <button class="header__minicart minicart--toggler btn-icon" data-role="minicart-trigger"> 5178 @if(areaInfo.ShowPrice) { 5179 <div id="cartCounter" class="minicart__counter__content" data-template="MiniCartCounterContent" data-json="@areaInfo.LinkStart@areaInfo.MiniCartFeedPage.ID"> 5180 <div class="minicart__counter__icon"> 5181 <sup>@cartProductsCount</sup> 5182 <div class="ico"> 5183 <svg version="1.1" id="Minicart_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 5184 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> 5185 <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 5186 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 5187 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 5188 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"/> 5189 </svg> 5190 </div> 5191 </div> 5192 @if(!string.IsNullOrEmpty(cartProductsTotalPriceReformated)) { 5193 <div class="minicart__counter__info"> 5194 <div class="minicart__counter__label">@Translate(Translations.Cart.CartGeneral)</div> 5195 <div class="minicart__counter__price">@cartProductsTotalPriceReformated</div> 5196 </div> 5197 } 5198 5199 </div> 5200 } 5201 </button> 5202 5203 5204 } 5205 5206 5207 5208 5209 5210 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5211 5212 @using System 5213 @using System.Web 5214 @using Dynamicweb.Rapido.Blocks.Extensibility 5215 @using Dynamicweb.Rapido.Blocks 5216 @{ 5217 Block masterDesktopActionsMenuDownloadCart = new Block 5218 { 5219 Id = "MasterDesktopActionsMenuDownloadCart", 5220 SortId = 35, 5221 Template = RenderDownloadCart() 5222 }; 5223 5224 if (areaInfo.ShowDownloadCartLink && user != null) 5225 { 5226 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuDownloadCart); 5227 } 5228 } 5229 5230 @helper RenderDownloadCart() 5231 { 5232 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5233 5234 <a href="@areaInfo.LinkStart@areaInfo.DownloadCartPage.ID"> 5235 <i class="fas fa-cart-arrow-down fa-1_5x"></i> 5236 </a> 5237 } 5238 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5239 5240 @using System 5241 @using System.Web 5242 @using Df.Dw 5243 @using Dynamicweb.Rapido.Blocks.Extensibility 5244 @using Dynamicweb.Rapido.Blocks 5245 5246 @functions { 5247 public class SearchConfiguration 5248 { 5249 public string 5250 searchFeedId, 5251 searchSecondFeedId, 5252 resultPageLink, 5253 searchPlaceholder, 5254 searchType, 5255 searchTemplate, 5256 searchContentTemplate, 5257 searchValue; 5258 5259 public bool 5260 showGroups; 5261 5262 public int 5263 groupsFeedId; 5264 5265 public SearchConfiguration() 5266 { 5267 searchFeedId = ""; 5268 searchSecondFeedId = ""; 5269 searchType = "product-search"; 5270 searchContentTemplate = ""; 5271 showGroups = true; 5272 } 5273 } 5274 } 5275 @{ 5276 Block masterSearchBar = new Block 5277 { 5278 Id = "MasterSearchBar", 5279 SortId = 10, 5280 Template = RenderSearch("bar"), 5281 Design = new Design 5282 { 5283 CssClass = "search S" 5284 } 5285 }; 5286 5287 Block masterSearchAction = new Block 5288 { 5289 Id = "MasterDesktopActionsMenuSearch", 5290 SortId = 10, 5291 Template = RenderSearch() 5292 }; 5293 5294 BlocksPage.GetBlockPage("Master").Add("MasterDesktopExtra", masterSearchBar); 5295 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterSearchAction); 5296 } 5297 5298 @helper RenderSearch(string type = "mini-search") 5299 { 5300 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5301 5302 SearchConfiguration searchConfiguration = null; 5303 5304 switch (areaInfo.SearchType) { 5305 case "contentSearch": 5306 searchConfiguration = new SearchConfiguration() { 5307 searchFeedId = areaInfo.ContentSearchFeedPage + "&Areaid=" + areaInfo.AreaId + "&pagesOnly=true", 5308 resultPageLink = areaInfo.LinkStart + areaInfo.ContentSearchFeedPage.ID, 5309 searchPlaceholder = Translate(Translations.General.SearchPage), 5310 groupsFeedId = 0, 5311 searchType = "content-search", 5312 searchTemplate = "SearchPagesTemplate", 5313 showGroups = false 5314 }; 5315 break; 5316 case "combinedSearch": 5317 searchConfiguration = new SearchConfiguration() { 5318 searchFeedId = areaInfo.ProductsPage.ID + "&feed=true", 5319 searchSecondFeedId = areaInfo.ContentSearchFeedPage.ID + "&Areaid=" + areaInfo.AreaId + "&pagesOnly=true", 5320 resultPageLink = Converter.ToString(areaInfo.ProductsPage.ID), 5321 searchPlaceholder = Translate(Translations.Products.SearchProductsOrPages), 5322 groupsFeedId = areaInfo.ProductGroupsFeedPage.ID, 5323 searchType = "combined-search", 5324 searchTemplate = "SearchProductsTemplateWrap", 5325 searchContentTemplate = "SearchPagesTemplateWrap", 5326 showGroups = areaInfo.ShowGroupsSelector 5327 }; 5328 break; 5329 default: //productSearch 5330 searchConfiguration = new SearchConfiguration() { 5331 resultPageLink = GetPageIdByNavigationTag("SearchResults").ToString(), 5332 searchFeedId = GetPageIdByNavigationTag("ProductSearch").ToString() + "&feed=true", 5333 groupsFeedId = areaInfo.ProductGroupsFeedPage.ID, 5334 searchPlaceholder = Translate(Translations.Products.SearchProducts), 5335 searchTemplate = "SearchProductsTemplate", 5336 searchType = "product-search", 5337 showGroups = areaInfo.ShowGroupsSelector 5338 }; 5339 break; 5340 } 5341 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 5342 5343 if (type == "mini-search") { 5344 @* RenderMiniSearch(searchConfiguration) *@ 5345 } else { 5346 @RenderSearchBar(searchConfiguration) 5347 } 5348 } 5349 5350 @helper RenderSearchBar(SearchConfiguration options) 5351 { 5352 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5353 var categoriesFeed = GetPageIdByNavigationTag("SearchCategoriesFeed"); 5354 var DesignFolder = Pageview.Layout.Design.Name; 5355 if (options.showGroups) 5356 { 5357 <button type="button" data-group-id="all">@Translate(Translations.General.All)</button> 5358 <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> 5359 } 5360 5361 <div id="headerSearch" class="typeahead"> 5362 <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> 5363 <div class="typeahead__input"> 5364 <df-input type="text" class="c0" value="@options.searchValue" label="@options.searchPlaceholder"></df-input> 5365 <button type="button" class="btn-icon clear-search hidden c1"><ion-icon src="/Files/Templates/Designs/Atomico/icons/default/close.svg"></ion-icon></button> 5366 <button type="button" class="btn-icon typeahead__loading"><ion-icon name="refresh-circle"></ion-icon></button> 5367 @* <div class="typeahead__select c2" data-template="SearchCategoriesTemplate" data-json="/Default.aspx?ID=@categoriesFeed"></div> *@ 5368 <button type="button" id="SubmitSearch" class="typeahead__submit btn-icon c3" data-results-page="/Default.aspx?ID=@options.resultPageLink"> 5369 <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> 5370 </button> 5371 5372 </div> 5373 5374 @if (!options.searchSecondFeedId.HasValue()) 5375 { 5376 <div class="typeahead__results"> 5377 <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> 5378 </div> 5379 } 5380 else 5381 { 5382 <div class="typeapead__results two-columns"> 5383 <div id="ProductSearchBarContent" data-template="@options.searchTemplate" data-init-onload="false"></div> 5384 <div id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-init-onload="false"></div> 5385 </div> 5386 } 5387 @* <div class="typeahead__backdrop hidden"></div> *@ 5388 5389 </div> 5390 5391 5392 } 5393 5394 @helper RenderMiniSearch(SearchConfiguration options) 5395 { 5396 <div onmouseover="document.getElementById('headerSearch').focus()"> 5397 5398 <df-input id="headerSearch" type="text" value="@options.searchValue" label="@options.searchPlaceholder" mask="^[A-Za-z]+$"></df-input> 5399 @if (!options.searchSecondFeedId.HasValue()) 5400 { 5401 <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> 5402 } 5403 else 5404 { 5405 <div class="dropdown"> 5406 <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> 5407 <div id="ContentSearchBarContent" data-template="@options.searchContentTemplate" data-json-feed="/Default.aspx?ID=@options.searchSecondFeedId" data-init-onload="false"></div> 5408 </div> 5409 } 5410 </div> 5411 } 5412 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/"+DesignFolder+"/MasterBlocks/HeaderBlocks/Custom__Blocks.cshtml"))) 5413 { 5414 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5415 5416 @using System 5417 @using System.Web 5418 @using Dynamicweb.Rapido.Blocks.Extensibility 5419 @using Dynamicweb.Rapido.Blocks 5420 </text> 5421 } 5422 5423 5424 @helper RenderDesktopTools() 5425 { 5426 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 5427 5428 if (subBlocks.Count > 0) 5429 { 5430 <div class="m">@RenderBlockList(subBlocks)</div> 5431 } 5432 } 5433 5434 @helper RenderDesktopToolsText() 5435 { 5436 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5437 var DesignFolder = Pageview.Layout.Design.Name; 5438 5439 <div class="nav--tertiary m1"> 5440 <span class="flex-wrap align-items-center"> 5441 <div class="ico mr-1 mt-ico"> 5442 <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> 5443 </div> 5444 @areaInfo.ContactNumber 5445 </span> 5446 <a href="mailto:@areaInfo.ContactEmail" class="line-height-reset"><div class="ico mr-1 mt-ico"> 5447 <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> 5448 </div> <span>@areaInfo.ContactEmail</span></a> 5449 </div> 5450 } 5451 5452 @helper RenderDesktopToolsNavigation() 5453 { 5454 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5455 5456 if (areaInfo.RenderPagesInToolBar) 5457 { 5458 <div class="nav--secondary m2"> 5459 @RenderNavigation(new 5460 { 5461 id = "topToolsNavigation", 5462 template = "TopMenu.xslt" 5463 }) 5464 </div> 5465 } 5466 } 5467 5468 @helper RenderDesktopNavigation() 5469 { 5470 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 5471 <nav class="nav--primary M"> 5472 @RenderBlockList(subBlocks) 5473 </nav> 5474 } 5475 5476 @helper RenderDesktopExtra() 5477 { 5478 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 5479 5480 if (subBlocks.Count > 0) 5481 { 5482 @RenderBlockList(subBlocks) 5483 } 5484 } 5485 5486 5487 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5488 5489 @using System 5490 @using System.Web 5491 @using Dynamicweb.Rapido.Blocks.Extensibility 5492 @using Dynamicweb.Rapido.Blocks 5493 @* using System.Collections.Generic *@ 5494 @{ 5495 Block impersonationBar = new Block 5496 { 5497 Id = "ImpersonationBar", 5498 SortId = 1, 5499 Template = RenderImpersonationBar() 5500 }; 5501 5502 if (user != null && Model.SecondaryUsers.Count > 0) 5503 5504 { 5505 BlocksPage.GetBlockPage("Master").Add("MasterHeaderTop", impersonationBar); 5506 } 5507 } 5508 5509 @helper RenderImpersonationBar() 5510 { 5511 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5512 var user = User.GetCurrentExtranetUser(); 5513 var secondaryUser = user.CurrentSecondaryUser; 5514 var DesignFolder = Pageview.Layout.Design.Name; 5515 5516 <div class="impersonation"> 5517 <div class="impersonation-bar"> 5518 @if (secondaryUser != null && secondaryUser.ID > 0) 5519 { 5520 string username = ""; 5521 if (!string.IsNullOrEmpty(secondaryUser.FirstName) && !string.IsNullOrEmpty(secondaryUser.LastName)) 5522 { 5523 username = secondaryUser.FirstName + " " + secondaryUser.LastName; 5524 } 5525 else if (!string.IsNullOrEmpty(secondaryUser.Name)) 5526 { 5527 username = secondaryUser.Name; 5528 } 5529 else if (!string.IsNullOrEmpty(secondaryUser.Email)) 5530 { 5531 username = secondaryUser.Email; 5532 } 5533 else 5534 { 5535 username = secondaryUser.UserName; 5536 } 5537 <div class="display-flex"> 5538 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/impersonation.svg"></ion-icon> 5539 5540 @username <text>&nbsp;</text>@Translate(Translations.Account.IsImpersonating)<text>&nbsp;</text> @Pageview.User.UserName 5541 <form method="post"> 5542 <input type="submit" name="DwExtranetRemoveSecondaryUser" value="@Translate(Translations.Account.StopImpersonation)"> 5543 </form> 5544 </div> 5545 } 5546 else 5547 { 5548 <div class="display-flex"> 5549 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/impersonation.svg"></ion-icon> 5550 <a href="@areaInfo.LinkStart@areaInfo.ImpersonationPage.ID" title="@Translate(Translations.Account.ViewListOfUsers)">@Translate(Translations.Account.ViewListOfUsers)</a> 5551 </div> 5552 } 5553 </div> 5554 </div> 5555 } 5556 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5557 5558 @using System 5559 @using System.Web 5560 @using Dynamicweb.Rapido.Blocks.Extensibility 5561 @using Dynamicweb.Rapido.Blocks 5562 @* using System.Collections.Generic *@ 5563 5564 @{ 5565 //Already defined in Master 5566 //var DesignFolder = Pageview.Layout.Design.Name; 5567 } 5568 5569 @{ 5570 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 5571 5572 Block orderLines = new Block 5573 { 5574 Id = "MiniCartOrderLines", 5575 SkipRenderBlocksList = true, 5576 5577 BlocksList = new List<Block> 5578 { 5579 new Block { 5580 Id = "MiniCartOrderLinesList", 5581 SortId = 20, 5582 Design = new Design 5583 { 5584 CssClass = "minicart__orderlines list" 5585 }, 5586 Template = RenderMiniCartOrderLinesList() 5587 } 5588 } 5589 }; 5590 5591 Block orderlinesScriptTemplates = new Block 5592 { 5593 Id = "OrderlinesScriptTemplates" 5594 }; 5595 5596 if (areaInfo.OrderlinesView == "table") 5597 { 5598 orderLines.Template = RenderMiniCartOrderLinesTable(); 5599 orderLines.BlocksList.Add( 5600 new Block { 5601 Id = "MiniCartOrderlinesTableHeader", 5602 SortId = 10, 5603 Template = RenderMiniCartOrderLinesHeader() 5604 } 5605 ); 5606 5607 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 5608 } 5609 else 5610 { 5611 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 5612 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 5613 } 5614 5615 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 5616 5617 Block miniCartScriptTemplates = new Block() 5618 { 5619 Id = "MasterMiniCartTemplates", 5620 SortId = 1, 5621 Template = RenderMiniCartScriptTemplates(), 5622 SkipRenderBlocksList = true, 5623 BlocksList = new List<Block> 5624 { 5625 orderLines, 5626 new Block { 5627 Id = "MiniCartFooter", 5628 Template = RenderMiniCartFooter(), 5629 SortId = 50, 5630 SkipRenderBlocksList = true, 5631 BlocksList = new List<Block> 5632 { 5633 new Block { 5634 Id = "MiniCartFees", 5635 Template = RenderMiniCartFees(), 5636 SortId = 30 5637 }, 5638 // new Block { 5639 // Id = "MiniCartPoints", 5640 // Template = RenderMiniCartPoints(), 5641 // SortId = 40 5642 // }, 5643 new Block { 5644 Id = "MiniCartTotal", 5645 Template = RenderMiniCartTotal(), 5646 SortId = 50 5647 }, 5648 new Block { 5649 Id = "MiniCartActions", 5650 Template = RenderMiniCartActions(), 5651 SortId = 60 5652 } 5653 } 5654 } 5655 } 5656 }; 5657 5658 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 5659 5660 Block MiniCartPanel = new Block 5661 { 5662 Id = "MiniCartPanel", 5663 SkipRenderBlocksList = true, 5664 Template = RenderMiniCartPanelDesign(), 5665 }; 5666 5667 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets",MiniCartPanel); 5668 5669 } 5670 5671 @helper RenderMiniCartScriptsTableTemplates() 5672 { 5673 <script id="MiniCartOrderline" type="text/x-template"> 5674 {{#unless isEmpty}} 5675 <tr> 5676 <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> 5677 <td> 5678 <a href="{{link}}" title="{{name}}">{{name}}</a> 5679 {{#if variantname}} 5680 <a href="{{link}}">{{variantname}}</a> 5681 {{/if}} 5682 {{#if unitname}} 5683 <div>{{unitname}}</div> 5684 {{/if}} 5685 </td> 5686 <td>{{quantity}}</td> 5687 <td> 5688 {{#if pointsTotal}} 5689 <span>{{pointsTotal}}</span> @Translate(Translations.Cart.Points) 5690 {{else}} 5691 {{totalprice}} 5692 {{/if}} 5693 </td> 5694 </tr> 5695 {{/unless}} 5696 </script> 5697 5698 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5699 {{#unless isEmpty}} 5700 <tr> 5701 <td>&nbsp;</td> 5702 <td><div>{{name}}</div></td> 5703 <td>&nbsp;</td> 5704 <td>{{totalprice}}</td> 5705 </tr> 5706 {{/unless}} 5707 </script> 5708 } 5709 5710 @helper RenderMiniCartScriptsListTemplates() 5711 { 5712 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5713 var DesignFolder = Pageview.Layout.Design.Name; 5714 5715 <script id="MiniCartOrderline" type="text/x-template"> 5716 {{#unless isEmpty}} 5717 <div class="item"> 5718 <div class="item__image"> 5719 <a href="{{link}}" class="{{hideimage}}"> 5720 <img src="/Admin/Public/GetImage.ashx?width=100&height=100&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"> 5721 </a> 5722 </div> 5723 <div class="item__content"> 5724 <div class="c0"> 5725 <div class="item__number">{{productnumber}}</div> 5726 <a href="{{link}}" class="item__title" data-tooltip-content="{{name}}">{{name}}</a> 5727 {{#if variantname}} 5728 <div>@Translate(Translations.Cart.Variant): {{variantname}}</div> 5729 {{/if}} 5730 {{#if unitname}} 5731 <div>@Translate(Translations.Cart.Unit): {{unitname}}</div> 5732 {{/if}} 5733 <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> 5734 5735 <div class="item__actions"> 5736 <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" 5737 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> 5738 </div> 5739 </div> 5740 <div class="c1"> 5741 <div class="item__price"> 5742 {{#if pointsTotal}} 5743 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate(Translations.Cart.Points) 5744 {{else}} 5745 {{{totalprice}}} 5746 5747 {{/if}} 5748 </div> 5749 5750 </div> 5751 </div> 5752 </div> 5753 {{/unless}} 5754 </script> 5755 5756 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 5757 {{#unless isEmpty}} 5758 <div class="item item--discount"> 5759 <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> 5760 <div class="item__price item__price--discount">{{{totalprice}}}</div> 5761 </div> 5762 {{/unless}} 5763 </script> 5764 } 5765 5766 @helper RenderMiniCartScriptTemplates() 5767 { 5768 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 5769 5770 <script id="MiniCartContent" type="text/x-template"> 5771 {{#.}} 5772 {{#ifCond discountStepMessage '!==' ""}} 5773 <div class="cart__step__discount">{{discountStepMessage}}</div> 5774 {{/ifCond}} 5775 {{#each ErrorMessages}} 5776 <div class="{{cssClass}}">{{text}}</div> 5777 {{/each}} 5778 {{#unless isEmpty}} 5779 @RenderBlockList(subBlocks) 5780 {{/unless}} 5781 {{/.}} 5782 </script> 5783 } 5784 5785 @helper RenderMiniCartOrderLinesTable() 5786 { 5787 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5788 5789 <div> 5790 <table> 5791 @RenderBlockList(subBlocks) 5792 </table> 5793 </div> 5794 } 5795 5796 @helper RenderMiniCartOrderLinesBlocks() 5797 { 5798 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5799 5800 <div> 5801 @RenderBlockList(subBlocks) 5802 </div> 5803 } 5804 5805 @helper RenderMiniCartOrderLinesHeader() 5806 { 5807 <thead> 5808 <tr> 5809 <td>&nbsp;</td> 5810 <td>@Translate(Translations.Products.Product)</td> 5811 <td>@Translate(Translations.Cart.Qty)</td> 5812 <td width="120">@Translate(Translations.Products.Price)</td> 5813 </tr> 5814 </thead> 5815 } 5816 5817 @helper RenderMiniCartOrderLinesList() 5818 { 5819 <text> 5820 {{#OrderLines}} 5821 {{#ifCond template "===" "CartOrderline"}} 5822 {{>MiniCartOrderline}} 5823 {{/ifCond}} 5824 {{#ifCond template "===" "CartOrderlineMobile"}} 5825 {{>MiniCartOrderline}} 5826 {{/ifCond}} 5827 {{#ifCond template "===" "CartOrderlineDiscount"}} 5828 {{>MiniCartOrderlineDiscount}} 5829 {{/ifCond}} 5830 {{/OrderLines}} 5831 </text> 5832 } 5833 5834 @helper RenderMiniCartFees() 5835 { 5836 <div class="minicart__fees"> 5837 {{#ifCond isPayMethodEmpty "==" false}} 5838 <div class="minicart__payment"> 5839 <div>@Translate(Translations.Cart.Payment): <span>{{paymentmethod}}</span></div> 5840 <div>{{paymentfee}}</div> 5841 </div> 5842 {{/ifCond}} 5843 {{#ifCond isShipMethodEmpty "==" false}} 5844 <div class="minicart__shipping"> 5845 <div>@Translate(Translations.Cart.Shipping): <span>{{shippingmethod}}</span></div> 5846 <div>{{shippingfee}}</div> 5847 </div> 5848 {{/ifCond}} 5849 </div> 5850 } 5851 5852 @helper RenderMiniCartFooter() 5853 { 5854 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 5855 5856 <div class="sticky--bottom"> 5857 @RenderBlockList(subBlocks) 5858 </div> 5859 } 5860 5861 @helper RenderMiniCartActions() 5862 { 5863 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5864 var DesignFolder = Pageview.Layout.Design.Name; 5865 <div class="minicart__actions"> 5866 @* <button type="button" class="btn-border--dark" title="@Translate(Translations.Cart.EmptyCart)" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate(Translations.Cart.EmptyCart)</button> *@ 5867 <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> 5868 <a class="btn btn-fill--buy" href="@areaInfo.LinkStart@areaInfo.CartPage.ID" title="@Translate(Translations.Cart.ProceedToCheckout)"><span>@Translate(Translations.Cart.ProceedToCheckout)</span></a> 5869 <button type="button" data-role="minicart-trigger" class="btn btn-fill--dark btn-continue-shopping">@Translate(Translations.Cart.ContinueShopping) </button> 5870 </div> 5871 5872 } 5873 5874 @helper RenderMiniCartPoints() 5875 { 5876 <text> 5877 {{#if earnings}} 5878 <div class="minicart__points"> 5879 <div>@Translate(Translations.Cart.Earnings)</div> 5880 <div> 5881 <span>{{earnings}}</span> @Translate(Translations.Cart.Points) 5882 </div> 5883 </div> 5884 {{/if}} 5885 </text> 5886 } 5887 5888 @helper RenderMiniCartTotal() 5889 { 5890 <div class="minicart__summary list"> 5891 <div class="item"> 5892 <div>@Translate(Translations.Cart.Total)</div> 5893 <div class="minicart__total">{{{totalprice}}}</div> 5894 </div> 5895 5896 </div> 5897 } 5898 5899 5900 @helper RenderMiniCartPanelDesign() 5901 { 5902 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5903 var DesignFolder = Pageview.Layout.Design.Name; 5904 5905 <div class="minicart" id="minicart"> 5906 <div class="minicart__header sticky--top"> 5907 <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> 5908 <h3 class="minicart__heading">@Translate(Translations.Cart.ShoppingCart)</h3> 5909 </div> 5910 5911 <div id="miniCartContent" data-template="MiniCartContent" data-json="@areaInfo.LinkStart@areaInfo.MiniCartFeedPage.ID&feedType=MiniCart"></div> 5912 </div> 5913 } 5914 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5915 5916 @using System 5917 @using System.Web 5918 @using Dynamicweb.Rapido.Blocks.Extensibility 5919 @using Dynamicweb.Rapido.Blocks 5920 5921 @{ 5922 if (!areaInfo.OnlyPreviewForAnonymous && !string.IsNullOrEmpty(areaInfo.AddToCartNotificationType)) { 5923 if (areaInfo.AddToCartNotificationType == "modal") 5924 { 5925 Block addToCartNotificationModal = new Block 5926 { 5927 Id = "AddToCartNotificationModal", 5928 Template = RenderAddToCartNotificationModal() 5929 }; 5930 5931 Block addToCartNotificationScript = new Block 5932 { 5933 Id = "AddToCartNotificationScript", 5934 Template = RenderAddToCartNotificationModalScript() 5935 }; 5936 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 5937 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5938 } 5939 else if (areaInfo.AddToCartNotificationType == "toggle" && !areaInfo.AddToCartHideCartIcon && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 5940 { 5941 Block addToCartNotificationScript = new Block 5942 { 5943 Id = "AddToCartNotificationScript", 5944 Template = RenderAddToCartNotificationToggleScript() 5945 }; 5946 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5947 } 5948 } 5949 } 5950 5951 @helper RenderAddToCartNotificationModal() 5952 { 5953 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 5954 } 5955 5956 @helper RenderAddToCartNotificationModalScript() 5957 { 5958 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 5959 5960 <script id="LastAddedProductTemplate" type="text/x-template"> 5961 <!-- Trigger for the login modal --> 5962 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 5963 5964 <!-- Login modal --> 5965 <div class="modal-container"> 5966 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 5967 <div class="modal modal--md"> 5968 <div class="modal__header"> 5969 <h2>@Translate(Translations.Cart.ProductIsAddedToTheCart)</h2> 5970 </div> 5971 <div class="modal__body"> 5972 <a href="{{productInfo.link}}"> 5973 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 5974 </a> 5975 <span>{{quantity}}</span> x 5976 <div>{{productInfo.name}}</div> 5977 {{#if productInfo.variantName}} 5978 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 5979 {{/if}} 5980 {{#if productInfo.unitName}} 5981 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 5982 {{/if}} 5983 </div> 5984 <div class="modal__footer"> 5985 <label for="LastAddedProductModalTrigger">@Translate(Translations.Cart.ContinueShopping)</label> 5986 <a href="@areaInfo.LinkStart@areaInfo.CartPage.ID">@Translate(Translations.Cart.ProceedToCheckout)</a> 5987 </div> 5988 <label for="LastAddedProductModalTrigger"></label> 5989 </div> 5990 </div> 5991 </script> 5992 <script> 5993 document.addEventListener('addToCart', function (event) { 5994 Cart.ShowLastAddedProductModal(event.detail); 5995 }); 5996 </script> 5997 } 5998 5999 @helper RenderAddToCartNotificationToggleScript() 6000 { 6001 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6002 <script> 6003 document.addEventListener('addToCart', function () { 6004 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@areaInfo.MiniCartFeedPage.ID'); 6005 }); 6006 </script> 6007 } 6008 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6009 6010 @using System 6011 @using System.Web 6012 @using Df.Dw 6013 @using Dynamicweb.Rapido.Blocks.Extensibility 6014 @using Dynamicweb.Rapido.Blocks 6015 @using Df.Dw.Rapido 6016 @* using System.Collections.Generic *@ 6017 6018 @functions { 6019 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 6020 } 6021 6022 @{ 6023 Block masterFooterContent = new Block() 6024 { 6025 Id = "MasterFooterContent", 6026 SortId = 10, 6027 Template = RenderFooter(areaInfo), 6028 SkipRenderBlocksList = true 6029 }; 6030 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 6031 6032 Block masterFooter1 = new Block() 6033 { 6034 Id = "MasterFooter1", 6035 SortId = 10, 6036 Design = new Design 6037 { 6038 Size = "12", 6039 RenderType = RenderType.Column, 6040 CssClass = "c1" 6041 } 6042 }; 6043 footerBlocksPage.Add("MasterFooterContent", masterFooter1); 6044 6045 Block masterFooter2 = new Block() 6046 { 6047 Id = "MasterFooter2", 6048 SortId = 20, 6049 Design = new Design 6050 { 6051 Size = "12", 6052 RenderType = RenderType.Column, 6053 CssClass = "c2" 6054 } 6055 }; 6056 footerBlocksPage.Add("MasterFooterContent", masterFooter2); 6057 6058 Block masterFooter3 = new Block() 6059 { 6060 Id = "MasterFooter3", 6061 SortId = 30, 6062 Design = new Design 6063 { 6064 Size = "12", 6065 RenderType = RenderType.Column, 6066 CssClass = "c3" 6067 } 6068 }; 6069 footerBlocksPage.Add("MasterFooterContent", masterFooter3); 6070 6071 Block masterFooter4 = new Block() 6072 { 6073 Id = "MasterFooter4", 6074 SortId = 40, 6075 Design = new Design 6076 { 6077 Size = "12", 6078 RenderType = RenderType.Column, 6079 CssClass = "c4" 6080 } 6081 }; 6082 footerBlocksPage.Add("MasterFooterContent", masterFooter4); 6083 6084 Block masterFooter5 = new Block() 6085 { 6086 Id = "MasterFooter5", 6087 SortId = 50, 6088 Design = new Design 6089 { 6090 Size = "12", 6091 RenderType = RenderType.Column, 6092 CssClass = "c5" 6093 } 6094 }; 6095 footerBlocksPage.Add("MasterFooterContent", masterFooter5); 6096 6097 Block masterFooter6 = new Block() 6098 { 6099 Id = "MasterFooter6", 6100 SortId = 60, 6101 Design = new Design 6102 { 6103 Size = "12", 6104 RenderType = RenderType.Column, 6105 CssClass = "c6" 6106 } 6107 }; 6108 footerBlocksPage.Add("MasterFooterContent", masterFooter6); 6109 6110 Block masterFooter7 = new Block() 6111 { 6112 Id = "MasterFooter7", 6113 SortId = 70, 6114 Design = new Design 6115 { 6116 Size = "12", 6117 RenderType = RenderType.Column, 6118 CssClass = "c7" 6119 } 6120 }; 6121 footerBlocksPage.Add("MasterFooterContent", masterFooter7); 6122 6123 Block masterFooter8 = new Block() 6124 { 6125 Id = "MasterFooter8", 6126 SortId = 80, 6127 Design = new Design 6128 { 6129 Size = "12", 6130 RenderType = RenderType.Column, 6131 CssClass = "c8" 6132 } 6133 }; 6134 footerBlocksPage.Add("MasterFooterContent", masterFooter8); 6135 6136 6137 //content Blocks 6138 Block masterFooterLogo = new Block 6139 { 6140 Id = "FooterLogo", 6141 SortId = 10, 6142 Template = RenderFooterLogo(areaInfo), 6143 Design = new Design{ 6144 CssClass = "footer__logo" 6145 } 6146 }; 6147 6148 Block masterFooterAddress = new Block 6149 { 6150 Id = "FooterAddress", 6151 SortId = 10, 6152 Template = RenderFooterAddress(areaInfo), 6153 Design = new Design{ 6154 CssClass = "footer__address" 6155 } 6156 }; 6157 6158 Block masterFooterColumnOne = new Block 6159 { 6160 Id = "MasterFooterColumnOne", 6161 SortId = 10, 6162 Template = RenderFooterColumn(areaInfo.FooterColumnOneHeader, areaInfo.FooterColumnOneContent, areaInfo.FooterColumnOneLinks, "footer__column-one") 6163 }; 6164 6165 Block masterFooterColumnTwo = new Block 6166 { 6167 Id = "MasterFooterColumnTwo", 6168 SortId = 20, 6169 Template = RenderFooterColumn(areaInfo.FooterColumnTwoHeader, areaInfo.FooterColumnTwoContent, areaInfo.FooterColumnTwoLinks, "footer__column-two") 6170 }; 6171 6172 Block masterFooterColumnThree = new Block 6173 { 6174 Id = "MasterFooterColumnThree", 6175 SortId = 30, 6176 Template = RenderFooterColumn(areaInfo.FooterColumnThreeHeader, areaInfo.FooterColumnThreeContent, areaInfo.FooterColumnThreeLinks, "footer__column-three") 6177 }; 6178 6179 Block masterFooterNewsletterSignUp = new Block 6180 { 6181 Id = "MasterFooterNewsletterSignUp", 6182 SortId = 9, 6183 Template = RenderFooterNewsletterSignUp(areaInfo), 6184 Design = new Design{ 6185 CssClass = "footer__newsletter" 6186 } 6187 }; 6188 6189 Block masterFooterSocialLinks = new Block 6190 { 6191 Id = "MasterFooterSocialLinks", 6192 SortId = 50, 6193 Template = RenderFooterSocialLinks(areaInfo), 6194 Design = new Design{ 6195 CssClass = "footer__social" 6196 } 6197 }; 6198 6199 Block masterFooterPayments = new Block 6200 { 6201 Id = "MasterFooterPayments", 6202 SortId = 60, 6203 Template = RenderFooterPayments(areaInfo), 6204 Design = new Design{ 6205 CssClass = "footer__payments" 6206 } 6207 }; 6208 6209 Block masterFooterCopyright = new Block 6210 { 6211 Id = "MasterFooterCopyright", 6212 SortId = 70, 6213 Design = new Design{ 6214 CssClass = "footer__copyright" 6215 } 6216 }; 6217 6218 Block compareModal = new Block 6219 { 6220 Id = "MasterFooterModalCompare", 6221 SortId = 80, 6222 Template = RenderCompareModule(), 6223 Design = new Design 6224 { 6225 Size = "12", 6226 RenderType = RenderType.Column 6227 }, 6228 SkipRenderBlocksList = true 6229 }; 6230 footerBlocksPage.Add("MasterFooterContent", compareModal); 6231 6232 6233 //Begin configuration of blocks 6234 string footerLayout = areaInfo.FooterLayout; 6235 6236 switch (footerLayout) 6237 { 6238 case "1": 6239 masterFooter1.Design.Size = "3"; 6240 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6241 footerBlocksPage.Add("MasterFooter1", masterFooterAddress); 6242 footerBlocksPage.RemoveBlock(masterFooterSocialLinks); 6243 footerBlocksPage.Add("MasterFooter1", masterFooterPayments); 6244 6245 masterFooter2.Design.Size = "3"; 6246 footerBlocksPage.Add("MasterFooter2", masterFooterColumnOne); 6247 6248 masterFooter3.Design.Size = "3"; 6249 footerBlocksPage.Add("MasterFooter3", masterFooterColumnTwo); 6250 6251 masterFooter4.Design.Size = "3"; 6252 footerBlocksPage.Add("MasterFooter4", masterFooterColumnThree); 6253 footerBlocksPage.Add("MasterFooter4", masterFooterSocialLinks); 6254 6255 footerBlocksPage.Add("MasterFooter5", masterFooterCopyright); 6256 6257 footerBlocksPage.RemoveBlock(masterFooter6); 6258 footerBlocksPage.RemoveBlock(masterFooter7); 6259 footerBlocksPage.RemoveBlock(masterFooter8); 6260 break; 6261 6262 case "2": 6263 masterFooter1.Design.Size = "12"; 6264 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6265 footerBlocksPage.Add("MasterFooter1", masterFooterSocialLinks); 6266 6267 masterFooter2.Design.Size = "3"; 6268 footerBlocksPage.Add("MasterFooter2", masterFooterAddress); 6269 footerBlocksPage.Add("MasterFooter2", masterFooterPayments); 6270 6271 masterFooter3.Design.Size = "3"; 6272 footerBlocksPage.Add("MasterFooter3", masterFooterColumnOne); 6273 6274 masterFooter4.Design.Size = "3"; 6275 footerBlocksPage.Add("MasterFooter4", masterFooterColumnTwo); 6276 6277 masterFooter5.Design.Size = "3"; 6278 footerBlocksPage.Add("MasterFooter5", masterFooterColumnThree); 6279 6280 footerBlocksPage.Add("MasterFooter6", masterFooterCopyright); 6281 6282 footerBlocksPage.RemoveBlock(masterFooter7); 6283 footerBlocksPage.RemoveBlock(masterFooter8); 6284 break; 6285 6286 default: 6287 footerBlocksPage.Add("MasterFooter1", masterFooterLogo); 6288 footerBlocksPage.Add("MasterFooter1", masterFooterAddress); 6289 footerBlocksPage.Add("MasterFooter1", masterFooterSocialLinks); 6290 footerBlocksPage.Add("MasterFooter1", masterFooterPayments); 6291 6292 masterFooter2.Design.Size = "3"; 6293 footerBlocksPage.Add("MasterFooter2", masterFooterColumnOne); 6294 6295 masterFooter3.Design.Size = "3"; 6296 footerBlocksPage.Add("MasterFooter3", masterFooterColumnTwo); 6297 6298 masterFooter4.Design.Size = "3"; 6299 footerBlocksPage.Add("MasterFooter4", masterFooterColumnThree); 6300 6301 footerBlocksPage.Add("MasterFooter5", masterFooterCopyright); 6302 footerBlocksPage.RemoveBlock(masterFooter6); 6303 footerBlocksPage.RemoveBlock(masterFooter7); 6304 footerBlocksPage.RemoveBlock(masterFooter8); 6305 break; 6306 } 6307 } 6308 6309 @helper RenderFooter(Df.Dw.Rapido.AreaInfo areaInfo) { 6310 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 6311 string footerClass = "footer__theme-" + areaInfo.FooterLayout; 6312 bool isMobileApp = !String.IsNullOrEmpty(HttpContext.Current.Request["mobileApp"]) ? true : false; 6313 6314 if(!isMobileApp){ 6315 <footer class="footer vars section__container container @footerClass"> 6316 <div class="footer__content section__content grid"> 6317 @RenderBlockList(subBlocks) 6318 </div> 6319 </footer> 6320 @RenderFooterCopyright(areaInfo) 6321 } 6322 } 6323 6324 6325 @helper RenderFooterLogo(Df.Dw.Rapido.AreaInfo areaInfo) 6326 { 6327 var footerLogo = ""; 6328 if (Path.GetExtension(areaInfo.FooterLogo).ToLower() != ".svg") 6329 { 6330 footerLogo = "/Admin/Public/GetImage.ashx?height=60&amp;crop=5&amp;Compression=75&amp;image=" + areaInfo.FooterLogo; 6331 } 6332 else 6333 { 6334 footerLogo = HttpUtility.UrlDecode(areaInfo.FooterLogo); 6335 } 6336 6337 <div class="logo L"> 6338 <a href="@areaInfo.FirstPageLink"> 6339 <img class="logo__img" src="@areaInfo.FooterLogo" alt="@Translate(Translations.General.Logo)" /> 6340 </a> 6341 </div> 6342 } 6343 @helper RenderFooterColumn(string header, string content, IList<ItemViewModel> links, string className = "column") { 6344 if (content.HasValue() || header.HasValue()) 6345 { 6346 <div class="@className"> 6347 @if (header.HasValue()) 6348 { 6349 <h5 class="footer__heading h5">@header</h5> 6350 } 6351 6352 @if(links.Any()){ 6353 <ul class="footer-links"> 6354 @foreach(var pageLink in links){ 6355 string link = pageLink.GetString("Link"); 6356 string title = pageLink.GetString("Title"); 6357 string icon = pageLink.GetString("Icon"); 6358 string newWindow = pageLink.GetBoolean("NewWindow") ? " target=\"_blank\"" : ""; 6359 <li class="footer-links__item"> 6360 @if (!string.IsNullOrEmpty(newWindow)) 6361 { 6362 <a href="@link" @newWindow rel="noreferrer" class="footer-links__link">@icon @title</a> 6363 } 6364 else 6365 { 6366 <a href="@link" class="footer-links__link">@icon @title</a> 6367 } 6368 6369 </li> 6370 } 6371 </ul> 6372 }else{ 6373 <div class="content"> 6374 @content 6375 </div> 6376 } 6377 </div> 6378 } 6379 } 6380 6381 @helper RenderFooterNewsletterSignUp(Df.Dw.Rapido.AreaInfo areaInfo) { 6382 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 6383 { 6384 6385 <div class="newsletter"> 6386 <h5 class="footer__heading h5">@Translate(Translations.General.MailingList)</h5> 6387 <div class="footer__content"> 6388 <form class="form" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 6389 <input name="ID" value="@areaInfo.NewsletterSignUpPage.ID" type="hidden" /> 6390 <label for="NewsletterEmail">@Translate(Translations.General.SignUpMessage)</label> 6391 <div class="form__field-combi newsletter__input"> 6392 <df-input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate(Translations.General.YourEmailAddress)' value="" ></df-input> 6393 <button type="submit" id="Submitter">@Translate(Translations.General.Go)</button> 6394 </div> 6395 </form> 6396 </div> 6397 </div> 6398 } 6399 } 6400 6401 @helper RenderFooterSocialLinks(Df.Dw.Rapido.AreaInfo areaInfo) { 6402 var DesignFolder = Pageview.Layout.Design.Name; 6403 if (areaInfo.FooterSocialLinks != null && areaInfo.FooterSocialLinks.Count > 0) 6404 { 6405 6406 <div class="contact"> 6407 @*<h5 class="footer__heading h5">@Translate(Translations.General.SocialLinks)</h5> *@ 6408 6409 <div class="contact__social-media"> 6410 @foreach (var socialitem in areaInfo.FooterSocialLinks) 6411 { 6412 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 6413 string socialIconImage = socialIcon.SelectedValue; 6414 string socialIconTitle = socialIcon.SelectedName; 6415 string socialLink = socialitem.GetString("Link"); 6416 6417 <a href="@socialLink" target="_blank" title="@socialIconTitle" rel="noopener" class=""><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/@socialIconImage"></ion-icon></a> 6418 } 6419 6420 </div> 6421 </div> 6422 } 6423 } 6424 6425 @helper RenderFooterPayments(Df.Dw.Rapido.AreaInfo areaInfo) { 6426 <div class="payment--icons"> 6427 @foreach (var payment in areaInfo.FooterPayments) 6428 { 6429 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 6430 string paymentImage = null; 6431 string paymentTitle = paymentItem.SelectedName; 6432 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 6433 if (selected != null) 6434 { 6435 paymentImage = selected.Icon; 6436 } 6437 6438 <img class="b-lazy" src="/Admin/Public/GetImage.ashx?height=40&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 6439 } 6440 </div> 6441 } 6442 6443 @helper RenderFooterCopyright(Df.Dw.Rapido.AreaInfo areaInfo) { 6444 <div class="section__container container copyright"> 6445 <div class="section__content"> 6446 <div class="col-12"> 6447 @areaInfo.FooterCopyrightText 6448 </div> 6449 </div> 6450 </div> 6451 } 6452 6453 @helper RenderFooterAddress(Df.Dw.Rapido.AreaInfo areaInfo) 6454 { 6455 <div class="company-address"> 6456 <p>@areaInfo.CompanyAddressStreetAddress, @areaInfo.CompanyAddressPostalCode</p> 6457 <p>@areaInfo.CompanyAddressCity, @areaInfo.CompanyAddressRegion</p> 6458 <p>@areaInfo.CompanyAddressCountry</p> 6459 <p>@areaInfo.ContactEmail</p> 6460 <p>@areaInfo.ContactNumber</p> 6461 </div> 6462 6463 } 6464 6465 @helper RenderCompareModule() { 6466 var compareMaxItems = Pageview.Device.ToString() == "Mobile" ? "2" : "3"; 6467 var DesignFolder = Pageview.Layout.Design.Name; 6468 <div class="row compareWrapper hidden" 6469 data-compare-new-list="@Translate("Compare new list")" 6470 data-compare-keep-list="@Translate("Compare keep list")" 6471 data-compare-different-group="@Translate("Compare product is in different group")" 6472 data-compare-list-full="@Translate("Compare list is full")" data-compare-max-items="@compareMaxItems"> 6473 6474 <div class="compareHeader"> 6475 <span> @Translate("Compare products")</span> 6476 <button id="collapseCompareWrapper" class="btn-icon" title="@Translate("Compare products")"><ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/compare.svg"></ion-icon></button> 6477 </div> 6478 6479 <div class="compareList"></div> 6480 <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> 6481 <div class="compareButtonClose"><a class="btn btn-border--dark close-compare-list full-width">@Translate("Close compare list")</a></div> 6482 </div> 6483 } 6484 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6485 6486 @using System 6487 @using System.Web 6488 @using Dynamicweb.Rapido.Blocks.Extensibility 6489 @using Dynamicweb.Rapido.Blocks 6490 @using Dynamicweb.Ecommerce.Common 6491 @* using System.Collections.Generic *@ 6492 6493 @{ 6494 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 6495 6496 Block masterScriptReferences = new Block() 6497 { 6498 Id = "MasterScriptReferences", 6499 SortId = 1, 6500 Template = RenderMasterScriptReferences() 6501 }; 6502 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 6503 } 6504 6505 @helper RenderMasterScriptReferences() { 6506 @* <script src="/Files/Templates/Designs/Wizaris/dist/js/app.min.js"></script> *@ 6507 @* PushPromise("/Files/Templates/Designs/Wizaris/dist/js/app.min.js"); *@ 6508 6509 @RenderSnippet("Script") 6510 } 6511 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6512 6513 @using System 6514 @using System.Web 6515 @using Df.Dw 6516 @using Dynamicweb.Rapido.Blocks.Extensibility 6517 @using Dynamicweb.Rapido.Blocks 6518 @* using System.Collections.Generic *@ 6519 6520 @{ 6521 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 6522 bool isFavoriteList = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("ListID")); 6523 6524 if (!areaInfo.NavigationItemsHideSearch || isFavoriteList) 6525 { 6526 Block masterSearchScriptTemplates = new Block() 6527 { 6528 Id = "MasterSearchScriptTemplates", 6529 SortId = 1, 6530 Template = RenderSearchScriptTemplates() 6531 }; 6532 6533 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 6534 } 6535 } 6536 6537 @helper RenderSearchScriptTemplates() 6538 { 6539 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6540 var user = User.GetCurrentExtranetUser(); 6541 bool onlyPreview = areaInfo.OnlyPreviewForAnonymous && user == null; 6542 var DesignFolder = Pageview.Layout.Design.Name; 6543 var userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 6544 6545 <div class="stock-notif-translates" 6546 data-notification-already-sent="@Translate(Translations.Products.NotifyWhenBackOnStockAlreadySent)" 6547 data-notification-registered="@Translate(Translations.Products.NotifyWhenBackOnStockRegistered)"></div> 6548 6549 <script id="SearchGroupsTemplate" type="text/x-template"> 6550 {{#.}} 6551 <li class="dropdown__item" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 6552 {{/.}} 6553 </script> 6554 6555 <script id="SearchProductsTemplate" type="text/x-template"> 6556 {{#each this}} 6557 {{#Product}} 6558 {{#ifCond template "!==" "SearchMore"}} 6559 <li class="item"> 6560 @if (areaInfo.FacebookPixelID.HasValue()) 6561 { 6562 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 6563 } 6564 @if (areaInfo.GoogleTagManagerID.HasValue()) 6565 { 6566 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 6567 } 6568 6569 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="item__title" title="{{name}}"> 6570 <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> 6571 6572 <div class="item__name">{{name}}</div> 6573 @if (areaInfo.ShowPrice && !onlyPreview) 6574 { 6575 if (areaInfo.PointShopOnly) 6576 { 6577 <text> 6578 {{#if havePointPrice}} 6579 <span>{{points}}</span> @Translate(Translations.Cart.Points) 6580 {{else}} 6581 <small>@Translate(Translations.General.NotAvailable)</small> 6582 {{/if}} 6583 {{#unless canBePurchasedWithPoints}} 6584 {{#if havePointPrice}} 6585 <small>@Translate(Translations.Cart.NotEnoughPointsToBuyThis)</small> 6586 {{/if}} 6587 {{/unless}} 6588 </text> 6589 } 6590 else 6591 { 6592 <div class="span-2 py-1">{{price}}</div> 6593 } 6594 } 6595 6596 </a> 6597 <div class="item__actions"> 6598 @if (areaInfo.ProductListShowCartButton && !onlyPreview) { 6599 if (areaInfo.PointShopOnly) 6600 { 6601 <button type="button" class="btn-icon--dark {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 6602 onclick="Cart.AddToCart(event, { 6603 id: '{{productId}}', 6604 quantity: 1, 6605 buyForPoints: true, 6606 productInfo: {{productInfo}} 6607 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 6608 <ion-icon name="arrow-forward"></ion-icon> 6609 </button> 6610 } else { 6611 6612 <text>{{#ifCond stockValue '>' 0}}</text> 6613 <form> 6614 <input type="hidden" name="ProductID" value="{{productId}}" /> 6615 @*<input type="hidden" name="Quantity" value="1" />*@ 6616 <input type="hidden" name="ID" value="@areaInfo.MiniCartFeedPage.ID.ToString()" /> 6617 <input type="hidden" name="redirect" value="false" /> 6618 <input type="hidden" name="CartCmd" value="add" /> 6619 <df-quantity name="Quantity" value="1" class="item__quantity"></df-quantity> 6620 <button type="button" class="btn-icon {{hideBuyOptions}} item__addToCart" data-role="add-to-cart" message-success="@Translate(Translations.Cart.ProductIsAddedToTheCart)"> 6621 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/cart.svg"></ion-icon> 6622 </button> 6623 </form> 6624 <text>{{else}}</text> 6625 @* Logic : if user is anonymous , we show the modal asking for email: otherwise the email is retrieved from account *@ 6626 if (userIsLoggedIn) 6627 { 6628 var notifyWhenBackOnStockLink = "/Default.aspx?ID=" + GetPageIdByNavigationTag("ProductsPage") + "&ProductID={{productId}}&VariantID={{variantId}}" + "&cartcmd=createnotificationforthisproduct"; 6629 <text>{{#ifCond notificationRegistered '==' false}}</text> 6630 <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)"> 6631 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6632 </button> 6633 <text>{{else}}</text> 6634 <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)"> 6635 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6636 </button> 6637 <text>{{/ifCond}}</text> 6638 } 6639 else 6640 { 6641 <text>{{#ifCond notificationRegistered '==' false}}</text> 6642 <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)"> 6643 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6644 </button> 6645 <df-modal id="notifyWhenBackOnStock{{productId}}" 6646 data-product-name="{{name}}" 6647 heading="@Translate(Translations.Products.NotifyWhenBackOnStock)"> 6648 <span> 6649 {{#ifCond notificationRegistered '==' false}} 6650 <form name="{{productId}}" action="/Default.aspx?ID=@GetPageIdByNavigationTag("ProductsPage")" class="full-width notify-stock-form"> 6651 <input type="hidden" name="ProductID" id="ProductID" value="{{productId}}" /> 6652 <input type="hidden" name="VariantID" id="VariantID" value="{{variantId}}" /> 6653 <input type="hidden" name="CartCmd" id="CartCmd" value="createnotificationforthisproduct" /> 6654 <df-input type="email" class="mb-3" id="NotificationEmail" name="NotificationEmail" placeholder="@Translate(Translations.General.YourEmailAddress)"></df-input> 6655 <button type="submit" class="create-stock-notification-request btn-fill--brand">@Translate(Translations.Account.CreateRequest)</button> 6656 </form> 6657 {{else}} 6658 <p>@Translate(Translations.Products.NotifyWhenBackOnStockAlreadySent)</p> 6659 {{/ifCond}} 6660 </span> 6661 </df-modal> 6662 <text>{{else}}</text> 6663 <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)"> 6664 <ion-icon src="/Files/Templates/Designs/@DesignFolder/icons/default/alert-circle-outline-white.svg"></ion-icon> 6665 </button> 6666 <text>{{/ifCond}}</text> 6667 } 6668 <text>{{/ifCond}}</text> 6669 6670 6671 6672 } 6673 <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> 6674 } 6675 else if (areaInfo.ProductListShowViewButton) 6676 { 6677 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn js-ignore-click-outside" title="@Translate(Translations.General.View)">@Translate(Translations.General.View)</a> 6678 } 6679 @if (areaInfo.ProductListShowAddToDownloadButton) 6680 { 6681 <button type="button" class="btn js-add-to-downloads" title="@Translate(Translations.General.Add)" data-product-id="{{productId}}"> 6682 <i class="fas fa-plus js-button-icon"></i> 6683 </button> 6684 } 6685 </div> 6686 </li> 6687 {{/ifCond}} 6688 {{#ifCond template "===" "SearchMore"}} 6689 @*{{>SearchMoreProducts}}*@ 6690 <li class="item item--full {{stickToBottom}}"> 6691 <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> 6692 </li> 6693 {{/ifCond}} 6694 {{/Product}} 6695 {{else}} 6696 <li class="dropdown__item"> 6697 @Translate(Translations.General.YourSearchGave0Results) 6698 </li> 6699 {{/each}} 6700 </script> 6701 6702 <script id="RecentSearchesTemplate" type="text/x-template"> 6703 <li class="recent-searches-header"> 6704 <h4>@Translate(Translations.Products.RecentSearches)</h4> 6705 <button class="clear-recent-searches"> Clear </button> 6706 </li> 6707 {{#each RecentSearches}} 6708 <li> {{this}} </li> 6709 {{/each}} 6710 </script> 6711 6712 <script id="SearchCategoriesTemplate" type="text/x-template"> 6713 <df-select id="headerSearch__categories" name="headerSearch__categories" value="" label="@Translate(Translations.Products.Categories)"> 6714 {{#each this}} 6715 <df-option value="{{id}}" label="{{name}}"><span>{{name}}</span></df-option> 6716 {{/each}} 6717 </df-select> 6718 6719 </script> 6720 6721 <script id="SearchMoreProducts" type="text/x-template"> 6722 <li class="dropdown__item {{stickToBottom}}"> 6723 <button type="button" class="btn" data-results-page="/Default.aspx?ID=@areaInfo.ProductsPage.ID"> @Translate(Translations.General.ViewAll)</button> 6724 </li> 6725 </script> 6726 6727 <script id="SearchMorePages" type="text/x-template"> 6728 <li class="dropdown__item {{stickToBottom}}"> 6729 <button type="button" class="btn" data-results-page="/Default.aspx?ID=@areaInfo.ProductsPage.ID"> @Translate(Translations.General.ViewAll)</button> 6730 </li> 6731 </script> 6732 6733 <script id="SearchPagesTemplate" type="text/x-template"> 6734 {{#each .}} 6735 {{#ifCond template "!==" "SearchMore"}} 6736 <li class="dropdown__item"> 6737 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link"> 6738 <i class="fa {{icon}}"></i> 6739 <div class="js-typeahead-name">{{name}}</div> 6740 </a> 6741 </li> 6742 {{/ifCond}} 6743 {{#ifCond template "===" "SearchMore"}} 6744 {{>SearchMorePages}} 6745 {{/ifCond}} 6746 {{else}} 6747 <li> 6748 @Translate(Translations.General.YourSearchGave0Results) 6749 </li> 6750 {{/each}} 6751 </script> 6752 6753 <script id="SearchPagesTemplateWrap" type="text/x-template"> 6754 <div class="dropdown__column-header">@Translate(Translations.General.Pages)</div> 6755 <ul class="dropdown__list"> 6756 {{>SearchPagesTemplate}} 6757 </ul> 6758 </script> 6759 6760 <script id="SearchProductsTemplateWrap" type="text/x-template"> 6761 <div>@Translate(Translations.Products.ProductsGeneral)</div> 6762 <ul> 6763 {{>SearchProductsTemplate}} 6764 </ul> 6765 </script> 6766 6767 6768 } 6769 6770 6771 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6772 6773 @using System 6774 @using System.Web 6775 @using Df.Dw 6776 @using Dynamicweb.Rapido.Blocks.Extensibility 6777 @using Dynamicweb.Rapido.Blocks 6778 @* using System.Collections.Generic *@ 6779 6780 @{ 6781 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 6782 6783 Block primaryBottomSnippets = new Block() 6784 { 6785 Id = "MasterJavascriptInitializers", 6786 SortId = 100, 6787 Template = RenderPrimaryBottomSnippets() 6788 }; 6789 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 6790 } 6791 6792 @helper RenderPrimaryBottomSnippets() { 6793 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6794 6795 if (areaInfo.IsWireframeMode) 6796 { 6797 <script> 6798 Wireframe.Init(true); 6799 </script> 6800 } 6801 6802 6803 if (areaInfo.GoogleTagManagerID.HasValue()) 6804 { 6805 <script> 6806 document.addEventListener('addToCart', function(event) { 6807 var googleImpression = event.detail.productInfo.googleImpression; 6808 dataLayer.push({ 6809 'event': 'addToCart', 6810 'ecommerce': { 6811 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 6812 'add': { 6813 'products': [{ 6814 'name': googleImpression.name, 6815 'id': googleImpression.id, 6816 'price': googleImpression.price, 6817 'brand': googleImpression.brand, 6818 'category': googleImpression.category, 6819 'variant': googleImpression.variant, 6820 'quantity': event.detail.quantity 6821 }] 6822 } 6823 } 6824 }); 6825 }); 6826 </script> 6827 } 6828 6829 //if digitalwarehouse 6830 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 6831 { 6832 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 6833 6834 if (!cartContextId.HasValue()) { 6835 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 6836 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 6837 cartContextId = cartSettings.OrderContextID; 6838 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 6839 } 6840 6841 <script> 6842 let downloadCart = new DownloadCart({ 6843 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 6844 contextId: "@cartContextId", 6845 addButtonText: "@Translate(Translations.General.Add)", 6846 removeButtonText: "@Translate(Translations.General.Remove)" 6847 }); 6848 </script> 6849 } 6850 <!--@Javascripts--> 6851 6852 @RenderSnippet("Messenger") 6853 } 6854 6855 6856 6857 6858 @if (File.Exists(HttpContext.Current.Server.MapPath("Files/Templates/Designs/@DesignFolder/MasterBlocks/Custom__Blocks.cshtml"))) 6859 { 6860 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6861 6862 @using System 6863 @using System.Web 6864 @using Dynamicweb.Rapido.Blocks 6865 @using Dynamicweb.Rapido.Blocks.Extensibility 6866 @* using System.Collections.Generic *@ 6867 6868 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6869 6870 @using System 6871 @using System.Web 6872 @using Df.Dw 6873 @using Dynamicweb.Rapido.Blocks.Extensibility 6874 @using Dynamicweb.Rapido.Blocks 6875 @* using System.Collections.Generic *@ 6876 6877 6878 @{ 6879 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 6880 { 6881 Block masterToolsCustom = new Block() 6882 { 6883 Id = "MasterDesktopTools", 6884 SortId = 30, 6885 Template = RenderDesktopToolsCustom(), 6886 SkipRenderBlocksList = true, 6887 BlocksList = new List<Block> 6888 { 6889 new Block { 6890 Id = "MasterDesktopToolsText", 6891 SortId = 10, 6892 Template = RenderDesktopToolsTextCustom() 6893 }, 6894 new Block { 6895 Id = "MasterDesktopToolsNavigation", 6896 SortId = 20, 6897 Template = RenderDesktopToolsNavigationCustom() 6898 } 6899 } 6900 }; 6901 headerBlocksPage.ReplaceBlock(masterToolsCustom); 6902 } 6903 } 6904 6905 @helper RenderDesktopToolsCustom() 6906 { 6907 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 6908 6909 if (subBlocks.Count > 0) 6910 { 6911 <div class="m">@RenderBlockList(subBlocks)</div> 6912 } 6913 } 6914 6915 @helper RenderDesktopToolsTextCustom() 6916 { 6917 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6918 6919 if (areaInfo.ToolsText.HasValue()) 6920 { 6921 <div class="nav--tertiary m1"> 6922 <span><i class="@areaInfo.PhoneIcon"></i> @areaInfo.ContactNumber</span> 6923 <span><i class="@areaInfo.EmailIcon"></i> @areaInfo.ContactEmail</span> 6924 </div> 6925 } 6926 } 6927 6928 @helper RenderDesktopToolsNavigationCustom() 6929 { 6930 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6931 6932 @* if (areaInfo.RenderPagesInToolBar) 6933 { *@ 6934 <div class="nav--secondary m2"> 6935 @* @RenderNavigation(new 6936 { 6937 id = "topToolsNavigation", 6938 template = "TopMenu.xslt" 6939 }) *@ 6940 Urmareste comanda 6941 @RenderLanguageSelectorCustom() 6942 </div> 6943 @* } *@ 6944 } 6945 6946 @helper RenderLanguageSelectorCustom() 6947 { 6948 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 6949 6950 if (Model.Languages.Count > 1) 6951 { 6952 6953 <div> 6954 <i class="@areaInfo.LanguageIcon"></i> 6955 </div> 6956 <div> 6957 @foreach (var lang in Model.Languages) 6958 { 6959 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>" + lang.Name; 6960 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 6961 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 6962 6963 if (areaInfo.LanguageViewType == "flag-culture") 6964 { 6965 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 6966 } 6967 6968 if (areaInfo.LanguageViewType == "flag") 6969 { 6970 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 6971 } 6972 6973 if (areaInfo.LanguageViewType == "name") 6974 { 6975 langInfo = lang.Name; 6976 } 6977 6978 if (areaInfo.LanguageViewType == "culture") 6979 { 6980 langInfo = cultureName; 6981 } 6982 6983 <div> 6984 <a href="@areaInfo.LinkStart@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID">@langInfo</a> 6985 </div> 6986 } 6987 </div> 6988 } 6989 }</text> 6990 } 6991 6992 6993 @functions { 6994 public class ManifestIcon 6995 { 6996 public string 6997 src, 6998 type, 6999 sizes; 7000 } 7001 7002 public class Manifest 7003 { 7004 public string 7005 name, 7006 short_name, 7007 start_url, 7008 display, 7009 background_color, 7010 theme_color; 7011 public List<ManifestIcon> icons; 7012 } 7013 } 7014 7015 @{ 7016 if (areaInfo.AppName != null && areaInfo.AppIcon != null) { 7017 Manifest manifest = new Manifest 7018 { 7019 name = areaInfo.AppName, 7020 short_name = areaInfo.AppShortName != null ? areaInfo.AppShortName : areaInfo.AppName, 7021 start_url = "/", 7022 display = "standalone", 7023 background_color = areaInfo.AppBackgroundColor, 7024 theme_color = areaInfo.AppThemeColor 7025 }; 7026 7027 manifest.icons = new List<ManifestIcon> { 7028 new ManifestIcon { 7029 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7030 sizes = "192x192", 7031 type = "image/png" 7032 }, 7033 new ManifestIcon { 7034 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7035 sizes = "512x512", 7036 type = "image/png" 7037 }, 7038 new ManifestIcon { 7039 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + areaInfo.AppIcon.PathUrlEncoded, 7040 sizes = "1024x1024", 7041 type = "image/png" 7042 } 7043 }; 7044 7045 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/"+DesignFolder+"/manifest.json"); 7046 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 7047 string currentManifest = File.ReadAllText(manifestFilePath); 7048 7049 if (manifestJSON != currentManifest) 7050 { 7051 File.WriteAllText(manifestFilePath, manifestJSON); 7052 } 7053 } 7054 } 7055 7056 7057 @{ 7058 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 7059 var brandColors = swatches.GetColorSwatch(1); 7060 string brandColorOne = brandColors.Palette["BrandColor1"]; 7061 string currentLang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 7062 7063 7064 } 7065 7066 <!DOCTYPE html> 7067 7068 <html lang="@currentLang"> 7069 <head> 7070 <link rel="dns-prefetch" href="//fonts.googleapis.com"> 7071 <link rel="dns-prefetch" href="https://use.typekit.net"> 7072 <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> 7073 <link rel="preconnect" href="https://use.typekit.net" crossorigin> 7074 7075 <!-- Global site tag (gtag.js) - Google Analytics --> 7076 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-183505810-1"></script> 7077 <script> 7078 window.dataLayer = window.dataLayer || []; 7079 function gtag(){dataLayer.push(arguments);} 7080 gtag('js', new Date()); 7081 gtag('config', 'UA-183505810-1'); 7082 </script> 7083 7084 <!-- Rapido version 3.1.1 --> 7085 <meta charset="utf-8"/> 7086 <title>@areaInfo.AreaTitle</title> 7087 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7088 @if(!Model.MetaTags.Contains("robots")){ 7089 if(HttpContext.Current.Request["PageNum"] != null) 7090 { 7091 <meta name="robots" content="noindex, follow"> 7092 }else{ 7093 <meta name="robots" content="index, follow"> 7094 } 7095 } 7096 <meta name="theme-color" content="@areaInfo.AppThemeColor"/> 7097 7098 @{ 7099 if (!Model.MetaTags.Contains("og:image")) 7100 { 7101 if(Model.PropertyItem.GetFile("OpenGraphImage") != null) 7102 { 7103 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"))); 7104 } 7105 } 7106 7107 if (!Model.MetaTags.Contains("og:description")) { 7108 Pageview.Meta.AddTag("og:description", Model.Description); 7109 } 7110 7111 Pageview.Meta.AddTag("og:title", Model.Title); 7112 Pageview.Meta.AddTag("og:site_name", Model.Name); 7113 Pageview.Meta.AddTag("og:url", HttpContext.Current.Request.Url.ToString()); 7114 Pageview.Meta.AddTag("og:type", "Website"); 7115 Pageview.Meta.AddTag("fb:page_id", Model.ID.ToString()); 7116 } 7117 7118 @Model.MetaTags 7119 7120 7121 <!-- Favicon --> 7122 <link href="@areaInfo.LogoFavicon" rel="icon" type="image/png"> 7123 7124 @* <link relnpm="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"> *@ 7125 7126 @* Libraries *@ 7127 <!-- Google fonts --> 7128 @{ 7129 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))); 7130 } 7131 @* <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> *@ 7132 <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet"> 7133 <link rel="stylesheet" href="https://use.typekit.net/mki7ofu.css" > 7134 <link rel="stylesheet" id="variablesCss" href="@autoCssLink" type="text/css"> 7135 7136 7137 @* <link rel="stylesheet" href="@wizarisCssLink" type="text/css"> *@ 7138 <link rel="stylesheet" type="text/css" href="@ApplicationCssLink"> 7139 <link rel="stylesheet" type="text/css" href="@ApplicationDeferCssLink"> 7140 7141 7142 @if (areaInfo.AppName.HasValue()) 7143 { 7144 <link rel="manifest" href="/Files/Templates/Designs/@DesignFolder/manifest.json"> 7145 PushPromise("/Files/Templates/Designs/@DesignFolder/manifest.json"); 7146 } 7147 7148 7149 </head> 7150 7151 <body @areaInfo.HeaderSticky @areaInfo.PageBackground> 7152 <!-- Facebook Pixel Code --> 7153 <script> 7154 !function(f,b,e,v,n,t,s) 7155 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 7156 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 7157 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 7158 n.queue=[];t=b.createElement(e);t.async=!0; 7159 t.src=v;s=b.getElementsByTagName(e)[0]; 7160 s.parentNode.insertBefore(t,s)}(window,document,'script', 7161 'https://connect.facebook.net/en_US/fbevents.js'); 7162 fbq('init', '171206141310434'); 7163 fbq('track', 'PageView'); 7164 </script> 7165 <noscript> 7166 <img height="1" width="1" src="https://www.facebook.com/tr?id=171206141310434&ev=PageView&noscript=1"/> 7167 </noscript> 7168 <!-- End Facebook Pixel Code --> 7169 7170 7171 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 7172 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 7173 7174 @helper RenderMasterTop() 7175 { 7176 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 7177 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeaderTop").OrderBy(item => item.SortId).ToList(); 7178 7179 <div class="@areaInfo.CenterContainer"> 7180 @RenderBlockList(subBlocks) 7181 </div> 7182 } 7183 @helper RenderMasterHeader() 7184 { 7185 var areaInfo = Df.Dw.Rapido.AreaInfo.Current(); 7186 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 7187 7188 <header class="header @areaInfo.CenterContainer @areaInfo.CustomHeaderClass" id="Top"> 7189 @{ 7190 bool editParameterSection = !String.IsNullOrEmpty(HttpContext.Current.Request["edit"]) ? true : false; 7191 } 7192 @if (editParameterSection) 7193 { 7194 <div class="local-config"> 7195 <button type="button" class="switcher" name="style-1" value="1">1</button> 7196 <button type="button" class="switcher" name="style-1" value="2">2</button> 7197 <button type="button" class="switcher" name="style-1" value="3">3</button> 7198 <button type="button" class="switcher" name="style-1" value="4">4</button> 7199 <button type="button" class="switcher" name="style-1" value="5">5</button> 7200 <button type="button" class="switcher" name="style-1" value="6">6</button> 7201 </div> 7202 } 7203 7204 @RenderBlockList(subBlocks) 7205 </header> 7206 } 7207 7208 @helper RenderMain() 7209 { 7210 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 7211 7212 @RenderBlockList(subBlocks) 7213 } 7214 7215 @helper RenderPageContent() 7216 { 7217 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7218 7219 7220 @using Dynamicweb.Rapido.Blocks.Components 7221 @using Dynamicweb.Rapido.Blocks.Components.Articles 7222 @using Dynamicweb.Rapido.Blocks.Components.General 7223 @using Dynamicweb.Rapido.Blocks 7224 7225 @functions { 7226 BlocksPage articlePage = BlocksPage.GetBlockPage("NewsArticle"); 7227 } 7228 7229 @{ 7230 string image = !String.IsNullOrEmpty(Model.Item.GetString("Image")) ? Model.Item.GetFile("Image").PathUrlEncoded : ""; 7231 7232 ArticleHeader topBanner = new ArticleHeader 7233 { 7234 Layout = ArticleHeaderLayout.Clean, 7235 Image = new Image { Path = image }, 7236 Heading = Model.Item.GetString("Title"), 7237 Subheading = Model.Item.GetString("Summary"), 7238 TextColor = "#fff", 7239 Category = Model.Item.GetString("Author"), 7240 Date = Model.Item.GetString("Date"), 7241 ButtonLayout = ButtonLayout.Primary, 7242 TextLayout = ArticleHeaderTextLayout.Full 7243 }; 7244 7245 ButtonLayout buttonDesign; 7246 Enum.TryParse<ButtonLayout>(Model.Item.GetString("ButtonDesign"), out buttonDesign); 7247 if (Enum.GetName(typeof(ButtonLayout), buttonDesign).ToLower() == "none") 7248 { 7249 buttonDesign = ButtonLayout.Primary; 7250 } 7251 7252 Block articleContainer = new Block 7253 { 7254 Id = "ArticleContainer", 7255 SortId = 10, 7256 Design = new Design 7257 { 7258 RenderType = RenderType.Row 7259 }, 7260 BlocksList = new List<Block> { 7261 new Block { 7262 Id = "ArticleBody", 7263 SortId = 20, 7264 Design = new Design { 7265 RenderType = RenderType.Column, 7266 Size = "8" 7267 }, 7268 BlocksList = new List<Block> { 7269 new Block { 7270 Id = "ArticleBodyRow", 7271 SortId = 10, 7272 Design = new Design { 7273 RenderType = RenderType.Row 7274 }, 7275 BlocksList = new List<Block> { 7276 new Block { 7277 Id = "ArticleHeader", 7278 SortId = 10, 7279 Component = topBanner, 7280 Design = new Design { 7281 RenderType = RenderType.Column, 7282 Size = "12", 7283 HidePadding = true, 7284 CssClass = "article-head" 7285 } 7286 }, 7287 new Block { 7288 Id = "ArticleText", 7289 SortId = 20, 7290 Component = new ArticleText { Text = Model.Item.GetString("Text") }, 7291 Design = new Design { 7292 RenderType = RenderType.Column, 7293 Size = "12", 7294 CssClass = "u-padding--lg" 7295 } 7296 }, 7297 new Block { 7298 Id = "ArticleLink", 7299 SortId = 30, 7300 Component = new ArticleLink { Link = Model.Item.GetString("Link"), Title = Model.Item.GetString("LinkText"), ButtonLayout = buttonDesign }, 7301 Design = new Design { 7302 RenderType = RenderType.Column, 7303 Size = "12", 7304 CssClass = "u-padding--lg u-ta-right" 7305 } 7306 } 7307 } 7308 } 7309 } 7310 } 7311 } 7312 }; 7313 articlePage.Add(articleContainer); 7314 7315 if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 7316 { 7317 Block breadcrumb = new Block 7318 { 7319 Id = "ArticleBreadcrumb", 7320 SortId = 10, 7321 Component = new BreadcrumbNavigation { }, 7322 Design = new Design 7323 { 7324 RenderType = RenderType.Column, 7325 Size = "12" 7326 } 7327 }; 7328 articlePage.Add("ArticleContainer", breadcrumb); 7329 } 7330 } 7331 7332 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 7333 @RenderBlockList(articlePage.BlocksRoot.BlocksList) 7334 </text> 7335 } 7336 @RenderSnippet("BottomJS") 7337 7338 7339 7340 7341 <script type="module" src="https://unpkg.com/ionicons@5.0.0/dist/ionicons/ionicons.esm.js"></script> 7342 @* TODO: Florin: mutate callurile de axios in fisier JS *@ 7343 <script src="https://cdn.jsdelivr.net/npm/noty@3.1.4/lib/noty.min.js" defer></script> 7344 <script src="https://cdn.jsdelivr.net/npm/handlebars@4.7.6/dist/handlebars.min.js" defer></script> 7345 <script src="https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js" defer></script> 7346 <script src="https://cdn.jsdelivr.net/npm/flatpickr" defer></script> 7347 <script src="https://cdn.jsdelivr.net/npm/js-image-zoom/js-image-zoom.min.js" defer></script> 7348 <script src="https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js" defer></script> 7349 <script src="https://unpkg.com/@("@popperjs")/core@2" defer></script> 7350 <script src="https://unpkg.com/tippy.js@6" defer></script> 7351 7352 <script src="/Files/Templates/Designs/@DesignFolder/js/translations/translations_21.js" defer></script> 7353 @if (!string.IsNullOrEmpty(googleAPIKey)) 7354 { 7355 <script src="https://maps.googleapis.com/maps/api/js?key=@googleAPIKey&libraries=places&language=@currentLang" defer></script> 7356 } 7357 @* <script type="module" src="/Files/Templates/Designs/@DesignFolder/js/app.js"></script> *@ 7358 @* <script type="module" src="/Files/Templates/Designs/@DesignFolder/dist/app.bundle.js"></script> *@ 7359 @{ 7360 string scriptBundle = "/Files/Templates/Designs/"+DesignFolder+"/dist/app.bundle.js?ticks=" + Model.Area.UpdatedDate.Ticks; 7361 } 7362 <script src="@scriptBundle" defer></script> 7363 7364 7365 <script> 7366 7367 7368 window.googleEnchantImpressionClick = function (googleImpression) { 7369 if (typeof dataLayer !== 'undefined') { 7370 dataLayer.push({ 7371 'event': 'productClick', 7372 'ecommerce': { 7373 'click': { 7374 'actionField': { 7375 'list': googleImpression.list 7376 }, 7377 // Optional list property. 7378 'products': [{ 7379 'name': googleImpression.name, 7380 // Name or ID is required. 7381 'id': googleImpression.id, 7382 'price': googleImpression.price, 7383 'brand': googleImpression.brand, 7384 'category': googleImpression.category, 7385 'variant': googleImpression.variant, 7386 'position': googleImpression.position 7387 }] 7388 } 7389 }, 7390 'eventCallback': function () { 7391 console.log('callback from googleImpression' , googleImpression) 7392 // document.location = googleImpression.url; 7393 } 7394 }); 7395 } 7396 }; 7397 </script> 7398 7399 7400 </body> 7401 </html> 7402 7403