diff options
| -rw-r--r-- | account/templates/account/list_approved.html | 20 | ||||
| -rw-r--r-- | account/templates/account/profile.html | 6 | ||||
| -rw-r--r-- | account/views.py | 4 | 
3 files changed, 19 insertions, 11 deletions
| 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 @@    <div class="container">      <h2>审定名单</h2>      <br> +    {# alert if the user not approved #} +    {% if profile.is_approved == 'N' %} +    <div class="alert alert-warning"> +      很抱歉,您未能被批准参加本次SKA暑期学校,感谢您的关注和参与。 +    </div> +    {% endif %}      {% if object_list %}        <table class="table table-striped table-bordered table-hover">          <thead>            <tr>              <th class="col-md-1 list-number">序号</th>              <th class="col-md-2 list-name">姓名</th> -            <th class="col-md-2 list-identify">身份</th> -            <th class="col-md-7 list-institute">单位</th> +            <th class="col-md-3 list-identify">身份</th> +            <th class="col-md-6 list-institute">单位</th>            </tr>          </thead>          <tbody>          {# mark out current user if approved #} -        {% for profile in object_list %} -          <tr{% if profile.user == user %} class="success"{% endif %}> +        {% for approved_profile in object_list %} +          <tr{% if approved_profile.user == user %} class="success"{% endif %}>              <td>{{ forloop.counter }}</td> -            <td>{{ profile.realname }}</td> -            <td>{% trans profile.get_identify_value %}</td> -            <td>{{ profile.institute }}</td> +            <td>{{ approved_profile.realname }}</td> +            <td>{% trans approved_profile.get_identify_value %}</td> +            <td>{{ approved_profile.institute }}</td>            </tr>          {% endfor %}          </tbody> 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' %} -            <span class="glyphicon glyphicon-ban-circle"></span> +            <span class="glyphicon glyphicon-ban-circle"></span>保密              {% else %}              <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">系统错误</span>              {% endif %} @@ -106,18 +106,18 @@            </td>          </tr>          {# user uploaded files #} +        {% if userfiles %}          <tr>            <th class="attachments">附件</th>            <td class="attachments-data"> -            {% if userfiles %}              <ul>                {% for attachment in userfiles %}                  <li><a href="{{ attachment.file.url }}">{{ attachment.title }}</a></li>                {% endfor %}              </ul> -            {% endif %}            </td>          </tr> +        {% endif %}      </table>      <br> 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 | 
