mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-22 10:20:11 +00:00
Updated Appearance (markdown)
parent
3c1ee9c154
commit
022a389175
@ -7,5 +7,34 @@ jfa-go uses Bootstrap, which is relatively easy to customize. There are 3 option
|
|||||||
|
|
||||||
### HTML
|
### HTML
|
||||||
|
|
||||||
support for custom HTML is a bit rudimentary. One can specify a path to a folder containing customized HTML files with the `files/html_templates` setting. Any files that match the names of jfa-go's internal templates will be loaded instead. The files use go's built in templating language, so familiarize yourself with it first ([a good resource](https://blog.gopheracademy.com/advent-2017/using-go-templates/)) so you know what different parts do. You can find the internal templates [here](https://github.com/hrfee/jfa-go/tree/main/data/templates). Good luck!
|
support for custom HTML is a bit rudimentary. One can specify a path to a folder containing customized HTML files with the `files/html_templates` setting. Any files that match the names of jfa-go's internal templates will be loaded instead. The files use go's built in templating language, so familiarize yourself with it first ([a good resource](https://blog.gopheracademy.com/advent-2017/using-go-templates/)) so you know what different parts do. You can find the internal templates [here](https://github.com/hrfee/jfa-go/tree/main/data/templates).
|
||||||
|
|
||||||
|
Additionally, Password requirement strings (e.g "Must have at least n characters") can be customized, which is useful if you're translating the page. In your `form.html` file, inside script tags, add this:
|
||||||
|
```javascript
|
||||||
|
var validationStrings = {
|
||||||
|
"length": {
|
||||||
|
"singular": "Must have at least {n} character",
|
||||||
|
"plural": "Must have a least {n} characters"
|
||||||
|
},
|
||||||
|
"uppercase": {
|
||||||
|
"singular": "Must have at least {n} uppercase character",
|
||||||
|
"plural": "Must have at least {n} uppercase characters"
|
||||||
|
},
|
||||||
|
"lowercase": {
|
||||||
|
"singular": "Must have at least {n} lowercase character",
|
||||||
|
"plural": "Must have at least {n} lowercase characters"
|
||||||
|
},
|
||||||
|
"number": {
|
||||||
|
"singular": "Must have at least {n} number",
|
||||||
|
"plural": "Must have at least {n} numbers"
|
||||||
|
},
|
||||||
|
"special": {
|
||||||
|
"singular": "Must have at least {n} special character",
|
||||||
|
"plural": "Must have at least {n} special characters"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Make sure you include `{n}` in each, this is where the number goes.
|
||||||
|
|
||||||
|
Good luck!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user