Exemple #1
0
        public ActionResult StoreThemeSelector()
        {
            if (!_storeInformationSettings.AllowCustomerToSelectTheme)
            {
                return(Content(""));
            }

            var model        = new StoreThemeSelectorModel();
            var currentTheme = _themeProvider.GetThemeConfiguration(_themeContext.WorkingDesktopTheme);

            model.CurrentStoreTheme = new StoreThemeModel()
            {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeProvider.GetThemeConfigurations()
                                         //do not display themes for mobile devices
                                         .Where(x => !x.MobileTheme)
                                         .Select(x =>
            {
                return(new StoreThemeModel()
                {
                    Name = x.ThemeName,
                    Title = x.ThemeTitle
                });
            })
                                         .ToList();
            return(PartialView(model));
        }
Exemple #2
0
        public ActionResult StoreThemeSelector()
        {
            if (!_themeSettings.AllowCustomerToSelectTheme)
            {
                return(Content(""));
            }

            var model        = new StoreThemeSelectorModel();
            var currentTheme = _themeRegistry.Value.GetThemeManifest(_themeContext.WorkingThemeName);

            model.CurrentStoreTheme = new StoreThemeModel()
            {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeRegistry.Value
                                         .GetThemeManifests()
                                         .Select(x =>
            {
                return(new StoreThemeModel
                {
                    Name = x.ThemeName,
                    Title = x.ThemeTitle
                });
            })
                                         .ToList();

            return(PartialView(model));
        }
        public ActionResult StoreThemeSelected(string themeName)
        {
            _themeContext.WorkingDesktopTheme = themeName;

            var model        = new StoreThemeSelectorModel();
            var currentTheme = _themeRegistry.GetThemeManifest(_themeContext.WorkingDesktopTheme);

            model.CurrentStoreTheme = new StoreThemeModel()
            {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeRegistry.GetThemeManifests()
                                         //do not display themes for mobile devices
                                         .Where(x => !x.MobileTheme)
                                         .Select(x =>
            {
                return(new StoreThemeModel()
                {
                    Name = x.ThemeName,
                    Title = x.ThemeTitle
                });
            })
                                         .ToList();
            return(PartialView("StoreThemeSelector", model));
        }
Exemple #4
0
        public ActionResult StoreThemeSelector()
        {
            if (!_storeInformationSettings.AllowCustomerToSelectTheme)
            {
                return(Content(""));
            }

            var model        = new StoreThemeSelectorModel();
            var currentTheme = _themeProvider.GetThemeConfiguration(_themeContext.WorkingThemeName);

            model.CurrentStoreTheme = new StoreThemeModel()
            {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };

            model.AvailableStoreThemes = _themeProvider.GetThemeConfigurations()
                                         .Select(m => new StoreThemeModel()
            {
                Name  = m.ThemeName,
                Title = m.ThemeTitle
            }).ToList();

            return(PartialView(model));
        }
        public ActionResult StoreThemeSelected(string themeName)
        {
            _themeContext.WorkingDesktopTheme = themeName;

            var model        = new StoreThemeSelectorModel();
            var currentTheme = _themeProvider.GetThemeConfiguration(_themeContext.WorkingDesktopTheme);

            model.CurrentStoreTheme = new StoreThemeModel()
            {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeProvider.GetThemeConfigurations()

                                         .Where(x => !x.MobileTheme)
                                         .Select(x =>
            {
                return(new StoreThemeModel()
                {
                    Name = x.ThemeName,
                    Title = x.ThemeTitle
                });
            })
                                         .ToList();
            return(PartialView("StoreThemeSelector", model));
        }
        private StoreThemeSelectorModel PrepareStoreThemeSelector()
        {
            var model = new StoreThemeSelectorModel();

            var currentTheme = _themeProvider.GetThemeConfiguration(_themeContext.WorkingThemeName);

            model.CurrentStoreTheme = new StoreThemeModel {
                Name  = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeProvider.GetThemeConfigurations()
                                         .Select(x => new StoreThemeModel {
                Name  = x.ThemeName,
                Title = x.ThemeTitle
            })
                                         .ToList();
            return(model);
        }
Exemple #7
0
        /// <summary>
        /// Prepare the store theme selector model
        /// </summary>
        /// <returns>Store theme selector model</returns>
        public virtual StoreThemeSelectorModel PrepareStoreThemeSelectorModel()
        {
            var model = new StoreThemeSelectorModel();

            var currentTheme = _themeProvider.GetThemeBySystemName(_themeContext.WorkingThemeName);

            model.CurrentStoreTheme = new StoreThemeModel
            {
                Name  = currentTheme?.SystemName,
                Title = currentTheme?.FriendlyName
            };

            model.AvailableStoreThemes = _themeProvider.GetThemes().Select(x => new StoreThemeModel
            {
                Name  = x.SystemName,
                Title = x.FriendlyName
            }).ToList();

            return(model);
        }
        /// <summary>
        /// Prepare the store theme selector model
        /// </summary>
        /// <returns>Store theme selector model</returns>
        public virtual async Task <StoreThemeSelectorModel> PrepareStoreThemeSelectorModelAsync()
        {
            var model = new StoreThemeSelectorModel();

            var currentTheme = await _themeProvider.GetThemeBySystemNameAsync(await _themeContext.GetWorkingThemeNameAsync());

            model.CurrentStoreTheme = new StoreThemeModel
            {
                Name  = currentTheme?.SystemName,
                Title = currentTheme?.FriendlyName
            };

            model.AvailableStoreThemes = (await _themeProvider.GetThemesAsync()).Select(x => new StoreThemeModel
            {
                Name  = x.SystemName,
                Title = x.FriendlyName
            }).ToList();

            return(model);
        }
        public ActionResult StoreThemeSelector()
        {
            if (!_storeInformationSettings.AllowCustomerToSelectTheme)
                return Content("");

            var model = new StoreThemeSelectorModel();
            var currentTheme = _themeProvider.GetThemeConfiguration(_themeContext.WorkingThemeName);
            model.CurrentStoreTheme = new StoreThemeModel
            {
                Name = currentTheme.ThemeName,
                Title = currentTheme.ThemeTitle
            };
            model.AvailableStoreThemes = _themeProvider.GetThemeConfigurations()
                .Select(x => new StoreThemeModel
                {
                    Name = x.ThemeName,
                    Title = x.ThemeTitle
                })
                .ToList();
            return PartialView(model);
        }