Beispiel #1
0
        public static HtmlString AdminForm(DocumentNode Model, string adminUrl, string divClassName = "")
        {
            var div = new HtmlTag("div");

            if (divClassName != "") div.AddClass(divClassName);

            var form = new FormTag().Method("post").Action("#");

            form.Append(HtmlBuilder.HtmlTagLabelInput("Name (header)", "name", Model.Name));
            form.Append(new HtmlTag("input").Attr("type", "submit").Attr("name", "update").Attr("value", "Update"));
            form.Append(HtmlBuilder.HtmlTagLabelCheckbox("Hide header", "hideHeader", Model.HideHeader));
            form.Append(HtmlBuilder.HtmlTagLabelTextArea("Body text", "body", Model.Body));
            form.Append(HtmlBuilder.HtmlTagLabelTextArea("Extra content 1", "extraContent1", Model.ExtraContent1, 5));
            //form.Append(HtmlBuilder.HtmlTagLabelTextArea("Extra content 2", "extraContent2", Model.ExtraContent2, 5));
            //form.Append(HtmlBuilder.HtmlTagLabelTextArea("Extra content 3", "extraContent3", Model.ExtraContent3, 3));
            form.Append(HtmlBuilder.HtmlTagLabelInput("Author", "author", Model.Author));
            form.Append(HtmlBuilder.HtmlTagLabelInput("ViewPath", "viewPath", Model.ViewPath));
            form.Append(HtmlBuilder.HtmlTagLabelCheckbox("Hidden", "isHidden", Model.IsHidden));
            form.Append(HtmlBuilder.HtmlTagLabelCheckbox("Deleted", "isDeleted", Model.IsDeleted));
            form.Append(new HtmlTag("input").Attr("type", "submit").Attr("name", "update").Attr("value", "Update"));

            if (!String.IsNullOrEmpty(Model.Url))
            {
                form.Append(new HtmlTag("p").Append(new HtmlTag("a").Attr("href", Model.Url).Text("View page")));
            }

            div.Append(form);
            return new HtmlString(div.ToHtmlString());
        }
Beispiel #2
0
        private void InitializeDocumentNodes()
        {
            var rootNode = new DocumentNode("root");

            rootNode.HideHeader = true;
            rootNode.Body = "<h1>Welcome to NodeTreeCms.</h1><p>Add content by going to <a href=\"" + settings.AdminUrl + "\">the admin section.</a></p>";
            rootNode.ExtraContent3 = "This is a minimalistic CMS by @joeriks";
            rootNode.Author = "Jonas Eriksson";

            dbProvider.DocumentNode_Insert(rootNode, null);
        }