diff --git a/README.md b/README.md index 5a12c76ba3c194d339d8b62af656d9d2227afb8e..9f5317a7b554d02009f6c4a4eb1aa64868ebf051 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The current version of this package ships the following own stuff and awesome th ### Own stuff - CD Content like Images under `static/hshassets/img/hsh_brand` -- [Bulma styled forms](https://lab.it.hs-hannover.de/django/hshassets/wikis/bulma-styled-forms), feels like CrispyForms +- Form renderer (like CrispyForms) ### Third party libraries @@ -140,3 +140,30 @@ To help you with the development, there are two command available: does the exact same as the command before, but doesn't stop at the end. It will continuously watch for changes on `*.js`, `*.sass`, `*.scss`, `*.css` files and everything at `img/` and `fonts/` to re-compile -minify and -copy the changed files + +## Forms +Example: +```python +class UnlockForm(forms.Form): + username = forms.CharField( + max_length=400, + widget=forms.TextInput(attrs={"placeholder": _("username"), "icon": "fa-user"}), + label="", # empty, not None + ) +``` +```jinja2 +{% load bulma %} +{% trans "Send" as submit_text %} +{% bulma_form form submit_text=submit_text %} +``` +To change styles and icons of the submit button: `bulma_form` with something like +```jinja2 +{% bulma_form form submit_icon="fa-hand-spock-o" submit_class="button is-danger" %} +``` +Or you can use these template tags for a DIY form: +```jinja2 +{% load bulma %} +{% bulma_form_errors form %} +{% bulma_form_fields form %} +{% bulma_submit_button %} +```