Skip to content

Better classes attribute handling#222

Open
paradoxxxzero wants to merge 2 commits intosyrusakbary:masterfrom
paradoxxxzero:better_classes
Open

Better classes attribute handling#222
paradoxxxzero wants to merge 2 commits intosyrusakbary:masterfrom
paradoxxxzero:better_classes

Conversation

@paradoxxxzero
Copy link
Copy Markdown

Now support multiple class attributes specified and class/bool objects:

- var a = True;

a.cls1(class={'cls2': False, 'cls3': True, 'cls4': a})

a.cls0.cls1(class=['cls2', 'cls3'], class=['cls4', 'cls5'])

gives

<a class="cls1 cls3 cls4"></a><a class="cls0 cls1 cls2 cls3 cls4 cls5"></a>

@syrusakbary syrusakbary force-pushed the master branch 3 times, most recently from 4a76e8a to eb84811 Compare January 7, 2016 17:08
@kakulukia
Copy link
Copy Markdown

Since there are no updates to pyjade and its successor recently was deleted from pypi, I took the liberty to revive it: https://github.com/kakulukia/pypugjs

Version 5.0.1 has fixed the incompatibility with recent Django versions.
I'll be happy to merge this into the next version if you resubmit the PR to my repo.

@paradoxxxzero
Copy link
Copy Markdown
Author

Please cherry-pick if you want the code, I'm not using this anymore.

@kakulukia
Copy link
Copy Markdown

Will do. What do you currently use?

@paradoxxxzero
Copy link
Copy Markdown
Author

React :)

@kakulukia
Copy link
Copy Markdown

But compared to pug templates react is ugly as hell! :)
I tried to work with it, but found react too complicated/ugly coming from Angular.
Have you had a look at VueJS? Its as beautiful as Angular u can use pug templates and sass right away and its as fast as react.
Plus VueJS can be used as a drop in script for pages served with Django.

Here is a lil example (i love that combination or DRF and Vue frontend) https://github.com/kakulukia/django-default-project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants