public ActionResult Index()
        {
            var settings = _settingsService.GetSettings();

            var viewModel = new ThemeSettingsViewModel
            {
                AccentCss     = settings.AccentCss,
                BackgroundCss = settings.BackgroundCss,
                Tagline       = settings.Tagline,
                UseBranding   = settings.UseBranding,
                UseCustomCss  = settings.UseCustomCss,
            };

            /************************************************************************************
            * Custom CSS is managed in "CustomCss" action
            ************************************************************************************
            *
            * string customCssAbsolutePath = Server.MapPath(Constants.CUSTOM_CSS_VIRTUAL_PATH);
            * if (System.IO.File.Exists(customCssAbsolutePath))
            *     viewModel.CustomCss = System.IO.File.ReadAllText(customCssAbsolutePath);
            *
            ************************************************************************************/

            return(View(viewModel));
        }
        protected override void Exporting(KrakeDefaultThemeSettingsPart part, ExportContentContext context)
        {
            var settings = _themeSettingsService.GetSettings();
            var root     = context.Element(part.PartDefinition.Name);

            root.SetAttributeValue("HeaderLogoUrl", settings.HeaderLogoUrl);
            root.SetAttributeValue("PlaceholderLogoUrl", settings.PlaceholderLogoUrl);
            root.SetAttributeValue("BaseLineText", settings.BaseLineText);
        }
示例#3
0
        public ActionResult Index()
        {
            var settings = _settingsService.GetSettings();

            var viewModel = new ThemeSettingsViewModel {
                AccentCss = settings.AccentCss,
            };

            return(View(viewModel));
        }
        public ActionResult ThemeSettings()
        {
            var settings  = _settingsService.GetSettings();
            var viewModel = new ThemeSettingsViewModel {
                BaseLineText       = settings.BaseLineText,
                HeaderLogoUrl      = settings.HeaderLogoUrl,
                PlaceholderLogoUrl = settings.PlaceholderLogoUrl,
            };

            return(View("~/Themes/KrakeDefaultTheme/Views/admin/ThemeSettings.cshtml", viewModel));
        }
        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
            };

            return(View(viewModel));
        }
示例#6
0
        private void AddCss()
        {
            var settings = _settingsService.GetSettings();

            // Add Swatch
            if (!String.IsNullOrEmpty(settings.Swatch))
            {
                _resourceManager.Require("stylesheet", settings.Swatch)
                .AtHead();
            }

            System.Web.HttpContext.Current.Items[Constants.UseSwatchName] = settings.Swatch.ToString();

            // Add Bootstrap Responsive
            _resourceManager.Require("stylesheet", ResourceManifest.BOOTSTRAP_RESPONSIVE_STYLE)
            .AtHead();

            // Add Bootswatch
            _resourceManager.Require("stylesheet", ResourceManifest.BOOTSWATCH_STYLE)
            .AtHead();

            // Add Theme Overrides
            _resourceManager.Require("stylesheet", ResourceManifest.CUSTOM_STYLE)
            .AtHead();
        }
示例#7
0
        private void AddCss()
        {
            var settings = _settingsService.GetSettings();

            // Add Bootstrap
            _resourceManager.Require("stylesheet", ResourceManifest.BOOTSTRAP_STYLE)
            .AtHead();

            // Add Base and Accent Color Theme, Add Theme Overrides
            _resourceManager.Require("stylesheet", ResourceManifest.CORE_STYLE)
            .AtHead();

            if (!String.IsNullOrEmpty(settings.AccentCss))
            {
                _resourceManager.Require("stylesheet", settings.AccentCss)
                .AtHead();
            }

            _resourceManager.Require("stylesheet", ResourceManifest.CUSTOM_STYLE)
            .AtHead();

            // Add Bootstrap Responsive
            _resourceManager.Require("stylesheet", ResourceManifest.BOOTSTRAP_RESPONSIVE_STYLE)
            .AtHead();
        }
        public ActionResult Index()
        {
            var settings         = _settingsService.GetSettings();
            var additionalThemes = _settingsService.GetThemes();
            var viewModel        = new ThemeSettingsViewModel {
                Swatch           = settings.Swatch,
                UseFixedNav      = settings.UseFixedNav,
                UseNavSearch     = settings.UseNavSearch,
                UseFluidLayout   = settings.UseFluidLayout,
                UseInverseNav    = settings.UseInverseNav,
                UseStickyFooter  = settings.UseStickyFooter,
                TagLineText      = settings.TagLineText,
                AdditionalThemes = additionalThemes,
            };

            return(View("OptionsIndex", viewModel));
        }
