mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 00:43:53 +00:00
[repo setting] bugfix for transfer
This commit is contained in:
@@ -142,6 +142,9 @@
|
||||
{% block right_panel %}{% endblock %}
|
||||
</div>
|
||||
<div id="main-panel" class="clear w100 ovhd">
|
||||
{% block main_panel %} {% endblock %}
|
||||
</div>
|
||||
|
||||
{% if messages %}
|
||||
{% autoescape off %}
|
||||
<ul class="messages hide">
|
||||
@@ -152,8 +155,6 @@
|
||||
{% endautoescape %}
|
||||
{% endif %}
|
||||
|
||||
{% block main_panel %} {% endblock %}
|
||||
</div>
|
||||
<div id="confirm-popup" class="hide">
|
||||
<div id="confirm-con"></div>
|
||||
<button id="confirm-yes" class="btn">{% trans "Yes"%}</button>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
{% block left_panel %}
|
||||
<div class="side-textnav">
|
||||
<h3 class="hd">{{ repo.name }}'s {% trans "Settings" %}</h3>
|
||||
<h3 class="hd"><span class="op-target">{{ repo.name }}</span>'s {% trans "Settings" %}</h3>
|
||||
<ul class="side-textnav-tabs">
|
||||
<li class="tab tab-cur"><a href="{% url 'repo_basic_info' repo.id %}">{% trans "Basic Info" %}</a></li>
|
||||
<li class="tab"><a href="{% url 'repo_transfer_owner' repo.id %}">{% trans "Transfer Ownership" %}</a></li>
|
||||
@@ -106,9 +106,7 @@ $('#repo-basic-info-form').submit(function() {
|
||||
'days': days
|
||||
},
|
||||
success: function(data) {
|
||||
if (data['success']) {
|
||||
location.reload(true);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.responseText) {
|
||||
|
@@ -66,9 +66,7 @@ $('#repo-owner-form').submit(function() {
|
||||
'repo_owner': new_owner
|
||||
},
|
||||
success: function(data) {
|
||||
if (data['success']) {
|
||||
location.href = '{% url 'myhome' %}';
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.responseText) {
|
||||
|
@@ -2195,7 +2195,7 @@ def ajax_repo_transfer_owner(request, repo_id):
|
||||
|
||||
messages.success(request,
|
||||
_(u'Library %(repo_name)s has been transfered to %(new_owner)s.') %
|
||||
{'repo_name': repo.name, 'new_owner': repo_owner})
|
||||
{'repo_name': escape(repo.name), 'new_owner': escape(repo_owner)})
|
||||
return HttpResponse(json.dumps({'success': True}),
|
||||
content_type=content_type)
|
||||
|
||||
|
@@ -36,6 +36,7 @@ define([
|
||||
Common.initAccountPopup();
|
||||
Common.initNoticePopup();
|
||||
Common.getContacts();
|
||||
Common.showMsg();
|
||||
|
||||
this.dirView = new DirView();
|
||||
|
||||
|
@@ -133,7 +133,7 @@ define([
|
||||
|
||||
feedback: function(con, type, time) {
|
||||
var time = time || 5000;
|
||||
if ($('.messages')[0]) {
|
||||
if ($('.messages').length > 0) {
|
||||
$('.messages').html('<li class="' + type + '">' + con + '</li>');
|
||||
} else {
|
||||
var html = '<ul class="messages"><li class="' + type + '">' + con + '</li></ul>';
|
||||
@@ -143,6 +143,15 @@ define([
|
||||
setTimeout(function() { $('.messages').addClass('hide'); }, time);
|
||||
},
|
||||
|
||||
// for '{% if messages %}'
|
||||
showMsg: function() {
|
||||
var msg = $('.messages');
|
||||
if (msg.length > 0) {
|
||||
msg.css({'left':($(window).width() - msg.width())/2, 'top':10}).removeClass('hide');
|
||||
setTimeout(function() { msg.addClass('hide'); }, 5000);
|
||||
}
|
||||
},
|
||||
|
||||
showFormError: function(formid, error_msg) {
|
||||
$("#" + formid + " .error").html(error_msg).removeClass('hide');
|
||||
$("#simplemodal-container").css({'height':'auto'});
|
||||
|
Reference in New Issue
Block a user