Example #1
0
        public static string GetFormGroupClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "control-group";
            }

            return "form-group";
        }
Example #2
0
        public static string GetFormGroupWarningClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "warning";
            }

            return "has-warning";
        }
Example #3
0
        public static string GetFormGroupSuccessClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "success";
            }

            return "has-success";
        }
Example #4
0
        public static string GetFormGroupInfoClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "info";
            }

            return "has-info";
        }
Example #5
0
        public static string GetFormGroupErrorClass(BootstrapVersions? bsVersion)
        {
            switch (bsVersion)
            {
                case BootstrapVersions.V2:
                    return "error";
            }

            return "has-error";
        }
Example #6
0
        public static string GetCssClass(IBasilWebControl control, BootstrapVersions? bsVersion)
        {
            var feedback = control.HasFeedback ? " has-feedback" : string.Empty;
            var cssClass = BootstrapHelper.GetFormGroupClass(bsVersion);

            if (!control.IsValid) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupErrorClass(bsVersion), feedback);
            if (control.IsWarning) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupWarningClass(bsVersion), feedback);
            if (control.IsInfo) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupInfoClass(bsVersion), feedback);
            if (control.IsSuccess) cssClass += string.Format(" {0}{1}", BootstrapHelper.GetFormGroupSuccessClass(bsVersion), feedback);

            return cssClass;
        }