Skip to content
Snippets Groups Projects
Commit ede1cb6f authored by Art's avatar Art :lizard:
Browse files

Update README with info about template tags

parent e96ad79b
Branches
Tags
No related merge requests found
...@@ -13,7 +13,7 @@ The current version of this package ships the following own stuff and awesome th ...@@ -13,7 +13,7 @@ The current version of this package ships the following own stuff and awesome th
### Own stuff ### Own stuff
- CD Content like Images under `static/hshassets/img/hsh_brand` - 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 ### Third party libraries
...@@ -140,3 +140,30 @@ To help you with the development, there are two command available: ...@@ -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 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 `*.js`, `*.sass`, `*.scss`, `*.css` files and everything at `img/` and `fonts/` to re-compile -minify and -copy
the changed files 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 %}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment