Revision 6795eb09 snf-astakos-app/astakos/im/templatetags/filters.py

b/snf-astakos-app/astakos/im/templatetags/filters.py
134 134
        paginator.len
135 135
    except AttributeError:
136 136
        paginator._count = len(list(l))
137
    
137

  
138 138
    try:
139 139
        page_number = int(page)
140 140
    except ValueError:
......
197 197
            return '1 byte'
198 198
        else:
199 199
           return '0'
200
   
200

  
201 201
@register.filter
202 202
def isinf(v):
203 203
    if math.isinf(v):
204 204
        return 'Unlimited'
205 205
    else:
206 206
        return v
207
    
207

  
208 208
@register.filter
209
def truncatename(v):
210
    max = 18
209
def truncatename(v, max=18, append="..."):
211 210
    length = len(v)
212 211
    if length>max:
213
        return v[:max]+'...'
212
        return v[:max] + append
214 213
    else:
215
        return v[:20]
214
        return v
216 215

  
217 216
@register.filter
218 217
def resource_groups(project_definition):

Also available in: Unified diff