diff --git a/seahub/templates/snippets/bottom_bar.html b/seahub/templates/snippets/bottom_bar.html deleted file mode 100644 index 127a7100ab..0000000000 --- a/seahub/templates/snippets/bottom_bar.html +++ /dev/null @@ -1,161 +0,0 @@ -{% load i18n %} -{% load url from future %} - -// set 'side toolbar' & 'groups' popup position -function setToolbarPos() { - var toolbar = $('#side-toolbar'); - - // set toolbar pos - toolbar.css({'top': ($(window).height() - toolbar.outerHeight())/2}); - - // set 'groups' popup position - $('#to-group').css({'top': parseInt(toolbar.css('top')) + 59}); -} -$(window).load(function() { - var to_top = $(''); - to_top.click(function() { - $(window).scrollTop(0); - }).appendTo($('#side-toolbar')); - $(window).scroll(function() { - if ($(window).scrollTop() > 0) { - to_top.show(); - } else { - to_top.hide(); - } - }); - setToolbarPos(); -}).resize(setToolbarPos); - - -{% if groups %} -function getAndHandleDiscussions(data_html) { - $('#discussions-to-grp').html(data_html).css({'max-height': parseInt($(window).height() * 0.8 - $('#discuss-to-group-form').outerHeight())}).removeClass('hide'); // 'parseInt' to fix '.msg-main top border missing when the ul's max-height is xxx.5px' - var popup = $('#discuss-to-group'); - popup.css({'top':($(window).height() - popup.outerHeight())/2}); - {% include 'group/msg_js.html' %} -} -$('#discuss').click(function() { - var popup = $('#discuss-to-group'), - form = $('#discuss-to-group-form'), - path = '{{ path }}'; - - // for repo.html: when get dir data with ajax - if ($('#repo-file-list').length > 0) { - path = cur_path; - $('[name="path"]', form).val(path); - // modify attachment dir name - $('.att-name', form).html($('#cur-dir-name').html()); - } - - if (popup.hasClass('hide')) { - $.ajax({ - url: form.attr('action'), - dataType: 'json', - data: { - 'repo_id': '{{ repo.id }}', - 'path': path - }, - success: function(data) { - getAndHandleDiscussions(data['html']); - popup.removeClass('hide'); - }, - error: function(jqXHR, textStatus, errorThrown) { - var err_str = ''; - if (jqXHR.responseText) { - err_str = $.parseJSON(jqXHR.responseText).error; - feedback(err_str, 'error'); - } - } - }); - } else { - popup.addClass('hide'); - } -}); - -// click 'close' to close discuss popup -$('#discuss-to-group .close').click(function () { - $('#discuss-to-group').addClass('hide'); -}); - -$(document).click(function(e) { - var target = e.target || event.srcElement; - if (!$('#discuss, #discuss-to-group').is(target) && !($('#discuss, #discuss-to-group').find('*').is(target))) { - $('#discuss-to-group').addClass('hide'); - } -}); - -$('#discuss-submit').click(function() { - var form = $('#discuss-to-group-form'), - form_id = form.attr('id'); - - if (form.find('.checkbox-checked').length == 0) { - apply_form_error(form_id, "{% trans "Please select at least 1 group." %}"); - return false; - } - - if (!$.trim($('#discuss-to-group-form .input').val())) { - apply_form_error(form_id, "{% trans "Please input a discussion." %}"); - return false; - } - form.find('.error').addClass('hide'); - - var groups = []; - form.find('.checkbox-checked .checkbox-orig').each(function() { - groups.push($(this).val()); - }); - - $.ajax({ - url: form.attr('action'), - type: 'POST', - dataType: 'json', - beforeSend: prepareCSRFToken, - traditional: true, - data: { - 'groups': groups, - 'message': $('[name="message"]', form).val(), - 'repo_id': '{{ repo.id }}', - 'path': $('[name="path"]', form).val(), - 'attach_type': $('[name="attach_type"]', form).val() - }, - success: function(data) { - if(data['success']) { - feedback(data['success'], 'success'); - getAndHandleDiscussions(data['html']); - form.find('.input').val(''); - } - if(data['error']) { - feedback(data['error'], 'error'); - } - }, - error: function(jqXHR, textStatus, errorThrown) { - var err_str = ''; - if (jqXHR.responseText) { - err_str = $.parseJSON(jqXHR.responseText).error; - } else { - err_str = "{% trans "Failed. Please check the network." %}"; - } - apply_form_error(form_id, err_str); - } - }); - return false; -}); - -$('#click-into-group').click(function() { - {% if groups|length == 1 %} - // only one group, just turn to group page - {% for group in groups %} - location.href= "{% url 'group_info' group.id %}"; - {% endfor %} - - {% else %} - // more than one group, then let user choose - $('#to-group').toggleClass('hide'); - {% endif %} -}); -$(document).click(function(e) { - var target = e.target || event.srcElement; - if (!$('#click-into-group, #to-group').is(target) && !($('#click-into-group, #to-group').find('*').is(target))) { - $('#to-group').addClass('hide'); - } -}); -{% endif %} diff --git a/seahub/templates/snippets/current_commit.html b/seahub/templates/snippets/current_commit.html deleted file mode 100644 index 5cde50dd48..0000000000 --- a/seahub/templates/snippets/current_commit.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load seahub_tags avatar_tags i18n %} - - {{ info_commit.props.desc|translate_commit_desc }} - {% trans "Details"%} - - - {% if info_commit.props.creator_name %} - {% avatar info_commit.props.creator_name 20 %} - {{ info_commit.creator_name|email2nickname }} - {% else %} - {% trans "Unknown"%} - {% endif %} - {{ info_commit.props.ctime|translate_seahub_time }} - - {% trans "History"%} diff --git a/seahub/templates/snippets/group_recommend_form.html b/seahub/templates/snippets/group_recommend_form.html deleted file mode 100644 index a1c0e02beb..0000000000 --- a/seahub/templates/snippets/group_recommend_form.html +++ /dev/null @@ -1,37 +0,0 @@ -{% load seahub_tags i18n %} -{% load url from future %} -
-
{% csrf_token %} -

