コード例 #1
0
        public ActionResult Index() {
            var settings = _settingsService.GetSettings();

            var viewModel = new ThemeSettingsViewModel {
                Swatch = settings.Swatch,
                UseFixedNav = settings.UseFixedNav,
                UseNavSearch = settings.UseNavSearch,
                UseFluidLayout = settings.UseFluidLayout,
                UseInverseNav = settings.UseInverseNav,
                UseStickyFooter = settings.UseStickyFooter,
                UseHoverMenu = settings.UseHoverMenu,
                BlogPostLayout = settings.BlogPostLayout
            };

            return View(viewModel);
        }
コード例 #2
0
        public ActionResult Index(ThemeSettingsViewModel viewModel) {
            if (!Services.Authorizer.Authorize(Bootstrap.Permissions.ManageThemeSettings, T("Couldn't update Bootstrap settings")))
                return new HttpUnauthorizedResult();

            var settings = _settingsService.GetSettings();
            settings.Swatch = viewModel.Swatch;
            settings.UseFixedNav = viewModel.UseFixedNav;
            settings.UseNavSearch = viewModel.UseNavSearch;
            settings.UseFluidLayout = viewModel.UseFluidLayout;
            settings.UseInverseNav = viewModel.UseInverseNav;
            settings.UseStickyFooter = viewModel.UseStickyFooter;
            settings.UseHoverMenu = viewModel.UseHoverMenu;
            settings.BlogPostLayout = viewModel.BlogPostLayout;

            Services.Notifier.Information(T("Your settings have been saved."));

            return View(viewModel);
        }