Esempio n. 1
0
        public ActionResult AddSnippet(string name, bool ismobile)
        {
            var handler = new ThemeHandler(MASTERdomain, ismobile);
            var dirs    = handler.GetThemeDirectory().GetDirectories("snippets");

            if (dirs.Length == 0)
            {
                return(new EmptyResult());
            }
            // try to get existing template
            // if none exist then create blank file
            var filename = string.Format("{0}.liquid", name);
            var dest     = Path.Combine(dirs[0].FullName, filename);

            // if destination file exist, then delete destination file
            if (System.IO.File.Exists(dest))
            {
                System.IO.File.Delete(dest);
            }

            System.IO.File.Create(dest).Dispose();

            var viewmodel = new LiquidFileContent(handler.GetThemeUrl(), string.Format("/snippets/{0}", filename));

            return(View("filecontent", viewmodel));
        }
Esempio n. 2
0
        public ActionResult FileContent(string path, bool ismobile)
        {
            var handler   = new ThemeHandler(MASTERdomain, ismobile);
            var root      = handler.GetThemeUrl();
            var viewmodel = new LiquidFileContent(root, path);

            return(View(viewmodel));
        }