From c11363e94069139f89c613c678624458fe167e66 Mon Sep 17 00:00:00 2001
From: Weitian LI <liweitianux@gmail.com>
Date: Sun, 20 Apr 2014 23:58:30 +0800
Subject: * added 'profile', 'profile_update' and 'profile_update_done'
 templates   and implemented related views * added
 'account.forms.UpdateProfileForm' * implemented
 'account.views.UpdateProfileView' using class-based view * updated
 'account.urls'

---
 account/templates/account/profile.html             | 20 +++++++++++++++---
 account/templates/account/profile_update.html      | 24 ++++++++++++++++++++++
 account/templates/account/profile_update_done.html | 21 +++++++++++++++++++
 3 files changed, 62 insertions(+), 3 deletions(-)
 create mode 100644 account/templates/account/profile_update.html
 create mode 100644 account/templates/account/profile_update_done.html

(limited to 'account/templates')

diff --git a/account/templates/account/profile.html b/account/templates/account/profile.html
index cb08717..e8d295c 100644
--- a/account/templates/account/profile.html
+++ b/account/templates/account/profile.html
@@ -20,6 +20,20 @@
           <th class="profile-name">姓名</th>
           <td class="profile-name-data">{{ profile.realname }}</td>
         </tr>
+        <tr>
+          <th class="profile-gender">性别</th>
+          <td class="profile-gender-data">
+            {% if profile.gender == 'M' %}
+            男
+            {% elif profile.gender == 'F' %}
+            女
+            {% elif profile.gender == 'X' %}
+            <span class="glyphicon glyphicon-ban-circle"></span>
+            {% else %}
+            <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">系统错误</span>
+            {% endif %}
+          </td>
+        </tr>
         <tr>
           <th class="profile-email">邮箱</th>
           <td class="profile-email-data">{{ user.email }}</td>
@@ -38,7 +52,7 @@
             {% elif profile.is_approved == 'C' %}
             <span class="glyphicon glyphicon-question-sign"></span> <span class="label label-default">审核中</span>
             {% else %}
-            <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">错误</span>
+            <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">系统错误</span>
             {% endif %}
           </td>
         </tr>
@@ -52,7 +66,7 @@
             {% elif profile.is_sponsored == 'C' %}
             <span class="glyphicon glyphicon-question-sign"></span> <span class="label label-default">审核中</span>
             {% else %}
-            <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">错误</span>
+            <span class="glyphicon glyphicon-warning-sign"></span> <span class="label label-danger">系统错误</span>
             {% endif %}
           </td>
         </tr>
@@ -60,7 +74,7 @@
 
     <br>
     <p>
-      <a href="#" class="btn btn-default">编辑个人信息</a>
+      <a href="{% url 'profile_update' %}" class="btn btn-default">更新个人信息</a>
       <a href="{% url 'password_change' %}" class="btn btn-default">修改密码</a>
     </p>
   </div>
diff --git a/account/templates/account/profile_update.html b/account/templates/account/profile_update.html
new file mode 100644
index 0000000..1802bb0
--- /dev/null
+++ b/account/templates/account/profile_update.html
@@ -0,0 +1,24 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# login template #}
+
+{% block title %}
+更新个人信息 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+  <div class="container">
+    <h2>更新个人信息</h2>
+    <br>
+    <form role="form" class="form-horizontal" method="post">
+      {% csrf_token %}
+      {% bootstrap_form form layout='horizontal' %}
+      {% buttons submit='提交' reset='重置' layout='horizontal' %}{% endbuttons %}
+    </form>
+  </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/account/templates/account/profile_update_done.html b/account/templates/account/profile_update_done.html
new file mode 100644
index 0000000..5b10eb2
--- /dev/null
+++ b/account/templates/account/profile_update_done.html
@@ -0,0 +1,21 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# login template #}
+
+{% block title %}
+信息已更新 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+  <div class="container">
+    <h2>信息已更新</h2>
+    <p class="lead">您的个人信息已更新。</p>
+    <br>
+    <p><a href="{% url 'profile' %}" class="btn btn-default">返回个人主页</a></p>
+  </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
-- 
cgit v1.2.2