{% trans "Post a discussion to group" %}

-
- {% for group in groups %} - - {% endfor %} -
- - - - -

- - - {% if attach_type == 'dir' %} - {% trans 'Directory icon' %} - {% endif %} - - {% for name,link in zipped %} - {% if forloop.last %} - {% if attach_type == 'file' %} - {% trans 'File' %} - {% endif %} - {{ name }} - {% endif %} - {% endfor %} - -
- - {% trans -
diff --git a/seahub/templates/snippets/repo_dir_data.html b/seahub/templates/snippets/repo_dir_data.html deleted file mode 100644 index 04df791eb3..0000000000 --- a/seahub/templates/snippets/repo_dir_data.html +++ /dev/null @@ -1,73 +0,0 @@ -{% load seahub_tags i18n %} -
-

- {% for name, link in zipped %} - {% if forloop.first or not forloop.last %} - {{ name }} / - {% else %} - {{ name }} / - {% endif %} - {% endfor %} -

-
- {% if user_perm == 'rw' %} - - {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %} - - {% else %} - {% if no_quota %} - - {% else %} -
- {% trans "Upload"%} - -
- {% if enable_upload_folder %} - - {% endif %} - {% endif %} - {% endif %} - - {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %} - {% else %} - - {% endif %} - {% endif %} - - {% if path != '/' %} - {% if not repo.encrypted %} - - {% endif %} - {% endif %} -
-
- {% include 'snippets/current_commit.html' %} -
-
- - - - - - - - - - - - {% include 'snippets/repo_dirents.html' %} -
- - {% trans "Name"%} {% trans "Size"%}{% trans "Last Update" %} {% trans "Operations"%}
-{% if dirent_more %} - -{% endif %} diff --git a/seahub/templates/snippets/repo_dirents.html b/seahub/templates/snippets/repo_dirents.html deleted file mode 100644 index 96b488f91c..0000000000 --- a/seahub/templates/snippets/repo_dirents.html +++ /dev/null @@ -1,98 +0,0 @@ -{% load seahub_tags i18n %} - {% for dirent in dir_list %} - - - - - - {% if dirent.permission = 'r' %} - {% trans - {% else %} - {% trans - {% endif %} - - {{ dirent.obj_name }} - - - - - {{ dirent.last_modified|translate_seahub_time }} - - -
-
- - - - {% if not repo.encrypted %} - - - - {% endif %} -
- {% if user_perm == 'rw' %} - {% trans 'More operations'%} - - {% endif %} -
- - - {% endfor %} - {% for dirent in file_list %} - - - - - - {% if dirent.starred %} - - {% else %} - - {% endif %} - - - {% trans - - - {% if repo.encrypted and repo.enc_version == 2 and not server_crypto %} - {{ dirent.obj_name }} - {% else %} - {{ dirent.obj_name }} - {% endif %} - - {{ dirent.file_size|filesizeformat }} - - {{ dirent.last_modified|translate_seahub_time }} - - -
-
- - - - {% if not repo.encrypted %} - - - - {% endif %} -
- {% if user_perm == 'rw' %} - {% trans - - {% endif %} -
- - - {% endfor %} diff --git a/seahub/templates/snippets/repo_group_list.html b/seahub/templates/snippets/repo_group_list.html deleted file mode 100644 index e5e5073f2c..0000000000 --- a/seahub/templates/snippets/repo_group_list.html +++ /dev/null @@ -1,9 +0,0 @@ -{% load url from future %} -{% autoescape off %} - -{% endautoescape %} - diff --git a/seahub/templates/sysadmin/admin_repo_view.html b/seahub/templates/sysadmin/admin_repo_view.html index 5a3777ed7a..4bb189a79a 100644 --- a/seahub/templates/sysadmin/admin_repo_view.html +++ b/seahub/templates/sysadmin/admin_repo_view.html @@ -34,7 +34,7 @@ {% endif %} -
+
@@ -106,7 +106,7 @@

- + @@ -224,12 +224,14 @@ $(function() { } }) .bind('fileuploadstop', function() { - location.reload(true); + setTimeout(function() { location.reload(true); }, 1000); }) // after tpl has rendered .bind('fileuploadcompleted', function() { // 'done' if ($('.files .cancel', popup).length == 0) { - location.reload(true); + saving_tip.hide(); + total_progress.addClass('hide'); + fu_status.html(fu_status_.complete); } }) .bind('fileuploadfailed', function(e, data) { // 'fail' @@ -301,10 +303,8 @@ $('#add-new-dir').click(function () { $('#add-new-dir-form').submit(function() { var form = $(this), form_id = form.attr('id'), - dirent_name = $.trim(form.find('input[name="name"]').val()), - submit_btn = form.children('input[type="submit"]'), - post_data = {'dirent_name': dirent_name}, - path = '{{path}}'; + dirent_name = $.trim($('[name="name"]', form).val()), + submit_btn = $('[type="submit"]', form); if (!dirent_name) { apply_form_error(form_id, "{% trans "It is required." %}"); @@ -314,11 +314,11 @@ $('#add-new-dir-form').submit(function() { disable(submit_btn); $.ajax({ - url: '{% url 'new_dir' repo.id %}?parent_dir=' + e(path), + url: '{% url 'new_dir' repo.id %}?parent_dir=' + e(cur_path), type: 'POST', dataType: 'json', beforeSend: prepareCSRFToken, - data: post_data, + data: {'dirent_name': dirent_name}, success: function(data) { location.reload(true); }, diff --git a/seahub/templates/sysadmin/sys_list_system.html b/seahub/templates/sysadmin/sys_list_system.html index 20e11091a8..b12a494e39 100644 --- a/seahub/templates/sysadmin/sys_list_system.html +++ b/seahub/templates/sysadmin/sys_list_system.html @@ -2,12 +2,6 @@ {% load i18n %} {% block cur_repo %}tab-cur{% endblock %} -{% block left_panel %}{{block.super}} - - - -{% endblock %} - {% block right_panel %}