Show More
@@ -150,9 +150,13 b' def chop_at_smart(s, sub, inclusive=Fals' | |||||
150 | return chopped |
|
150 | return chopped | |
151 |
|
151 | |||
152 |
|
152 | |||
153 | def shorter(text, size=20): |
|
153 | def shorter(text, size=20, prefix=False): | |
154 | postfix = '...' |
|
154 | postfix = '...' | |
155 | if len(text) > size: |
|
155 | if len(text) > size: | |
|
156 | if prefix: | |||
|
157 | # shorten in front | |||
|
158 | return postfix + text[-(size - len(postfix)):] | |||
|
159 | else: | |||
156 | return text[:size - len(postfix)] + postfix |
|
160 | return text[:size - len(postfix)] + postfix | |
157 | return text |
|
161 | return text | |
158 |
|
162 |
@@ -381,9 +381,14 b'' | |||||
381 |
|
381 | |||
382 |
|
382 | |||
383 | ## ARTIFACT RENDERERS |
|
383 | ## ARTIFACT RENDERERS | |
|
384 | <%def name="repo_artifact_name(repo_name, file_uid, artifact_display_name)"> | |||
|
385 | <a href="${h.route_path('repo_artifacts_get', repo_name=repo_name, uid=file_uid)}"> | |||
|
386 | ${artifact_display_name or 'EMPTY NAME'} | |||
|
387 | </a> | |||
|
388 | </%def> | |||
384 |
|
|
389 | ||
385 | <%def name="repo_artifact_uid(repo_name, file_uid)"> |
|
390 | <%def name="repo_artifact_uid(repo_name, file_uid)"> | |
386 | <code><a href="${h.route_path('repo_artifacts_get', repo_name=repo_name, uid=file_uid)}">${file_uid}</a></code> |
|
391 | <code>${h.shorter(file_uid, size=12, prefix=True)}</code> | |
387 | </%def> |
|
392 | </%def> | |
388 |
|
393 | |||
389 | <%def name="repo_artifact_uid_action(repo_name, file_uid)"> |
|
394 | <%def name="repo_artifact_uid_action(repo_name, file_uid)"> |
General Comments 0
You need to be logged in to leave comments.
Login now