mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
Modified unshare
This commit is contained in:
Binary file not shown.
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2012-11-04 13:28+0800\n"
|
||||
"POT-Creation-Date: 2012-11-05 11:53+0800\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -140,20 +140,44 @@ msgstr ""
|
||||
msgid "简体中文"
|
||||
msgstr ""
|
||||
|
||||
#: views.py:1158
|
||||
#: views.py:1126
|
||||
msgid "Operation successful"
|
||||
msgstr "操作成功"
|
||||
|
||||
#: views.py:1128
|
||||
msgid "Operation failed"
|
||||
msgstr "操作失败"
|
||||
|
||||
#: views.py:1159
|
||||
msgid "Failed to delete file."
|
||||
msgstr "删除文件出错。"
|
||||
|
||||
#: views.py:1165
|
||||
#: views.py:1166
|
||||
#, python-format
|
||||
msgid "%s successfully deleted."
|
||||
msgstr "%s 删除成功。"
|
||||
|
||||
#: views.py:1167
|
||||
#: views.py:1168
|
||||
#, python-format
|
||||
msgid "Internal error. Failed to delete %s."
|
||||
msgstr "内部错误。删除 %s 失败。"
|
||||
|
||||
#: views.py:1751 views.py:1761
|
||||
msgid "Remove share failed"
|
||||
msgstr "取消共享失败"
|
||||
|
||||
#: views.py:1757
|
||||
msgid "group id is not valid"
|
||||
msgstr "group id 无效"
|
||||
|
||||
#: views.py:1770
|
||||
msgid "Remove share successful"
|
||||
msgstr "取消共享成功"
|
||||
|
||||
#: views.py:2561 views.py:2569
|
||||
msgid "Remove successful"
|
||||
msgstr "删除成功"
|
||||
|
||||
#: templates/404.html:6
|
||||
msgid "Sorry, but the requested page could not be found."
|
||||
msgstr "对不起,你访问的页面不存在。"
|
||||
@@ -165,7 +189,7 @@ msgstr "添加新用户"
|
||||
#: templates/add_user_form.html:9 templates/sys_useradmin.html:15
|
||||
#: templates/registration/login.html:8
|
||||
#: templates/registration/registration_form.html:11
|
||||
#: templates/snippets/user_profile_html.html:27
|
||||
#: templates/snippets/user_profile_html.html:28
|
||||
msgid "Email"
|
||||
msgstr "邮箱"
|
||||
|
||||
@@ -195,7 +219,7 @@ msgstr "确认密码"
|
||||
#: templates/snippets/group_recommend_form.html:23
|
||||
#: templates/snippets/repo_create_form.html:23
|
||||
#: templates/snippets/repo_share_form.html:18
|
||||
#: templates/snippets/user_profile_html.html:33
|
||||
#: templates/snippets/user_profile_html.html:34
|
||||
msgid "Submit"
|
||||
msgstr "提交"
|
||||
|
||||
@@ -308,7 +332,7 @@ msgstr "海文互知"
|
||||
msgid "Contact Us"
|
||||
msgstr "联系我们"
|
||||
|
||||
#: templates/base.html:143
|
||||
#: templates/base.html:143 templates/snippets/myhome_extra_script.html:31
|
||||
msgid "Really want to delete?"
|
||||
msgstr "确定要删除?"
|
||||
|
||||
@@ -510,8 +534,8 @@ msgid "Creator: "
|
||||
msgstr "创建者:"
|
||||
|
||||
#: templates/pubinfo.html:34
|
||||
msgid "Create Time: "
|
||||
msgstr "创建时间:"
|
||||
msgid "Time: "
|
||||
msgstr "时间:"
|
||||
|
||||
#: templates/pubinfo.html:40
|
||||
msgid ""
|
||||
@@ -524,7 +548,8 @@ msgid "Tips"
|
||||
msgstr "小提示"
|
||||
|
||||
#: templates/public_home.html:10
|
||||
msgid "Libraries mark as read-only can only be viewing, can not be downloaded."
|
||||
msgid ""
|
||||
"Libraries marked as read-only can only be viewing, can not be downloaded."
|
||||
msgstr "标记为只读的资料库只能查看,无法整个下载。"
|
||||
|
||||
#: templates/public_home.html:15
|
||||
@@ -580,10 +605,17 @@ msgstr "可读写"
|
||||
msgid "Read-Only"
|
||||
msgstr "只读"
|
||||
|
||||
#: templates/public_home.html:53
|
||||
#: templates/public_home.html:54
|
||||
msgid "No public library"
|
||||
msgstr "当前没有公共资料"
|
||||
|
||||
#: templates/public_home.html:55
|
||||
msgid ""
|
||||
"You can create a public library, others can view and download this library."
|
||||
msgstr "你可以新建一个公开的资料库,网站内的其他人都可以查看下载这个资料库。"
|
||||
"You can create a public library by clicking \"New Library\" button, others "
|
||||
"can view and download this library."
|
||||
msgstr ""
|
||||
"你可以点击“新建资料库”按钮创建一个公开的资料库,网站内的其他人都可以查看下载"
|
||||
"这个资料库。"
|
||||
|
||||
#: templates/repo.html:11
|
||||
msgid ""
|
||||
@@ -1378,8 +1410,8 @@ msgid "Shared By"
|
||||
msgstr "共享来源"
|
||||
|
||||
#: templates/snippets/my_owned_repos.html:84
|
||||
msgid "Remove Share"
|
||||
msgstr "取消共享"
|
||||
msgid "Leave Share"
|
||||
msgstr "退出共享"
|
||||
|
||||
#: templates/snippets/my_owned_repos.html:91
|
||||
msgid "No library is shared to you"
|
||||
@@ -1414,8 +1446,8 @@ msgid "Input cannot be empty"
|
||||
msgstr "输入不能为空"
|
||||
|
||||
#: templates/snippets/myhome_extra_script.html:33
|
||||
msgid "Really remove this shared library?"
|
||||
msgstr "确定要还原这个资料库?"
|
||||
msgid "Really want to leave share?"
|
||||
msgstr "确定要退出共享?"
|
||||
|
||||
#: templates/snippets/repo_create_form.html:9
|
||||
msgid "Share Permission"
|
||||
@@ -1450,18 +1482,24 @@ msgstr "Tip:必须是团体内成员或群组,输入 all 共享到公共资
|
||||
msgid "Tip: type all to share to public library."
|
||||
msgstr "Tip:输入 all 共享到公共资料"
|
||||
|
||||
#: templates/snippets/user_profile_html.html:8
|
||||
msgid "Add as contact"
|
||||
#: templates/snippets/user_profile_html.html:21
|
||||
msgid "Add to contacts"
|
||||
msgstr "加为联系人"
|
||||
|
||||
#: templates/snippets/user_profile_html.html:29
|
||||
#: templates/snippets/user_profile_html.html:30
|
||||
msgid "Name(optional)"
|
||||
msgstr "名字(可选)"
|
||||
|
||||
#: templates/snippets/user_profile_html.html:31
|
||||
#: templates/snippets/user_profile_html.html:32
|
||||
msgid "Note(optional)"
|
||||
msgstr "备注(可选)"
|
||||
|
||||
#~ msgid "Create Time: "
|
||||
#~ msgstr "创建时间:"
|
||||
|
||||
#~ msgid "Really remove this shared library?"
|
||||
#~ msgstr "确定要取消共享这个资料库?"
|
||||
|
||||
#~ msgid "Personal Account"
|
||||
#~ msgstr "个人帐号"
|
||||
|
||||
|
Binary file not shown.
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2012-11-02 17:37+0800\n"
|
||||
"POT-Creation-Date: 2012-11-05 11:43+0800\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -147,7 +147,7 @@ msgstr "编辑"
|
||||
|
||||
#: templates/repo/share_admin.html:56 templates/repo/share_admin.html.py:59
|
||||
#: templates/repo/share_admin.html:63 templates/repo/share_admin.html.py:65
|
||||
msgid "Revoke"
|
||||
msgid "Unshare"
|
||||
msgstr "取消共享"
|
||||
|
||||
#: templates/repo/share_admin.html:74
|
||||
@@ -158,8 +158,7 @@ msgstr "你还没有共享任何资料库"
|
||||
msgid ""
|
||||
"Share library to your friends and colleagues by clicking the \"Share\" icon "
|
||||
"near the library."
|
||||
msgstr ""
|
||||
"点击资料库旁的“共享”图标将你的资料库共享给你的朋友和同事。"
|
||||
msgstr "点击资料库旁的“共享”图标将你的资料库共享给你的朋友和同事。"
|
||||
|
||||
#: templates/repo/share_admin.html:79
|
||||
msgid "Links"
|
||||
@@ -207,3 +206,5 @@ msgstr "权限修改失败"
|
||||
msgid "edit failed"
|
||||
msgstr "权限修改失败"
|
||||
|
||||
#~ msgid "Revoke"
|
||||
#~ msgstr "取消共享"
|
||||
|
@@ -53,16 +53,16 @@
|
||||
<td>{{ repo.props.repo_desc }}</td>
|
||||
<td>
|
||||
{% if repo.props.share_type == 'group' %}
|
||||
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&gid={{ repo.props.group_id }}" class="cancel-share op">{% trans "Revoke"%}</a>
|
||||
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&gid={{ repo.props.group_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% endif %}
|
||||
{% if repo.props.share_type == 'personal' %}
|
||||
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&to={{ repo.props.user }}" class="cancel-share op">{% trans "Revoke"%}</a>
|
||||
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&to={{ repo.props.user }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% endif %}
|
||||
{% if repo.props.share_type == 'public' %}
|
||||
{% if not org %}
|
||||
<a href="#" data="{{ SITE_ROOT }}repo/unsetinnerpub/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Revoke"%}</a>
|
||||
<a href="#" data="{{ SITE_ROOT }}repo/unsetinnerpub/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% else %}
|
||||
<a href="#" data="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Revoke"%}</a>
|
||||
<a href="#" data="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="cancel-share op">{% trans "Unshare"%}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<div class="txt fright">
|
||||
<h4><a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a></h4>
|
||||
<p><span class="item-name">{% trans "Creator: "%}</span>{{ group.props.creator_name }}</p>
|
||||
<p><span class="item-name">{% trans "Create Time: "%}</span>{{ group.props.timestamp|tsstr_sec }}</p>
|
||||
<p><span class="item-name">{% trans "Time: "%}</span>{{ group.props.timestamp|tsstr_sec }}</p>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{% block left_panel %}
|
||||
<div class="info-item">
|
||||
<h3 class="info-item-top">{% trans "Tips"%}</h3>
|
||||
<p class="info-item-bottom">{% trans "Libraries mark as read-only can only be viewing, can not be downloaded."%}</p>
|
||||
<p class="info-item-bottom">{% trans "Libraries marked as read-only can only be viewing, can not be downloaded."%}</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<tr>
|
||||
<th width="4%"><!--icon--></th>
|
||||
<th width="20%">{% trans "Name"%}</th>
|
||||
<th width="36%">{% trans "Description"%}</th>
|
||||
<th width="33%">{% trans "Description"%}</th>
|
||||
<th width="15%">{% trans "Last Update"%}</th>
|
||||
<th width="15%">{% trans "Share From"%}</th>
|
||||
<th width="10%">{% trans "Operations"%}</th>
|
||||
<th width="13%">{% trans "Operations"%}</th>
|
||||
</tr>
|
||||
{% for repo in public_repos %}
|
||||
<tr>
|
||||
@@ -50,7 +50,10 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="empty-repo-tips">{% trans "You can create a public library, others can view and download this library."%}</p>
|
||||
<div class="empty-tips">
|
||||
<h2 class="center-contents">{% trans "No public library" %}</h2>
|
||||
<p>{% blocktrans %}You can create a public library by clicking "New Library" button, others can view and download this library.{% endblocktrans %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- /.main -->
|
||||
{% include "snippets/repo_create_form.html" %}
|
||||
|
@@ -81,7 +81,7 @@
|
||||
{% if repo.user_perm == 'rw' %}
|
||||
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.repo_id }}" class="download-btn op-icon vh" title="{% trans "Download" %}" alt="{% trans "Download" %}" />
|
||||
{% endif %}
|
||||
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ repo.props.user }}&to={{ request.user }}" class="unshare-btn op-icon vh" title="{% trans "Remove Share" %}" alt="{% trans "Remove Share" %}" />
|
||||
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ repo.props.user }}&to={{ request.user }}" class="unshare-btn op-icon vh" title="{% trans "Leave Share" %}" alt="{% trans "Leave Share" %}" />
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@@ -28,9 +28,9 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
addConfirmTo($('.repo-delete-btn'));
|
||||
addConfirmTo($('.repo-delete-btn'), '{% trans "Really want to delete?" %}');
|
||||
|
||||
addConfirmTo($('.unshare-btn'), '{% trans "Really remove this shared library?" %}');
|
||||
addConfirmTo($('.unshare-btn'), '{% trans "Really want to leave share?" %}');
|
||||
|
||||
$(".download-btn").click(function() {
|
||||
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data'));
|
||||
|
@@ -4,9 +4,6 @@
|
||||
{#if !$T.err_msg}
|
||||
<div class="pic fleft">
|
||||
<img class="avatar" width="80" height="80" alt="{$T.email}" />
|
||||
{#if $T.new_user}
|
||||
<button id="add-as-contact">{% trans "Add as contact" %}</button>
|
||||
{#/if}
|
||||
</div>
|
||||
|
||||
<div class="txt fright">
|
||||
@@ -19,6 +16,10 @@
|
||||
{#if $T.user_intro}
|
||||
<p class="intro">{$T.user_intro}</p>
|
||||
{#/if}
|
||||
|
||||
{#if $T.new_user}
|
||||
<button id="add-as-contact">{% trans "Add to contacts" %}</button>
|
||||
{#/if}
|
||||
</div>
|
||||
|
||||
{#if $T.new_user}
|
||||
|
18
views.py
18
views.py
@@ -22,6 +22,7 @@ from django.shortcuts import render_to_response, redirect
|
||||
from django.template import Context, loader, RequestContext
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.hashcompat import md5_constructor
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
from django.views.generic.base import TemplateView, TemplateResponseMixin
|
||||
from django.views.generic.edit import BaseFormView, FormMixin
|
||||
@@ -1122,10 +1123,9 @@ def public_repo_create(request):
|
||||
def unset_inner_pub_repo(request, repo_id):
|
||||
try:
|
||||
seafserv_threaded_rpc.unset_inner_pub_repo(repo_id)
|
||||
messages.success(request, _('Operation successful'))
|
||||
except SearpcError:
|
||||
pass
|
||||
|
||||
messages.add_message(request, messages.INFO, '操作成功')
|
||||
messages.error(request, _('Operation failed'))
|
||||
|
||||
return HttpResponseRedirect(reverse('share_admin'))
|
||||
|
||||
@@ -1748,17 +1748,17 @@ def repo_remove_share(request):
|
||||
to_email = request.GET.get('to', '')
|
||||
if request.user.username != from_email and \
|
||||
request.user.username != to_email:
|
||||
return render_permission_error(request, u'取消共享失败')
|
||||
return render_permission_error(request, _(u'Remove share failed'))
|
||||
seafserv_threaded_rpc.remove_share(repo_id, from_email, to_email)
|
||||
else:
|
||||
try:
|
||||
group_id_int = int(group_id)
|
||||
except:
|
||||
return render_error(request, u'group id 不是有效参数')
|
||||
return render_error(request, _(u'group id is not valid'))
|
||||
|
||||
if not check_group_staff(group_id_int, request.user) \
|
||||
and request.user.username != from_email:
|
||||
return render_permission_error(request, u'取消共享失败')
|
||||
return render_permission_error(request, _(u'Remove share failed'))
|
||||
|
||||
if is_org_group(group_id_int):
|
||||
org_id = get_org_id_by_group(group_id_int)
|
||||
@@ -1767,7 +1767,7 @@ def repo_remove_share(request):
|
||||
from group.views import group_unshare_repo
|
||||
group_unshare_repo(request, repo_id, group_id_int, from_email)
|
||||
|
||||
messages.add_message(request, messages.INFO, '操作成功')
|
||||
messages.success(request, _('Remove share successful'))
|
||||
|
||||
next = request.META.get('HTTP_REFERER', None)
|
||||
if not next:
|
||||
@@ -2558,7 +2558,7 @@ def remove_shared_link(request):
|
||||
if not next:
|
||||
next = reverse('share_admin')
|
||||
|
||||
messages.add_message(request, messages.INFO, u'删除成功')
|
||||
messages.success(request, _(u'Remove successful'))
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
@@ -2566,7 +2566,7 @@ def remove_shared_link(request):
|
||||
|
||||
FileShare.objects.filter(token=token).delete()
|
||||
|
||||
msg = '删除成功'
|
||||
msg = _('Remove successful')
|
||||
data = json.dumps([{'msg': msg}])
|
||||
return HttpResponse(data, status=200, content_type=content_type)
|
||||
|
||||
|
Reference in New Issue
Block a user