Example #1
0
        void rptEvents_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                BaseEventDetailPageItem item = (BaseEventDetailPageItem)e.Item.DataItem;

                FieldRenderer frExpertName                = e.FindControlAs <FieldRenderer>("frExpertName");
                FieldRenderer frExpertSubheading          = e.FindControlAs <FieldRenderer>("frExpertSubheading");
                System.Web.UI.WebControls.Image imgExpert = e.FindControlAs <System.Web.UI.WebControls.Image>("imgExpert");
                HyperLink hlEventDetail1 = e.FindControlAs <HyperLink>("hlEventDetail1");
                HyperLink hlEventDetail2 = e.FindControlAs <HyperLink>("hlEventDetail2");
                HyperLink hlEventDetail3 = e.FindControlAs <HyperLink>("hlEventDetail3");
                Literal   litExpertType  = e.FindControlAs <Literal>("litExpertType");
                Literal   litEventDate   = e.FindControlAs <Literal>("litEventDate");

                litEventDate.Text              = item.GetFormattedEventStartDate();
                hlEventDetail1.NavigateUrl     =
                    hlEventDetail2.NavigateUrl = hlEventDetail3.NavigateUrl = item.GetUrl();

                // Expert details
                ExpertDetailPageItem expert = item.Expert.Item;

                if (expert != null)
                {
                    frExpertName.Item  = frExpertSubheading.Item = expert;
                    imgExpert.ImageUrl = expert.GetThumbnailUrl(150, 150);
                    litExpertType.Text = expert.GetExpertType();
                }
            }
        }
        void rptExperts_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                ExpertDetailPageItem expert = (ExpertDetailPageItem)e.Item.DataItem;

                HyperLink hlExpertDetail          = e.FindControlAs <HyperLink>("hlExpertDetail");
                HyperLink hlExpertDetailCta       = e.FindControlAs <HyperLink>("hlExpertDetailCta");
                HyperLink hlOfficeHours           = e.FindControlAs <HyperLink>("hlOfficeHours");
                HyperLink hlExpertDetailCtaMobile = e.FindControlAs <HyperLink>("hlExpertDetailCtaMobile");
                HyperLink hlOfficeHoursMobile     = e.FindControlAs <HyperLink>("hlOfficeHoursMobile");

                hlExpertDetail.NavigateUrl = hlExpertDetailCta.NavigateUrl = hlExpertDetailCtaMobile.NavigateUrl
                                                                                 = expert.GetUrl();

                System.Web.UI.WebControls.Image imgExpert = e.FindControlAs <System.Web.UI.WebControls.Image>("imgExpert");
                imgExpert.ImageUrl = expert.GetThumbnailUrl(150, 150);

                Literal litExpertType = e.FindControlAs <Literal>("litExpertType");
                litExpertType.Text = expert.GetExpertType();

                FieldRenderer frExpertName       = e.FindControlAs <FieldRenderer>("frExpertName");
                FieldRenderer frExpertSubheading = e.FindControlAs <FieldRenderer>("frExpertSubheading");

                frExpertName.Item = frExpertSubheading.Item = expert;
            }
        }
Example #3
0
        void lvExperts_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ExpertDetailPageItem expert = (ExpertDetailPageItem)e.Item.DataItem;

                FieldRenderer frExpertName       = (FieldRenderer)e.Item.FindControl("frExpertName");
                FieldRenderer frExpertSubheading = (FieldRenderer)e.Item.FindControl("frExpertSubheading");
                FieldRenderer frTwitterLink      = (FieldRenderer)e.Item.FindControl("frTwitterLink");
                FieldRenderer frBlogLink         = (FieldRenderer)e.Item.FindControl("frBlogLink");

                frExpertName.Item = frExpertSubheading.Item = frTwitterLink.Item
                                                                  = frBlogLink.Item = expert;

                System.Web.UI.WebControls.Image imgExpert = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgExpert");
                imgExpert.ImageUrl = expert.GetThumbnailUrl(230, 230);

                HyperLink hlExpertDetail    = (HyperLink)e.Item.FindControl("hlExpertDetail");
                HyperLink hlExpertName      = (HyperLink)e.Item.FindControl("hlExpertName");
                HyperLink hlExpertThumbnail = (HyperLink)e.Item.FindControl("hlExpertThumbnail");

                hlExpertDetail.NavigateUrl             = hlExpertName.NavigateUrl
                                                       = hlExpertThumbnail.NavigateUrl = expert.GetUrl();

                Repeater rptTasks = (Repeater)e.Item.FindControl("rptTasks");
                var      tasks    = expert.GetTasks();
                if (tasks.Any())
                {
                    rptTasks.DataSource = tasks;
                    rptTasks.DataBind();
                }
            }
        }
