mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 13:50:07 +00:00
rm get_my_unenc_repos
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
{% block extra_script %}{{block.super}}
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/select2.min.js?t=1393578720"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(function(){
|
||||
$('tr[data-href]').click(function() {
|
||||
location.href = $(this).data('href');
|
||||
});
|
||||
@@ -132,13 +132,10 @@ $(document).click(function(e) {
|
||||
/*
|
||||
if (!popup.hasClass('hide') && !popup.is(target) && !popup.find('*').is(target) && !popup_switch.is(target) && !add_file_popup.is(target) && !add_file_popup.find('*').is(target)) {
|
||||
popup.addClass('hide');
|
||||
}
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
var repos_get_url = '{% url 'get_my_unenc_repos' %}';
|
||||
{% include 'snippets/add_file_js.html' %}
|
||||
|
||||
$('#send-msg-form .cancel').click(function() {
|
||||
$('#send-msg-popup').addClass('hide');
|
||||
$('#selected-files').data('files','').html('').addClass('hide');
|
||||
@@ -187,7 +184,7 @@ $('#send-msg-form').submit(function() {
|
||||
}
|
||||
});
|
||||
if (!r) {
|
||||
$('tr:first').after(new_tr);
|
||||
$('tr:first').after(new_tr);
|
||||
}
|
||||
new_tr.click(function() {
|
||||
location.href = $(this).data('href');
|
||||
@@ -200,7 +197,7 @@ $('#send-msg-form').submit(function() {
|
||||
err_msg = $.parseJSON(xhr.responseText).error.join('<br />');
|
||||
} else {
|
||||
err_msg = "{% trans "Failed. Please check the network." %}";
|
||||
}
|
||||
}
|
||||
apply_form_error(form_id, err_msg);
|
||||
}
|
||||
});
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
|
||||
</div>
|
||||
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
||||
<button class="simplemodal-close">{% trans "Cancel"%}</button>
|
||||
<button class="simplemodal-close">{% trans "Cancel"%}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -41,13 +41,13 @@
|
||||
{% if msg.to_email == request.user.email %}
|
||||
<li class="msg msg-received w100" data-id="{{msg.message_id}}">
|
||||
<a href="{% url 'user_profile' msg.from_email %}" class="pic fright">{% avatar msg.from_email 48 %}</a>
|
||||
{% else %}
|
||||
{% else %}
|
||||
<li class="msg msg-send w100" data-id="{{msg.message_id}}">
|
||||
<a href="{% url 'user_profile' msg.from_email %}" class="pic fleft">{% avatar msg.from_email 48 %}</a>
|
||||
<a href="{% url 'user_profile' msg.from_email %}" class="pic fleft">{% avatar msg.from_email 48 %}</a>
|
||||
{% endif %}
|
||||
<div class="txt">
|
||||
<div class="msg-main">
|
||||
<div class="msg-hd w100 ovhd">
|
||||
<div class="msg-hd w100 ovhd">
|
||||
{% if msg.from_email == request.user.username %}
|
||||
<span class="msg-del op fright vh">{% trans "Delete" %}</span>
|
||||
{% else %}
|
||||
@@ -99,7 +99,7 @@ $(window).scroll(function() {
|
||||
var up_icon = $('#msg-upward');
|
||||
var msg_panel = up_icon.parent();
|
||||
var msg_panel_offset = msg_panel.offset();
|
||||
var msg_panel_bot = msg_panel_offset.top + msg_panel.height();
|
||||
var msg_panel_bot = msg_panel_offset.top + msg_panel.height();
|
||||
var win_st = $(window).scrollTop();
|
||||
var win_h = $(window).height() + win_st;
|
||||
|
||||
@@ -127,15 +127,12 @@ $('.cancel', msg_form).click(function() {
|
||||
$('#message').val('').height(25);
|
||||
});
|
||||
|
||||
var repos_get_url = '{% url 'get_my_unenc_repos' %}';
|
||||
{% include 'snippets/add_file_js.html' %}
|
||||
|
||||
$('#personal-message-form').submit(function() {
|
||||
var form = $(this),
|
||||
msg_input = $('[name="mass_msg"]', form),
|
||||
msg = $.trim(msg_input.val()),
|
||||
files_ct = $('#selected-files');
|
||||
|
||||
|
||||
if (!msg) {
|
||||
return false;
|
||||
}
|
||||
@@ -152,7 +149,7 @@ $('#personal-message-form').submit(function() {
|
||||
success: function(data) {
|
||||
var new_msg = $(data['html']);
|
||||
if ($('.msg-list').length == 0) { // the new discussion is the first discussion in this page
|
||||
form.after('<ul class="msg-list"></ul>');
|
||||
form.after('<ul class="msg-list"></ul>');
|
||||
}
|
||||
$('.msg-list').prepend(new_msg);
|
||||
bind_del(new_msg);
|
||||
@@ -160,14 +157,14 @@ $('#personal-message-form').submit(function() {
|
||||
msg_input.val('');
|
||||
files_ct.data('files','').html('').addClass('hide');
|
||||
enable(sb_btn);
|
||||
},
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
var err_msg;
|
||||
if (xhr.responseText) {
|
||||
err_msg = $.parseJSON(xhr.responseText).error[0];
|
||||
} else {
|
||||
err_msg = "{% trans "Failed. Please check the network." %}";
|
||||
}
|
||||
}
|
||||
apply_form_error(form.attr('id'), err_msg);
|
||||
}
|
||||
});
|
||||
|
@@ -158,7 +158,6 @@ urlpatterns = patterns(
|
||||
url(r'^ajax/group/(?P<group_id>\d+)/toggle-modules/$', toggle_group_modules, name='toggle_group_modules'),
|
||||
url(r'^ajax/group/(?P<group_id>\d+)/members/import/$', ajax_group_members_import, name='ajax_group_members_import'),
|
||||
url(r'^ajax/toggle-personal-modules/$', toggle_personal_modules, name='toggle_personal_modules'),
|
||||
url(r'^ajax/my-unenc-repos/$', get_my_unenc_repos, name='get_my_unenc_repos'),
|
||||
url(r'^ajax/unenc-rw-repos/$', unenc_rw_repos, name='unenc_rw_repos'),
|
||||
url(r'^ajax/upload-file-done/$', upload_file_done, name='upload_file_done'),
|
||||
url(r'^ajax/get_popup_notices/$', get_popup_notices, name='get_popup_notices'),
|
||||
|
@@ -195,22 +195,6 @@ def get_unenc_group_repos(request, group_id):
|
||||
repo_list.sort(lambda x, y : cmp(x['name'].lower(), y['name'].lower()))
|
||||
return HttpResponse(json.dumps(repo_list), content_type=content_type)
|
||||
|
||||
@login_required_ajax
|
||||
def get_my_unenc_repos(request):
|
||||
"""Get my owned and unencrypted repos.
|
||||
"""
|
||||
content_type = 'application/json; charset=utf-8'
|
||||
|
||||
repos = get_owned_repo_list(request)
|
||||
repo_list = []
|
||||
for repo in repos:
|
||||
if repo.encrypted or repo.is_virtual:
|
||||
continue
|
||||
repo_list.append({"name": repo.name, "id": repo.id})
|
||||
|
||||
repo_list.sort(lambda x, y: cmp(x['name'].lower(), y['name'].lower()))
|
||||
return HttpResponse(json.dumps(repo_list), content_type=content_type)
|
||||
|
||||
@login_required_ajax
|
||||
def unenc_rw_repos(request):
|
||||
"""Get a user's unencrypt repos that he/she can read-write.
|
||||
|
@@ -105,7 +105,6 @@ define([
|
||||
// Repos
|
||||
case 'repos': return siteRoot + 'api2/repos/';
|
||||
case 'pub_repos': return siteRoot + 'api2/repos/public/';
|
||||
case 'get_my_unenc_repos': return siteRoot + 'ajax/my-unenc-repos/';
|
||||
case 'unenc_rw_repos': return siteRoot + 'ajax/unenc-rw-repos/';
|
||||
case 'api_v2.1_repo_set_password': return siteRoot + 'api/v2.1/repos/' + options.repo_id + '/set-password/';
|
||||
case 'get_folder_perm_by_path': return siteRoot + 'ajax/repo/' + options.repo_id + '/get-folder-perm-by-path/';
|
||||
|
Reference in New Issue
Block a user