public static IRazorTheme GetTheme(this IHtmlHelper helper)
        {
            IRazorTheme th = helper.GetViewData <IRazorTheme>("Theme");

            if (th == null)
            {
                return(RazorConfig.Theme);
            }
            return(th);
        }
        public static void ConfigureAngularApbRazor(this Shell shell, IRazorTheme theme = null)
        {
            theme = theme ?? new AbpLeptonTheme();

            RazorConfig.SetCollectionType <AngularValidationCollection>();

            RazorConfig.LocaleTextProvider    = new AbpTextProvider();
            RazorConfig.ExpressionStringifier = new AngularExpressionStringifier();

            RazorConfig.Theme = theme;
        }
        public static void ConfigureMvcRazor(this Shell shell, IRazorTheme theme = null)
        {
            theme = theme ?? new MvcTheme();

            RazorConfig.SetCollectionType <ValidationCollection>();

            RazorConfig.FieldErrorMessagesTemplate = "<span>\r{2}</span>";
            RazorConfig.ErrorMessageTemplate       = "<small class=\"form-text text-danger\">{3}</small>\r";
            RazorConfig.LocaleTextProvider         = new MvcTextProvider(new Language());
            RazorConfig.ExpressionStringifier      = new DefaultExpressionStringifier();

            RazorConfig.Theme = theme;
        }
        public static void ConfigureAngular2Razor(this Shell shell, IRazorTheme theme = null)
        {
            theme = theme ?? new AngularTheme();

            RazorConfig.SetCollectionType <AngularValidationCollection>();

            RazorConfig.FieldErrorMessagesTemplate = "<span *ngIf=\"{0}.controls['{1}'] && {0}.controls['{1}'].invalid && ({0}.controls['{1}'].dirty || {0}.controls['{1}'].touched)\">\r{2}</span>";
            RazorConfig.ErrorMessageTemplate       = "<small *ngIf=\"{0}.controls['{1}'].errors!.{2}\" class=\"form-text text-danger\">{3}</small>\r";
            RazorConfig.LocaleTextProvider         = new AngularTextProvider();
            RazorConfig.ExpressionStringifier      = new AngularExpressionStringifier();

            RazorConfig.Theme = theme;
        }
Beispiel #5
0
 private RazorConfig()
 {
     _modelName                  = "model";
     _calendarCssClass           = "date-picky";
     _validationMessageContainer = "<small ng-show='{0}.{1}.$error.{2}' class='form-text text-danger'>{3}</small>";
     _fieldErrorMessagesTemplate = "<span ng-show='{0}.{1}.$invalid'>\n{2}</span>\n";
     _dateValidationPattern      = "^([0-2][0-9]|3[0-1])[/]([0-1][0-9])[/]([1-9][0-9]{3})$";
     _formName = "Form";
     _validatorCollectionType = typeof(ValidationCollection);
     _localeTextProvider      = Shell.RootInjector.GetService <IRazorLocaleTextProvider>();
     _stringifier             = new DefaultExpressionStringifier();
     _theme       = new DefaultTheme();
     _nameService = Shell.RootInjector.GetService <IUIFileNameService>();
 }
Beispiel #6
0
 public EditableTheme(IRazorTheme th)
 {
     _inner = th;
 }