removing avatar component
This commit is contained in:
parent
7f9ee5dbee
commit
642b43796f
4 changed files with 7 additions and 24 deletions
|
|
@ -8,22 +8,6 @@ namespace Yavsc.Helpers
|
||||||
{
|
{
|
||||||
public static class UserHelpers
|
public static class UserHelpers
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The avatar ...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dbContext"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="imgFmt"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
// FIXME support imgFmt
|
|
||||||
public static string AvatarUri(this ApplicationDbContext dbContext, string userId, string imgFmt )
|
|
||||||
{
|
|
||||||
var user = dbContext.Users.FirstOrDefault(u => u.Id == userId);
|
|
||||||
if (user==null) return Constants.AnonAvatar;
|
|
||||||
if (user.Avatar==null) return Constants.DefaultAvatar;
|
|
||||||
var avatar = user.UserName;
|
|
||||||
return $"/Avatars/{avatar}{imgFmt}.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IEnumerable<BlogPost> UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId)
|
public static IEnumerable<BlogPost> UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
@model ShortUserInfo
|
|
||||||
<div style="display: inline-block;">
|
|
||||||
<img src="@Model.Avatar" class="smalltofhol" />
|
|
||||||
@Model.UserName
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
@model ApplicationUser
|
@model ApplicationUser
|
||||||
|
@{
|
||||||
|
var avuri = "/Avatars/"+Model.UserName+".s.png";
|
||||||
|
}
|
||||||
<div class="userinfo">
|
<div class="userinfo">
|
||||||
<h3>@Component.Invoke("Avatar", Model.Id, ".s")</h3>
|
<h3>
|
||||||
|
<img src="@avuri" asp-append-version="true" class="smalltofhol" />
|
||||||
|
</h3>
|
||||||
@if (Model.Posts!=null && Model.Posts.Count()>1) { <a asp-controller="Blogspot" asp-action="UserPosts"
|
@if (Model.Posts!=null && Model.Posts.Count()>1) { <a asp-controller="Blogspot" asp-action="UserPosts"
|
||||||
asp-route-id="@Model.UserName" class="btn btn-primary">@SR["index de ses articles"]</a>
|
asp-route-id="@Model.UserName" class="btn btn-primary">@SR["index de ses articles"]</a>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
@model ApplicationUser
|
@model ApplicationUser
|
||||||
|
|
||||||
@if (Model!=null) {
|
@if (Model!=null) {
|
||||||
@Component.Invoke("Avatar", Model.Id, ".xs")
|
<img src="/Avatars/@(Model.UserName+".xs").png" asp-append-version="true" class="smalltofhol" />
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue