1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-22 02:10:10 +00:00

Updated Appearance (markdown)

Harvey Tindall 2020-11-03 21:41:28 +00:00
parent 86c0dbcc3b
commit c55bd66d66

@ -9,32 +9,7 @@ jfa-go uses Bootstrap, which is relatively easy to customize. There are 3 option
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
window.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.
Additionally, All text on the page, including password requirement strings (e.g "Must have at least n characters") can be customized. Copy one of the internal language files in the `data/lang/form` directory, and change at least the `"meta": { name: "" }` field (This is the name that will appear in settings). You can then modify the `"validationStrings"` values. Restart jfa-go and you should see a new option in Settings > General > Language.
Good luck!