aboutsummaryrefslogtreecommitdiffstats
path: root/account/templates
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-04-20 23:58:30 +0800
committerWeitian LI <liweitianux@gmail.com>2014-04-20 23:58:30 +0800
commitc11363e94069139f89c613c678624458fe167e66 (patch)
treecfb3dc85e7d4ab610bbcb1e5148bf388e6232fb9 /account/templates
parentf74743aca5ffa55c717b336a314b58d59f4abc03 (diff)
downloaddjango-skaschool-c11363e94069139f89c613c678624458fe167e66.tar.bz2
* 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'
Diffstat (limited to 'account/templates')
-rw-r--r--account/templates/account/profile.html20
-rw-r--r--account/templates/account/profile_update.html24
-rw-r--r--account/templates/account/profile_update_done.html21
3 files changed, 62 insertions, 3 deletions
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
@@ -21,6 +21,20 @@
<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>
</tr>
@@ -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: #}