Beispiel #1
0
        public ActivityFeedTabModel GetMainFeedTab(IPublishedContent currentPage, Guid groupId)
        {
            var groupRoom = _contentProvider.GetGroupRoomPage();
            var type      = GetFeedTabType(groupRoom);
            var result    = new ActivityFeedTabModel
            {
                Content  = groupRoom,
                Type     = type,
                IsActive = groupRoom.Id == currentPage.Id,
                Links    = _feedLinkService.GetCreateLinks(type, groupId)
            };

            return(result);
        }
Beispiel #2
0
        public IEnumerable <ActivityFeedTabModel> GetActivityTabs(IPublishedContent currentPage, IIntranetUser user, Guid groupId)
        {
            yield return(GetMainFeedTab(currentPage, groupId));

            foreach (var content in _contentProvider.GetRelatedPages())
            {
                var tabType = GetFeedTabType(content);

                var activityTypeIds = _activityTypeProvider.All.Select(t => t.ToInt());

                if (activityTypeIds.Contains(tabType.ToInt()))
                {
                    var tab = new ActivityFeedTabModel
                    {
                        Content  = content,
                        Type     = tabType,
                        IsActive = content.IsAncestorOrSelf(currentPage),
                        Links    = _feedLinkService.GetCreateLinks(tabType, groupId)
                    };

                    yield return(tab);
                }
            }
        }