Example #4
0
        private void BindContent()
        {
            ExpertLivePageItem landingPage = ExpertLivePageItem.GetLandingPage();
            bool landingExists             = landingPage != null;

            hlBackExperts.Visible = landingExists;
            if (landingExists)
            {
                hlBackExperts.NavigateUrl = landingPage.GetUrl();
                hlBackExperts.Text        = landingPage.ContentPage.BasePageNEW.NavigationTitle;
            }

            bool isUpcoming = Model.BaseEventDetailPage.IsUpcoming();

            phCallToActions.Visible = isUpcoming;

            phPastChatDetails.Visible = phPastSidebarDetails.Visible = !isUpcoming;

            litEventDate.Text = Model.BaseEventDetailPage.GetFormattedEventStartDate();

            // Expert details
            ExpertDetailPageItem expert = Model.BaseEventDetailPage.Expert.Item;

            frExpertName.Item = frHostTitle.Item = expert;

            if (expert != null)
            {
                imgExpert.ImageUrl          = expert.GetThumbnailUrl(150, 150);
                litExpertType.Text          = expert.GetExpertType();
                hlExpertDetails.NavigateUrl = expert.GetUrl();
            }

            CommunityRecommendationIcons1.MatchingChildrenIds = CommunityRecommendationIcons2.MatchingChildrenIds = Model.BaseEventDetailPage.GetMatchingChildrenIds(this.CurrentMember);
        }
Example #5
0
        void rptEvents_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                BaseEventDetailPageItem item = (BaseEventDetailPageItem)e.Item.DataItem;

                FieldRenderer frExpertName                = e.FindControlAs <FieldRenderer>("frExpertName");
                FieldRenderer frExpertSubheading          = e.FindControlAs <FieldRenderer>("frExpertSubheading");
                System.Web.UI.WebControls.Image imgExpert = e.FindControlAs <System.Web.UI.WebControls.Image>("imgExpert");
                HyperLink hlEventDetail   = e.FindControlAs <HyperLink>("hlEventDetail");
                HyperLink hlExpertPicture = e.FindControlAs <HyperLink>("hlExpertPicture");
                Literal   litExpertType   = e.FindControlAs <Literal>("litExpertType");
                Literal   litEventDate    = e.FindControlAs <Literal>("litEventDate");
                //Literal litRSVPText = e.FindControlAs<Literal>("litRSVPText");
                Literal litSkipThisText = e.FindControlAs <Literal>("litSkipThisText");

                //litRSVPText.Text = DictionaryConstants.Community_RSVPButtonText;
                //litSkipThisText.Text = DictionaryConstants.Community_SkipThisButtonText;

                litEventDate.Text           = item.GetFormattedEventStartDate();
                hlEventDetail.NavigateUrl   = item.GetUrl();
                hlExpertPicture.NavigateUrl = item.GetUrl();
                frExpertName.Item           = item;

                // Expert details
                ExpertDetailPageItem expert = item.Expert.Item;

                if (expert != null)
                {
                    imgExpert.ImageUrl = expert.GetThumbnailUrl(150, 150);
                    //litExpertType.Text = expert.GetExpertType();
                }
            }
        }
