From b137de1c9d986e5e3d48f9d1d479c25def3b6516 Mon Sep 17 00:00:00 2001 From: killing Date: Thu, 11 Oct 2012 10:55:13 +0800 Subject: [PATCH] Fix bugs in admin pages. * Admin should not access the contents of non-readable repos. * Fix bug in userinfo.html. --- templates/repo.html | 9 +++++++-- templates/userinfo.html | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/templates/repo.html b/templates/repo.html index 11455befd6..5ba9cacccf 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -21,14 +21,18 @@ {% endif %} - {% if user_perm != 'rw' %} + {% if user_perm == 'r' %}

这个资料库设置了只读共享,您只能在线浏览文件。

{% endif %} + + {% if user_perm %}

{{repo.props.desc}}

大小:{{ repo_size|filesizeformat }}

- + {% endif %} + + {% if user_perm %}

@@ -52,6 +56,7 @@

+ {% endif %}
diff --git a/templates/userinfo.html b/templates/userinfo.html index cac7bed4e7..02874b667b 100644 --- a/templates/userinfo.html +++ b/templates/userinfo.html @@ -51,9 +51,9 @@ {% for repo in in_repos %} 目录icon - {{ repo.props.name }} - {{ repo.props.shared_email }} - {{ repo.props.desc }} + {{ repo.props.repo_name }} + {{ repo.props.user }} + {{ repo.props.repo_desc }} {% endfor %}