示例#9
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            // ignore filter on admin pages
            if (AdminFilter.IsApplied(filterContext.RequestContext))
            {
                return;
            }

            // should only run on a full view rendering result
            if (!(filterContext.Result is ViewResult))
            {
                return;
            }

            var settings = _settingsService.GetSettings();

            if (String.IsNullOrEmpty(settings.Swatch))
            {
                return;
            }

            var themeName = _siteThemeService.GetSiteTheme();

            if (themeName.Name == Constants.ThemeName)
            {
                var viewResult = filterContext.Result as ViewResult;
                if (viewResult == null)
                {
                    return;
                }

                if (settings.UseFixedNav)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.UseFixedNav] = settings.UseFixedNav.ToString();
                }
                if (settings.UseNavSearch)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.UseNavSearch] = settings.UseNavSearch.ToString();
                }
                if (settings.UseFluidLayout)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.UseFluidLayout] = settings.UseFluidLayout.ToString();
                }
                if (settings.UseInverseNav)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.UseInverseNav] = settings.UseInverseNav.ToString();
                }
                if (settings.UseStickyFooter)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.UseStickyFooter] = settings.UseStickyFooter.ToString();
                }
            }
        }
示例#10
0
        private void AddCss()
        {
            var settings = _settingsService.GetSettings();

            // Add Base Structure, Base and Accent Color Theme and Media Queries CSS
            _resourceManager.Require("stylesheet", ResourceManifest.CORE_STYLE)
            .AtHead();

            if (!String.IsNullOrEmpty(settings.BackgroundCss))
            {
                _resourceManager.Require("stylesheet", settings.BackgroundCss)
                .AtHead();
            }

            if (!String.IsNullOrEmpty(settings.AccentCss))
            {
                _resourceManager.Require("stylesheet", settings.AccentCss)
                .AtHead();
            }

            _resourceManager.Require("stylesheet", ResourceManifest.MEDIA_QUERIES_STYLE)
            .AtHead();

            // Add Hack CSS
            _resourceManager.Require("stylesheet", ResourceManifest.IE7_HACK_STYLE)
            .UseCondition("IE 7")
            .AtHead();

            //_resourceManager.Require("stylesheet", ResourceManifest.IE6_HACK_STYLE)
            //                .UseCondition("IE 6")
            //                .AtHead();

            // Add Custom CSS if request
            if (settings.UseCustomCss)
            {
                _resourceManager.Require("stylesheet", ResourceManifest.CUSTOM_STYLE)
                .AtHead();
            }

            // Add Respond.js v1.1.0
            _resourceManager.Require("script", ResourceManifest.RESPOND_SCRIPT)
            .UseCondition("lt IE 9")
            .AtHead();
        }
示例#11
0
        private void AddCss()
        {
            var settings = _settingsService.GetSettings();

            // Add Swatch
            if (!String.IsNullOrEmpty(settings.Swatch))
            {
                _resourceManager.Require("stylesheet", settings.Swatch)
                .AtHead();
            }

            System.Web.HttpContext.Current.Items[Constants.UseSwatchName] = settings.Swatch.ToString();

            // Add Bootswatch
            _resourceManager.Require("stylesheet", ResourceManifest.BootswatchStyle)
            .AtHead();

            // Add Theme Overrides
            _resourceManager.Require("stylesheet", ResourceManifest.CustomStyle)
            .AtHead();
        }
示例#12
0
        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            // ignore filter on admin pages
            if (AdminFilter.IsApplied(filterContext.RequestContext))
            {
                return;
            }

            // should only run on a full view rendering result
            if (!(filterContext.Result is ViewResult))
            {
                return;
            }

            var settings = _settingsService.GetSettings();

            if (String.IsNullOrEmpty(settings.AccentCss))
            {
                return;
            }

            var themeName = _siteThemeService.GetSiteTheme();

            if (themeName.Name == Constants.THEME_NAME)
            {
                var viewResult = filterContext.Result as ViewResult;
                if (viewResult == null)
                {
                    return;
                }

                if (settings.UseBranding)
                {
                    /* TODO: Replace note use Items collection */
                    System.Web.HttpContext.Current.Items[Constants.ITEM_USE_BRANDING] = settings.UseBranding.ToString();
                    System.Web.HttpContext.Current.Items[Constants.ITEM_TAGLINE]      = settings.Tagline;
                }
            }
        }