From 766535cde952b2386d35ce613aad95730f0ddcba Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Fri, 27 Sep 2019 03:21:35 +0100 Subject: [PATCH] removing avatar component --- src/Yavsc/Helpers/UserHelpers.cs | 16 ---------------- .../Shared/Components/Avatar/Default.cshtml | 5 ----- .../DisplayTemplates/ApplicationUser.cshtml | 8 ++++++-- .../DisplayTemplates/ApplicationUserLink.cshtml | 2 +- 4 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml diff --git a/src/Yavsc/Helpers/UserHelpers.cs b/src/Yavsc/Helpers/UserHelpers.cs index 63b53801..093eab20 100644 --- a/src/Yavsc/Helpers/UserHelpers.cs +++ b/src/Yavsc/Helpers/UserHelpers.cs @@ -8,22 +8,6 @@ namespace Yavsc.Helpers { public static class UserHelpers { - /// - /// The avatar ... - /// - /// - /// - /// - /// - // 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 UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId) { diff --git a/src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml b/src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml deleted file mode 100644 index 76296207..00000000 --- a/src/Yavsc/Views/Shared/Components/Avatar/Default.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@model ShortUserInfo -
- -@Model.UserName -
\ No newline at end of file diff --git a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml index f9f2e0a1..3f4c2cc8 100644 --- a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml +++ b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml @@ -1,7 +1,11 @@ @model ApplicationUser - +@{ + var avuri = "/Avatars/"+Model.UserName+".s.png"; +}
-

@Component.Invoke("Avatar", Model.Id, ".s")

+

+ +

@if (Model.Posts!=null && Model.Posts.Count()>1) { @SR["index de ses articles"] } diff --git a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUserLink.cshtml b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUserLink.cshtml index 5a97a79c..c3657f95 100644 --- a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUserLink.cshtml +++ b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUserLink.cshtml @@ -1,5 +1,5 @@ @model ApplicationUser @if (Model!=null) { -@Component.Invoke("Avatar", Model.Id, ".xs") + }