devices: better documentation for device add form

This commit is contained in:
Tigor Hutasuhut 2024-05-07 21:02:10 +07:00
parent 494a4bc956
commit 0c8e6622bc
4 changed files with 7 additions and 8 deletions

View file

@ -30,8 +30,8 @@ templ AspectRatioToleranceInput(data AspectRatioToleranceData) {
/> />
<div class="label"> <div class="label">
<span class="label-text"> <span class="label-text">
Aspect Ratio Tolerance is a filter on how close the shape of the download images to the device shape is. Aspect Ratio Tolerance is a filter on how close the shape of the candidate for download images to the device shape is.
The bigger the value, the more images will be accepted and vice versa. '0.20' is the default value because The bigger the value, the more images will be accepted, but will also get more images that does not look good when stretched. '0.20' is the default value because
it accept quite a bit of images to download while still looking good even when the image is stretched for the device's wallpaper. it accept quite a bit of images to download while still looking good even when the image is stretched for the device's wallpaper.
</span> </span>
</div> </div>

View file

@ -32,7 +32,7 @@ templ NameInput(data NameInputData) {
if data.Error != "" { if data.Error != "" {
<span class="label-text text-error">{ data.Error }</span> <span class="label-text text-error">{ data.Error }</span>
} else { } else {
<span class="label-text">The display name for the device. Use distinguishable value for easy lookup.</span> <span class="label-text">The display name for the device. You can use non-english characters for the name.</span>
} }
</div> </div>
</label> </label>

View file

@ -41,7 +41,7 @@ templ ResolutionXInput(data ResolutionData) {
if data.Value > 0 { if data.Value > 0 {
value={ strconv.Itoa(data.Value) } value={ strconv.Itoa(data.Value) }
} }
placeholder="1920" placeholder="e.g. 1920"
required required
/> />
<div class="label"> <div class="label">
@ -90,7 +90,7 @@ templ ResolutionYInput(data ResolutionData) {
if data.Value > 0 { if data.Value > 0 {
value={ strconv.Itoa(data.Value) } value={ strconv.Itoa(data.Value) }
} }
placeholder="1080" placeholder="e.g. 1080"
required required
/> />
<div class="label"> <div class="label">

View file

@ -25,7 +25,7 @@ templ SlugInput(data SlugInputData) {
"text-error", data.Error != "", "text-error", data.Error != "",
"text-success", data.Valid != "", "text-success", data.Valid != "",
) } ) }
>Slug</span> >Slug Identifier</span>
</div> </div>
<input <input
id="slug-input-field" id="slug-input-field"
@ -48,7 +48,6 @@ templ SlugInput(data SlugInputData) {
value={ data.Value } value={ data.Value }
placeholder="my-awesome-device" placeholder="my-awesome-device"
title="Url Friendly Characters Only" title="Url Friendly Characters Only"
pattern="^[a-z0-9-_]+$"
required required
/> />
<div class="label"> <div class="label">
@ -58,7 +57,7 @@ templ SlugInput(data SlugInputData) {
} else if data.Error != "" { } else if data.Error != "" {
{ data.Error } { data.Error }
} else { } else {
Unique identifier for the device. URL friendly Unique identifier for the device.
Value must be lowercase english alphabet and supported separator is only 'dash' (-) and 'underscores' (_). Value must be lowercase english alphabet and supported separator is only 'dash' (-) and 'underscores' (_).
} }
</span> </span>