From b784a30dd8c92f8e7f49a15e564c8ff422e85f94 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Sun, 27 Apr 2014 17:38:05 +0800 Subject: * updated 'list_approved.html' and related 'ListApprovedView' * small update to 'profile.html' --- account/templates/account/list_approved.html | 20 +++++++++++++------- account/templates/account/profile.html | 6 +++--- account/views.py | 4 +++- 3 files changed, 19 insertions(+), 11 deletions(-) (limited to 'account') diff --git a/account/templates/account/list_approved.html b/account/templates/account/list_approved.html index bf6bf2f..6295765 100644 --- a/account/templates/account/list_approved.html +++ b/account/templates/account/list_approved.html @@ -14,24 +14,30 @@

审定名单


+ {# alert if the user not approved #} + {% if profile.is_approved == 'N' %} +
+ 很抱歉,您未能被批准参加本次SKA暑期学校,感谢您的关注和参与。 +
+ {% endif %} {% if object_list %} - - + + {# mark out current user if approved #} - {% for profile in object_list %} - + {% for approved_profile in object_list %} + - - - + + + {% endfor %} diff --git a/account/templates/account/profile.html b/account/templates/account/profile.html index aa99650..f36c114 100644 --- a/account/templates/account/profile.html +++ b/account/templates/account/profile.html @@ -45,7 +45,7 @@ {% elif profile.gender == 'F' %} 女 {% elif profile.gender == 'X' %} - + 保密 {% else %} 系统错误 {% endif %} @@ -106,18 +106,18 @@ {# user uploaded files #} + {% if userfiles %} + {% endif %}
序号 姓名身份单位身份单位
{{ forloop.counter }}{{ profile.realname }}{% trans profile.get_identify_value %}{{ profile.institute }}{{ approved_profile.realname }}{% trans approved_profile.get_identify_value %}{{ approved_profile.institute }}
附件 - {% if userfiles %} - {% endif %}

diff --git a/account/views.py b/account/views.py index faf0a43..d998c6e 100644 --- a/account/views.py +++ b/account/views.py @@ -130,11 +130,13 @@ class ListApprovedView(ListView): def get_context_data(self, **kwargs): """ - add 'user' context + add 'user' and 'profile' context """ context = super(ListApprovedView, self).get_context_data(**kwargs) user = self.request.user + profile = user.userprofile_set.get(user=user) context['user'] = user + context['profile'] = profile return context -- cgit v1.2.2