/// <summary>
        /// Renders the page to the provided <see cref="StringBuilder"/>.
        /// </summary>
        /// <param name="sb">The <see cref="StringBuilder"/> to render to.</param>
        protected override void RenderHtml(StringBuilder sb)
        {
            sb.AppendLine("<!DOCTYPE html>")
            .AppendLine("<meta charset=\"utf-8\">")
            .AppendLine("<html>")
            .AppendLine("  <head>")
            .AppendFormat("    <title>{0}</title>", PageTitle.HtmlEncode()).AppendLine();
            if (InlineCSS)
            {
                sb.Append("    <style>").Append(Resources.BundleCss.Content).AppendLine("</style>");
            }
            else
            {
                sb.AppendFormat("    <link rel=\"stylesheet\" type=\"text/css\" href=\"{0}?v={1}\" integrity=\"sha512-{1}\" crossorigin=\"anonymous\"/>", Url(KnownRoutes.Css), Resources.BundleCss.Sha512).AppendLine();
            }

            foreach (var css in Settings.Render.CSSIncludes)
            {
                sb.AppendFormat("    <link rel=\"stylesheet\" type=\"text/css\" href=\"{0}\" />", css).AppendLine();
            }

            sb.AppendFormat("    <script>var baseUrl = '{0}';</script>", Url("")).AppendLine();
            if (Error != null)
            {
                sb.Append("    <script>var Exception = ");
                Error.WriteDetailedJson(sb);
                sb.AppendLine(";</script>");
            }

            if (IncludeJS)
            {
                sb.AppendFormat("    <script src=\"{0}?v={1}\" integrity=\"sha512-{1}\" crossorigin=\"anonymous\"></script>", Url(KnownRoutes.Js), Resources.BundleJs.Sha512).AppendLine();
            }
            foreach (var js in Settings.Render.JSIncludes)
            {
                sb.AppendFormat("    <script src=\"{0}\"></script>", js).AppendLine();
            }
            sb.AppendLine("  </head>")
            .AppendLine("  <body>")
            .AppendLine("    <div class=\"wrapper\">")
            .AppendFormat("      <header{0}>{1}</header>", Store.InFailureMode ? " class=\"failure\"" : "", HeaderTitle).AppendLine()
            .AppendLine("      <main>");

            // Render the page inheriting from us
            RenderInnerHtml(sb);
            sb.AppendLine("      </main>")
            .AppendLine("      <div class=\"bottom\"></div>")
            .AppendLine("    </div>")
            .AppendLine("    <footer>")
            .Append("      <div class=\"version-info\">Exceptional ").Append(typeof(Error).Assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion)
            .Append("<br/>")
            .AppendHtmlEncode(Store.Name).AppendLine("</div>")
            .Append("      <div class=\"server-time\">Server time is ").Append(DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ")).AppendLine("</div>")
            .AppendLine("    </footer>")
            .AppendLine("  </body>")
            .AppendLine("</html>");
        }
Beispiel #2
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\n");
            this.Write("\n");
            this.Write("\n");
            this.Write("<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta http-equiv=\"\"X-UA-Compatible" +
                       "\"\" content=\"\"IE=edge\"\" />\r\n    <meta charset=\"utf-8\">\r\n    <title>");

            #line 11 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsWpfControls\ContentHistoryView\ContentViewHistoryPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PageTitle.HtmlEncode()));

            #line default
            #line hidden
            this.Write(@" - Photographs</title>

    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
    <style>
        .item-list {
            display: flex;
            flex-wrap: wrap;
        }

        .item-list-container {
            box-shadow: 0 0 4px 0px #909090;
            margin: 1rem;
        }

        .item-list-content {
            margin: 1rem;
        }
    </style>
</head>

<body>
    ");

            #line 32 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsWpfControls\ContentHistoryView\ContentViewHistoryPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.TitleDiv(ContentTitle).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    <div class=\"item-list\">\r\n        ");

            #line 34 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsWpfControls\ContentHistoryView\ContentViewHistoryPage.tt"
            foreach (var loopItem in Items)
            {
            #line default
            #line hidden
                this.Write("       <div class=\"item-list-container\">\r\n            <div class=\"item-list-conte" +
                           "nt\">\r\n                ");

            #line 38 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsWpfControls\ContentHistoryView\ContentViewHistoryPage.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(loopItem));

            #line default
            #line hidden
                this.Write("\r\n            </div>\r\n       </div>\r\n       ");

            #line 41 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsWpfControls\ContentHistoryView\ContentViewHistoryPage.tt"
            }

            #line default
            #line hidden
            this.Write("      </div>\r\n</body>\r\n\r\n</html>");
            return(this.GenerationEnvironment.ToString());
        }