Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the button problem Issue #196 #197

Merged
merged 3 commits into from
Jun 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions website/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ <h1 class="page-header text-capitalize">{{ user.username }}</h1>
</div>
<div class="col-md-3">
{% if request.user == user %}
<button class="btn btn-primary btn-small edit-pic">Change Profile Picture</button>
<div class="update-pic" style="display: none">


<form method="post" action="." enctype="multipart/form-data">
{% csrf_token %}
{{ profile_form.user_avatar }}
<br/>
<span>
<input type="file" class="required" style="opacity: 0; width: 1px;height:1px;" id='${multipartFilePath}' name="user_avatar" onchange="$(this).parent().find('span').html($(this).val().replace('C:\\fakepath\\', ''))" />
<button class="btn btn-primary" name="test_files" type="button" onclick="$(this).parent().find('input[type=file]').click();"> <i class="fa fa-upload" aria-hidden="true"></i> Upload Profile Pic </button>
&nbsp;
<span class="badge badge-important" ></span>
</span>
<br/> <br>
<button type="submit" class="btn btn-primary btn-small">Upload</button>
</form>
</div>

{% endif %}
</div>
<div class="col-md-3 col-md-offset-3">
Expand Down