Example #6
0
        private void BindContent()
        {
            ExpertLivePageItem landingPage = ExpertLivePageItem.GetLandingPage();
            bool landingExists             = landingPage != null;

            hlBackExperts.Visible      = landingExists;
            litTopicsCoveredLabel.Text = DictionaryConstants.TopicsCoveredLabel;
            if (landingExists)
            {
                hlBackExperts.NavigateUrl = landingPage.GetUrl();
                hlBackExperts.Text        = landingPage.ContentPage.BasePageNEW.NavigationTitle;
            }

            // TODO: replace with correct check for archived state
            bool isUpcoming = Model.BaseEventDetailPage.IsUpcoming();

            phCallToActions.Visible = isUpcoming;
            phVideoDetails.Visible  = phHelpful.Visible = !isUpcoming;

            litEventDate.Text = Model.BaseEventDetailPage.GetFormattedEventStartDate();

            if (isUpcoming)
            {
                // TODO: add display logic to hide if no video/transcript present
            }

            // Expert details
            var expert = new ExpertDetailPageItem(Model.BaseEventDetailPage.Expert.Item);

            if (expert.InnerItem != null)
            {
                hlExpertDetail.NavigateUrl = expert.GetUrl();
                imgExpert.ImageUrl         = expert.GetThumbnailUrl(150, 150);
                frExpertName.Item          = Model.BaseEventDetailPage.Expert;
                frHostTitle.Item           = expert;
                litExpertType.Text         = expert.GetExpertType();
            }

            //Get Topics overed in webinar based on Topics embedded in Parent interest field
            StringBuilder sb = new StringBuilder();

            foreach (var topics in Model.BaseEventDetailPage.ParentInterest.ListItems)
            {
                sb.Append(topics.Name);
                sb.Append(",");
            }
            litTopicsCovered.Text = sb.Length > 1?  sb.Remove(sb.Length - 1, 1).ToString():sb.ToString();
            CommunityRecommendationIcons2.MatchingChildrenIds = CommunityRecommendationIcons.MatchingChildrenIds = Model.BaseEventDetailPage.GetMatchingChildrenIds(this.CurrentMember);
        }
        private void BindContent()
        {
            if (DataSource != null && DataSource.InheritsTemplate(BaseEventDetailPageItem.TemplateId))
            {
                BaseEventDetailPageItem item = (BaseEventDetailPageItem)DataSource;

                EventUrl = item.GetUrl();

                // Field renderers
                frHeading.Item = frSubheading.Item = frPageTitle.Item = item;

                // Expert details
                ExpertDetailPageItem expert = item.Expert.Item;
                if (expert != null)
                {
                    imgExpert.ImageUrl = expert.GetThumbnailUrl(150, 150);
                    litExpertType.Text = expert.GetExpertType();
                }

                // Webinar/chat
                litEventType.Text = item.GetEventType();

                // Time elapsed
                // TODO: consider moving into helper function
                // TODO: verify documentation for display logic
                DateTime?eventDate = item.GetEventStartDateUtc();
                if (eventDate.HasValue)
                {
                    int daysElapsed = (DateTime.UtcNow - eventDate.Value).Days;
                    if (daysElapsed == 0)
                    {
                        // TODO: display something?
                    }
                    else if (daysElapsed <= 30)
                    {
                        litEventDate.Text    = daysElapsed.ToString();
                        litEventSubDate.Text = DictionaryConstants.DaysAgoLabel;
                    }
                    else
                    {
                        litEventDate.Text    = eventDate.Value.ToString("MMM dd");
                        litEventSubDate.Text = eventDate.Value.ToString("yyyy");
                    }
                }
                CommunityRecommendationIcons.MatchingChildrenIds = item.GetMatchingChildrenIds(this.CurrentMember);
            }
        }
        private void BindContent()
        {
            if (DataSource != null && DataSource.InheritsTemplate(BaseEventDetailPageItem.TemplateId))
            {
                BaseEventDetailPageItem item = (BaseEventDetailPageItem)DataSource;

                frPageTitle.Item = item;

                EventUrl          = item.GetUrl();
                litEventDate.Text = item.GetFormattedEventStartDate();

                ExpertDetailPageItem expert = item.Expert.Item;
                if (expert != null)
                {
                    imgThumbnail.ImageUrl = expert.GetThumbnailUrl(150, 150);
                    litExpertType.Text    = expert.GetExpertType();
                }
            }
        }
        private void BindContent()
        {
            if (DataSource != null && DataSource.InheritsTemplate(BaseEventDetailPageItem.TemplateId))
            {
                BaseEventDetailPageItem item = (BaseEventDetailPageItem)DataSource;

                hlEventDetail.NavigateUrl = item.GetUrl();
                litEventDate.Text         = item.GetFormattedEventStartDate();

                // Expert details
                ExpertDetailPageItem expert = item.Expert.Item;
                if (expert != null)
                {
                    imgThumbnail.ImageUrl = expert.GetThumbnailUrl(150, 150);

                    // TODO: verify Heading should be tied to expert or actual event page
                    frExpertHeading.Item       = frExpertSubheading.Item = expert.InnerItem;
                    hlExpertDetail.NavigateUrl = expert.GetUrl();
                    litExpertType.Text         = expert.GetExpertType();
                }

                CommunityRecommendationIcons.MatchingChildrenIds = item.GetMatchingChildrenIds(this.CurrentMember);
            }
        }
