Skip to content

Commit 9e1c53c

Browse files
committed
Added final documentation tweaks for tag helpers and an example buttons page
1 parent 852730c commit 9e1c53c

File tree

7 files changed

+238
-43
lines changed

7 files changed

+238
-43
lines changed

ChameleonForms.Example/Controllers/ExampleFormsController.cs

+5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ public ActionResult Buttons()
9595
return View();
9696
}
9797

98+
public ActionResult ButtonsTH()
99+
{
100+
return View();
101+
}
102+
98103
public ActionResult Partials()
99104
{
100105
return View(new ViewModelExample{TextAreaField = "Initial value"});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@using ChameleonForms.Templates.TwitterBootstrap3
2+
@model dynamic
3+
4+
@{
5+
ViewBag.Title = "Buttons";
6+
}
7+
8+
<h1>Buttons</h1>
9+
10+
<chameleon-form>
11+
<form-navigation>
12+
<form-button label="text button" emphasis-style="Primary" size="Default" />
13+
<form-button add-class="random-class"><strong>html button</strong></form-button>
14+
<reset-button label="text reset" icon="refresh" />
15+
<reset-button><strong>html reset</strong></reset-button>
16+
<submit-button><strong>html submit</strong></submit-button>
17+
<submit-button label="text submit" emphasis-style="Danger" />
18+
<submit-button name="name" value="value"><strong>html submit with value</strong></submit-button>
19+
<submit-button name="name" value="value" label="value" icon="star" emphasis-style="Success" />
20+
</form-navigation>
21+
22+
<p></p>
23+
24+
<form-navigation>
25+
<form-button label="Small button 1" size="Small" />
26+
<form-button label="Small button 2" fluent-attrs='c => c.WithSize(ButtonSize.Small)' />
27+
</form-navigation>
28+
29+
<p></p>
30+
31+
<form-navigation>
32+
<form-button label="Extra small button 1" size="ExtraSmall" />
33+
<form-button label="Extra small button 2" fluent-attrs='c => c.WithSize(ButtonSize.ExtraSmall)' />
34+
</form-navigation>
35+
36+
<p></p>
37+
38+
<form-navigation>
39+
<form-button label="Large button 1" size="Large" />
40+
<form-button label="Large button 2" fluent-attrs='c => c.WithSize(ButtonSize.Large)' />
41+
</form-navigation>
42+
</chameleon-form>

ChameleonForms.Example/Views/Home/Index.cshtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<li>@Html.ActionLink("Null model", "NullModel", "ExampleForms")</li>
3232
<li>@Html.ActionLink("Null model with list", "NullModelWithList", "ExampleForms")</li>
3333
<li>@Html.ActionLink("Null list", "NullList", "ExampleForms")</li>
34-
<li>@Html.ActionLink("Buttons", "Buttons", "ExampleForms")</li>
34+
<li>@Html.ActionLink("Buttons", "Buttons", "ExampleForms") | @Html.ActionLink("Buttons - Tag Helpers", "ButtonsTH", "ExampleForms")</li>
3535
<li>@Html.ActionLink("Partials", "Partials", "ExampleForms") | @Html.ActionLink("Partials - Tag Helpers", "PartialsTH", "ExampleForms")</li>
3636
<li>@Html.ActionLink("Changing model context - HTML Helpers", "ChangingContext", "ExampleForms")</li>
3737
<li>@Html.ActionLink("Changing model context - Tag Helpers", "ChangingContextTH", "ExampleForms")</li>

docs/multiple-enum.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ This will change the default HTML for the non-Required drop-down list of enum fi
112112
### Hide empty item
113113
If you have a non-Required list of enums field then it will show the empty item and this item will be selected by default if no values are selected. If for some reason you want a non-Required list of enums field, but you would also like to hide the empty item you can do so with the `HideEmptyItem` method in the Field Configuration, e.g.:
114114

115-
# [Tag Helpers variant](#tab/xxx-th)
115+
# [Tag Helpers variant](#tab/hide-empty-th)
116116

117117
The `HideEmptyItem` method is [mapped](./field-configuration.md#mapped-attributes) to `hide-empty-item="true"`.
118118

119119
```cshtml
120120
<field for="NullableEnumListField" hide-empty-item="true" />
121121
```
122122

123-
# [HTML Helpers variant](#tab/xxx-hh)
123+
# [HTML Helpers variant](#tab/hide-empty-hh)
124124

125125
```cshtml
126126
@s.FieldFor(m => m.NullableEnumListField).HideEmptyItem()

docs/multiple-list.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ This will change the default HTML for both Required and non-Required fields with
117117

118118
When you display a non-Required list of list values field as a drop-down you can change the text that is used to display the `none` value to the user. By default the text used is `None`. To change the text simply use the `WithNoneAs` method, e.g.:
119119

120-
# [Tag Helpers variant](#tab/xxx-th)
120+
# [Tag Helpers variant](#tab/none-label-th)
121121

122122
The `WithNoneAs` method is [mapped](./field-configuration.md#mapped-attributes) to `none-label="{label}"`.
123123

124124
```cshtml
125125
<label for="EnumerableListId" none-label="No value" />
126126
```
127127

128-
# [HTML Helpers variant](#tab/xxx-hh)
128+
# [HTML Helpers variant](#tab/none-label-hh)
129129

130130
```cshtml
131131
@s.FieldFor(m => m.EnumerableListId).WithNoneAs("No value")

0 commit comments

Comments
 (0)