mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-15 16:04:01 +00:00
49 lines
1.7 KiB
HTML
49 lines
1.7 KiB
HTML
{% load seahub_tags avatar_tags i18n %}
|
|
$('#repos-tabs').tabs({cookie:{expires:1}});
|
|
$(function() {
|
|
//repo-share-form share-list autocomplete
|
|
var share_list = [], contact_email, group_name, group_name_py;
|
|
{% for contact in contacts %}
|
|
contact_email = '{{ contact.contact_email }}';
|
|
share_list.push({value:contact_email, label:contact_email});
|
|
{% endfor %}
|
|
|
|
{% for group in groups %}
|
|
group_name = '{{ group.group_name }}';
|
|
group_name_py = '{{ group.group_name|char2pinyin }}'
|
|
share_list.push({value:group_name + group_name_py, label:group_name});
|
|
{% endfor %}
|
|
|
|
$(".repo-share-btn").click(function() {
|
|
$("#repo_id").val($(this).attr("data"));
|
|
$("#repo-share-form").modal({appendTo: "#main"});
|
|
addAutocomplete('#email_or_group', '#repo-share-form', share_list);
|
|
});
|
|
|
|
//check before post
|
|
$('#share-submit-btn').click(function() {
|
|
if (!$.trim($('#email_or_group').attr('value'))) {
|
|
apply_form_error('repo-share-form', '{% trans "Input cannot be empty" %}');
|
|
return false;
|
|
}
|
|
});
|
|
|
|
addConfirmTo($('.repo-delete-btn'), '{% trans "Really want to delete?" %}');
|
|
|
|
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'));
|
|
});
|
|
|
|
//show op images when mouse hover on
|
|
$("table tr:gt(0)").hover(
|
|
function() {
|
|
$(this).find('.op-icon').css('cursor', 'pointer').removeClass('vh');
|
|
},
|
|
function() {
|
|
$(this).find('.op-icon').addClass('vh');
|
|
}
|
|
);
|
|
});
|