diff --git a/WebCms/App_Start/RegisterServices.cs b/WebCms/App_Start/RegisterServices.cs index ec65690..452fc92 100644 --- a/WebCms/App_Start/RegisterServices.cs +++ b/WebCms/App_Start/RegisterServices.cs @@ -18,8 +18,8 @@ namespace LeafWeb.WebCms.App_Start HangfireBootstrapper.Instance.Start(); BackloadBundles.RegisterBundles(BundleTable.Bundles); - // route for downloading results - RouteTable.Routes.MapRoute( + // route for downloading results, see also URL rewrite rules in web.config + RouteTable.Routes.MapRoute( "ResultsDownload", // Route name "Results/Download", // URL with parameters new { controller = "Results", action = "Download" } // Parameter defaults @@ -27,5 +27,5 @@ namespace LeafWeb.WebCms.App_Start base.ApplicationStarted(umbracoApplication, applicationContext); } - } + } } \ No newline at end of file diff --git a/WebCms/Content/bootstrap_leafweb.css b/WebCms/Content/bootstrap_leafweb.css index 4a00f72..7f28f32 100644 --- a/WebCms/Content/bootstrap_leafweb.css +++ b/WebCms/Content/bootstrap_leafweb.css @@ -7187,278 +7187,3 @@ a.text-dark:hover, a.text-dark:focus { @media (min-width: 992px) { .navbar-brand img { width: 205px; } } - -/* - -$bgDefault: $dark; -$bgHighlight: $primary; -$colDefault: #ecf0f1; -$colHighlight: #b7f696; -$dropDown: false; - -.navbar { - background-color: $bgDefault !important; - - .navbar-brand { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .navbar-text { - color: $colDefault; - - a { - color: $colHighlight; - - &:hover, &:focus { - color: $colHighlight; - } - } - } - - .navbar-nav { - .nav-link { - color: $colDefault; - border-radius: .25rem; - margin: 0 0.25em; - - &:not(.disabled) { - &:hover, &:focus { - color: $colHighlight; - } - } - } - - @if ($dropDown) { - .dropdown-menu { - background-color: $bgDefault; - border-color: $bgHighlight; - - .dropdown-item { - color: $colDefault; - - &:hover, &:focus, &.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } - - .dropdown-divider { - border-top-color: $bgHighlight; - } - } - } - - .nav-item.active, .nav-item.show { - .nav-link, .nav-link:hover, .nav-link:focus { - color: $colHighlight; - background-color: $bgHighlight; - } - } - } - - .navbar-toggle { - border-color: $bgHighlight; - - &:hover, &:focus { - background-color: $bgHighlight; - } - - .navbar-toggler-icon { - color: $colDefault; - } - } - - .navbar-collapse, - .navbar-form { - border-color: $colDefault; - } - - .navbar-link { - color: $colDefault; - - &:hover { - color: $colHighlight; - } - } -} - -@media (max-width: 575px) { - .navbar-expend-sm .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 767px) { - .navbar-expend-md .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 991px) { - .navbar-expend-lg .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 1199px) { - .navbar-expend-xl .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -.navbar-expend .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } -} - */ -/* -// Alternate buttons styles inverse and transparent -// -------------------------------------------------- -.btn-default { - &.btn-inverse { - @include button-variant($btn-secondary-bg, $btn-secondary-color, $btn-secondary-bg); - &:hover { - @include button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border); - } - } - &.btn-transparent { - @include button-variant($btn-secondary-bg, transparent, $btn-secondary-bg); - &:hover { - @include button-variant($btn-secondary-bg, darken($btn-secondary-bg, 25%), $btn-secondary-bg); - } - } -} - -.btn-primary { - &.btn-inverse { - @include button-variant($btn-primary-bg, $btn-primary-color, $btn-primary-bg); - &:hover { - @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border); - } - } - &.btn-transparent { - @include button-variant($btn-primary-bg, transparent, $btn-primary-bg); - &:hover { - @include button-variant($btn-primary-bg, darken($btn-primary-bg, 25%), $btn-primary-bg); - } - } -} - -.btn-success { - &.btn-inverse { - @include button-variant($btn-success-bg, $btn-success-color, $btn-success-bg); - &:hover { - @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border); - } - } - &.btn-transparent { - @include button-variant($btn-success-bg, transparent, $btn-success-bg); - &:hover { - @include button-variant($btn-success-bg, darken($btn-success-bg, 25%), $btn-success-bg); - } - } -} - -.btn-info { - &.btn-inverse { - @include button-variant($btn-info-bg, $btn-info-color, $btn-info-bg); - &:hover { - @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border); - } - } - &.btn-transparent { - @include button-variant($btn-info-bg, transparent, $btn-info-bg); - &:hover { - @include button-variant($btn-info-bg, darken($btn-info-bg, 25%), $btn-info-bg); - } - } -} - -.btn-warning { - &.btn-inverse { - @include button-variant($btn-warning-bg, $btn-warning-color, $btn-warning-bg); - &:hover { - @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border); - } - } - &.btn-transparent { - @include button-variant($btn-warning-bg, transparent, $btn-warning-bg); - &:hover { - @include button-variant($btn-warning-bg, darken($btn-warning-bg, 25%), $btn-warning-bg); - } - } -} - -.btn-danger { - &.btn-inverse { - @include button-variant($btn-danger-bg, $btn-danger-color, $btn-danger-bg); - &:hover { - @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border); - } - } - &.btn-transparent { - @include button-variant($btn-danger-bg, transparent, $btn-danger-bg); - &:hover { - @include button-variant($btn-danger-bg, darken($btn-danger-bg, 25%), $btn-danger-bg); - } - } -} -*/ diff --git a/WebCms/Content/bootstrap_leafweb.scss b/WebCms/Content/bootstrap_leafweb.scss index 7c1240c..6147460 100644 --- a/WebCms/Content/bootstrap_leafweb.scss +++ b/WebCms/Content/bootstrap_leafweb.scss @@ -4,6 +4,7 @@ .navbar-brand img { width: 140px; } + @include media-breakpoint-up(md) { .navbar-brand img { width: 175px; @@ -14,278 +15,3 @@ width: 205px; } } - -/* - -$bgDefault: $dark; -$bgHighlight: $primary; -$colDefault: #ecf0f1; -$colHighlight: #b7f696; -$dropDown: false; - -.navbar { - background-color: $bgDefault !important; - - .navbar-brand { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .navbar-text { - color: $colDefault; - - a { - color: $colHighlight; - - &:hover, &:focus { - color: $colHighlight; - } - } - } - - .navbar-nav { - .nav-link { - color: $colDefault; - border-radius: .25rem; - margin: 0 0.25em; - - &:not(.disabled) { - &:hover, &:focus { - color: $colHighlight; - } - } - } - - @if ($dropDown) { - .dropdown-menu { - background-color: $bgDefault; - border-color: $bgHighlight; - - .dropdown-item { - color: $colDefault; - - &:hover, &:focus, &.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } - - .dropdown-divider { - border-top-color: $bgHighlight; - } - } - } - - .nav-item.active, .nav-item.show { - .nav-link, .nav-link:hover, .nav-link:focus { - color: $colHighlight; - background-color: $bgHighlight; - } - } - } - - .navbar-toggle { - border-color: $bgHighlight; - - &:hover, &:focus { - background-color: $bgHighlight; - } - - .navbar-toggler-icon { - color: $colDefault; - } - } - - .navbar-collapse, - .navbar-form { - border-color: $colDefault; - } - - .navbar-link { - color: $colDefault; - - &:hover { - color: $colHighlight; - } - } -} - -@media (max-width: 575px) { - .navbar-expend-sm .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 767px) { - .navbar-expend-md .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 991px) { - .navbar-expend-lg .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -@media (max-width: 1199px) { - .navbar-expend-xl .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } - } -} - -.navbar-expend .navbar-nav .show .dropdown-menu { - .dropdown-item { - color: $colDefault; - - &:hover, &:focus { - color: $colHighlight; - } - } - - .dropdown-item.active { - color: $colHighlight; - background-color: $bgHighlight; - } -} - */ - /* -// Alternate buttons styles inverse and transparent -// -------------------------------------------------- -.btn-default { - &.btn-inverse { - @include button-variant($btn-secondary-bg, $btn-secondary-color, $btn-secondary-bg); - &:hover { - @include button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border); - } - } - &.btn-transparent { - @include button-variant($btn-secondary-bg, transparent, $btn-secondary-bg); - &:hover { - @include button-variant($btn-secondary-bg, darken($btn-secondary-bg, 25%), $btn-secondary-bg); - } - } -} - -.btn-primary { - &.btn-inverse { - @include button-variant($btn-primary-bg, $btn-primary-color, $btn-primary-bg); - &:hover { - @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border); - } - } - &.btn-transparent { - @include button-variant($btn-primary-bg, transparent, $btn-primary-bg); - &:hover { - @include button-variant($btn-primary-bg, darken($btn-primary-bg, 25%), $btn-primary-bg); - } - } -} - -.btn-success { - &.btn-inverse { - @include button-variant($btn-success-bg, $btn-success-color, $btn-success-bg); - &:hover { - @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border); - } - } - &.btn-transparent { - @include button-variant($btn-success-bg, transparent, $btn-success-bg); - &:hover { - @include button-variant($btn-success-bg, darken($btn-success-bg, 25%), $btn-success-bg); - } - } -} - -.btn-info { - &.btn-inverse { - @include button-variant($btn-info-bg, $btn-info-color, $btn-info-bg); - &:hover { - @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border); - } - } - &.btn-transparent { - @include button-variant($btn-info-bg, transparent, $btn-info-bg); - &:hover { - @include button-variant($btn-info-bg, darken($btn-info-bg, 25%), $btn-info-bg); - } - } -} - -.btn-warning { - &.btn-inverse { - @include button-variant($btn-warning-bg, $btn-warning-color, $btn-warning-bg); - &:hover { - @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border); - } - } - &.btn-transparent { - @include button-variant($btn-warning-bg, transparent, $btn-warning-bg); - &:hover { - @include button-variant($btn-warning-bg, darken($btn-warning-bg, 25%), $btn-warning-bg); - } - } -} - -.btn-danger { - &.btn-inverse { - @include button-variant($btn-danger-bg, $btn-danger-color, $btn-danger-bg); - &:hover { - @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border); - } - } - &.btn-transparent { - @include button-variant($btn-danger-bg, transparent, $btn-danger-bg); - &:hover { - @include button-variant($btn-danger-bg, darken($btn-danger-bg, 25%), $btn-danger-bg); - } - } -} -*/ \ No newline at end of file diff --git a/WebCms/Content/style.css b/WebCms/Content/style.css index 798b92a..6f541ad 100644 --- a/WebCms/Content/style.css +++ b/WebCms/Content/style.css @@ -153,6 +153,8 @@ h1.headline { form .validation-summary-errors ul { list-style-type: none; } + form .validation-summary-errors ul li { + color: #dc3545; } .autocomplete-suggestions { border: 1px solid #999; diff --git a/WebCms/Content/style.min.css b/WebCms/Content/style.min.css index 766fb2d..01ab124 100644 --- a/WebCms/Content/style.min.css +++ b/WebCms/Content/style.min.css @@ -1 +1 @@ -body header{padding:15px 0;}body.debug header .navbar-brand{position:relative;}body.debug header .navbar-brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}i{cursor:default;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon,.banner-link .fa{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}h1.headline{font-size:2.9em;text-align:center;text-shadow:-1px -1px 0 rgba(255,255,255,.8),1px 1px 0 rgba(0,0,0,.4),5px 5px 10px rgba(0,0,0,.4);}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"FontAwesome";font-size:.8em;padding-left:10px;text-shadow:-1px -1px 0 rgba(255,255,255,.8),1px 1px 0 rgba(0,0,0,.4),5px 5px 10px rgba(0,0,0,.4);}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;cursor:default;}.status:before{font-family:"FontAwesome";font-size:1em;padding-right:6px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:before{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:before{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:before{content:"";}.status.status-unresponsive{color:#66512c;}.status.status-unresponsive:before{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:before{content:"";}.status.status-starting:before{content:"";}.status.status-finishing:before{content:"";}.status.status-cancelpending:before,.status.status-cancelling:before{content:"";}.status.status-cancelled{color:#ec971f;}.status.status-cancelled:before{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}.read{overflow:hidden;font-size:16px !important;transition:all .3s;margin-bottom:10px;}.read-less{height:90px !important;}code,pre{line-height:1;}.alert{position:absolute;left:30%;top:10em;width:40%;z-index:1;}.copyright{font-size:.8em;color:#777 !important;cursor:default;}.withshadow{text-shadow:2px 2px 4px #000;}.files td{vertical-align:middle;} \ No newline at end of file +body header{padding:15px 0;}body.debug header .navbar-brand{position:relative;}body.debug header .navbar-brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}i{cursor:default;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon,.banner-link .fa{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}h1.headline{font-size:2.9em;text-align:center;text-shadow:-1px -1px 0 rgba(255,255,255,.8),1px 1px 0 rgba(0,0,0,.4),5px 5px 10px rgba(0,0,0,.4);}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"FontAwesome";font-size:.8em;padding-left:10px;text-shadow:-1px -1px 0 rgba(255,255,255,.8),1px 1px 0 rgba(0,0,0,.4),5px 5px 10px rgba(0,0,0,.4);}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;cursor:default;}.status:before{font-family:"FontAwesome";font-size:1em;padding-right:6px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:before{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:before{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:before{content:"";}.status.status-unresponsive{color:#66512c;}.status.status-unresponsive:before{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:before{content:"";}.status.status-starting:before{content:"";}.status.status-finishing:before{content:"";}.status.status-cancelpending:before,.status.status-cancelling:before{content:"";}.status.status-cancelled{color:#ec971f;}.status.status-cancelled:before{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}form .validation-summary-errors ul li{color:#dc3545;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}.read{overflow:hidden;font-size:16px !important;transition:all .3s;margin-bottom:10px;}.read-less{height:90px !important;}code,pre{line-height:1;}.alert{position:absolute;left:30%;top:10em;width:40%;z-index:1;}.copyright{font-size:.8em;color:#777 !important;cursor:default;}.withshadow{text-shadow:2px 2px 4px #000;}.files td{vertical-align:middle;} \ No newline at end of file diff --git a/WebCms/Content/style.scss b/WebCms/Content/style.scss index afb1312..5263bac 100644 --- a/WebCms/Content/style.scss +++ b/WebCms/Content/style.scss @@ -237,6 +237,9 @@ h1.headline { form .validation-summary-errors ul { list-style-type: none; + li { + color: #dc3545 + } } .autocomplete { diff --git a/WebCms/Utility/Validation.cs b/WebCms/Utility/Validation.cs index 1ce25b9..d1fd4a7 100644 --- a/WebCms/Utility/Validation.cs +++ b/WebCms/Utility/Validation.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Linq.Expressions; using System.Web.Mvc; @@ -21,8 +22,7 @@ namespace LeafWeb.WebCms.Utility : null; } - - private static bool HasError(this HtmlHelper htmlHelper, ModelMetadata modelMetadata, string expression) + public static bool HasError(this HtmlHelper htmlHelper, ModelMetadata modelMetadata, string expression) { var modelName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(expression); var formContext = htmlHelper.ViewContext.FormContext; @@ -38,5 +38,12 @@ namespace LeafWeb.WebCms.Utility return modelErrors?.Count > 0; } + + public static bool HasError(this HtmlHelper htmlHelper) + { + var viewDataModelState = htmlHelper.ViewData.ModelState; + return viewDataModelState.ContainsKey(htmlHelper.ViewData.TemplateInfo.HtmlFieldPrefix) && + viewDataModelState[htmlHelper.ViewData.TemplateInfo.HtmlFieldPrefix].Errors.Any(); + } } } diff --git a/WebCms/Views/Contact/Index.cshtml b/WebCms/Views/Contact/Index.cshtml index 9006bce..f10e885 100644 --- a/WebCms/Views/Contact/Index.cshtml +++ b/WebCms/Views/Contact/Index.cshtml @@ -4,13 +4,13 @@ @{ Html.RequiresJs("~/scripts/jquery.validate.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2); - Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js", 2); + Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2); Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2); } -
-
-
+
+
+
@Html.Partial("_ValidationSummary") @using (Html.BeginUmbracoForm("Submit")) diff --git a/WebCms/Views/LeafInput/Create.cshtml b/WebCms/Views/LeafInput/Create.cshtml index 1258f3d..21b6383 100644 --- a/WebCms/Views/LeafInput/Create.cshtml +++ b/WebCms/Views/LeafInput/Create.cshtml @@ -7,7 +7,7 @@ Html.RequiresJs("~/scripts/jquery.autocomplete.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2); - Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js", 2); + Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2); Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2); Html.RequiresJs("~/scripts/LeafInputCreate.js", 3); @@ -83,10 +83,12 @@ @Html.EditorFor(m => m.TermsOfService) } -
- -
- +
+
+ +
+
+
diff --git a/WebCms/Views/MacroPartials/Membership/Login.cshtml b/WebCms/Views/MacroPartials/Membership/Login.cshtml index a54044a..7cddeb1 100644 --- a/WebCms/Views/MacroPartials/Membership/Login.cshtml +++ b/WebCms/Views/MacroPartials/Membership/Login.cshtml @@ -7,28 +7,22 @@ var loginModel = new LoginModel { RedirectUrl = "/leaf-data/manage-queue/" }; } -
-
-
- @using (Html.BeginUmbracoForm("HandleLogin")) - { -
- @Html.ValidationSummary("loginModel", true) -
- @Html.LabelFor(m => loginModel.Username) - @Html.TextBoxFor(m => loginModel.Username, new {@class = "form-control" }) - @Html.ValidationMessageFor(m => loginModel.Username) -
-
- @Html.LabelFor(m => loginModel.Password) - @Html.PasswordFor(m => loginModel.Password, new {@class = "form-control" }) - @Html.ValidationMessageFor(m => loginModel.Password) -
+
+
+
+@using (Html.BeginUmbracoForm("HandleLogin")) +{ + @Html.EditorFor(m => loginModel.Username) + @Html.EditorFor(m => loginModel.Password, "Password") - - @Html.HiddenFor(m => loginModel.RedirectUrl) -
- } + @Html.ValidationSummary("loginModel", true) + + + @Html.HiddenFor(m => loginModel.RedirectUrl) +} +
+
+
+

