1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

Fixed bug when email contains '+' sign

This commit is contained in:
zhengxie
2012-12-24 19:57:34 +08:00
parent 05c8280e40
commit 49db04c5db
7 changed files with 13 additions and 8 deletions

View File

@@ -256,3 +256,8 @@ def translate_permission(value):
return _(u'Read-Only')
else:
return ''
@register.filter(name='quote')
def quote(value):
from urllib2 import quote
return quote(value)

View File

@@ -1,5 +1,5 @@
{% extends "myhome_base.html" %}
{% load avatar_tags i18n %}
{% load avatar_tags i18n seahub_tags %}
{% block nav_contacts_class %}class="cur"{% endblock %}
@@ -31,7 +31,7 @@
<td>{{ contact.note }}</td>
<td>
<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}}" data-target="{{ contact.contact_email}}" class="contact-delete op">{% trans "Delete"%}</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>
</td>
</tr>
{% endfor %}

View File

@@ -19,7 +19,7 @@ urlpatterns = patterns('',
# repo share
url(r'^(?P<url_prefix>[^/]+)/shareadmin/$', org_shareadmin, name='org_shareadmin'),
url(r'^(?P<url_prefix>[^/]+)/share/$', org_shareadmin, name='org_shareadmin'),
url(r'^(?P<url_prefix>[^/]+)/repo/share/$', org_repo_share, name='org_repo_share'),
url(r'^(?P<url_prefix>[^/]+)/share/permission_admin/$', org_share_permission_admin, name='org_share_permission_admin'),

View File

@@ -53,10 +53,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 }}&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|quote }}&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 }}&to={{ repo.props.user }}" class="cancel-share op">{% trans "Unshare"%}</a>
<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>
{% endif %}
{% if repo.props.share_type == 'public' %}
{% if not org %}

View File

@@ -12,7 +12,7 @@
<a href="{% url 'organizations.views.org_groups' org.url_prefix %}" {% block nav_group_class %}{% endblock %}>{% trans "Groups" %}</a>
</li>
<li>
<a href="{% url 'organizations.views.org_shareadmin' org.url_prefix %}" {% block nav_shareadmin_class %}{% endblock %}>{% trans "Share" %}</a>
<a href="{% url 'organizations.views.org_shareadmin' org.url_prefix %}" {% block nav_share_class %}{% endblock %}>{% trans "Share" %}</a>
</li>
<li>
<a href="{% url 'organizations.views.org_public' org.url_prefix %}" {% block nav_org_class %}{% endblock %}>{% trans "Public Library" %}</a>

View File

@@ -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 }}&to={{ request.user }}" 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|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" %}" />
{% endif %}
</td>
</tr>