Skip to content

Commit

Permalink
Merge pull request #36 from brecons/develop
Browse files Browse the repository at this point in the history
v2.4.0
  • Loading branch information
brecons authored Dec 21, 2018
2 parents b3d9c86 + 0ebae89 commit 685da35
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -16,7 +17,7 @@ public class RegisterViewModel
[Required]
public string Name { get; set; }

[Display(Name = "Email Address")]
[DisplayName("E-Mail Adresse")]
[Required]
[EmailAddress]
public string Email { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
<row>
<column>
<form asp-action="Register" bc-validation="true">
<form-group>
@*<form-group>
<input asp-for="Date" bc-static="true" />
</form-group>
<form-group>
<input type="text" asp-for="Name" />
</form-group>
<form-group>
<input type="email" asp-for="Email" />
</form-group>
</form-group>*@
@*<form-group>
<input id="eeeeemail" type="email" asp-for="Email" bc-help="Tipphkcizt" />
</form-group>*@
<form-group>
<input bc-label="E-Mail-Adresse" />
</form-group>
@*<form-group>
<select asp-for="Country" asp-items="Model.Countries"></select>
</form-group>
</form-group>*@

<button type="submit">Submit</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BSolutions.Brecons.Core" Version="2.1.6" />
<PackageReference Include="BSolutions.Brecons.Core" Version="2.1.8" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ protected override async Task RenderProcessAsync(TagHelperContext context, TagHe
{
output.AddCssClass("dropdown-toggle");
output.MergeAttribute("type", "button");
output.MergeAttribute("id", this.Id);
output.MergeAttribute("data-toggle", "dropdown");
output.MergeAttribute("aria-haspopup", "true");
output.MergeAttribute("aria-expanded", "false");
Expand All @@ -100,7 +99,6 @@ private TagBuilder DropdownButtonBuilder()
TagBuilder button = new TagBuilder("button");
button.AddCssClass("btn dropdown-toggle");
button.MergeAttribute("type", "button");
button.MergeAttribute("id", this.Id);
button.MergeAttribute("data-toggle", "dropdown");
button.MergeAttribute("aria-haspopup", "true");
button.MergeAttribute("aria-expanded", "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ protected override void RenderProcess(TagHelperContext context, TagHelperOutput
output.TagMode = TagMode.StartTagAndEndTag;
output.AddCssClass("progress");

// Height
output.AddCssStyle("height", $"{this.Height}px");

output.Content.SetHtmlContent(this.BuildProgressbar());
}

Expand All @@ -63,7 +66,7 @@ private TagBuilder BuildProgressbar()
progressbar.MergeAttribute("aria-valuemax", "100");
progressbar.MergeAttribute("aria-valuenow", this.Value.ToString());
progressbar.MergeAttribute("role", "progressbar");
progressbar.MergeAttribute("style", $"width: {this.Value}%; height: {this.Height}px");
progressbar.MergeAttribute("style", $"width: {this.Value}%;");

// Label
if (this.HasLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ protected override void RenderProcess(TagHelperContext context, TagHelperOutput
}
}

public static IHtmlContent Generate(ModelExpression model, ViewContext viewContext)
public static IHtmlContent Generate(FormTagHelperBase tagHelper)
{
var builder = new TagBuilder("div") { TagRenderMode = TagRenderMode.Normal };
builder.AddCssClass("invalid-feedback");
builder.MergeAttribute("data-valmsg-for", model.Metadata.PropertyName);
builder.MergeAttribute("data-valmsg-for", tagHelper.Id);
builder.MergeAttribute("data-valmsg-replace", "true");

// Error Message
var modelState = viewContext.ViewData.ModelState.FirstOrDefault(k => k.Key == model.Metadata.PropertyName).Value;
var modelState = tagHelper.ViewContext.ViewData.ModelState.FirstOrDefault(k => k.Key == tagHelper.For.Metadata.PropertyName).Value;
if (modelState != null && modelState.ValidationState == ModelValidationState.Invalid)
{
builder.AddCssClass("field-validation-error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static void RenderValidation(this BoconsFormTagHelperBase tagHelper, Ta
// Validation Message
if (tagHelper.For != null && tagHelper.Validation)
{
output.PostElement.AppendHtml(ValidationTagHelper.Generate(tagHelper.For, tagHelper.ViewContext));
output.PostElement.AppendHtml(ValidationTagHelper.Generate(tagHelper));
}
}

Expand Down
11 changes: 7 additions & 4 deletions docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Change Logs & Releases
# Change Log and Releases

In this page, you can find a record of all the changes made to Bocons such as bug fixes, new features, etc.

## Version 2.4.0 <small class="release-date">Oct. 09, 2018</small>
## Version 2.4.0 <small class="release-date">Dec. 21, 2018</small>

This release of Bocons supports Bootstrap 4.1.3 and comes with many extensions, bugfixes and a new documentation published on GitHub.
This release of Bocons supports Bootstrap 4.1.3 and comes with some bugfixes and small changes requested by the community.

<ul class="changelog">
<li class="ch-added">Input: Support for Bootstrap Buttons with <code><input type="button" /></code> Tag Helper.</li>
<li class="ch-added">Input: Support for Bootstrap Buttons with <code>&lt;input type="button" /&gt;</code> Tag Helper.</li>
<li class="ch-added">Add support for Target Framework <code>netstandard1.6</code>.</li>
<li class="ch-changed">Table: The attribute <code>bc-bordered</code> has been replaced by the <code>bc-border</code> attribute.</li>
<li class="ch-changed">Switch from bower package manager to Yarn.</li>
<li class="ch-fixed">Form Controls: Wrong <code>for</code> attribute generated in label tags.</li>
<li class="ch-fixed">Progress: Height applied to wrong tag.</li>
</ul>

<a href="https://www.nuget.org/packages/BSolutions.Bocons/2.4.0" class="btn btn-info">
Expand Down

0 comments on commit 685da35

Please sign in to comment.