public PartialViewResult ThemeInfo(string workspace, string collection, string theme) { var m = new AdminThemeModel(); m.CurrentThemeName = ThemeService.GetThemeName(Scope); m.InheritedThemeName = ThemeService.GetInheritedThemeName(Scope); if (theme == "(inherit)") { theme = ThemeService.GetInheritedThemeName(Scope.ToAbove()); m.Inherited = true; } m.Theme = ThemeService.GetTheme(theme); m.ThemeLocation = ThemeService.GetThemePath(theme); m.InstalledThemes = ThemeService.GetInstalledThemes().Select(t => ThemeService.GetTheme(t)); return PartialView("AdminThemeInfo", m); }
public ViewResult Theme(string workspace, string collection) { var m = new AdminThemeModel(); m.CurrentThemeName = ThemeService.GetThemeName(Scope); m.InheritedThemeName = ThemeService.GetInheritedThemeName(Scope); m.Inherited = ThemeService.GetThemeName(Scope) == null; m.Theme = ThemeService.GetTheme(m.InheritedThemeName); m.ThemeLocation = ThemeService.GetThemePath(m.InheritedThemeName); m.InstalledThemes = ThemeService.GetInstalledThemes().Select(t => ThemeService.GetTheme(t)); if (TempData["error"] != null) m.Errors.Add((string)TempData["error"]); if (TempData["applied"] != null) m.Notifications.Add("Success", "The theme was successfully updated."); else if (TempData["deleted"] != null) m.Notifications.Add("Success", "The theme was successfully deleted."); //temporary notification else if (m.Errors.Count == 0) m.Notifications.Add("So you've mastered CSS,", "then help us improve the theme system by creating a theme."); return View("AdminTheme", "Admin", m); }