コード例 #1
0
        protected IActionResult CommonReplaces(string htmlName)
        {
            var html = this.getHtml.GetContent(htmlName);

            var script = TagHelper.ToHtml(HtmlHelper.GetBodyScript());

            html = html.Replace("{{script}}", script);
            var css = TagHelper.ToHtml(HtmlHelper.GetHeadCss());

            html = html.Replace("{{css}}", css);
            html = html.Replace("{{copyright}}", HtmlHelper.GetCopyRight());
            html = html.Replace("{{navbar}}", Navigation.GetNavbar());
            html = html.Replace("{{footernav}}", HtmlHelper.GetFooter());

            if (htmlName == HtmlFile.ContactUsHtml)
            {
                html = html.Replace("navbar navbar-primary navbar-transparent navbar-absolute", "navbar navbar-inverse navbar-fixed-top");
            }

            if (htmlName == HtmlFile.IndexHtml)
            {
                html = html.Replace("{{ManualRotatingCards}}", new ManualRotatingCard().ToHtml());
                html = html.Replace("{{table}}", new Table().ToHtml());
                html = html.Replace("{{Tooltips}}", Tooltip.Generate());
                html = html.Replace("{{Popovers}}", Popovers.Generate());
                html = html.Replace("{{buttons}}", Button.Generate());
                html = html.Replace("{{pickSizeButtons}}", XSmallButton.Generate());
                html = html.Replace("{{ColoredButton}}", ColoredButton.Generate());
                html = html.Replace("{{Input}}", LabeledInput.Generate());
                html = html.Replace("{{Checkbox}}", Checkbox.Generate());
                html = html.Replace("{{RadioButton}}", RadioButton.Generate());
                html = html.Replace("{{ToggleButton}}", ToggleButton.Generate());
                html = html.Replace("{{Dropdown}}", new Dropdown().ToHtml());
                html = html.Replace("{{Textarea}}", new Textarea().ToHtml());
                html = html.Replace("{{SelectPicker}}", new SingleSelect().ToHtml());
                html = html.Replace("{{MultipleSelect}}", new MultipleSelect().ToHtml());
                html = html.Replace("{{Tags}}", new HtmlTag().ToHtml());
            }

            if (htmlName == HtmlFile.ScheduleHtml)
            {
                html = html.Replace("{{ManualRotatingCards}}", new SchedulePage().ToHtml());
            }

            return(this.HtmlResult(html));
        }