From 2993a6d7945a0ce649afd994e7eda48b2df1cc7e Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Wed, 11 Nov 2015 21:05:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/src/js/app/oj/account/avatar.js | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/static/src/js/app/oj/account/avatar.js b/static/src/js/app/oj/account/avatar.js index 04368b52..4780e266 100644 --- a/static/src/js/app/oj/account/avatar.js +++ b/static/src/js/app/oj/account/avatar.js @@ -1,5 +1,6 @@ require(["jquery", "bsAlert", "csrfToken"], function ($, bsAlert, csrfTokenHeader) { - var avatar=""; + var avatar = ""; + function changeAvatar(event) { avatar = $(event.target).attr('src'); $('#current_avatar').attr('src', avatar); @@ -7,27 +8,27 @@ require(["jquery", "bsAlert", "csrfToken"], function ($, bsAlert, csrfTokenHeade $('.avatar-item').click(changeAvatar); - $('#save_avatar').click(function(){ + $('#save_avatar').click(function () { if (avatar) $.ajax({ - beforeSend: csrfTokenHeader, - url: "/api/account/userprofile/", - data: { - avatar: avatar - }, - dataType: "json", - method: "put", - success: function (data) { - if (!data.code) { - bsAlert("已保存!"); - } - else{ - bsAlert(data.data); - } - }, - error: function () { - bsAlert("额 好像出错了,请刷新页面重试。如还有问题,请填写页面导航栏上的反馈。") + beforeSend: csrfTokenHeader, + url: "/api/account/userprofile/", + data: { + avatar: avatar + }, + dataType: "json", + method: "put", + success: function (data) { + if (!data.code) { + bsAlert("已保存!"); } + else { + bsAlert(data.data); + } + }, + error: function () { + bsAlert("额 好像出错了,请刷新页面重试。如还有问题,请填写页面导航栏上的反馈。") + } }); else From 5598387159a7c30c3d811d6364a6c50069fa2261 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Wed, 11 Nov 2015 21:05:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E8=A1=A5=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA=20None=20=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/src/oj/account/settings.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/src/oj/account/settings.html b/template/src/oj/account/settings.html index 3dc75c6d..ebfee385 100644 --- a/template/src/oj/account/settings.html +++ b/template/src/oj/account/settings.html @@ -36,7 +36,7 @@
+ value="{% if request.user.userprofile.phone_number %}{{ request.user.userprofile.phone_number }}{% endif %}">
@@ -44,7 +44,7 @@
+ value="{% if request.user.userprofile.school %}{{ request.user.userprofile.school }}{% endif %}">
From 4040d98e65e24b65496f039ee54ce92901b24217 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Wed, 11 Nov 2015 21:05:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=8C=89=E9=92=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=9B=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E6=8C=87=E9=92=88=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/src/oj/account/avatar.html | 79 +++++++++++++++-------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/template/src/oj/account/avatar.html b/template/src/oj/account/avatar.html index 39daa513..d551c4a9 100644 --- a/template/src/oj/account/avatar.html +++ b/template/src/oj/account/avatar.html @@ -1,50 +1,51 @@ {% extends "oj_base.html" %} {% block title %} -更换头像 + 更换头像 {% endblock %} {% block body %} -
+
-
- -
-
- -
-
- +
+ +
+
+ +
+ +
+
+
+
+ {% for i in "aaaaaaaaaaaaaaaaaaaa" %} +
+
+ +
+
+ {% endfor %} + +
+ +
+ + 水果头像由coding.net提供。 +
+
+ +
+ +
-
-
-
- {% for i in "aaaaaaaaaaaaaaaaaaaa" %} -
-
- -
-
- {% endfor %} - -
- -
- - 水果头像由coding.net提供。 -
- -
-
-
{% endblock %} {% block js_block %} - + {% endblock %}