public override HtmlTag Build(ElementRequest request) { HtmlTag root = new HtmlTag("a"); root.Attr("href", "#"); root.Id(request.Accessor.FieldName); root.Append(new HtmlTag("span").Text(request.StringValue())); return root; }
public override HtmlTag Build(ElementRequest request) { HtmlTag root = new HtmlTag("a"); root.Attr("href", request.RawValue); root.Attr("target", "_blank"); root.Id(request.Accessor.FieldName); var img = new HtmlTag("img"); img.Attr("src", request.RawValue); root.Append(img); return root; }
public HtmlDocument get__fubu() { var document = new HtmlDocument { Title = "FubuMVC Diagnostics" }; writeStyles(document); var div = new HtmlTag("div"); div.Id("diagnostics"); var foot = new HtmlTag("foot"); document.Body.Children.Add(div); document.Body.Children.Add(foot); writeScripts(foot); return document; }
public HtmlTag ToHtmlTag() { AddClass("entity-link-list"); var rootTag = ToHtmlTagBase(); var ul = new HtmlTag("ul"); if (_filGroup) { ul.AddClasses(new[] { "ccMenu" }); }else { ul.AddClasses(new[] { "main-tabs" }); ul.Id("main-tabs"); } renderListItems(ul, _items); rootTag.Children.Add(ul); return rootTag; }
public HtmlTag FilterTemplatesFor(GridViewModel model) { var tag = new HtmlTag("div"); var containerNameForGrid = model.GridType.ContainerNameForGrid(); tag.Id("filters_" + containerNameForGrid); tag.AddClass("smart-grid-filter"); tag.Append(new TableTag()); var metadata = new Dictionary<string, object>{ {"gridId", "grid_" + model.GridName}, {"initialCriteria", model.InitialCriteria()} }; tag.MetaData("filters", metadata); var properties = model.FilteredProperties; var templates = _sources.Distinct().SelectMany(x => x.TagsFor(properties)); var operators = properties.Select(prop => { return new SelectTag(select => { prop.Operators.Each(oper => select.Option(oper.ToString(), oper.Key)); }).AddClass(prop.Accessor.Name); }); tag.Add("div", div => { div.Hide(); div.AddClass("templates"); div.Add("div").AddClass("smart-grid-editors").Append(templates); div.Add("div").AddClass("smart-grid-operators").Append(operators); div.Append(new SelectTag(select => { select.AddClass("smart-grid-properties"); properties.Each(prop => select.Option(prop.Header, prop.Accessor.Name)); })); }); return tag; }