1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 02:10:24 +00:00

[misc] fixup

This commit is contained in:
llj
2018-08-18 11:05:08 +08:00
parent 0105e8e8ef
commit 5b8dc61e6f
7 changed files with 19 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ def get_repo_info(repo):
result['file_count'] = repo.file_count
if '@seafile_group' in owner:
group_id = get_group_id_by_repo_owner(repo_owner)
group_id = get_group_id_by_repo_owner(owner)
result['group_name'] = group_id_to_name(group_id)
return result

View File

@@ -477,6 +477,7 @@
</script>
<script type="text/template" id="system-library-tmpl">
<span class="loading-icon loading-tip"></span>
<table class="hide">
<thead>
<tr>
@@ -488,13 +489,15 @@
<tbody>
</tbody>
</table>
<span class="loading-icon loading-tip"></span>
<p class="error hide"></p>
</script>
<script type="text/template" id="system-library-item-tmpl">
<tr>
<td><a href="#libs/<%= id %>/"><%- name %></a></td>
<td style="font-size:11px;"><%= id %></td>
<td><%= description %></td>
</tr>
</script>
<script type="text/template" id="trash-libraries-tmpl">

View File

@@ -81,9 +81,9 @@ define([
repos.reset(repos.models);
}
},
error: function(xhr, textStatus, errorThrown) {
// TODO: handle error gracefully
Common.feedback('Error', 'error', Common.ERROR_TIMEOUT);
error: function(collection, response, options) {
var error_msg = Common.prepareAjaxErrorMsg(response);
Common.feedback(error_msg, 'error', Common.ERROR_TIMEOUT);
},
complete: function() {
Common.closeModal();

View File

@@ -217,8 +217,8 @@ define([
}
},
error: function(collection, response, options) {
var err_msg = Common.prepareCollectionFetchErrorMsg(collection, response, opts);
_this.$error.html(err_msg).show();
var error_msg = Common.prepareAjaxErrorMsg(response);
_this.$error.html(error_msg).show();
}
});

View File

@@ -55,8 +55,8 @@ define([
Common.closeModal();
},
error: function(collection, response, options) {
var err_msg = Common.prepareCollectionFetchErrorMsg(collection, response, opts);
$error.html(err_msg).show();
var error_msg = Common.prepareAjaxErrorMsg(response);
$error.html(error_msg).show();
Common.enableButton($submitBtn);
}
});

View File

@@ -93,8 +93,8 @@ define([
Common.closeModal();
},
error: function(collection, response, options) {
var err_msg = Common.prepareCollectionFetchErrorMsg(collection, response, opts);
$error.html(err_msg).show();
var error_msg = Common.prepareAjaxErrorMsg(response);
$error.html(error_msg).show();
Common.enableButton($submitBtn);
}
});

View File

@@ -28,11 +28,13 @@ define([
this.$table = this.$('table');
this.$tableBody = $('tbody', this.$table);
this.$loadingTip = this.$('.loading-tip');
this.$error = this.$('.error');
},
initPage: function() {
this.$table.hide();
this.$tableBody.empty();
this.$error.hide();
this.$loadingTip.show();
},
@@ -42,14 +44,12 @@ define([
this.systemRepo.fetch({
url: Common.getUrl({name: 'admin-system-library'}),
cache: false, // for IE
reset: true,
cache: false,
success: function(model, response, options) {
_this.reset();
},
error: function(model, response, options) {
var err_msg = Common.prepareCollectionFetchErrorMsg(collection, response, opts);
Common.feedback(err_msg, 'error');
_this.$error.html(gettext("Error")).show();
}
});
},
@@ -65,6 +65,7 @@ define([
reset: function() {
this.$loadingTip.hide();
this.$error.hide();
this.$tableBody.html(this.itemTemplate(this.systemRepo.toJSON()));
this.$table.show();
}