示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        public static HtmlConvention AddRailsUjs(this HtmlConvention cfg)
        {
            cfg.Forms.Always.Attr("data-remote", "true");

            return(cfg);
        }
示例#4
0
 public static void InputHiddenForIds(this HtmlConvention cfg)
 {
     cfg.Editors
     .IfPropertyNameEnds("Id")
     .ModifyWith(m => m.CurrentTag.Attr("type", "hidden"));
 }
示例#5
0
 public static void InputForPassword(this HtmlConvention cfg)
 {
     cfg.Editors
     .If(_ => _.Accessor.Name.Contains("Password"))
     .ModifyWith(m => m.CurrentTag.Attr("type", "password"));
 }
示例#6
0
 public static void InputForBoolean(this HtmlConvention cfg)
 {
     cfg.Editors
     .IfPropertyIs <bool>()
     .ModifyWith(m => m.CurrentTag.Attr("value", true));
 }