Created
April 8, 2013 20:55
-
-
Save alxf/5340408 to your computer and use it in GitHub Desktop.
Sample def block with mako
This file contains hidden or 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
# Sample def block with mako | |
<%def name="artist_summary(label, img1, img2, *klass)" | |
cached="True" cache_timeout="300"> | |
<div id="${label}" class="artist-column ${' '.join(klass)}"> | |
<img src="/static/img/${img1}"/> | |
</div> | |
<script type="text/javascript"> | |
$$("#${label} img").invoke('observe', 'mouseover', function(ev) { | |
ev.element().setAttribute('src', "/static/img/${img2}"); | |
}); | |
$$("#${label} img").invoke('observe', 'mouseout', function(ev) { | |
ev.element().setAttribute('src', "/static/img/${img1}"); | |
}); | |
</script> | |
</%def> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment