diff --git a/src/EventHub.Application.Contracts/Organizations/IOrganizationAppService.cs b/src/EventHub.Application.Contracts/Organizations/IOrganizationAppService.cs index 7ce5686..6c9e49e 100644 --- a/src/EventHub.Application.Contracts/Organizations/IOrganizationAppService.cs +++ b/src/EventHub.Application.Contracts/Organizations/IOrganizationAppService.cs @@ -9,7 +9,7 @@ namespace EventHub.Organizations { Task CreateAsync(CreateOrganizationDto input); - Task> GetListAsync(PagedResultRequestDto input); + Task> GetListAsync(OrganizationListFilterDto input); Task GetProfileAsync(string name); diff --git a/src/EventHub.Application.Contracts/Organizations/Memberships/IOrganizationMembershipAppService.cs b/src/EventHub.Application.Contracts/Organizations/Memberships/IOrganizationMembershipAppService.cs index 953fae3..e57d79c 100644 --- a/src/EventHub.Application.Contracts/Organizations/Memberships/IOrganizationMembershipAppService.cs +++ b/src/EventHub.Application.Contracts/Organizations/Memberships/IOrganizationMembershipAppService.cs @@ -13,6 +13,6 @@ namespace EventHub.Organizations.Memberships Task IsJoinedAsync(Guid organizationId); - Task> GetMembersAsync(Guid organizationId); + Task> GetMembersAsync(OrganizationMemberListFilterDto input); } } \ No newline at end of file diff --git a/src/EventHub.Application.Contracts/Organizations/Memberships/OrganizationMemberListFilterDto.cs b/src/EventHub.Application.Contracts/Organizations/Memberships/OrganizationMemberListFilterDto.cs new file mode 100644 index 0000000..8c50e61 --- /dev/null +++ b/src/EventHub.Application.Contracts/Organizations/Memberships/OrganizationMemberListFilterDto.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EventHub.Organizations.Memberships +{ + public class OrganizationMemberListFilterDto : PagedResultRequestDto + { + public Guid OrganizationId { get; set; } + } +} \ No newline at end of file diff --git a/src/EventHub.Application.Contracts/Organizations/OrganizationListFilterDto.cs b/src/EventHub.Application.Contracts/Organizations/OrganizationListFilterDto.cs new file mode 100644 index 0000000..d59f489 --- /dev/null +++ b/src/EventHub.Application.Contracts/Organizations/OrganizationListFilterDto.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EventHub.Organizations +{ + public class OrganizationListFilterDto : PagedResultRequestDto + { + public Guid? RegisteredUserId { get; set; } + } +} \ No newline at end of file diff --git a/src/EventHub.Application/Organizations/Memberships/OrganizationMembershipAppService.cs b/src/EventHub.Application/Organizations/Memberships/OrganizationMembershipAppService.cs index 8428358..a3d70dc 100644 --- a/src/EventHub.Application/Organizations/Memberships/OrganizationMembershipAppService.cs +++ b/src/EventHub.Application/Organizations/Memberships/OrganizationMembershipAppService.cs @@ -55,19 +55,20 @@ namespace EventHub.Organizations.Memberships ); } - public async Task> GetMembersAsync(Guid organizationId) + public async Task> GetMembersAsync(OrganizationMemberListFilterDto input) { var organizationMembershipsQueryable = await _organizationMembershipsRepository.GetQueryableAsync(); var userQueryable = await _userRepository.GetQueryableAsync(); var query = from organizationMembership in organizationMembershipsQueryable join user in userQueryable on organizationMembership.UserId equals user.Id - where organizationMembership.OrganizationId == organizationId + where organizationMembership.OrganizationId == input.OrganizationId orderby organizationMembership.CreationTime descending select user; var totalCount = await AsyncExecuter.CountAsync(query); - var users = await AsyncExecuter.ToListAsync(query.Take(10)); + + var users = await AsyncExecuter.ToListAsync(query.PageBy(input)); return new PagedResultDto( totalCount, diff --git a/src/EventHub.Application/Organizations/OrganizationAppService.cs b/src/EventHub.Application/Organizations/OrganizationAppService.cs index bf0d2f1..32cc81b 100644 --- a/src/EventHub.Application/Organizations/OrganizationAppService.cs +++ b/src/EventHub.Application/Organizations/OrganizationAppService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EventHub.Organizations.Memberships; using EventHub.Users; using Microsoft.AspNetCore.Authorization; using Volo.Abp; @@ -15,17 +16,20 @@ namespace EventHub.Organizations public class OrganizationAppService : EventHubAppService, IOrganizationAppService { private readonly IRepository _organizationRepository; + private readonly IRepository _organizationMembershipsRepository; private readonly OrganizationManager _organizationManager; private readonly IBlobContainer _organizationBlobContainer; private readonly IRepository _userRepository; public OrganizationAppService( IRepository organizationRepository, + IRepository organizationMembershipsRepository, OrganizationManager organizationManager, IBlobContainer organizationBlobContainer, IRepository userRepository) { _organizationRepository = organizationRepository; + _organizationMembershipsRepository = organizationMembershipsRepository; _organizationManager = organizationManager; _organizationBlobContainer = organizationBlobContainer; _userRepository = userRepository; @@ -56,16 +60,29 @@ namespace EventHub.Organizations } } - public async Task> GetListAsync(PagedResultRequestDto input) + public async Task> GetListAsync(OrganizationListFilterDto input) { - var organizationCount = await _organizationRepository.GetCountAsync(); - var organizations = await _organizationRepository.GetPagedListAsync( - input.SkipCount, - input.MaxResultCount, - nameof(Organization.DisplayName) - ); + var organizationQueryable = await _organizationRepository.GetQueryableAsync(); + var organizationMemberQueryable = await _organizationMembershipsRepository.GetQueryableAsync(); - var organizationDto = ObjectMapper.Map, List>(organizations); + var query = organizationQueryable; + + if (input.RegisteredUserId.HasValue) + { + var registeredOrganization = organizationMemberQueryable + .Where(x => x.UserId == input.RegisteredUserId) + .Select(x => x.OrganizationId); + + var organizationIds = await AsyncExecuter.ToListAsync(registeredOrganization); + query = query.Where(x => organizationIds.Contains(x.Id)); + } + + var totalCount = await AsyncExecuter.CountAsync(query); + + query = query.PageBy(input); + + var organizationDto = ObjectMapper + .Map, List>(await AsyncExecuter.ToListAsync(query)); foreach (var organization in organizationDto) { @@ -73,7 +90,7 @@ namespace EventHub.Organizations } return new PagedResultDto( - organizationCount, + totalCount, organizationDto ); } diff --git a/src/EventHub.Domain.Shared/Localization/EventHub/en.json b/src/EventHub.Domain.Shared/Localization/EventHub/en.json index a6c1518..896fd73 100644 --- a/src/EventHub.Domain.Shared/Localization/EventHub/en.json +++ b/src/EventHub.Domain.Shared/Localization/EventHub/en.json @@ -26,9 +26,9 @@ "Organization": "Organization", "Submit": "Submit", "SeeEvent": "See event", - "RegisterNow": "Register Now", + "JoinThisEvent": "Join This Event", "LoginToRegister": "Login to register", - "CancelRegistration": "Cancel registration", + "YouAttendedThisEvent": "You Attended This Event", "EventRegisterSuccessMessage": "Your event registration has been done successfully.", "EventRegistrationCancelledMessage": "Your event registration has been cancelled.", "OrganizedBy": "Organized by", diff --git a/src/EventHub.Web/Controllers/OrganizationController.cs b/src/EventHub.Web/Controllers/OrganizationController.cs index 582da26..1ef1aba 100644 --- a/src/EventHub.Web/Controllers/OrganizationController.cs +++ b/src/EventHub.Web/Controllers/OrganizationController.cs @@ -22,7 +22,7 @@ namespace EventHub.Web.Controllers [HttpGet] [Route("get-list")] - public async Task GetList(PagedResultRequestDto input) + public async Task GetList(OrganizationListFilterDto input) { ViewData.Model = (await _organizationAppService.GetListAsync(input)).Items.ToList(); diff --git a/src/EventHub.Web/Controllers/OrganizationMembershipController.cs b/src/EventHub.Web/Controllers/OrganizationMembershipController.cs index fd9e42c..dfe1e5f 100644 --- a/src/EventHub.Web/Controllers/OrganizationMembershipController.cs +++ b/src/EventHub.Web/Controllers/OrganizationMembershipController.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using EventHub.Organizations.Memberships; using EventHub.Web.Pages.Organizations.Components.JoinArea; @@ -7,6 +9,7 @@ using Volo.Abp.AspNetCore.Mvc; namespace EventHub.Web.Controllers { + [Route("api/organization-membership")] public class OrganizationMembershipController : AbpController { private readonly IOrganizationMembershipAppService _organizationMembershipAppService; @@ -16,6 +19,19 @@ namespace EventHub.Web.Controllers _organizationMembershipAppService = organizationMembershipAppService; } + [HttpGet] + [Route("get-list")] + public async Task GetList(OrganizationMemberListFilterDto input) + { + ViewData.Model = (await _organizationMembershipAppService.GetMembersAsync(input)).Items.ToList(); + + return new PartialViewResult + { + ViewName = "~/Pages/Organizations/Components/MembersArea/_memberListSection.cshtml", + ViewData = ViewData + }; + } + [HttpPost] public async Task Join(Guid organizationId) { diff --git a/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml b/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml index 1e8e939..09720e1 100644 --- a/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml @@ -8,7 +8,7 @@ @if (Model.IsPagination && Model.TotalCount > Model.MaxResultCount && Model.TotalCount > Model.Events.Count) { -
+
+
+ +
} \ No newline at end of file diff --git a/src/EventHub.Web/Pages/Organizations/Components/MembersArea/MembersAreaViewComponent.cs b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/MembersAreaViewComponent.cs index 739e2b1..b1cf82b 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/MembersArea/MembersAreaViewComponent.cs +++ b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/MembersAreaViewComponent.cs @@ -24,9 +24,19 @@ namespace EventHub.Web.Pages.Organizations.Components.MembersArea _organizationMembershipAppService = organizationMembershipAppService; } - public async Task InvokeAsync(Guid organizationId) + public async Task InvokeAsync( + Guid organizationId, + int? skipCount, + int maxResultCount = 26, + bool isPagination = true, + bool isMoreDetail = false) { - var result = await _organizationMembershipAppService.GetMembersAsync(organizationId); + var result = await _organizationMembershipAppService.GetMembersAsync(new OrganizationMemberListFilterDto + { + OrganizationId = organizationId, + SkipCount = skipCount.GetValueOrDefault(), + MaxResultCount = maxResultCount + }); return View( "~/Pages/Organizations/Components/MembersArea/Default.cshtml", @@ -34,7 +44,11 @@ namespace EventHub.Web.Pages.Organizations.Components.MembersArea { OrganizationId = organizationId, Members = result.Items, - TotalCount = result.TotalCount + TotalCount = result.TotalCount, + SkipCount = skipCount.GetValueOrDefault(), + MaxResultCount = maxResultCount, + IsPagination = isPagination, + IsMoreDetail = isMoreDetail } ); } @@ -46,6 +60,14 @@ namespace EventHub.Web.Pages.Organizations.Components.MembersArea public long TotalCount { get; set; } public Guid OrganizationId { get; set; } + + public int SkipCount { get; set; } + + public int MaxResultCount { get; set; } + + public bool IsPagination { get; set; } + + public bool IsMoreDetail { get; set; } public string GetMemberName(OrganizationMemberDto member) { diff --git a/src/EventHub.Web/Pages/Organizations/Components/MembersArea/_memberListSection.cshtml b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/_memberListSection.cshtml new file mode 100644 index 0000000..eb06895 --- /dev/null +++ b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/_memberListSection.cshtml @@ -0,0 +1,22 @@ +@model List + +@foreach (var member in Model) +{ +
+
+ + +
+
+} \ No newline at end of file diff --git a/src/EventHub.Web/Pages/Organizations/Components/MembersArea/members-area.js b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/members-area.js index c8014c8..20637f5 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/MembersArea/members-area.js +++ b/src/EventHub.Web/Pages/Organizations/Components/MembersArea/members-area.js @@ -1,16 +1,62 @@ (function () { abp.widgets.MembersArea = function ($wrapper) { var organizationId = $wrapper.find('[data-organization-id]').attr('data-organization-id'); + var totalCount = Number($wrapper.find('[data-total-count]').attr('data-total-count')) + var skipCount = Number($wrapper.find('[data-skip-count]').attr('data-skip-count')) + var maxResultCount = Number($wrapper.find('[data-max-result-count]').attr('data-max-result-count')) + var isMoreDetail = $wrapper.find('[data-is-more-detail]').attr('data-is-more-detail') + var hashCode = Number($wrapper.find('[data-hash-code]').attr('data-hash-code')) + skipCount += maxResultCount; + + function moreDetailFilter() { + var hashCode = Number($wrapper.find('[data-hash-code]').attr('data-hash-code')) + $('#MemberList-' + hashCode + '> div').addClass('col-6 col-md-4 col-lg-2'); + $('#MemberList-' + hashCode + '> * > div > .member-name').removeAttr('style'); + $('#MemberList-' + hashCode + '> * > div').addClass('member-container text-center'); + $('#load-more-section-' + hashCode).addClass('text-center mt-3'); + } + + if (isMoreDetail === 'True'){ + moreDetailFilter() + } + + function init() { + var loadMoreButton = $wrapper.find('#LoadMoreButton-' + hashCode); + loadMoreButton.click(function (e) { + e.preventDefault(); + loadMoreButton.buttonBusy(true); + abp.ajax({ + type: 'GET', + dataType: 'html', + contentType: 'text/html; charset=utf-8', + url: (loadMoreButton.attr('data-url') + '&skipCount=' + skipCount) + }).then(function (response) { + var memberList = $wrapper.find('#MemberList-' + hashCode) + memberList.append(response); + skipCount += maxResultCount; + }).always(function () { + if (isMoreDetail === 'True'){ + moreDetailFilter() + } + if (skipCount >= totalCount) { + loadMoreButton.hide(); + } + loadMoreButton.buttonBusy(false); + }); + }); + } + return { getFilters: function () { return { organizationId: organizationId }; - } + }, + init: init }; }; - abp.event.on("EventHub.Organization.JoinStatusChanged", function(){ + abp.event.on("EventHub.Organization.JoinStatusChanged", function () { $('[data-widget-name="MembersArea"]') .data('abp-widget-manager') .refresh(); diff --git a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/Default.cshtml b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/Default.cshtml index b862651..38184bd 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/Default.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/Default.cshtml @@ -8,12 +8,16 @@ @if (Model.IsPagination && Model.TotalCount > Model.MaxResultCount && Model.TotalCount > Model.Organizations.Count) { -
+
diff --git a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/OrganizationsAreaViewComponent.cs b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/OrganizationsAreaViewComponent.cs index a406aac..969e647 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/OrganizationsAreaViewComponent.cs +++ b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/OrganizationsAreaViewComponent.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; using EventHub.Organizations; @@ -21,13 +22,15 @@ namespace EventHub.Web.Pages.Organizations.Components.OrganizationsArea } public async Task InvokeAsync( + Guid? registeredUserId, int? skipCount, int maxResultCount = 15, bool isPagination = true) { var result = await _organizationAppService.GetListAsync( - new PagedResultRequestDto + new OrganizationListFilterDto { + RegisteredUserId = registeredUserId, SkipCount = skipCount.GetValueOrDefault(), MaxResultCount = maxResultCount } @@ -39,6 +42,7 @@ namespace EventHub.Web.Pages.Organizations.Components.OrganizationsArea { Organizations = result.Items, TotalCount = result.TotalCount, + RegisteredUserId = registeredUserId, SkipCount = skipCount.GetValueOrDefault(), MaxResultCount = maxResultCount, IsPagination = isPagination @@ -51,6 +55,8 @@ namespace EventHub.Web.Pages.Organizations.Components.OrganizationsArea public IReadOnlyList Organizations { get; set; } public long TotalCount { get; set; } + + public Guid? RegisteredUserId { get; set; } public int SkipCount { get; set; } diff --git a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/organizations-area.js b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/organizations-area.js index 027144e..9fdd151 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/organizations-area.js +++ b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/organizations-area.js @@ -4,12 +4,12 @@ var skipCount = Number($wrapper.find('[data-skip-count]').attr('data-skip-count')) var maxResultCount = Number($wrapper.find('[data-max-result-count]').attr('data-max-result-count')) var hashCode = Number($wrapper.find('[data-hash-code]').attr('data-hash-code')) + skipCount += maxResultCount; function init() { var loadMoreButton = $wrapper.find('#LoadMoreButton-' + hashCode); loadMoreButton.click(function (e) { e.preventDefault(); - skipCount += maxResultCount; loadMoreButton.buttonBusy(true); abp.ajax({ type: 'GET', @@ -19,10 +19,10 @@ }).then(function (response) { var organizationList = $wrapper.find('#OrganizationList') organizationList.append(response); + skipCount += maxResultCount; }).always(function () { - var organizationCount = $('.organization').length; - if (Number(organizationCount) >= totalCount) { - $('.load-more-section-' + hashCode).hide(); + if (skipCount >= totalCount) { + $('#load-more-section-' + hashCode).hide(); } loadMoreButton.buttonBusy(false); }); diff --git a/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs b/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs index d88f4bf..a469279 100644 --- a/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs @@ -1,25 +1,10 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using EventHub.Organizations; -using Volo.Abp.Application.Dtos; - -namespace EventHub.Web.Pages.Organizations +namespace EventHub.Web.Pages.Organizations { public class IndexPageModel : EventHubPageModel { - public IReadOnlyList Organizations { get; set; } - - private readonly IOrganizationAppService _organizationAppService; - - public IndexPageModel(IOrganizationAppService organizationAppService) + public void OnGet() { - _organizationAppService = organizationAppService; - } - - public async Task OnGetAsync() - { - var result = await _organizationAppService.GetListAsync(new PagedResultRequestDto()); - Organizations = result.Items; + } } } diff --git a/src/EventHub.Web/Pages/Organizations/Profile.cshtml b/src/EventHub.Web/Pages/Organizations/Profile.cshtml index 38133b0..9f498a5 100644 --- a/src/EventHub.Web/Pages/Organizations/Profile.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Profile.cshtml @@ -59,8 +59,14 @@
@await Component.InvokeAsync(typeof(JoinAreaViewComponent), new {organizationId = Model.Organization.Id}) - @await Component.InvokeAsync(typeof(MembersAreaViewComponent), new {organizationId = Model.Organization.Id}) - + @await Component.InvokeAsync(typeof(MembersAreaViewComponent), + new + { + organizationId = Model.Organization.Id, + isPagination = true, + maxResultCount = 15 + }) +
Share Organizations
-

Members @Model.Members.Count

-
- @foreach (var member in Model.Members) + @await Component.InvokeAsync(typeof(MembersAreaViewComponent), + new { -
-
- - - @if (!string.IsNullOrWhiteSpace(member.Name) && !string.IsNullOrWhiteSpace(member.Surname)) - { - @(member.Name + " " + member.Surname) - } - else - { - { - @member.UserName - } - } - -
-
- } -
-
- @* ToDo: Implement show more!!! *@ - -
+ 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 cc258ed..fbe6950 100644 --- a/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs +++ b/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs @@ -17,23 +17,18 @@ namespace EventHub.Web.Pages.Organizations public bool IsOrganizationOwner { get; private set; } - public List Members { get; private set; } - private readonly IOrganizationAppService _organizationAppService; - private readonly IOrganizationMembershipAppService _organizationMembershipAppService; public ProfilePageModel( IOrganizationAppService organizationAppService, IOrganizationMembershipAppService organizationMembershipAppService) { _organizationAppService = organizationAppService; - _organizationMembershipAppService = organizationMembershipAppService; } public async Task OnGetAsync() { await GetProfileAsync(); - await GetMembersAsync(); IsOrganizationOwner = await _organizationAppService.IsOrganizationOwnerAsync(Organization.Id); } @@ -42,10 +37,5 @@ namespace EventHub.Web.Pages.Organizations { Organization = await _organizationAppService.GetProfileAsync(Name); } - - private async Task GetMembersAsync() - { - Members = (await _organizationMembershipAppService.GetMembersAsync(Organization.Id)).Items.ToList(); - } } } diff --git a/src/EventHub.Web/Pages/Profile.cshtml b/src/EventHub.Web/Pages/Profile.cshtml index d087d65..afe8804 100644 --- a/src/EventHub.Web/Pages/Profile.cshtml +++ b/src/EventHub.Web/Pages/Profile.cshtml @@ -1,7 +1,6 @@ @page @using EventHub.Web.Pages.Events.Components.EventsArea -@using Volo.Abp.Identity -@using Volo.Abp.ObjectExtending +@using EventHub.Web.Pages.Organizations.Components.OrganizationsArea @using Volo.Abp.Timing @using Volo.Abp.Users @inject ICurrentUser CurrentUser @@ -9,213 +8,189 @@ @model EventHub.Web.Pages.ProfileModel
-
-
- -
-
-
-
-
-
-

Profile Photo

- -

- You should note that the photo to be added does not exceed 30 MB in JPEG or PNG format. -

+
+
+ +
+
+
+
+
+
+

Profile Photo

+ +

+ You should note that the photo to be added does not exceed 30 MB in JPEG or PNG format. +

- - Update Profile Photo - -
-
-
-
-
-
-

Profile Informations

-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - + + Update Profile Photo +
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
- -
-
- - -
-
- -
-
-
-
+
+
+
+

Profile Informations

+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
-
-
-

Change Password

-
-
-
-
- - -
-
-
-
+
+
+ + +
+
-
-
- - + +
+
-
-
- - +
+
+

Change Password

+
+
+
+
+ + +
+
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
-
-
-
-
-
-
-
-
-
-
-

Notification Settings

-

General Notifications

-
-
Send SMS notification
-
-
- -
-
-
-
-
Send E-mail notification
-
-
- -
-
-
- -

Special Notifications to EventHub

-
-
Send notification about updates
-
-
- +
+
+
+
+
+

My Organizations

+ @await Component.InvokeAsync(typeof(OrganizationsAreaViewComponent), new + { + registeredUserId = CurrentUser.GetId(), + maxResultCount = 12 + }) +
-
-
Send notification for organization suggestions
-
-
- +
+
+
+
+
+
+

My Past Events

+
+ @await Component.InvokeAsync(typeof(EventsAreaViewComponent), new + { + maxDate = Clock.Now.ClearTime(), + registeredUserId = CurrentUser.GetId(), + maxResultCount = 6, + skipCount = 0 + }) +
+
-
-
Send notifications for new organizations
-
-
- +
+
+
+
+
+
+

My Upcoming Events

+ @await Component.InvokeAsync(typeof(EventsAreaViewComponent), new + { + minDate = Clock.Now.ClearTime(), + registeredUserId = CurrentUser.GetId(), + maxResultCount = 6, + skipCount = 0 + }) +
@@ -223,63 +198,4 @@
-
-
-
-
-
-
-

My Events

- @await Component.InvokeAsync(typeof(EventsAreaViewComponent), new - { - registeredUserId = CurrentUser.Id, - maxResultCount = 6, - skipCount = 0 - }) -
-
-
-
-
-
-
-
-
-
-

My Past Events

-
- @await Component.InvokeAsync(typeof(EventsAreaViewComponent), new - { - maxDate = Clock.Now.ClearTime(), - registeredUserId = CurrentUser.Id, - maxResultCount = 6, - skipCount = 0 - }) -
-
-
-
-
-
-
-
-
-
-
-

My Upcoming Events

- @await Component.InvokeAsync(typeof(EventsAreaViewComponent), new - { - minDate = Clock.Now.ClearTime(), - registeredUserId = CurrentUser.Id, - maxResultCount = 6, - skipCount = 0 - }) -
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/src/EventHub.Web/Pages/Profile.cshtml.cs b/src/EventHub.Web/Pages/Profile.cshtml.cs index 9910a0a..992d99c 100644 --- a/src/EventHub.Web/Pages/Profile.cshtml.cs +++ b/src/EventHub.Web/Pages/Profile.cshtml.cs @@ -1,9 +1,23 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using EventHub.Organizations; + namespace EventHub.Web.Pages { public class ProfileModel : EventHubPageModel { - public void OnGet() + private readonly IOrganizationAppService _organizationAppService; + + public IReadOnlyList MyOrganizations { get; set; } + + public ProfileModel(IOrganizationAppService organizationAppService) { + _organizationAppService = organizationAppService; + } + + public async Task OnGetAsync() + { + MyOrganizations = (await _organizationAppService.GetMyOrganizationsAsync()).Items; } } } \ No newline at end of file