public static HtmlConvention AddMiruBootstrapLayout(this HtmlConvention cfg) { cfg.Labels.Always.AddClass("col-md-4 col-form-label text-md-right"); cfg.Labels.IfPropertyIs <bool>().ModifyTag(tag => tag.Class("form-check-label")); return(cfg); }
public static HtmlConvention AddTwitterBootstrap(this HtmlConvention cfg) { cfg.Editors.Always.AddClass("form-control"); cfg.Selects.Always.AddClass("form-control"); cfg.Submits.Always.AddClass("btn btn-primary"); // cfg.FormSummaries.Always.AddClass("alert alert-danger d-none"); cfg.Editors.IfPropertyIs <bool>().ModifyWith(m => m.CurrentTag.Class("form-check-input")); cfg.TableHeader.IfPropertyIs <decimal>().AddClass("text-right"); cfg.TableHeader.IfPropertyIs <long>().AddClass("text-right"); cfg.TableHeader.IfPropertyIs <int>().AddClass("text-right"); cfg.Cells.IfPropertyIs <decimal>().AddClass("text-right"); cfg.Cells.IfPropertyIs <long>().AddClass("text-right"); cfg.Cells.IfPropertyIs <int>().AddClass("text-right"); return(cfg); }
public static HtmlConvention AddRailsUjs(this HtmlConvention cfg) { cfg.Forms.Always.Attr("data-remote", "true"); return(cfg); }
public static void InputHiddenForIds(this HtmlConvention cfg) { cfg.Editors .IfPropertyNameEnds("Id") .ModifyWith(m => m.CurrentTag.Attr("type", "hidden")); }
public static void InputForPassword(this HtmlConvention cfg) { cfg.Editors .If(_ => _.Accessor.Name.Contains("Password")) .ModifyWith(m => m.CurrentTag.Attr("type", "password")); }
public static void InputForBoolean(this HtmlConvention cfg) { cfg.Editors .IfPropertyIs <bool>() .ModifyWith(m => m.CurrentTag.Attr("value", true)); }