mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-21 19:00:12 +00:00
Urlencode email
This commit is contained in:
@@ -3,7 +3,6 @@ import datetime as dt
|
||||
from datetime import datetime
|
||||
import re
|
||||
import time
|
||||
from urllib2 import quote as default_quote
|
||||
|
||||
from django import template
|
||||
from django.core.cache import cache
|
||||
@@ -294,11 +293,6 @@ def translate_permission(value):
|
||||
else:
|
||||
return ''
|
||||
|
||||
@register.filter(name='quote')
|
||||
def quote(value):
|
||||
"""Replace special characters in value using the %xx escape."""
|
||||
return default_quote(value.encode('utf-8'))
|
||||
|
||||
@register.filter(name='trim')
|
||||
def trim(value, length):
|
||||
if len(value) > length:
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<td>{{ contact.note }}</td>
|
||||
<td data-email="{{ contact.contact_email }}" data-name="{{ contact.contact_name }}" data-note="{{ contact.note }}">
|
||||
<a href="#" data="{{ SITE_ROOT }}contacts/edit/?email={{ contact.contact_email }}" class="contact-edit op">{% trans "Edit"%}</a>
|
||||
<a href="#" data-url="{{ SITE_ROOT }}contacts/delete/?email={{ contact.contact_email|quote}}" data-target="{{ contact.contact_email}}" class="contact-delete op">{% trans "Delete"%}</a>
|
||||
<a href="#" data-url="{{ SITE_ROOT }}contacts/delete/?email={{ contact.contact_email|urlencode}}" data-target="{{ contact.contact_email}}" class="contact-delete op">{% trans "Delete"%}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@@ -54,10 +54,10 @@
|
||||
<td>{{ repo.props.repo_desc }}</td>
|
||||
<td>
|
||||
{% if repo.props.share_type == 'group' %}
|
||||
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|quote }}&gid={{ repo.props.group_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&gid={{ repo.props.group_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% endif %}
|
||||
{% if repo.props.share_type == 'personal' %}
|
||||
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|quote }}&to={{ repo.props.user|quote }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&to={{ repo.props.user|urlencode }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% endif %}
|
||||
{% if repo.props.share_type == 'public' %}
|
||||
{% if not org %}
|
||||
|
@@ -80,7 +80,7 @@
|
||||
<td>
|
||||
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.repo_id }}" class="download-btn op-icon vh" title="{% trans "Download" %}" alt="{% trans "Download" %}" />
|
||||
{% if repo.share_type == 'personal' %}
|
||||
<img src="{{ MEDIA_URL }}img/delete-20.png" data-url="{% url 'repo_remove_share' %}?repo_id={{ repo.repo_id }}&from={{ repo.user|quote }}&to={{ request.user.username|quote }}" data-target="{{repo.repo_name}}" class="unshare-btn op-icon vh" title="{% trans "Leave Share" %}" alt="{% trans "Leave Share" %}" />
|
||||
<img src="{{ MEDIA_URL }}img/delete-20.png" data-url="{% url 'repo_remove_share' %}?repo_id={{ repo.repo_id }}&from={{ repo.user|urlencode }}&to={{ request.user.username|urlencode }}" data-target="{{repo.repo_name}}" class="unshare-btn op-icon vh" title="{% trans "Leave Share" %}" alt="{% trans "Leave Share" %}" />
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user