Example #10
0
        protected void RepeaterSingleDayEvents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                BaseEventDetailPageItem eventToBind = (BaseEventDetailPageItem)e.Item.DataItem;
                bool      IsChatEvent         = eventToBind.InnerItem.TemplateID == Sitecore.Data.ID.Parse(ChatEventPageItem.TemplateId);
                Literal   literalEventUTCTime = (Literal)e.Item.FindControl("literalEventUTCTime");
                HyperLink linkEventDetails    = (HyperLink)e.Item.FindControl("linkEventDetails");
                HyperLink linkEventDate       = (HyperLink)e.Item.FindControl("linkEventDate");
                Sitecore.Web.UI.WebControls.FieldRenderer frRsvpLink      = (Sitecore.Web.UI.WebControls.FieldRenderer)e.Item.FindControl("frRsvpLink");
                Sitecore.Web.UI.WebControls.FieldRenderer frAddToCalendar = (Sitecore.Web.UI.WebControls.FieldRenderer)e.Item.FindControl("frAddToCalendar");
                Literal            literalExpertName   = (Literal)e.Item.FindControl("literalExpertName");
                Literal            literalExpertTitles = (Literal)e.Item.FindControl("literalExpertTitles");
                Image              imageExpert         = (Image)e.Item.FindControl("imageExpert");
                Literal            litExpertType       = e.FindControlAs <Literal>("litExpertType");
                HyperLink          linkExpert          = (HyperLink)e.Item.FindControl("linkExpert");
                HtmlGenericControl itemSingleEvent     = (HtmlGenericControl)e.Item.FindControl("itemSingleEvent");
                PlaceHolder        placeholderLive     = (PlaceHolder)e.Item.FindControl("placeholderLive");

                StringBuilder builderForDateHeading = new StringBuilder();
                builderForDateHeading.Append(String.Format("{0} {1} ", eventToBind.ContentPage.PageTitle.Rendered, DictionaryConstants.AtFragment));
                builderForDateHeading.Append(eventToBind.GetFormattedEventStartTime());
                builderForDateHeading.Append(" ");
                builderForDateHeading.Append(eventToBind.EventStartDate.DateTime.ToString("MMM d, yyyy", CultureInfo.InvariantCulture));
                linkEventDate.Text = builderForDateHeading.ToString();

                var dateToCheck = eventToBind.EventStartDate.DateTime;
                var startDate   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                var endDate     = startDate.AddDays(1);
                if (dateToCheck >= startDate && dateToCheck < endDate)
                {
                    itemSingleEvent.Attributes["class"] += " live-event";
                    placeholderLive.Visible              = true;
                }

                literalEventUTCTime.Text     = eventToBind.EventStartDate.DateTime.ToUniversalTime().ToString("htt") + " UTC";
                linkEventDetails.NavigateUrl = linkEventDate.NavigateUrl = eventToBind.GetUrl();
                frRsvpLink.Item = frAddToCalendar.Item = eventToBind;

                ExpertDetailPageItem expertToBind = (ExpertDetailPageItem)eventToBind.Expert.Item;
                if (expertToBind != null)
                {
                    literalExpertName.Text = expertToBind.ExpertName;
                    StringBuilder builderExpertCaption = new StringBuilder();
                    builderExpertCaption.Append(expertToBind.ExpertHeading.Rendered);
                    if (!string.IsNullOrWhiteSpace(expertToBind.ExpertSubheading.Rendered))
                    {
                        builderExpertCaption.AppendLine(",<br />");
                        builderExpertCaption.Append(expertToBind.ExpertSubheading.Rendered);
                    }
                    literalExpertTitles.Text = builderExpertCaption.ToString();

                    imageExpert.ImageUrl      = expertToBind.GetThumbnailUrl(150, 150);
                    imageExpert.AlternateText = expertToBind.ExpertName;
                    linkExpert.NavigateUrl    = expertToBind.GetUrl();
                    litExpertType.Text        = expertToBind.GetExpertType();
                }

                HtmlGenericControl paragraphChatHeading   = (HtmlGenericControl)e.Item.FindControl("paragraphChatHeading");
                HyperLink          linkEventName          = (HyperLink)e.Item.FindControl("linkEventName");
                HyperLink          linkEventNameTruncated = (HyperLink)e.Item.FindControl("linkEventNameTruncated");

                paragraphChatHeading.Visible   = true;
                paragraphChatHeading.InnerText = eventToBind.EventHeading.Raw;
                linkEventName.Text             = eventToBind.ContentPage.PageTitle.Rendered;
                linkEventName.NavigateUrl      = linkEventNameTruncated.NavigateUrl = eventToBind.GetUrl();
                linkEventNameTruncated.Text    = UnderstoodDotOrg.Common.Helpers.TextHelper.TruncateText(
                    System.Web.HttpUtility.HtmlDecode(eventToBind.ContentPage.PageTitle.Raw), 15);
            }
        }