Avatar
This commit is contained in:
parent
3d0632303d
commit
fbd352e788
18 changed files with 179 additions and 55 deletions
|
|
@ -16,6 +16,7 @@
|
|||
[<a asp-controller="Manage"
|
||||
asp-action="CHUN">@SR["Change"]</a>]
|
||||
</dd>
|
||||
|
||||
@if (Model.Roles.Count()>0) {
|
||||
<dt>@SR["Roles"]:</dt>
|
||||
<dd>
|
||||
|
|
@ -45,7 +46,9 @@
|
|||
</dd>
|
||||
|
||||
<dt>@SR["Avatar"]:</dt>
|
||||
<dd>@Model.Avatar
|
||||
<dd>
|
||||
<img src="~/Avatars/@(User.Identity.Name).png">
|
||||
@Model.Avatar
|
||||
[<a asp-controller="Manage" asp-action="SetAvatar"
|
||||
>@SR[@Model.Avatar==null?"Set":"Modify"]</a>]
|
||||
</dd>
|
||||
|
|
|
|||
32
Yavsc/Views/Manage/SetAvatar.cshtml
Normal file
32
Yavsc/Views/Manage/SetAvatar.cshtml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@model PerformerProfile
|
||||
@{ ViewData["Title"] = SR["Edit your avatar"]; }
|
||||
@section header{
|
||||
<link href="~/css/dropzone.css" rel="stylesheet">
|
||||
}
|
||||
@section scripts{
|
||||
<script src="~/js/dropzone.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
Dropzone.options.postavatar= {
|
||||
maxFilesize: 2, // MB
|
||||
autoProcessQueue: true,
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
}
|
||||
else { done(); }
|
||||
},
|
||||
url: "/api/setavatar"
|
||||
};
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<img src="~/Avatars/@(User.Identity.Name).png">
|
||||
|
||||
<form id="postavatar" class="dropzone" method="post" enctype="multipart/form-data">
|
||||
<div class="fallback">
|
||||
<input name="Avatar" type="file" id="Avatar" />
|
||||
</div>
|
||||
|
||||
@Html.AntiForgeryToken()
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue