mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-21 00:15:26 +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):
|
def url_target_blank(text):
|
||||||
return text.replace('<a ', '<a target="_blank" ')
|
return text.replace('<a ', '<a target="_blank" ')
|
||||||
url_target_blank.is_safe=True
|
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">
|
<p class="al-rt">
|
||||||
<span class="author">by
|
<span class="author">by
|
||||||
{% if current_commit.props.creator_name %}
|
{% if current_commit.props.creator_name %}
|
||||||
{{ current_commit.props.creator_name }}
|
{{ current_commit.props.creator_name|short_email }}
|
||||||
{% else %}
|
{% else %}
|
||||||
未知
|
未知
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<td>{{ commit.props.ctime|translate_commit_time }}</td>
|
<td>{{ commit.props.ctime|translate_commit_time }}</td>
|
||||||
|
|
||||||
{% if commit.props.creator_name %}
|
{% if commit.props.creator_name %}
|
||||||
<td>{{ commit.props.creator_name }}</td>
|
<td>{{ commit.props.creator_name|short_email }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>未知</td>
|
<td>未知</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user