Merge branch 'virusdefender-dev' of git.coding.net:virusdefender/qduoj into dev-s

This commit is contained in:
uzi 2015-11-24 18:59:41 +08:00
commit 43ac27ea08
3 changed files with 62 additions and 60 deletions

View File

@ -1,5 +1,6 @@
require(["jquery", "bsAlert", "csrfToken"], function ($, bsAlert, csrfTokenHeader) {
var avatar = "";
function changeAvatar(event) {
avatar = $(event.target).attr('src');
$('#current_avatar').attr('src', avatar);

View File

@ -17,17 +17,15 @@
<img src="{{ user.userprofile.avatar }}" class="img-responsive"
style="height: 200px;width: 200px;" id="current_avatar">
<br>
<div class="form-group left">
<button id="save_avatar" type="submit" class="btn btn-primary">保存</button>
</div>
</div>
<div class="col-lg-6">
<form>
<div>
<div class="row">
{% for i in "aaaaaaaaaaaaaaaaaaaa" %}
<div class="col-lg-2 avatar-item">
<div style="border: 1px solid red;">
<img src="/static/img/avatar/avatar-{{ forloop.counter }}.png">
<div>
<img src="/static/img/avatar/avatar-{{ forloop.counter }}.png" style="cursor:pointer">
</div>
</div>
{% endfor %}
@ -39,8 +37,11 @@
style="height: 100px;width: 150px">
水果头像由<a href="https://coding.net">coding.net</a>提供。
</div>
<div class="form-group left">
<button id="save_avatar" type="submit" class="btn btn-primary">保存</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@ -36,7 +36,7 @@
<div class="form-group col-md-6"><label>手机</label>
<input name="phone" type="text" maxlength="11" id="phone"
class="form-control"
value="{{ request.user.userprofile.phone_number }}">
value="{% if request.user.userprofile.phone_number %}{{ request.user.userprofile.phone_number }}{% endif %}">
</div>
<div class="help-block with-errors"></div>
</div>
@ -44,7 +44,7 @@
<div class="form-group col-md-6">
<label>学校</label>
<input name="school" type="text" class="form-control" id="school"
value="{{ request.user.userprofile.school }}">
value="{% if request.user.userprofile.school %}{{ request.user.userprofile.school }}{% endif %}">
<div class="help-block with-errors"></div>
</div>