示例#1
0
        public async Task SetTheme(SetThemeInput input)
        {
            var theme = await _themeManager.GetTheme(input.ThemeId, _server);

            await _settingStore.UpdateAsync(Settings.ThemeInitialConfig(TenantId, theme.ThemeUniqueName));

            var themeFromFile = await _themeManager.GetThemeByThemeName(input.ThemeId, HttpContext.Current.Server);

            _pymeManager.SetMainPageContent(themeFromFile, input.KeepOldData);
        }
示例#2
0
        public async Task <ThemeSelectorOutput> GetThemesForSelector()
        {
            var themes =
                await _themeManager.GetAllThemesFromFiles(_server);

            var activeThemeName = await _settingStore.GetSettingOrNullAsync(TenantId, null, ConfigConst.Theme);

            var activeTheme = await _themeManager.GetTheme(activeThemeName.Value, _server);

            return(new ThemeSelectorOutput()
            {
                Themes = themes.Select(a => new ThemeDto()
                {
                    Id = a.ThemeUniqueName,
                    Preview = GetPreviewsFromFolder(a.PreviewsFolder, a.ThemeUniqueName),
                    Released = a.InDevelopment,
                    ThemeDescription = a.ThemeDescription,
                    ThemeName = a.ThemeName,
                    ThemeUniqueName = a.ThemeUniqueName,
                }).ToList(),
                ActiveTheme = activeTheme
            });
        }