Skip to content

Commit 90e2dee

Browse files
authored
Merge pull request #93 from HtmlTags/data-annotations
Full support for model metadata
2 parents 76cb13e + 0d13b7b commit 90e2dee

25 files changed

+872
-102
lines changed

Build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exec { & dotnet build -c Release --version-suffix=$buildSuffix -v q /nologo }
3838
Push-Location -Path .\test\HtmlTags.Testing
3939

4040
try {
41-
exec { & dotnet xunit -configuration Release -nobuild }
41+
exec { & dotnet xunit -configuration Release -nobuild -fxversion 2.0.0 }
4242
}
4343
finally {
4444
Pop-Location
@@ -47,7 +47,7 @@ finally {
4747
Push-Location -Path .\test\HtmlTags.AspNetCore.Testing
4848

4949
try {
50-
exec { & dotnet xunit -configuration Release -nobuild }
50+
exec { & dotnet xunit -configuration Release -nobuild -fxversion 2.0.0 }
5151
}
5252
finally {
5353
Pop-Location

Directory.Build.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<Description>Easy generation of html with a jquery inspired object model</Description>
5+
<Copyright>Copyright Jeremy D. Miller, Josh Arnold, Joshua Flanagan, Jimmy Bogard, et al. All rights reserved.</Copyright>
6+
<VersionPrefix>7.0.0</VersionPrefix>
7+
<Authors>Jeremy D. Miller;Joshua Flanagan;Josh Arnold;Jimmy Bogard</Authors>
8+
<LangVersion>latest</LangVersion>
9+
<WarningsAsErrors>true</WarningsAsErrors>
10+
<NoWarn>$(NoWarn);1701;1702;1591</NoWarn>
11+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
12+
<PackageIconUrl>https://raw.githubusercontent.com/HtmlTags/htmltags/master/logo/FubuHtml_256.png</PackageIconUrl>
13+
<PackageProjectUrl>https://github.com/HtmlTags/htmltags</PackageProjectUrl>
14+
<PackageLicenseUrl>https://github.com/HtmlTags/htmltags/raw/master/license.txt</PackageLicenseUrl>
15+
</PropertyGroup>
16+
17+
</Project>

HtmlTags.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
99
.gitignore = .gitignore
1010
appveyor.yml = appveyor.yml
1111
Build.ps1 = Build.ps1
12-
NuGet.config = NuGet.config
12+
Directory.Build.props = Directory.Build.props
1313
..\readme.md = ..\readme.md
1414
EndProjectSection
1515
EndProject

NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
6+
</configuration>

NuGet.config

Lines changed: 0 additions & 9 deletions
This file was deleted.

UpgradeLog.htm

-57.9 KB
Binary file not shown.

src/HtmlTags.AspNetCore.TestSite/Controllers/HomeController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
34
using System.Linq;
45
using System.Threading.Tasks;
56
using Microsoft.AspNetCore.Mvc;
@@ -19,8 +20,12 @@ public HomeIndexModel()
1920
}
2021
public class BlargModel
2122
{
23+
[Required]
24+
[MinLength(10)]
2225
public string Blorg { get; set; }
2326
}
27+
[Required]
28+
[MaxLength(20)]
2429
public string Value { get; set; }
2530
public Blarg Blarg { get; set; }
2631

src/HtmlTags.AspNetCore.TestSite/Views/Home/Index.cshtml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
6868
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
6969
<span class="sr-only">Next</span>
70+
7071
</a>
7172
</div>
7273

@@ -86,26 +87,37 @@
8687

8788
@Html.Lookup(nameof(Model.Value)).RemoveClass("readonly")
8889

89-
@(Html.ButtonGroup(Html.PrimaryButton("Save"),
90-
Html.LinkButton("Cancel", nameof(HomeController.Index))))
91-
90+
@(Html.ButtonGroup(Html.PrimaryButton("Save"),
91+
Html.LinkButton("Cancel", nameof(HomeController.Index))))
9292

93+
Input Tag value:
9394
<input-tag for="Value" class="foo"></input-tag>
95+
Editor for value:
9496
@Html.EditorFor(m => m.Value)
97+
Input tag blarg:
9598
<input-tag for="Blarg"></input-tag>
99+
Editor for blarg:
96100
@Html.EditorFor(m => m.Blarg)
101+
Input tag blorg.blorg:
97102
<input-tag for="Blorg.Blorg"></input-tag>
103+
Editor for blorg.blorg:
98104
@Html.EditorFor(m => m.Blorg.Blorg)
105+
Input tag Blorgs[0].Blarg:
99106
<input-tag for="Blorgs[0].Blorg"></input-tag>
107+
Editor for Blorgs[0].Blarg:
100108
@Html.EditorFor(m => m.Blorgs[0].Blorg)
101109
@Html.Input(m => m.Value).AddClass("foo")
110+
Display tag for Value:
102111
<display-tag for="Value"></display-tag>
112+
Display for Vlaue:
103113
@Html.Display(m => m.Value)
114+
Label tag for Value:
104115
<label-tag for="Value"></label-tag>
116+
Label for Value:
105117
@Html.Label(m => m.Value)
106-
118+
107119
@{
108-
var tag = new HtmlTag("canvas");
120+
var tag = new HtmlTag("canvas");
109121
}
110122
@tag
111123

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
43
<!--
54
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
65
-->
7-
86
<system.webServer>
97
<handlers>
10-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
8+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
119
</handlers>
12-
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
10+
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" />
1311
</system.webServer>
14-
</configuration>
12+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace HtmlTags
2+
{
3+
public class ElementName
4+
{
5+
public ElementName(string value) => Value = value;
6+
7+
public string Value { get; }
8+
}
9+
}

0 commit comments

Comments
 (0)