|
@ -18,16 +18,6 @@ from django.template.loader import render_to_string |
|
|
|
|
|
|
|
|
register = template.Library(); |
|
|
register = template.Library(); |
|
|
|
|
|
|
|
|
### FILTER: mrange -- used to render the ||| lines in the channel tree |
|
|
|
|
|
|
|
|
|
|
|
def mrange( value ): |
|
|
|
|
|
"If value > 1, returns range( value - 1 ), else returns an empty list." |
|
|
|
|
|
val = int( value ); |
|
|
|
|
|
if( val > 1 ): |
|
|
|
|
|
return range( val - 1 ); |
|
|
|
|
|
return list(); |
|
|
|
|
|
|
|
|
|
|
|
register.filter( 'mrange', mrange ); |
|
|
|
|
|
|
|
|
|
|
|
### FILTER: trunc -- converts "a very very extaordinary long text" to "a very very extra..." |
|
|
### FILTER: trunc -- converts "a very very extaordinary long text" to "a very very extra..." |
|
|
def trunc( string, maxlen = 50 ): |
|
|
def trunc( string, maxlen = 50 ): |
|
|