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

Show groups on myhome.html

This commit is contained in:
xiez
2012-05-15 11:23:28 +08:00
parent d63b068b2d
commit 1de93aa036
3 changed files with 23 additions and 0 deletions

View File

@@ -79,6 +79,8 @@ def group_info(request, group_id):
if not repo_id: if not repo_id:
continue continue
repo = get_repo(repo_id) repo = get_repo(repo_id)
if not repo:
continue
repo.share_from = seafserv_threaded_rpc.get_group_repo_share_from(repo_id) repo.share_from = seafserv_threaded_rpc.get_group_repo_share_from(repo_id)
if request.user.username == repo.share_from: if request.user.username == repo.share_from:
repo.share_from_me = True repo.share_from_me = True

View File

@@ -4,6 +4,22 @@
{% block left_panel %} {% block left_panel %}
<h3>已用空间</h3> <h3>已用空间</h3>
<p>{{ quota_usage|filesizeformat }} / 2 GB</p> <p>{{ quota_usage|filesizeformat }} / 2 GB</p>
<h3>我创建的小组</h3>
{% if groups %}
{% for group in groups %}
{% if group.my_create %}
<p><a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a></p>
{% endif %}
{% endfor %}
{% endif %}
<h3>我参加的小组</h3>
{% for group in groups %}
{% if not group.my_create %}
<p><a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a></p>
{% endif %}
{% endfor %}
{% endblock %} {% endblock %}

View File

@@ -281,6 +281,11 @@ def myhome(request):
# groups I join # groups I join
groups = ccnet_rpc.get_groups(email) groups = ccnet_rpc.get_groups(email)
for group in groups:
if group.props.creator_name == request.user.username:
group.my_create = True
else:
group.my_create = False
return render_to_response('myhome.html', { return render_to_response('myhome.html', {
"owned_repos": owned_repos, "owned_repos": owned_repos,