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