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:
parent
571e9ba2b0
commit
6dd67afc43
@ -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('@')]
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user