2015-04-20 17:49:19 +02:00
|
|
|
@using Orchard.DisplayManagement.Shapes
|
|
|
|
@using Orchard.DynamicForms.Elements
|
2014-10-16 00:53:04 -07:00
|
|
|
@using Orchard.Layouts.Helpers
|
|
|
|
@{
|
|
|
|
var element = (PasswordField)Model.Element;
|
2015-04-20 17:49:19 +02:00
|
|
|
var tagBuilder = (OrchardTagBuilder)TagBuilderExtensions.CreateElementTagBuilder(Model, "input");
|
2014-10-16 00:53:04 -07:00
|
|
|
|
|
|
|
tagBuilder.AddCssClass("text");
|
|
|
|
tagBuilder.Attributes["type"] = "password";
|
2015-06-29 14:01:58 +03:00
|
|
|
tagBuilder.Attributes["name"] = Model.ProcessedName;
|
2014-10-16 00:53:04 -07:00
|
|
|
tagBuilder.AddClientValidationAttributes((IDictionary<string, string>)Model.ClientValidationAttributes);
|
|
|
|
|
|
|
|
if (!ViewData.ModelState.IsValidField(element.Name)) {
|
|
|
|
tagBuilder.AddCssClass("input-validation-error");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (element.ShowLabel) {
|
2015-06-29 14:01:58 +03:00
|
|
|
<label for="@element.HtmlId">@Model.ProcessedLabel</label>
|
2014-10-16 00:53:04 -07:00
|
|
|
}
|
2015-04-17 14:34:00 +02:00
|
|
|
@tagBuilder.ToHtmlString(TagRenderMode.SelfClosing)
|
2014-10-16 00:53:04 -07:00
|
|
|
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
2015-06-29 14:01:58 +03:00
|
|
|
@Html.ValidationMessage((string)Model.ProcessedName)
|
2014-10-16 00:53:04 -07:00
|
|
|
}
|