Don't have an account? Register here

-
\ No newline at end of file diff --git a/WebCms/Views/MacroPartials/Membership/Register.cshtml b/WebCms/Views/MacroPartials/Membership/Register.cshtml index 11083e6..990c0be 100644 --- a/WebCms/Views/MacroPartials/Membership/Register.cshtml +++ b/WebCms/Views/MacroPartials/Membership/Register.cshtml @@ -12,25 +12,23 @@ Html.EnableClientValidation(); Html.RequiresJs("~/scripts/jquery.validate.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2); + Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2); Html.RequiresJs("~/scripts/Register.js"); var user = Membership.GetUser(); - if (user != null) - { - TempData["StatusMessage"] = "You are already logged in, " + user.UserName; - TempData["StatusMessage-Type"] = "alert-danger"; - - // todo: redirect - } }
-@if (success) +@if (success || (!user?.IsApproved ?? false)) { -

Registration succeeded.

+

Registration succeeded. Please check your email to verify your account.

+} +else if (user != null) +{ +

No need to register - you are already logged withe email @user.Email

} else { @@ -39,30 +37,33 @@ else null, new {id="register-member"})) { -
- @Html.ValidationSummary("registerModel", true) + @Html.ValidationSummary(true) + @Html.EditorFor(m => registerModel.Name) + @Html.EditorFor(m => registerModel.Email, new { type = "email"}) + @Html.EditorFor(m => registerModel.Password, "Password") + @*
@Html.LabelFor(m => registerModel.Name) @Html.TextBoxFor(m => registerModel.Name, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => registerModel.Name) + @Html.ValidationMessageFor(m => registerModel.Name, "", new { @class = "text-danger" })
@Html.LabelFor(m => registerModel.Email) @Html.TextBoxFor(m => registerModel.Email, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => registerModel.Email) + @Html.ValidationMessageFor(m => registerModel.Email, "", new { @class = "text-danger" })
@Html.LabelFor(m => registerModel.Password) @Html.PasswordFor(m => registerModel.Password, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => registerModel.Password) -
-
+ @Html.ValidationMessageFor(m => registerModel.Password, "", new { @class = "text-danger" }) +
*@ +
@Html.Label("VerifyPassword") @Html.Password("VerifyPassword", null, new { @class = "form-control" }) - @Html.ValidationMessage("VerifyPassword") + @Html.ValidationMessage("VerifyPassword", "", new { @class = "text-danger" })
- if (registerModel.MemberProperties != null) + @*if (registerModel.MemberProperties != null) { for (var i = 0; i < registerModel.MemberProperties.Count; i++) { @@ -72,7 +73,7 @@ else @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
} - } + }*@ @Html.HiddenFor(m => registerModel.MemberTypeAlias) @Html.HiddenFor(m => registerModel.RedirectUrl) diff --git a/WebCms/Views/Shared/EditorTemplates/Boolean.cshtml b/WebCms/Views/Shared/EditorTemplates/Boolean.cshtml index 69f7f5d..1af9085 100644 --- a/WebCms/Views/Shared/EditorTemplates/Boolean.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Boolean.cshtml @@ -1,7 +1,8 @@ -@using LeafWeb.WebCms.Utility @model Boolean? @{ + Layout = "_FieldLayout.cshtml"; + var htmlAttributes = new RouteValueDictionary(); if (ViewBag.@class != null) { @@ -9,13 +10,7 @@ } } -
- @Html.LabelFor(m => m, new { @class = "" }) -
- @Html.CheckBox( - "", - Model.HasValue && Model.Value, - htmlAttributes) - @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) -
-
+@Html.CheckBox( + "", + Model.HasValue && Model.Value, + htmlAttributes) diff --git a/WebCms/Views/Shared/EditorTemplates/DateTime.cshtml b/WebCms/Views/Shared/EditorTemplates/DateTime.cshtml index 2e35c97..757e09d 100644 --- a/WebCms/Views/Shared/EditorTemplates/DateTime.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/DateTime.cshtml @@ -1,7 +1,9 @@ -@using LeafWeb.WebCms.Utility +@using System.Threading @model DateTime? @{ + Layout = "_FieldLayout.cshtml"; + DateTime dt; if (Model.HasValue) { @@ -13,8 +15,14 @@ } } -
- @Html.LabelFor(m => m) - @Html.TextBoxFor(m => m, new { @class="form-control datepicker", data_provide="datepicker", data_date_language="globalize", data_date=dt, data_date_format=System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("M", "m"), data_date_today_highlight="true", data_date_today_btn="false" }) - @Html.ValidationMessageFor(m => m, null, new { @class="form-text" }) -
+@Html.TextBoxFor(m => m, + new + { + @class="form-control datepicker", + data_provide="datepicker", + data_date_language="globalize", + data_date=dt, + data_date_format=Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("M", "m"), + data_date_today_highlight="true", + data_date_today_btn="false" + }) diff --git a/WebCms/Views/Shared/EditorTemplates/Decimal.cshtml b/WebCms/Views/Shared/EditorTemplates/Decimal.cshtml index a4c13fb..fef5c39 100644 --- a/WebCms/Views/Shared/EditorTemplates/Decimal.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Decimal.cshtml @@ -1,13 +1,14 @@ -@using LeafWeb.WebCms.Utility +@using System.Globalization @model decimal? - -
- @Html.LabelFor(m => m) -
- €@Html.TextBox( - "", - Model == null ? "" : String.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:F2}", ViewData.ModelMetadata.Model), - ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" }) -
- @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) +@{ + Layout = "_FieldLayout.cshtml"; +} +
+ + €@Html.TextBox( + "", + Model == null + ? "" + : string.Format(CultureInfo.CurrentCulture, "{0:F2}", ViewData.ModelMetadata.Model)) +
diff --git a/WebCms/Views/Shared/EditorTemplates/EmailAddress.cshtml b/WebCms/Views/Shared/EditorTemplates/EmailAddress.cshtml index bf2f2bf..25ba759 100644 --- a/WebCms/Views/Shared/EditorTemplates/EmailAddress.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/EmailAddress.cshtml @@ -1,29 +1,30 @@ +@using LeafWeb.WebCms.Utility @model object @{ - Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml"; + Layout = "_FieldLayout.cshtml"; } @{ var htmlAttributes = new RouteValueDictionary(); + + htmlAttributes.Add("type", "email"); + + var controlClass = "form-control"; + if (ViewBag.@class != null) { - htmlAttributes.Add("class", "form-control " + ViewBag.@class); - } - else - { - htmlAttributes.Add("class", "form-control"); - } - if (ViewBag.@type != null) - { - htmlAttributes.Add("type", ViewBag.@type); - } - else - { - htmlAttributes.Add("type", "email"); + controlClass = string.Concat(controlClass, " ", ViewBag.@class); } + if (ViewBag.placeholder != null) { htmlAttributes.Add("placeholder", ViewBag.placeholder); } + + if (Html.HasError()) + { + controlClass = string.Concat(controlClass, " ", "is-invalid"); + } + htmlAttributes.Add("class", controlClass); } @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) \ No newline at end of file diff --git a/WebCms/Views/Shared/EditorTemplates/Enum.cshtml b/WebCms/Views/Shared/EditorTemplates/Enum.cshtml index aab6740..b64143e 100644 --- a/WebCms/Views/Shared/EditorTemplates/Enum.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Enum.cshtml @@ -1,9 +1,6 @@ -@using LeafWeb.WebCms.Utility @model object +@{ + Layout = "_FieldLayout.cshtml"; +} - -
- @Html.LabelFor(m => m) - @Html.EnumDropDownListFor(m => m, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) -
+@Html.EnumDropDownListFor(m => m, new { @class = "form-control" }) diff --git a/WebCms/Views/Shared/EditorTemplates/HttpPostedFileBase.cshtml b/WebCms/Views/Shared/EditorTemplates/HttpPostedFileBase.cshtml index f86e12a..41b72df 100644 --- a/WebCms/Views/Shared/EditorTemplates/HttpPostedFileBase.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/HttpPostedFileBase.cshtml @@ -1,6 +1,6 @@ @model HttpPostedFileBase @{ - Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml"; + Layout = "_FieldLayout.cshtml"; } diff --git a/WebCms/Views/Shared/EditorTemplates/Int32.cshtml b/WebCms/Views/Shared/EditorTemplates/Int32.cshtml index 9bf62ce..ebb49bd 100644 --- a/WebCms/Views/Shared/EditorTemplates/Int32.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Int32.cshtml @@ -1,7 +1,8 @@ -@using LeafWeb.WebCms.Utility @model int? @{ + Layout = "_FieldLayout.cshtml"; + var htmlAttributes = new RouteValueDictionary(); if (ViewBag.@class != null) { @@ -18,13 +19,4 @@ } } -
- @Html.LabelFor(m => m) -
- @Html.TextBox( - "", - ViewData.TemplateInfo.FormattedModelValue, - htmlAttributes) - @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) -
-
+@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) diff --git a/WebCms/Views/Shared/EditorTemplates/Markdown.cshtml b/WebCms/Views/Shared/EditorTemplates/Markdown.cshtml index a85f0a5..643f10a 100644 --- a/WebCms/Views/Shared/EditorTemplates/Markdown.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Markdown.cshtml @@ -6,7 +6,7 @@ } -
+
@Html.LabelFor(m => m)
@Html.TextAreaFor( diff --git a/WebCms/Views/Shared/EditorTemplates/Multiline.cshtml b/WebCms/Views/Shared/EditorTemplates/Multiline.cshtml index 9638708..c27777b 100644 --- a/WebCms/Views/Shared/EditorTemplates/Multiline.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Multiline.cshtml @@ -1,13 +1,8 @@ -@using LeafWeb.WebCms.Utility @model object +@{ + Layout = "_FieldLayout.cshtml"; +} -
- @Html.LabelFor(m => m) -
- @Html.TextAreaFor( - m => m, - 8, 8, - ViewBag.ClearTextField == true ? new { @class = "form-control input-block-level clear-text-field" } : new { @class = "form-control input-block-level" } ) - @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) -
+
+ @Html.TextAreaFor(m => m, new{rows=8, @class="form-control"})
diff --git a/WebCms/Views/Shared/EditorTemplates/Password.cshtml b/WebCms/Views/Shared/EditorTemplates/Password.cshtml index d519aa2..13bfa60 100644 --- a/WebCms/Views/Shared/EditorTemplates/Password.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/Password.cshtml @@ -1,26 +1,5 @@ -@using LeafWeb.WebCms.Utility @model object - @{ - var htmlAttributes = new RouteValueDictionary(); - if (ViewBag.@class != null) - { - htmlAttributes.Add("class", "form-control " + ViewBag.@class); - } - else - { - htmlAttributes.Add("class", "form-control"); - } + Layout = "_FieldLayout.cshtml"; } - - -
- @Html.LabelFor(m => m) -
- @Html.Password( - "", - ViewData.TemplateInfo.FormattedModelValue, - htmlAttributes) - @Html.ValidationMessageFor(m => m, null, new { @class = "form-text" }) -
-
\ No newline at end of file +@Html.Password("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "form-control" }) diff --git a/WebCms/Views/Shared/EditorTemplates/SelectListViewModel.cshtml b/WebCms/Views/Shared/EditorTemplates/SelectListViewModel.cshtml index 45cea91..f6b9dc1 100644 --- a/WebCms/Views/Shared/EditorTemplates/SelectListViewModel.cshtml +++ b/WebCms/Views/Shared/EditorTemplates/SelectListViewModel.cshtml @@ -1,17 +1,20 @@ @model SelectListViewModel @{ - Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml"; + Layout = "_FieldLayout.cshtml"; } @{ var prefix = ViewData.TemplateInfo.HtmlFieldPrefix; ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty; var required = new { required = "true" }; + foreach (var li in Model.ListItems) { -
-