diff --git a/seahub/contacts/views.py b/seahub/contacts/views.py index 13cd6a9dd0..0807d68f76 100644 --- a/seahub/contacts/views.py +++ b/seahub/contacts/views.py @@ -89,9 +89,9 @@ def contact_add(request): contact.note = form.cleaned_data['note'] contact.save() - messages.success(request, _(u"Successfully added %s.") % contact_email) + messages.success(request, _(u"Successfully added %s to contacts.") % contact_email) else: - messages.error(request, _('Failed to add an contact.')) + messages.error(request, _('Failed to add %s to contacts.')) referer = request.META.get('HTTP_REFERER', None) if not referer: diff --git a/seahub/group/templates/group/group_members.html b/seahub/group/templates/group/group_members.html index f5d270cb30..3238804ca6 100644 --- a/seahub/group/templates/group/group_members.html +++ b/seahub/group/templates/group/group_members.html @@ -41,30 +41,19 @@ {{ e|email2nickname }}
{{ e }}
{% if m.can_be_contact %} - + {% endif %} {% endwith %} {% endfor %} - + +{% include 'snippets/add_to_contacts_form.html' %} + {% endblock %} {% block extra_script %} - +{% include 'snippets/add_to_contacts_js.html' %} + {% endblock %} diff --git a/seahub/message/templates/message/user_msg_list.html b/seahub/message/templates/message/user_msg_list.html index 60188d8ee2..f0c88a1b39 100644 --- a/seahub/message/templates/message/user_msg_list.html +++ b/seahub/message/templates/message/user_msg_list.html @@ -11,7 +11,7 @@{% if to_email %}{{ to_email|email2nickname }}{% else %}{% trans "No Nickname" %}{% endif %}
{% if add_to_contacts %} - + {% endif %}{% trans "After login, you can post discussions and add replies." %}
{% endif %} - + +{% include 'snippets/add_to_contacts_form.html' %} + {% endblock %} @@ -132,6 +134,9 @@ function check(it){ return false; } + +{% include 'snippets/add_to_contacts_js.html' %} + {% endblock %} diff --git a/seahub/share/templates/repo/user_share_list.html b/seahub/share/templates/repo/user_share_list.html index 2b31c9eaff..2023b131db 100644 --- a/seahub/share/templates/repo/user_share_list.html +++ b/seahub/share/templates/repo/user_share_list.html @@ -11,7 +11,7 @@{% if to_email %}{{ to_email|email2nickname }}{% else %}{% trans "No Nickname" %}{% endif %}
{% if add_to_contacts %} - + {% endif %}{{ e }}
{% if u.can_be_contact %} - + {% endif %} @@ -49,27 +49,15 @@ {% endif %} - {% else %}{% trans "None"%}
{% endif %} +{% include 'snippets/add_to_contacts_form.html' %} + {% endblock %} {% block extra_script %} - +{% include 'snippets/add_to_contacts_js.html' %} + {% endblock %} diff --git a/seahub/templates/snippets/add_to_contacts_form.html b/seahub/templates/snippets/add_to_contacts_form.html new file mode 100644 index 0000000000..9200845d9e --- /dev/null +++ b/seahub/templates/snippets/add_to_contacts_form.html @@ -0,0 +1,10 @@ +{% load i18n %} diff --git a/seahub/templates/snippets/add_to_contacts_js.html b/seahub/templates/snippets/add_to_contacts_js.html new file mode 100644 index 0000000000..f4c81fe924 --- /dev/null +++ b/seahub/templates/snippets/add_to_contacts_js.html @@ -0,0 +1,6 @@ +