Created
January 20, 2016 09:05
-
-
Save somebee/7291f774a2b81bf535f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tag collection | |
def render | |
<self .searchme=@searchable> | |
for item,i in query | |
element(item,i) | |
<add_element object=object relation=@relation maxlength=@maxlength> if @addable | |
# you can override this for subclasses of collection | |
# but if you want the elements to be cached, you must | |
# remember to pass in the key (which in this case is | |
# the index in the list). In many cases it's better | |
# if each data-item has a unique id/reference, then | |
# it's better to use that like <div@{item:id}> ... | |
def element item, key | |
<div@{key} .selected=selected(item)> | |
<h3> item:name | |
<projects_collection[item] relation="projects" maxlength=20 addable=true searchable=true> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment