From d69e5e00b5ecc627f92abb3726f2fea8f644a841 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 12 May 2021 00:16:37 +0300 Subject: [PATCH] Add social media links on Organization profile page --- src/EventHub.Web/Pages/Events/Detail.cshtml | 17 --- src/EventHub.Web/Pages/Events/Edit.cshtml | 2 +- .../Pages/Organizations/Edit.cshtml | 2 +- .../Pages/Organizations/Profile.cshtml | 69 +++++++--- .../Pages/Organizations/Profile.cshtml.cs | 10 +- src/EventHub.Web/Pages/Profile.cshtml | 125 +----------------- src/EventHub.Web/Pages/Profile.cshtml.cs | 17 +-- src/EventHub.Web/wwwroot/assets/github.svg | 59 +++++++++ src/EventHub.Web/wwwroot/assets/instagram.svg | 67 ++++++++++ src/EventHub.Web/wwwroot/assets/medium.svg | 1 + 10 files changed, 194 insertions(+), 175 deletions(-) create mode 100644 src/EventHub.Web/wwwroot/assets/github.svg create mode 100644 src/EventHub.Web/wwwroot/assets/instagram.svg create mode 100644 src/EventHub.Web/wwwroot/assets/medium.svg diff --git a/src/EventHub.Web/Pages/Events/Detail.cshtml b/src/EventHub.Web/Pages/Events/Detail.cshtml index c75e2a4..118dda3 100644 --- a/src/EventHub.Web/Pages/Events/Detail.cshtml +++ b/src/EventHub.Web/Pages/Events/Detail.cshtml @@ -56,24 +56,7 @@

@EventDateHelper.GetDateRangeText(Model.Event.StartTime, Model.Event.EndTime)

- @await Component.InvokeAsync(typeof(AttendeesAreaViewComponent), new {eventId = Model.Event.Id}) - - - -
-
Share Event
-
diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml b/src/EventHub.Web/Pages/Events/Edit.cshtml index 461b38e..64aa5ed 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml @@ -1,4 +1,4 @@ -@page "/event/edit/{url}" +@page "/Event/Edit/{url}" @inject IHtmlLocalizer L @using EventHub.Localization @using Microsoft.AspNetCore.Mvc.Localization diff --git a/src/EventHub.Web/Pages/Organizations/Edit.cshtml b/src/EventHub.Web/Pages/Organizations/Edit.cshtml index cded6fd..0290d50 100644 --- a/src/EventHub.Web/Pages/Organizations/Edit.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Edit.cshtml @@ -1,4 +1,4 @@ -@page "/organization/edit/{name}" +@page "/Organization/Edit/{name}" @inject IHtmlLocalizer L @using EventHub.Localization @using EventHub.Organizations diff --git a/src/EventHub.Web/Pages/Organizations/Profile.cshtml b/src/EventHub.Web/Pages/Organizations/Profile.cshtml index 447c1aa..9228369 100644 --- a/src/EventHub.Web/Pages/Organizations/Profile.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Profile.cshtml @@ -65,27 +65,60 @@ } @await Component.InvokeAsync(typeof(JoinAreaViewComponent), new {organizationId = Model.Organization.Id}) - @await Component.InvokeAsync(typeof(MembersAreaViewComponent), + @await Component.InvokeAsync(typeof(MembersAreaViewComponent), new { - organizationId = Model.Organization.Id, + organizationId = Model.Organization.Id, isPagination = true, maxResultCount = 15 }) - -
Share Organizations
- + + @if (Model.IsShowSocialMediaContent) + { +
Share Organizations
+ + } @@ -124,10 +157,10 @@
- @await Component.InvokeAsync(typeof(MembersAreaViewComponent), + @await Component.InvokeAsync(typeof(MembersAreaViewComponent), new { - organizationId = Model.Organization.Id, + organizationId = Model.Organization.Id, isPagination = true, maxResultCount = 18, isMoreDetail = true diff --git a/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs b/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs index 9eb5152..43d3780 100644 --- a/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using EventHub.Organizations; using EventHub.Organizations.Memberships; using Microsoft.AspNetCore.Mvc; @@ -13,6 +14,8 @@ namespace EventHub.Web.Pages.Organizations public OrganizationProfileDto Organization { get; private set; } public bool IsOrganizationOwner { get; private set; } + + public bool IsShowSocialMediaContent { get; set; } = false; private readonly IOrganizationAppService _organizationAppService; @@ -33,6 +36,11 @@ namespace EventHub.Web.Pages.Organizations private async Task GetProfileAsync() { Organization = await _organizationAppService.GetProfileAsync(Name); + + if (!Organization.Website.IsNullOrWhiteSpace() || !Organization.TwitterUsername.IsNullOrWhiteSpace() || !Organization.GitHubUsername.IsNullOrWhiteSpace() || !Organization.FacebookUsername.IsNullOrWhiteSpace() || !Organization.InstagramUsername.IsNullOrWhiteSpace() || !Organization.MediumUsername.IsNullOrWhiteSpace()) + { + IsShowSocialMediaContent = true; + } } } } diff --git a/src/EventHub.Web/Pages/Profile.cshtml b/src/EventHub.Web/Pages/Profile.cshtml index afe8804..241e28d 100644 --- a/src/EventHub.Web/Pages/Profile.cshtml +++ b/src/EventHub.Web/Pages/Profile.cshtml @@ -10,12 +10,9 @@
-