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:
@@ -79,6 +79,8 @@ def group_info(request, group_id):
|
||||
if not repo_id:
|
||||
continue
|
||||
repo = get_repo(repo_id)
|
||||
if not repo:
|
||||
continue
|
||||
repo.share_from = seafserv_threaded_rpc.get_group_repo_share_from(repo_id)
|
||||
if request.user.username == repo.share_from:
|
||||
repo.share_from_me = True
|
||||
|
@@ -4,6 +4,22 @@
|
||||
{% block left_panel %}
|
||||
<h3>已用空间</h3>
|
||||
<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 %}
|
||||
|
||||
|
||||
|
5
views.py
5
views.py
@@ -281,6 +281,11 @@ def myhome(request):
|
||||
|
||||
# groups I join
|
||||
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', {
|
||||
"owned_repos": owned_repos,
|
||||
|
Reference in New Issue
Block a user