Ejemplo n.º 1
0
        public ActionResult CreateTheme(ThemeViewModel model)
        {
            if (IsModelValidAndPersistErrors())
            {
                Theme theme = new Theme()
                {
                    DisplayName = model.DisplayName,
                    FolderName = model.FolderName,
                    Name = model.Name,
                    VisibleToUsers = model.VisibleToUsers
                };
                _themeRepository.Add(theme);

                if (model.DefaultTheme)
                    _themeServices.ChangeDefaultTheme(theme.ThemeID);

                SetSuccess("Theme Created");
                return RedirectToAction("Themes");
            }

            return RedirectToSelf();
        }
Ejemplo n.º 2
0
        public ActionResult EditTheme(ThemeViewModel model)
        {
            if (IsModelValidAndPersistErrors())
            {
                Theme theme = _themeRepository.Get(model.ThemeID);
                theme.DisplayName = model.DisplayName;
                theme.FolderName = model.FolderName;
                theme.Name = model.Name;
                theme.ThemeID = model.ThemeID;
                theme.VisibleToUsers = model.VisibleToUsers;
                _themeRepository.Update(theme);

                if (model.DefaultTheme)
                    _themeServices.ChangeDefaultTheme(theme.ThemeID);

                SetSuccess("Theme updated");
                return RedirectToAction("Themes");
            }

            return RedirectToSelf(new { ThemeID = model.ThemeID });
        }
Ejemplo n.º 3
0
        public ActionResult EditTheme(int ThemeID)
        {
            Theme theme = _themeRepository.Get(ThemeID);

            ThemeViewModel model = new ThemeViewModel()
            {
                DefaultTheme = SiteConfig.BoardTheme.ToInt() == theme.ThemeID,
                DisplayName = theme.DisplayName,
                FolderName = theme.FolderName,
                Name = theme.Name,
                ThemeID = theme.ThemeID,
                VisibleToUsers = theme.VisibleToUsers
            };

            return View(model);
        }
Ejemplo n.º 4
0
 public ActionResult CreateTheme()
 {
     ThemeViewModel model = new ThemeViewModel();
     return View(model);
 }