Esempio n. 1
0
        public HtmlDocument Index()
        {
            _document.Title = "Storyteller 3";

            writeInitialDataIntoPage(_document);

            _document.Add("div").Id("header-container");
            _document.Add("div").Id("body-pane").AddClass("container");

            if (File.Exists(_files.RootPath.AppendPath("public", "stylesheets", "storyteller.css")))
            {
                _tags.BuildStylesheetTags(new[] { "bootstrap.min.css", "storyteller.css", "font-awesome.min.css" });
            }
            else
            {
                BatchResultsWriter.WriteCSS(_document);
                _document.Head.Add("link")
                .Attr("rel", "stylesheet")
                .Attr("href", "//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css");
            }

            _document.Body.Append(_document.Script("bundle.js"));

            return(_document);
        }
Esempio n. 2
0
        public HtmlDocument Index()
        {
            _document.Title = "Storyteller 3";

            writeInitialDataIntoPage(_document);

            _document.Add("div").Id("header-container");
            _document.Add("div").Id("body-pane").AddClass("container");
            _document.Add("div").Id("main");

            if (File.Exists(_files.RootPath.AppendPath("public", "stylesheets", "storyteller.css")))
            {
                var stylesheets = new[] { "bootstrap.min.css", "storyteller.css", "font-awesome.min.css" };
                var tags        = stylesheets.Select(file =>
                {
                    var path = $"/public/stylesheets/{file}";
                    return(new HtmlTag("link").Attr("rel", "stylesheet").Attr("href", path));
                });

                _document.Head.Append(tags);
            }
            else
            {
                BatchResultsWriter.WriteCSS(_document);
                _document.Head.Add("link")
                .Attr("rel", "stylesheet")
                .Attr("href", "//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");
            }

            var scriptTag = new HtmlTag("script").Attr("type", "text/javascript").Attr("src", "/bundle.js");

            _document.Body.Append(scriptTag);

            return(_document);
        }
Esempio n. 3
0
        private void writeClientSideAssetsFromEmbeds()
        {
            BatchResultsWriter.WriteCSS(_document);
            _document.Head.Add("link")
            .Attr("rel", "stylesheet")
            .Attr("href", "//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");


            var bundleJS = typeof(HomeEndpoint).GetAssembly()
                           .GetManifestResourceStream("ST.bundle.js").ReadAllText();

            var scriptTag = new HtmlTag("script").Attr("type", "text/javascript").Text(bundleJS).Encoded(false);

            _document.Body.Append(scriptTag);
        }