1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-27 11:01:14 +00:00

Add list of fetched repos

This commit is contained in:
plt 2012-03-11 21:35:44 +08:00
parent f2dac3102b
commit c51eadc4f5
2 changed files with 22 additions and 0 deletions

View File

@ -33,4 +33,23 @@
{% endfor %}
</table>
<h3>我用过的同步目录</h3>
<table class="repo-list default">
<tr>
<th>名字</th>
<th>ID</th>
<th>描述</th>
<th>操作</th>
</tr>
{% for repo in fetched_repos %}
<tr>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.name }}</a></td>
<td>{{ repo.props.id }}</td>
<td>{{ repo.props.desc }}</td>
<td><a href="{{ SITE_ROOT }}repo/remove/{{ repo.props.id }}/">删除</a></td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -148,16 +148,19 @@ def remove_repo(request, repo_id):
@login_required
def myhome(request):
owned_repos = []
fetched_repos = []
quota_usage = 0
user_id = request.user.user_id
if user_id:
owned_repos = seafserv_threaded_rpc.list_owned_repos(user_id)
quota_usage = seafserv_threaded_rpc.get_user_quota_usage(user_id)
fetched_repos = seafserv_threaded_rpc.list_fetched_repos(user_id)
return render_to_response('myhome.html', {
"owned_repos": owned_repos,
"quota_usage": quota_usage,
"fetched_repos": fetched_repos,
}, context_instance=RequestContext(request))