1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-21 11:27:18 +00:00

Fixed list_orphan_repos

This commit is contained in:
zhengxie
2013-10-19 11:32:49 +08:00
parent f3ef6a4cdd
commit 91980022f3
2 changed files with 3 additions and 49 deletions

View File

@@ -15,28 +15,7 @@
{% block main_panel %}
{% if repos %}
<table>
<tr>
<th width="15%">{% trans "Name" %}</th>
<th width="25%">ID</th>
<th width="20%">{% trans "Owner" %}</th>
<th width="27%">{% trans "Description" %}</th>
<th width="13%">{% trans "Operations" %}</th>
</tr>
{% for repo in repos %}
<tr>
<td>{{ repo.props.name }}</td>
<td style="font-size:11px;">{{ repo.id }}</td>
<td><a href="{{ SITE_ROOT }}useradmin/info/{{ repo.owner }}/">{{ repo.owner}}</a></td>
<td>{{ repo.props.desc }}</td>
<td>
<a href="#" data-url="{{ SITE_ROOT }}repo/remove/{{ repo.props.id }}/?next={{ request.path }}" data-target="{{ repo.props.name }}" class="repo-delete-btn op">{% trans "Delete" %}</a>
<a href="#" data-id="{{repo.id}}" data-name="{{repo.name}}" class="repo-transfer-btn op">{% trans "Transfer" %}</a>
</td>
</tr>
{% endfor %}
</table>
{% include "sysadmin/repoadmin_table.html" %}
{% else %}
<p>{% trans "Empty" %}</p>
@@ -57,35 +36,11 @@
{% block extra_script %}
<script type="text/javascript">
addConfirmTo($('.repo-delete-btn'), {
'title':'{% trans "Delete Library" %}',
'con':'{% trans "Are you sure you want to delete %s ?" %}'
});
$('#search-repo-btn').click(function() {
location.href = "{% url 'sys_repo_search' %}";
});
{% include "sysadmin/repoadmin_js.html" %}
$('.repo-transfer-btn').click(function(){
var repo_id = $(this).data('id'),
repo_name = $(this).data('name'),
form = $('#repo-transfer-form');
$('#repo-transfer-form input[name="repo_id"]').val(repo_id);
form.modal({appendTo:'#main'});
return false;
});
$('#repo-transfer-form').submit(function() {
var form = $(this),
form_id = form.attr('id'),
email = $.trim(form.children('[name="email"]').val());
if (!email) {
apply_form_error(form_id, "{% trans "Email cannot be blank" %}");
return false;
}
form.submit();
});
</script>
{% endblock %}

View File

@@ -588,7 +588,6 @@ def sys_repo_transfer(request):
def sys_list_orphan(request):
try:
repos = seafile_api.get_orphan_repo_list()
return repos
except Exception as e:
logger.error(e)
repos = []