Toolkit: Fix text input label, add basic checkbox

This commit is contained in:
asonix 2021-02-01 21:53:06 -06:00
parent d3e62b7cd1
commit 8253a211ae
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,12 @@
@(name: &str, title: &str, checked: bool)
<div>
<label>
@if checked {
<input type="checkbox" name="@name" checked />
} else {
<input type="checkbox" name="@name" />
}
<span>@title</span>
</label>
</div>

View file

@ -5,7 +5,7 @@
<div class="@text_input.class_string()">
@if let Some(title) = text_input.title.as_ref() {
<label for="@text_input.input.name" class="toolkit-input--label">
<label class="toolkit-input--label">
<span class="toolkit-input--title">@title</span>
@:input(&text_input.input)
</label>