avatar component is removed

vnext
Paul Schneider 5 years ago
parent 8f99f36d49
commit a7df4288f6
2 changed files with 1 additions and 32 deletions

@ -1,30 +0,0 @@
using System.Linq;
using Microsoft.AspNet.Mvc;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.ViewModels.Account;
namespace Yavsc.ViewComponents
{
public class AvatarViewComponent : ViewComponent
{
ApplicationDbContext dbContext;
public AvatarViewComponent(ApplicationDbContext dbContext)
{
this.dbContext = dbContext;
}
public IViewComponentResult Invoke ( string userId, string imgFmt )
{
var user = dbContext.Users.Single(u=>u.Id == userId);
return View ( "Default", new ShortUserInfo
{
Avatar = dbContext.AvatarUri(userId, imgFmt),
UserName = user.UserName,
UserId = userId
} );
}
}
}

@ -79,8 +79,7 @@
<dt>@SR["Avatar"]:</dt> <dt>@SR["Avatar"]:</dt>
<dd> <dd>
<img src="/Avatars/@(User.GetUserName()+".s").png" asp-append-version="true" class="smalltofhol" />
@Component.Invoke("Avatar", User.GetUserId(), ".s")
[<a asp-controller="Manage" asp-action="SetAvatar" [<a asp-controller="Manage" asp-action="SetAvatar"
>@SR["Modify"]</a>] >@SR["Modify"]</a>]
</dd> </dd>

Loading…