mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
add deleted_files_msg for email (#5554)
This commit is contained in:
@@ -206,6 +206,17 @@ class Command(BaseCommand):
|
|||||||
notice.inv_accept_at = inv.accept_time.strftime("%Y-%m-%d %H:%M:%S")
|
notice.inv_accept_at = inv.accept_time.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
return notice
|
return notice
|
||||||
|
|
||||||
|
def format_deleted_files_msg(self, notice):
|
||||||
|
d = json.loads(notice.detail)
|
||||||
|
repo_id = d['repo_id']
|
||||||
|
repo = seafile_api.get_repo(repo_id)
|
||||||
|
repo_url = reverse('lib_view', args=[repo.id, repo.name, ''])
|
||||||
|
|
||||||
|
notice.repo_url = repo_url
|
||||||
|
notice.repo_name = repo.name
|
||||||
|
notice.avatar_src = self.get_avatar_src(notice.to_user)
|
||||||
|
return notice
|
||||||
|
|
||||||
def get_user_language(self, username):
|
def get_user_language(self, username):
|
||||||
return Profile.objects.get_user_language(username)
|
return Profile.objects.get_user_language(username)
|
||||||
|
|
||||||
@@ -333,6 +344,9 @@ class Command(BaseCommand):
|
|||||||
elif notice.is_guest_invitation_accepted_msg():
|
elif notice.is_guest_invitation_accepted_msg():
|
||||||
notice = self.format_guest_invitation_accepted_msg(notice)
|
notice = self.format_guest_invitation_accepted_msg(notice)
|
||||||
|
|
||||||
|
elif notice.is_deleted_files_msg():
|
||||||
|
notice = self.format_deleted_files_msg(notice)
|
||||||
|
|
||||||
if notice is None:
|
if notice is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@@ -62,6 +62,9 @@ You've got {{num}} new notices on {{ site_name }}:
|
|||||||
{% elif notice.is_guest_invitation_accepted_msg %}
|
{% elif notice.is_guest_invitation_accepted_msg %}
|
||||||
<p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with user=notice.inv_accepter inv_url=notice.inv_url time=notice.inv_accept_at %}Guest {{user}} accepted your <a href="{{url_base}}{{inv_url}}">invitation</a> at {{time}}.{% endblocktrans %}</p>
|
<p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with user=notice.inv_accepter inv_url=notice.inv_url time=notice.inv_accept_at %}Guest {{user}} accepted your <a href="{{url_base}}{{inv_url}}">invitation</a> at {{time}}.{% endblocktrans %}</p>
|
||||||
|
|
||||||
|
{% elif notice.is_deleted_files_msg %}
|
||||||
|
<p style="line-height:1.5; margin:.2em 10px .2em 0;">{% blocktrans with repo_url=notice.repo_url repo_name=notice.repo_name %}Your library <a href="{{url_base}}{{ repo_url }}">{{ repo_name }}</a> has recently deleted a large number of files.{% endblocktrans %}</p>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size: 13px; color: #333; word-wrap: break-word;">{{ notice.timestamp|date:"Y-m-d G:i:s"}}</td>
|
<td style="padding: 5px 3px; border-bottom: 1px solid #eee; font-size: 13px; color: #333; word-wrap: break-word;">{{ notice.timestamp|date:"Y-m-d G:i:s"}}</td>
|
||||||
|
Reference in New Issue
Block a user