ensure the avatar path
This commit is contained in:
parent
d5d1f686f3
commit
a72b0cba7b
5 changed files with 88 additions and 29 deletions
|
|
@ -1,9 +1,14 @@
|
|||
@model PerformerProfile
|
||||
@{ ViewBag.Title = "Edit your avatar"; }
|
||||
@model PerformerProfile
|
||||
@{ ViewBag.Title = "Edit your avatar"; }
|
||||
@{
|
||||
var previewAvatarSrc = string.IsNullOrWhiteSpace(User?.Identity?.Name)
|
||||
? Yavsc.Constants.DefaultAvatar
|
||||
: $"{Yavsc.Constants.AvatarsPath}/{User.Identity.Name}.png";
|
||||
}
|
||||
@section header{
|
||||
<script src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>
|
||||
<link rel="stylesheet" href="https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" type="text/css" />
|
||||
}
|
||||
}
|
||||
@section scripts{
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
|
@ -21,7 +26,7 @@ $(document).ready(function() {
|
|||
});
|
||||
</script>
|
||||
}
|
||||
<img src="~/avatars/@(User.Identity.Name).png">
|
||||
<img src="@previewAvatarSrc">
|
||||
|
||||
<form id="postavatar" action="/api/setavatar" class="dropzone" method="post" enctype="multipart/form-data">
|
||||
<div class="fallback">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue