Skip to content

Releases: wrabit/django-cotton

v0.9.13

05 Jul 21:42
Compare
Choose a tag to compare

What's Changed

We can now use multi-line attribute values, like:

<div x-data="{
    something: true
  }">
  ...
</div>

v0.9.12

03 Jul 14:29
Compare
Choose a tag to compare

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

24 Jun 13:13
Compare
Choose a tag to compare

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
  • Refactor loader + keep attribute ordering by @wrabit in #27

Full Changelog: v0.9.10...v0.9.11

v0.9.10

22 Jun 11:08
Compare
Choose a tag to compare

What's Changed

Ensures that the new template expression attributes are also provided in {{ attrs }} alongside all normal attributes.

  • added expression attributes to {{ attrs }} by @wrabit in #25

Full Changelog: v.0.9.8...v0.9.10

v.0.9.9 - Native tags in attributes

22 Jun 09:10
Compare
Choose a tag to compare

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 %}"
/>

Full Changelog: v.0.9.7...v.0.9.8

v.0.9.7

21 Jun 06:15
Compare
Choose a tag to compare

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

Full Changelog: v.0.9.6...v.0.9.7

v0.9.6 - Rename c-props to c-vars

17 Jun 20:31
Compare
Choose a tag to compare

What's Changed (Breaking change)

  • Rename c props by @wrabit in PR: #15, all <c-props /> are now <c-vars />, see issue: #14

Full Changelog: v0.9.4...v.0.9.6

Boolean Attributes

11 Jun 22:00
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.9.1...v0.9.4

Open source release

08 Jun 13:43
Compare
Choose a tag to compare
v0.9.1

Automatic version bump