1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +00:00

i18n for group and myhome

This commit is contained in:
zhengxie
2012-10-27 14:11:37 +08:00
parent cb469bd31f
commit 68377baee4
20 changed files with 233 additions and 95 deletions

View File

@@ -64,29 +64,29 @@ class RepoCreateForm(forms.Form):
Form for creating repo and org repo.
"""
repo_name = forms.CharField(max_length=50, error_messages={
'required': '名称不能为空',
'max_length': '名称太长不超过50个字符'
'required': _(u'Name can\'t be empty'),
'max_length': _(u'Name should be less than 50 characters')
})
repo_desc = forms.CharField(max_length=100, error_messages={
'required': '描述不能为空',
'max_length': '描述太长不超过100个字符'
'required': _(u'Description can\'t be empty'),
'max_length': _(u'Description should be less than 100 characters')
})
encryption = forms.CharField(max_length=1)
passwd = forms.CharField(min_length=3, max_length=15, required=False,
error_messages={
'min_length': '密码太短',
'max_length': '密码太长',
'min_length': _(u'Password should be at least 3 characters'),
'max_length': _(u'Password should be less than 15 characters'),
})
passwd_again = forms.CharField(min_length=3, max_length=15, required=False,
error_messages={
'min_length': '密码太短',
'max_length': '密码太长',
'min_length': _(u'Password should be at least 3 characters'),
'max_length': _(u'Password should be less than 15 characters'),
})
def clean_repo_name(self):
repo_name = self.cleaned_data['repo_name']
if not is_valid_filename(repo_name):
error_msg = u"您输入的名称 %s 包含非法字符" % repo_name
error_msg = _(u"Name %s is not valid") % repo_name
raise forms.ValidationError(error_msg)
else:
return repo_name
@@ -108,7 +108,7 @@ class RepoCreateForm(forms.Form):
passwd = self.cleaned_data['passwd']
passwd_again = self.cleaned_data['passwd_again']
if passwd != passwd_again:
raise forms.ValidationError("两次输入的密码不一致")
raise forms.ValidationError(_("The two password fields didn't match."))
return self.cleaned_data
class SharedRepoCreateForm(RepoCreateForm):

View File

@@ -1,4 +1,7 @@
#!/bin/sh
django-admin.py makemessages -l zh_CN -e py,html
django-admin.py makemessages -d djangojs -l zh_CN
django-admin.py compilemessages

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-27 11:11+0800\n"
"POT-Creation-Date: 2012-10-27 13:34+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"
@@ -135,6 +135,8 @@ msgid "You can click \"Add\" button to add members."
msgstr "可以点击上方的“添加”来加入成员。"
#: templates/group/group_info.html:57 templates/group/group_info.html.py:80
#: templates/group/group_manage.html:13 templates/group/group_manage.html:32
#: templates/group/group_manage.html:54
msgid "Operations"
msgstr "操作"
@@ -163,7 +165,7 @@ msgid "Description"
msgstr "描述"
#: templates/group/group_info.html:78
msgid "Update Time"
msgid "Last Update"
msgstr "更新时间"
#: templates/group/group_info.html:79
@@ -211,7 +213,8 @@ msgstr "回复"
msgid "Hide Reply"
msgstr "收起回复"
#: templates/group/group_info.html:164
#: templates/group/group_info.html:164 templates/group/group_manage.html:40
#: templates/group/group_manage.html:63
msgid "Delete"
msgstr "删除"
@@ -223,6 +226,42 @@ msgstr "前一页"
msgid "Next"
msgstr "下一页"
#: templates/group/group_manage.html:8
msgid "group management"
msgstr "群组管理"
#: templates/group/group_manage.html:16
msgid "Set Group Avatar"
msgstr "设置群组图标"
#: templates/group/group_manage.html:17
msgid "Dismiss Group"
msgstr "解散群组"
#: templates/group/group_manage.html:18
msgid "Back to Group"
msgstr "返回群组"
#: templates/group/group_manage.html:25
msgid "Group Members"
msgstr "成员列表"
#: templates/group/group_manage.html:26
msgid "Add Members"
msgstr "添加成员"
#: templates/group/group_manage.html:31 templates/group/group_manage.html:53
msgid "Email"
msgstr "邮箱"
#: templates/group/group_manage.html:47
msgid "Group Staffs"
msgstr "管理员列表"
#: templates/group/group_manage.html:48
msgid "Add Staffs"
msgstr "添加管理员"
#: templates/group/groups_left_panel.html:3
msgid "Tips"
msgstr "小提示"
@@ -264,3 +303,6 @@ msgstr "您还没有参加任何群组,可以点击“添加群组”按钮创
#: templates/group/groups_right_panel.html:27
msgid "Group Name"
msgstr "群组名称"
#~ msgid "Update Time"
#~ msgstr "更新时间"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-26 17:04+0800\n"
"POT-Creation-Date: 2012-10-27 13:24+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"
@@ -18,10 +18,24 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
#: templates/group/po.js:4
#: templates/group/po.js:3
msgid "Confirm to quit group?"
msgstr "确定要退出?"
#: templates/group/po.js:5
msgid "Confirm to unshare this repo?"
#: templates/group/po.js:4
#, fuzzy
msgid "Confirm to unshare this library?"
msgstr "确定要取消共享?"
#: templates/group/po.js:5
msgid ""
"<div class=\"msg-del-confirm hide\"><p>Confirm to delete this message?</"
"p><button class=\"msg-del-yes\">Yes</button><button class=\"msg-del-no\">No</"
"button></div>"
msgstr ""
"<div class=\"msg-del-confirm hide\"><p>确认要删除该留言吗?</p><button class="
"\"msg-del-yes\">确认</button><button class=\"msg-del-no\">取消</button></div>"
#: templates/group/po.js:6
msgid "Successfully deleted."
msgstr "删除成功"

View File

@@ -75,7 +75,7 @@
<th width="4%"><!--icon--></th>
<th width="20%">{% trans "Name" %}</th>
<th width="36%">{% trans "Description" %}</th>
<th width="14%">{% trans "Update Time" %}</th>
<th width="14%">{% trans "Last Update" %}</th>
<th width="16%">{% trans "Share From" %}</th>
<th width="10%">{% trans "Operations" %}</th>
</tr>
@@ -192,7 +192,7 @@
{% include 'snippets/user_profile_js.html' %}
<script type="text/javascript">
addConfirmTo($('#quit-group'), gettext('Confirm to quit group?'));
addConfirmTo($('.cancel-share'), gettext('Confirm to unshare this repo?'));
addConfirmTo($('.cancel-share'), gettext('Confirm to unshare this library?'));
addAtAutocomplete('#message', '#group-message-form', {{ group.id }}, "{% url 'group_attention' %}", {'border':'1px solid #ddd', 'width':'600px', 'height': '80px', 'word-wrap':'break-word', 'overflow-y':'auto', 'line-height': '1.5em'}); // remember to add unit (px or em) to line-height, as js in ie will take 1.5 as 1.5, not 1.5em
@@ -234,7 +234,7 @@ $('.msg-delete').hover(
$('.msg-delete').click(function() {
var url = $(this).attr('data');
var msg = $(this).parents('.msg');
var del_confirm = '<div class="msg-del-confirm hide"><p>确认要删除该留言吗?</p><button class="msg-del-yes">确认</button><button class="msg-del-no">取消</button></div>';
var del_confirm = gettext('<div class="msg-del-confirm hide"><p>Confirm to delete this message?</p><button class="msg-del-yes">Yes</button><button class="msg-del-no">No</button></div>');
$(this).parent().append(del_confirm).css('position', 'relative');
del_confirm = $(this).parent().find('.msg-del-confirm');
del_confirm.css({'left':$(this).position().left - 15, 'top':$(this).position().top - del_confirm.outerHeight()}).removeClass('hide');
@@ -246,7 +246,7 @@ $('.msg-delete').click(function() {
success: function(data) {
if (data['success']) {
msg.remove();
feedback('删除成功', 'success');
feedback(gettext('Successfully deleted.'), 'success');
} else {
feedback('删除失败:' + data['err_msg'], 'error');
}

View File

@@ -1,35 +1,35 @@
{% extends base_template %}
{% load seahub_tags avatar_tags %}
{% load seahub_tags avatar_tags i18n %}
{% load url from future %}
{% block nav_group_class %}class="cur"{% endblock %}
{% block title_panel %}
<h2>{{ group.group_name }} 群组管理</h2>
<h2>{{ group.group_name }} {% trans "group management"%}</h2>
{% endblock %}
{% block left_panel %}
<div class="info-item">
<div class="info-item-top"><h3>操作</h3> </div>
<div class="info-item-top"><h3>{% trans "Operations"%}</h3> </div>
<div class="info-item-bottom">
<ul class="with-bg">
<li><a href="{{ SITE_ROOT }}avatar/group/add/?gid={{ group.id }}">设置群组图标</a></li>
<li><a id="group-remove" href="#" data="{{ SITE_ROOT }}group/{{ group.id }}/?op=dismiss">解散群组</a></li>
<li><a href="{{ SITE_ROOT }}group/{{ group.id }}/">返回群组</a></li>
<li><a href="{{ SITE_ROOT }}avatar/group/add/?gid={{ group.id }}">{% trans "Set Group Avatar"%}</a></li>
<li><a id="group-remove" href="#" data="{{ SITE_ROOT }}group/{{ group.id }}/?op=dismiss">{% trans "Dismiss Group"%}</a></li>
<li><a href="{{ SITE_ROOT }}group/{{ group.id }}/">{% trans "Back to Group"%}</a></li>
</ul>
</div>
</div>
{% endblock %}
{% block right_panel %}
<h3>成员列表</h3>
<button id="group-member-add">添加成员</button>
<h3>{% trans "Group Members"%}</h3>
<button id="group-member-add">{% trans "Add Members"%}</button>
{% if members %}
<table class="member-list">
<tr>
<th width="4%"></th>
<th width="71%">邮箱</th>
<th width="25%">操作</th>
<th width="71%">{% trans "Email"%}</th>
<th width="25%">{% trans "Operations"%}</th>
</tr>
{% for member in members %}
@@ -37,27 +37,21 @@
<td>{% avatar member.user_name 20 %}</td>
<td>{{ member.user_name }}</td>
<td>
<a href="#" data="{{ SITE_ROOT }}group/{{ group.id }}/member/{{ member.user_name }}/?op=delete" class="member-remove-btn op">删除</a>
<a href="#" data="{{ SITE_ROOT }}group/{{ group.id }}/member/{{ member.user_name }}/?op=delete" class="member-remove-btn op">{% trans "Delete"%}</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
{% if cloud_mode and not org %}
<div class="empty-repo-tips"><h3>当前群组还没有成员</h3>可以点击上方的“添加成员”按钮来加入成员,如果对方未注册,系统会向他发送邀请邮件。</div>
{% else %}
<div class="empty-repo-tips"><h3>当前群组还没有成员</h3>可以点击上方的“添加成员”按钮来加入成员,对方必须在当前团体内。</div>
{% endif %}
{% endif %}
<h3>管理员列表</h3>
<button id="group-admin-add">添加管理员</button>
<h3>{% trans "Group Staffs"%}</h3>
<button id="group-admin-add">{% trans "Add Staffs"%}</button>
{% if admins %}
<table class="member-list">
<tr>
<th width="4%"></th>
<th width="71%">邮箱</th>
<th width="25%">操作</th>
<th width="71%">{% trans "Email"%}</th>
<th width="25%">{% trans "Operations"%}</th>
</tr>
{% for member in admins %}
@@ -66,14 +60,12 @@
<td>{{ member.user_name }}</td>
<td>
{% if member.user_name != request.user.username %}
<a href="#" data="{% url 'group_remove_admin' group.id %}?u={{ member.user_name }}" class="member-remove-btn op">删除</a>
<a href="#" data="{% url 'group_remove_admin' group.id %}?u={{ member.user_name }}" class="member-remove-btn op">{% trans "Delete"%}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
{% include 'group/grpmember_add_form.html' %}

View File

@@ -2,5 +2,6 @@ var msg = '';
// group_info.html
msg = gettext('Confirm to quit group?');
msg = gettext('Confirm to unshare this repo?');
msg = gettext('Confirm to unshare this library?');
msg = gettext('<div class="msg-del-confirm hide"><p>Confirm to delete this message?</p><button class="msg-del-yes">Yes</button><button class="msg-del-no">No</button></div>');
msg = gettext('Successfully deleted.');

View File

@@ -6,6 +6,6 @@
django-admin.py makemessages -l zh_CN -e py,html -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" -i "profile*" -i "share*"
# js i18n
django-admin.py makemessages -d djangojs -l zh_CN -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" -i "profile*" -i "share*"
django-admin.py makemessages -d djangojs -l zh_CN -i "thirdpart*" -i "api*" -i "avatar*" -i "base*" -i "contacts*" -i "group*" -i "notifications*" -i "organizations*" -i "profile*" -i "share*" -i "media*"
django-admin.py compilemessages

Binary file not shown.

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-27 11:39+0800\n"
"POT-Creation-Date: 2012-10-27 14:01+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"
@@ -20,11 +20,39 @@ msgstr ""
#: forms.py:26
msgid "A user with this email already"
msgstr ""
msgstr "该邮箱已被注册"
#: forms.py:40
#: forms.py:40 forms.py:111
msgid "The two password fields didn't match."
msgstr ""
msgstr "两次输入的密码不一致"
#: forms.py:67
msgid "Name can't be empty"
msgstr "名称不能为空"
#: forms.py:68
msgid "Name should be less than 50 characters"
msgstr "名称太长不超过50个字符"
#: forms.py:71
msgid "Description can't be empty"
msgstr "描述不能为空"
#: forms.py:72
msgid "Description should be less than 100 characters"
msgstr "描述太长不超过100个字符"
#: forms.py:77 forms.py:82
msgid "Password should be at least 3 characters"
msgstr "密码太短"
#: forms.py:78 forms.py:83
msgid "Password should be less than 15 characters"
msgstr "密码太长"
#: forms.py:89
msgid "Name %s is not valid"
msgstr "名称 %s 含有无效字符"
#: settings.py:93
msgid "English"
@@ -88,9 +116,21 @@ msgstr "海文互知"
msgid "Contact Us"
msgstr "联系我们"
#: templates/base.html:143
msgid "Confirm to delete?"
msgstr "确定要删除?"
#: templates/base.html:144
msgid "Yes"
msgstr "确定"
#: templates/base.html:145
msgid "No"
msgstr "取消"
#: templates/myhome.html:9
msgid "Account"
msgstr ""
msgstr "我的基本信息"
#: templates/myhome.html:15
msgid "Nickname is empty"
@@ -122,7 +162,7 @@ msgstr "团体消息"
#: templates/myhome.html:44
msgid "Space used"
msgstr ""
msgstr "已用空间"
#: templates/myhome_base.html:8
msgid "My Home"
@@ -155,11 +195,13 @@ msgstr "邮箱"
#: templates/registration/login.html:10
#: templates/registration/registration_form.html:13
#: templates/snippets/repo_create_form.html:17
msgid "Password"
msgstr "密码"
#: templates/registration/login.html:13
#: templates/registration/registration_form.html:18
#: templates/snippets/repo_share_form.html:18
msgid "Submit"
msgstr "提交"
@@ -210,6 +252,7 @@ msgid "Welcome back, you are already signed in."
msgstr "欢迎回来,您已登录。"
#: templates/registration/registration_form.html:15
#: templates/snippets/repo_create_form.html:19
msgid "Confirm Password"
msgstr "确认密码"
@@ -234,26 +277,29 @@ msgid "Shared"
msgstr "共享给我的"
#: templates/snippets/my_owned_repos.html:9
msgid "Starred Files"
msgid "Starred"
msgstr "星标文件"
#: templates/snippets/my_owned_repos.html:11
#: templates/snippets/repo_create_form.html:3
msgid "New Library"
msgstr "新建资料库"
#: templates/snippets/my_owned_repos.html:18
#: templates/snippets/my_owned_repos.html:50
#: templates/snippets/repo_create_form.html:4
msgid "Name"
msgstr "名字"
#: templates/snippets/my_owned_repos.html:19
#: templates/snippets/my_owned_repos.html:51
#: templates/snippets/repo_create_form.html:6
msgid "Description"
msgstr "描述"
#: templates/snippets/my_owned_repos.html:20
#: templates/snippets/my_owned_repos.html:52
msgid "Update Time"
msgid "Last Update"
msgstr "更新时间"
#: templates/snippets/my_owned_repos.html:21
@@ -263,6 +309,8 @@ msgstr "操作"
#: templates/snippets/my_owned_repos.html:25
#: templates/snippets/my_owned_repos.html:61
#: templates/snippets/repo_create_form.html:11
#: templates/snippets/repo_share_form.html:13
msgid "Read-Write"
msgstr "可读写"
@@ -295,6 +343,8 @@ msgid "Share From"
msgstr "共享来源"
#: templates/snippets/my_owned_repos.html:63
#: templates/snippets/repo_create_form.html:12
#: templates/snippets/repo_share_form.html:14
msgid "Read-Only"
msgstr "只读"
@@ -327,21 +377,47 @@ msgstr "图标"
msgid "You can star the important files, and they will be shown here."
msgstr "您可以给那些重要的文件加上星标,然后它们将在这里显示。"
#: templates/snippets/repo_create_form.html:9
msgid "Share Permission"
msgstr "共享权限"
#: templates/snippets/repo_create_form.html:16
msgid "Encrypt"
msgstr "加密"
#: templates/snippets/repo_create_form.html:17
msgid "(3-15 characters)"
msgstr "(3到15个字符)"
#: templates/snippets/repo_share_form.html:3
msgid "Share to"
msgstr "共享给"
#: templates/snippets/repo_share_form.html:4
msgid "Emails or Groups"
msgstr "输入邮箱或群组"
#: templates/snippets/repo_share_form.html:7
msgid ""
"Tip: must be org members or org groups, type all to share to public library."
msgstr "Tip必须是团体内成员或群组输入 all 共享到公共资料。"
#: templates/snippets/repo_share_form.html:10
msgid "Tip: type all to share to public library."
msgstr "Tip输入 all 共享到公共资料"
#~ msgid "Update Time"
#~ msgstr "更新时间"
#~ msgid "My Basic Infos"
#~ msgstr "我的基本信息"
#~ msgid "Storage Used"
#~ msgstr "已用空间"
#~ msgid "Share Admin"
#~ msgstr "共享管理"
#~ msgid "I owned"
#~ msgstr "我拥有的"
#~ msgid "Shared to me"
#~ msgstr "共享给我的"
#~ msgid "Public Repo"
#~ msgstr "公共资料"

Binary file not shown.

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-26 19:43+0800\n"
"POT-Creation-Date: 2012-10-27 14:09+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"
@@ -18,22 +18,30 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
#: po.js:4 po.js.c:10
#: templates/po.js:3 templates/po.js.py:8
msgid "Email can't be blank"
msgstr "邮箱不能为空"
#: po.js:5 po.js.c:11
#: templates/po.js:4 templates/po.js.py:9
msgid "Password can't be blank"
msgstr "密码不能为空"
#: po.js:6
#: templates/po.js:5
msgid "Confirm password can't be blank"
msgstr "确认密码不能为空"
#: po.js:7
#: templates/po.js:6
msgid "The two password fields did't match"
msgstr "两次密码不相同"
#: po.js:12
#: templates/po.js:10
msgid "Incorrect email or password"
msgstr "您输入的邮箱或密码不正确"
#: templates/po.js:12
msgid "Input can't be empty"
msgstr "输入不能为空"
#: templates/po.js:13
msgid "Confirm to remove shared library?"
msgstr "确定要取消共享?"

View File

@@ -140,9 +140,9 @@
</div>
<div id="dialog-confirm" class="hide">
<p id="confirm-con">确定要删除?</p>
<button id="yes-btn">确定</button>
<button class="simplemodal-close">取消</button>
<p id="confirm-con">{% trans "Confirm to delete?"%}</p>
<button id="yes-btn">{% trans "Yes"%}</button>
<button class="simplemodal-close">{% trans "No"%}</button>
</div>
</div><!-- wrapper -->

View File

@@ -11,6 +11,6 @@ msg = gettext('Email can\'t be blank');
msg = gettext('Password can\'t be blank');
msg = gettext('Incorrect email or password');
// myhome_extra_script.html
msg = gettext('Input can\'t be empty');
msg = gettext('Confirm to remove shared library?');

View File

@@ -6,7 +6,7 @@
<ul class="fleft">
<li><a href="#my-own-repos" onfocus="this.blur()">{% trans "Mine" %}</a></li>
<li><a href="#repos-shared-to-me" onfocus="this.blur()">{% trans "Shared" %}</a></li>
<li><a href="#starred-files" onfocus="this.blur()">{% trans "Starred Files" %}</a></li>
<li><a href="#starred-files" onfocus="this.blur()">{% trans "Starred" %}</a></li>
</ul>
<button id="repo-create" class="fright">{% trans "New Library" %}</button>
</div>
@@ -17,7 +17,7 @@
<th width="4%"><!--icon--></th>
<th width="24%">{% trans "Name" %}</th>
<th width="43%">{% trans "Description" %}</th>
<th width="15%">{% trans "Update Time" %}</th>
<th width="15%">{% trans "Last Update" %}</th>
<th width="14%">{% trans "Operations" %}</th>
</tr>
{% for repo in owned_repos %}
@@ -49,7 +49,7 @@
<th width="4%"><!--icon--></th>
<th width="20%">{% trans "Name" %}</th>
<th width="36%">{% trans "Description" %}</th>
<th width="15%">{% trans "Update Time" %}</th>
<th width="15%">{% trans "Last Update" %}</th>
<th width="15%">{% trans "Share From" %}</th>
<th width="10%">{% trans "Operations" %}</th>
</tr>

View File

@@ -23,14 +23,14 @@ $(function() {
//check before post
$('#share-submit-btn').click(function() {
if (!$.trim($('#email_or_group').attr('value'))) {
apply_form_error('repo-share-form', '输入不能为空。');
apply_form_error('repo-share-form', gettext('Input can\'t be empty'));
return false;
}
});
addConfirmTo($('.repo-delete-btn'));
addConfirmTo($('.unshare-btn'), '确定要取消共享?');
addConfirmTo($('.unshare-btn'), gettext('Confirm to remove shared library?'));
$(".download-btn").click(function() {
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data'));

View File

@@ -1,21 +1,22 @@
{% load i18n %}
<form id="repo-create-form" action="" method="post" class="hide">
<h3>新建资料库</h3>
<label>名称:</label><br/>
<h3>{% trans "New Library"%}</h3>
<label>{% trans "Name"%}</label><br/>
<input id="repo-name" type="text" name="repo_name" value="" /><br />
<label>描述:</label><br/>
<label>{% trans "Description"%}</label><br/>
<textarea id="repo-desc" name="repo_desc"></textarea>
{% if create_shared_repo %}
<label style="display:block">共享权限:</label>
<label style="display:block">{% trans "Share Permission"%}</label>
<select name="permission">
<option value="rw" selected="selected">可读写</option>
<option value="r">只可浏览</option>
<option value="rw" selected="selected">{% trans "Read-Write"%}</option>
<option value="r">{% trans "Read-Only"%}</option>
</select>
{% endif %}
<div class="repo-create-encryption">
<input type="checkbox" name="encryption" id="encrypt-switch" /><label>加密</label><br />
<label>密码:</label><span class="tip">(315个字符)</span><br />
<input type="checkbox" name="encryption" id="encrypt-switch" /><label>{% trans "Encrypt"%}</label><br />
<label>{% trans "Password"%}</label><span class="tip">{% trans "(3-15 characters)"%}</span><br />
<input type="password" name="passwd" disabled="disabled" class="passwd input-disabled" /><br />
<label>密码确认:</label><br />
<label>{% trans "Confirm Password"%}</label><br />
<input type="password" name="passwd_again" disabled="disabled" class="passwd input-disabled" />
</div>
<p class="error hide"></p>

View File

@@ -1,18 +1,19 @@
{% load i18n %}
<form id="repo-share-form" action="{{ post_url }}" method="post" name="repo-share-form" class="hide">
<p>共享给:</p>
<textarea id="email_or_group" name="email_or_group" placeholder="输入邮箱或群组"></textarea>
<p>{% trans "Share to"%}</p>
<textarea id="email_or_group" name="email_or_group" placeholder="{% trans "Emails or Groups"%}"></textarea>
{% if cloud_mode %}
{% if org %}
<p class="tip">Tip必须是团体内成员或群组输入 all 共享到公共资料。</p>
<p class="tip">{% trans "Tip: must be org members or org groups, type all to share to public library."%}</p>
{% endif %}
{% else %}
<p class="tip">Tip输入 all 共享到公共资料</p>
<p class="tip">{% trans "Tip: type all to share to public library."%}</p>
{% endif %}
<select name="permission" class="share-permission-select">
<option value="rw" selected="selected">可读写</option>
<option value="r">只可浏览</option>
<option value="rw" selected="selected">{% trans "Read-Write"%}</option>
<option value="r">{% trans "Read-Only"%}</option>
</select>
<input id="repo_id" type="hidden" name="repo_id" value="" />
<p class="error hide"></p>
<input type="submit" value="提交" id="share-submit-btn" />
<input type="submit" value="{% trans "Submit"%}" id="share-submit-btn" />
</form>