Releases: wrabit/django-cotton
v0.9.13
v0.9.12
What's Changed
Breaking changes:
Cotton no longer requires the .cotton.html
suffix on component or view templates. A simple .html
will do. This is to optimise experience and help reduce any 'project creep' the original implementation introduced.
- Rename our cotton related files, from
[filename].html.cotton
-> [fileame].html
- If you have cotton in production, it's recommended to clear the Django cache
This will ensure the cache rebuilds in the next visit to the page.
Full Changelog: v0.9.11...v0.9.12
v0.9.11
What's Changed
- Attribute ordering was not being kept during compilation which was breaking situations when we are using template expressions to govern attributes in HTML tags
Full Changelog: v0.9.10...v0.9.11
v0.9.10
v.0.9.9 - Native tags in attributes
What's Changed
Using template variables in attributes
Cotton now allows you to include template variables inside attributes.
<c-weather icon="fa-{{ icon }}"
unit="{{ unit|default:'c' }}"
condition="very {% get_intensity %}"
/>
- Docs fix by @wrabit in #20
- implemented variables and template methods inside attributes by @wrabit in #23
- updated poetry lock by @wrabit in #24
Full Changelog: v.0.9.7...v.0.9.8
v.0.9.7
What's Changed
Passing Python data types
Using the :
to prefix an attribute tells Cotton we're passing a dynamic type down. We already know we can use this to send a variable, but you can also send basic python types, namely:
- Integers and Floats
- None
- True and False
- Lists
- Dictionaries
This benefits a number of use-cases, for example if you have a select component that you want to provide some value:
<!-- select.cotton.html -->
<select {{ attrs }}>
{% for option in options %}
<option value="{{ option }}">{{ option }}</option>
{% endfor %}
</select>
<c-select name="q1" :options="['yes', 'no', 'maybe']" />
<!-- output -->
<select name="q1">
<option value="yes">yes</option>
<option value="no">no</option>
<option value="maybe">maybe</option>
</select>
More
- Literal eval on ":" attrs and vars by @wrabit in #19
- #16
- https://django-cotton.com/docs/components#python-types
Full Changelog: v.0.9.6...v.0.9.7
v0.9.6 - Rename c-props to c-vars
What's Changed (Breaking change)
Full Changelog: v0.9.4...v.0.9.6
Boolean Attributes
What's Changed
- formatted title by @wrabit in #2
- Format mobile landing by @wrabit in #3
- Fix template loader path in docs by @shakedown-street in #5
- adds navigation items and remove code wrapping for better mobile expe… by @wrabit in #6
- Boolean attributes by @wrabit in #8
New Contributors
- @shakedown-street made their first contribution in #5
Full Changelog: v0.9.1...v0.9.4
Open source release
v0.9.1 Automatic version bump