1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

Use short email in commit message.

This commit is contained in:
xiez 2012-07-23 17:00:58 +08:00
parent 571e9ba2b0
commit 6dd67afc43
3 changed files with 12 additions and 2 deletions

View File

@ -122,3 +122,13 @@ def email2nickname(value):
def url_target_blank(text):
return text.replace('<a ', '<a target="_blank" ')
url_target_blank.is_safe=True
@register.filter(name='short_email')
def short_email(email):
"""
Return short email which is the string before '@'.
"""
if email.find('@') <= 0:
return email
else:
return email[:email.find('@')]

View File

@ -27,7 +27,7 @@
<p class="al-rt">
<span class="author">by
{% if current_commit.props.creator_name %}
{{ current_commit.props.creator_name }}
{{ current_commit.props.creator_name|short_email }}
{% else %}
未知
{% endif %}

View File

@ -23,7 +23,7 @@
<td>{{ commit.props.ctime|translate_commit_time }}</td>
{% if commit.props.creator_name %}
<td>{{ commit.props.creator_name }}</td>
<td>{{ commit.props.creator_name|short_email }}</td>
{% else %}
<td>未知</td>
{% endif %}