Esempio n. 1
0
        private void SetLeftPanelContent(IHtmlElement panel)
        {
            var header = new HtmlElement(HtmlTag.Header).AddClass("row").Text(Logo ?? Title);

            panel.Append(header);

            var nav = new HtmlElement(HtmlTag.Nav).AddClass("row");

            panel.Append(nav);

            nav.Append(Menu);
        }
Esempio n. 2
0
        private void SetSearchAction(IHtmlElement header)
        {
            var form = new HtmlElement(HtmlTag.Form);

            header.Append(form);
            form.Attribute(HtmlAttribute.Method, "post").Attribute(HtmlAttribute.Action, SearchAction.Path);
            SearchAction.Behave.SetTargetAttribute(form);

            var input = new HtmlElement(HtmlTag.Input)
                        .Attribute(HtmlAttribute.Type, "text")
                        .Attribute(HtmlAttribute.Name, SearchInputName)
                        .AddClass("form-control");

            if (!string.IsNullOrEmpty(SearchAction.Display))
            {
                input.Attribute(HtmlAttribute.PlaceHolder, SearchAction.Display);
            }

            var button = new HtmlElement(HtmlTag.I).AddClass("fa fa-search");

            form.Append(input).Append(button);
            if (SearchAction == Location.Empty)
            {
                form.AddClass("hidden");
            }
        }
Esempio n. 3
0
        private void SetHeader(IHtmlElement header)
        {
            var bar = new HtmlElement(HtmlTag.Div).AddClass("webman-bar");

            header.Append(bar);
            bar.Append(Location.Create(null, null, FontAwesome.Bars, LinkBehave.Link).CreateElement());
            SetSearchAction(header);

            var nav = new HtmlElement(HtmlTag.Ul);

            header.Append(nav);
            foreach (var item in Taskbar)
            {
                item.Display = null;
                var a = item.CreateElement();
                a.AddClass("badge-container badge-bar");
                nav.Append(new HtmlElement(HtmlTag.Li).Append(a));
            }

            SetQuickMenu(nav);
        }
Esempio n. 4
0
        private void SetMainPanelContent(IHtmlElement panel)
        {
            var header = new HtmlElement(HtmlTag.Header).AddClass("row");

            panel.Append(header);
            SetHeader(header);

            var nav = new HtmlElement(HtmlTag.Nav).AddClass("row");

            panel.Append(nav);

            var breadcrumb = new HtmlElement(HtmlTag.Div).AddClass("webman-breadcrumb");

            nav.Append(breadcrumb);
            breadcrumb.Append(new HtmlElement(HtmlTag.Span).Text("位置: "));
            breadcrumb.Append(new HtmlElement(HtmlTag.Ul).AddClass("breadcrumb"));

            var main = new HtmlElement(HtmlTag.Div).AddClass("webman-content row");

            panel.Append(main);
        }
Esempio n. 5
0
 /// <summary>
 /// 添加到另一元素
 /// </summary>
 /// <param name="source"></param>
 /// <param name="element"></param>
 /// <returns></returns>
 public static IHtmlElement AppendTo(this IHtmlElement source, IHtmlElement element)
 {
     if (element == null)
     {
         return(source);
     }
     if (source == null)
     {
         return(source);
     }
     element.Append(source);
     return(source);
 }