Error executing template "Designs/Wizaris/_parsed/Product.parsed.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Cannot open database "df_total-tools_dw" requested by the login. The login failed.
Login failed for user 'd0tFusi0n'.
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Ecommerce.Products.ProductRepository.GetProductsCountByGroups(IEnumerable`1 groupIds, Boolean countOnlyActive, String searchValue, String productLanguageId, Boolean includeVariants, Boolean doRefactoring, Boolean searchInAllFields)
   at Dynamicweb.Ecommerce.Products.Group.<GetProductsCountByGroups>d__181.MoveNext()
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.SetProductCountOnGroups(Dictionary`2 groupNavigationItemMap)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<RenderPageContent>b__159_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 7285
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass4_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 894
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass3_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 808
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<RenderMain>b__158_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 7258
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass4_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 894
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass3_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 808
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass4_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 916
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.<>c__DisplayClass3_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 808
   at CompiledRazorTemplates.Dynamic.RazorEngine_1fbb792e0f464b1e8c5b867fc39ae195.Execute() in C:\inetpub\wwwroot\www.total.ro\Files\Templates\Designs\Wizaris\_parsed\Product.parsed.cshtml:line 7218
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
ClientConnectionId:c35fd151-8c68-456d-bdb5-95c16dd9dbf2
Error Number:4060,State:1,Class:11

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