1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

[repo setting] bugfix for transfer

This commit is contained in:
llj
2015-05-22 15:01:38 +08:00
parent 02ab013dd6
commit 6630cade24
6 changed files with 26 additions and 19 deletions

View File

@@ -142,6 +142,9 @@
{% block right_panel %}{% endblock %} {% block right_panel %}{% endblock %}
</div> </div>
<div id="main-panel" class="clear w100 ovhd"> <div id="main-panel" class="clear w100 ovhd">
{% block main_panel %} {% endblock %}
</div>
{% if messages %} {% if messages %}
{% autoescape off %} {% autoescape off %}
<ul class="messages hide"> <ul class="messages hide">
@@ -152,8 +155,6 @@
{% endautoescape %} {% endautoescape %}
{% endif %} {% endif %}
{% block main_panel %} {% endblock %}
</div>
<div id="confirm-popup" class="hide"> <div id="confirm-popup" class="hide">
<div id="confirm-con"></div> <div id="confirm-con"></div>
<button id="confirm-yes" class="btn">{% trans "Yes"%}</button> <button id="confirm-yes" class="btn">{% trans "Yes"%}</button>

View File

@@ -12,7 +12,7 @@
{% block left_panel %} {% block left_panel %}
<div class="side-textnav"> <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"> <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 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> <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 'days': days
}, },
success: function(data) { success: function(data) {
if (data['success']) {
location.reload(true); location.reload(true);
}
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
if (jqXHR.responseText) { if (jqXHR.responseText) {

View File

@@ -66,9 +66,7 @@ $('#repo-owner-form').submit(function() {
'repo_owner': new_owner 'repo_owner': new_owner
}, },
success: function(data) { success: function(data) {
if (data['success']) {
location.href = '{% url 'myhome' %}'; location.href = '{% url 'myhome' %}';
}
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
if (jqXHR.responseText) { if (jqXHR.responseText) {

View File

@@ -2195,7 +2195,7 @@ def ajax_repo_transfer_owner(request, repo_id):
messages.success(request, messages.success(request,
_(u'Library %(repo_name)s has been transfered to %(new_owner)s.') % _(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}), return HttpResponse(json.dumps({'success': True}),
content_type=content_type) content_type=content_type)

View File

@@ -36,6 +36,7 @@ define([
Common.initAccountPopup(); Common.initAccountPopup();
Common.initNoticePopup(); Common.initNoticePopup();
Common.getContacts(); Common.getContacts();
Common.showMsg();
this.dirView = new DirView(); this.dirView = new DirView();

View File

@@ -133,7 +133,7 @@ define([
feedback: function(con, type, time) { feedback: function(con, type, time) {
var time = time || 5000; var time = time || 5000;
if ($('.messages')[0]) { if ($('.messages').length > 0) {
$('.messages').html('<li class="' + type + '">' + con + '</li>'); $('.messages').html('<li class="' + type + '">' + con + '</li>');
} else { } else {
var html = '<ul class="messages"><li class="' + type + '">' + con + '</li></ul>'; var html = '<ul class="messages"><li class="' + type + '">' + con + '</li></ul>';
@@ -143,6 +143,15 @@ define([
setTimeout(function() { $('.messages').addClass('hide'); }, time); 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) { showFormError: function(formid, error_msg) {
$("#" + formid + " .error").html(error_msg).removeClass('hide'); $("#" + formid + " .error").html(error_msg).removeClass('hide');
$("#simplemodal-container").css({'height':'auto'}); $("#simplemodal-container").css({'height':'auto'});