public static MvcHtmlString PhotoGallery(this HtmlHelper htmlHelper, List<Image> images) { var ul = Tags.UL.Id("gallery").AddClasses(Foundation3.GetBlockGridColumnsCss(4, 2)); ul.Data(Foundation3.Attributes.Clearing, ""); //ul.Attr("data-clearing"); foreach (var image in images) { ul.Append(Tags.ListItem.Append(new AnchorTag().Href(image.Url, new ImageTag(image.Url, image.Caption, true)))); } var row = new DivTag().AddClass(Foundation3.Classes.Row) .Append( Tags.Div.AddClass(Foundation3.GetColumnsCss(12, true)) .Append(Tags.Div.Append( new List<HtmlTag> { Tags.H2.Text("put configuration.title here"), Tags.H3.Text("configuration.Date.ToShortDateString()"), Tags.PTag.Text("configuration.Description") } ) ) .Append(ul) ) .After(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/jquery.event.move.js")) .Append(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/jquery.event.swipe.js")) .Append(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/jquery.foundation.clearing.js")) .Append(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/jquery.foundation.mediaQueryToggle.js")) .Append(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/jquery.foundation.orbit.js")) .Append(new ScriptTag("/dx1/Content/Scripts/Libs/foundation/app.js")) .Append(new StyleLink("/dx1/Content/Modules/photoGallery/Css/photoGallery.css")); return MvcHtmlString.Create(row.ToString()); }
public static HtmlTag Clear(this IFubuPage page, int height = 0) { var tag = new DivTag().AddClass("clear"); if (height != 0) { tag.Style("height", height + "px"); } return tag; }
private static HtmlTag MakeRadioButton(string display, object value, string name) { DivTag divTag = new DivTag(display); HtmlTag radioButton = new RadioButtonTag(false).Attr("value", value).Attr("name",name); HtmlTag label = new HtmlTag("label").Text(display); label.Append(radioButton); divTag.Append(label); return divTag; }
public static HtmlTag DebugGrid(this HtmlHelper htmlHelper) { var tag = new DivTag(); tag.Append(new DivTag().AddClass("alert alert-info text-center visible-xs").Text("Extra Small")) .Append(new DivTag().AddClass("alert alert-info text-center visible-sm").Text("Small")) .Append(new DivTag().AddClass("alert alert-info text-center visible-md").Text("Medium")) .Append(new DivTag().AddClass("alert alert-info text-center visible-lg").Text("Large")); return tag; }
public HtmlDocument Products_Id(ViewProductRequest request) { var product = _crudService.Retrieve(request.Id); var document = new HtmlDocument(); var container = new DivTag(""); container.Append(new HtmlTag("h1").Text(product.Number + " - " + product.Name)); container.Append(new HtmlTag("h2").Text("$" + product.Price.ToString("F2"))); container.Append(new HtmlTag("h3").Text(product.Description)); document.Add(container); return document; }
public CombinationConventions() { Inputs.If<CombinationType>().BuildBy((r,p) => { var val = r.GetValue<CombinationType>(); if (val.IsSingle) { var div = new DivTag().Text(val.Name); var hidden = new HiddenTag().Id(r.Id).Attr("name", r.Name).Attr("value", val.Value); hidden.WrapWith(div); return hidden.RenderFromTop(); } return p.Build<CombinationType>(x=>x.Items); }); All.If<DateTime>().Modify((h, r) => { var val = r.GetValue<DateTime>(); h.Text(val.ToString("yyyyMMdd")); }); }
protected virtual void WrapFieldWithDiv(IDefinedConventions editor) { editor. If(WhenToWrapFields) .Modify((tag, model) => { var wrapper = new DivTag(); if (tag is MvcCheckboxElement) { wrapper.AddClass("checkbox"); } else { wrapper.AddClass("form-group"); } if (model.ValidationFailed) { wrapper.AddClass("has-error"); } return tag.WrapWith(wrapper); }); }
private void wrapInCollapsable(string title, Action<HtmlTag> stuff) { var id = Guid.NewGuid().ToString(); var hid = "h" + id; _document.Add("h2") .AddClass("header") .Text(title) .Id(hid); var div = new DivTag(id); div.Style("display", "none"); stuff(div); _document.Add(div); }