コード例 #1
0
        public PartialViewResult DoubleMetroTileForSponsors()
        {
            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Sponsors",
                TileLinkControllerName = "Home",
                TileDisplayName = "Sponsors",
                TileBackgroundCssClass = "blueLightTile" // "singleTileGreenImage",
            };

            var defaultEvent = service.GetDefaultEvent();
            var sponsors = new List<Sponsor>(service.GetSponsors(defaultEvent.ID));

            foreach (Sponsor sponsor in sponsors)
            {
                if (!string.IsNullOrEmpty(sponsor.Name) && sponsor.Image != null)
                {
                    tileViewModel.MetroTileIcons.Add(new MetroTileImage(new Infrastructure.WebImageOCC(sponsor.Image))
                    {
                        AltText = sponsor.Name,
                        Title = string.Format("{0} ({1} sponsor)", sponsor.Name, sponsor.SponsorshipLevel.Replace("sponsor", String.Empty)),
                        AnchorTagUri = sponsor.WebsiteUrl
                    });
                }
            }
            tileViewModel.MetroTileIcons.Shuffle();

            return PartialView("_DoubleMetroTile", tileViewModel);
        }
コード例 #2
0
        public PartialViewResult DoubleMetroTileForCCPhotos()
        {
            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Index",
                TileLinkControllerName = "Home",
                TileDisplayName = "Codecamp 2014 Photos",
                TileBackgroundCssClass = "greenTile"
            };

            tileViewModel.MetroTileIcons.Add(new MetroTileImage("~/Content/Avatar/2014.jpg")
            {
                AltText = "Codecamp 2014 Photos",
                Title = "Codecamp 2014 Photos",
                //AnchorTagUri = "https://www.facebook.com/media/set/?set=oa.10152344594037028&type=1"
            });

            return PartialView("_DoubleMetroTile", tileViewModel);
        }
コード例 #3
0
        public PartialViewResult SingleMetroTileForAccount()
        {
            /* We'll probably want to check to see if the user is logged in and if so, show their
             * profile picture as the main image on the tile (referencing a path to the "IconUri")
             * and then change the "TileDisplayName" to their username or first and last name. Also change
             * the tile's link to go to the users profile page instead of the login page.
             *
             * An idea I had was to put a notification icon overlayed on their profile picture for times when
             * we need them to address an issue with their profile (i.e. T-shirt size, food requirements, etc).
             *
             * Also might want to add some logic that checks to see if the retrieved image is larger than
             * (height)110 x (width)128.  If it is larger than that, set the "IconHeight" and "IconWidth" to the max
             * values of 110x128, otherwise set them to the height and width of the image.*/

            var tileViewModel = new MetroTileViewModel
                                {
                                    TileLinkActionName = "LogOn",
                                    TileLinkControllerName = "Account",
                                    TileDisplayName = "Login",
                                    TileBackgroundCssClass = "singleTileGreenImage",
                                    DefaultTileIcon = this.defaultSingleIcon
                                };
            tileViewModel.MetroTileIcons.Add(item: new MetroTileIcon
                                                   {
                                                       PathUri = "../../Content/themes/Shared/BlankUser.png",
                                                       AltText = "Login or sign up",
                                                       Title = "Login or Sign up"
                                                   });
            tileViewModel.MetroTileIcons.Add(new MetroTileIcon
                                             {
                                                 PathUri = "../../Content/themes/Shared/onetug.113x132.jpg",
                                                 AltText = "The only tug",
                                                 Title = "The only tug"
                                             });
            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #4
0
        public PartialViewResult SingleMetroTileForAgenda()
        {
            var tileViewModel = new MetroTileViewModel
                                {
                                    TileLinkActionName = "Agenda",
                                    TileLinkControllerName = "Home",
                                    TileDisplayName = "Agenda",
                                    TileBackgroundCssClass = "singleTileGreenImage",
                                    DefaultTileIcon = this.defaultSingleIcon
                                };

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #5
0
        public PartialViewResult SingleMetroTileForSponsors()
        {
            var tileViewModel = new MetroTileViewModel
                                {
                                    TileLinkActionName = "Sponsors",
                                    TileLinkControllerName = "Home",
                                    TileDisplayName = "Sponsors",
                                    TileBackgroundCssClass = "singleTileGreenImage",
                                    DefaultTileIcon = this.defaultSingleIcon
                                };

                var sponsors = service.GetSponsors(1);
                foreach (var sponsor in sponsors)
                {
                    if (!string.IsNullOrEmpty(sponsor.Name) && !string.IsNullOrEmpty(sponsor.ImageUrl))
                    {
                        tileViewModel.MetroTileIcons.Add(new MetroTileIcon
                                                         {
                                                             PathUri = sponsor.ImageUrl,
                                                             AltText = sponsor.Name,
                                                             Title = sponsor.Name
                                                         });
                    }
                }

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #6
0
        public PartialViewResult SingleMetroTileForVolunteers()
        {
            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Volunteers",
                TileLinkControllerName = "Home",
                TileDisplayName = "Volunteers",
                DefaultTileImage = new MetroTileImage("../../Content/themes/Metro/MetroIcons/QVolunteer.png")
                {
                    AltText = "Volunteers",
                    Title = "Volunteers"
                },
                TileBackgroundCssClass = "limeTile"
            };

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #7
0
        public PartialViewResult SingleMetroTileForVenue()
        {
            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Venue",
                TileLinkControllerName = "Home",
                TileDisplayName = "Venue",
                TileBackgroundCssClass = "singleTileMapImage",
                DefaultTileImage = new MetroTileImage("../../Content/themes/Metro/MetroIcons/BlankImage-1x1.png")
                {
                    AltText = "Venue",
                    Title = "Venue"
                }
            };

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #8
0
        public PartialViewResult SingleMetroTileForSpeakers()
        {
            var defaultEvent = service.GetDefaultEvent();
            int speakersCount = service.GetSpeakersCount(defaultEvent.ID);

            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Speakers",
                TileLinkControllerName = "Home",
                TileDisplayName = "Speakers",
                TileBackgroundCssClass = "redTile",
                DefaultTileImage = new MetroTileImage("../../Content/themes/Metro/MetroIcons/QSpeaker.png")
                {
                    AltText = "Speakers",
                    Title = "Speakers"
                },
                TileNotificationMessage = speakersCount.ToString()
            };

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #9
0
        public PartialViewResult SingleMetroTileForAgenda()
        {
            var tileViewModel = new MetroTileViewModel
            {
                TileLinkActionName = "Agenda",
                TileLinkControllerName = "Home",
                TileDisplayName = "Agenda",
                TileBackgroundCssClass = "greenTile",
                DefaultTileImage = new MetroTileImage("../../Content/themes/Metro/MetroIcons/QAgenda.png")
                {
                    AltText = "Agenda",
                    Title = "Agenda"
                }
            };

            return PartialView("_SingleMetroTile", tileViewModel);
        }
コード例 #10
0
        public PartialViewResult SingleMetroTileForAccount()
        {
            MetroTileImage metroTileImage = null;
            MetroTileViewModel metroTileViewModel = null;

            if (CurrentUser != null)
            {
                metroTileViewModel = new MetroTileViewModel
                {
                    TileLinkActionName = "UpdateProfile",
                    TileLinkControllerName = "Account",
                    TileDisplayName = "Update Profile",
                    TileBackgroundCssClass = "singleTileGreenImage"
                };

                Person user = CurrentUser;

                if (!String.IsNullOrEmpty(user.ImageUrl))
                {
                    metroTileImage = new MetroTileImage(user.ImageUrl)
                    {
                        AltText = user.FullName,
                        Title = string.Format("Welcome, {0}", user.FirstName)
                    };
                }
            }
            else
            {
                metroTileViewModel = new MetroTileViewModel
                {
                    TileLinkActionName = "LogOn",
                    TileLinkControllerName = "Account",
                    TileDisplayName = "Login / Register",
                    TileBackgroundCssClass = "singleTileGreenImage"
                };

                metroTileImage = new MetroTileImage("../../Content/themes/Shared/BlankUser.png")
                {
                    AltText = "Login or Register",
                    Title = "Login or Register"
                };
            }

            if (metroTileImage == null)
            {
                metroTileImage = new MetroTileImage("../../Content/themes/Shared/BlankUser.png")
                {
                    AltText = "Login or Register",
                    Title = "Login or Register"
                };
            }

            metroTileViewModel.MetroTileIcons.Add(item: metroTileImage);
            metroTileViewModel.MetroTileIcons.Add(new MetroTileImage("../../Content/themes/Shared/SpaceNeedle.ico")
            {
                AltText = "The only tug",
                Title = "The only tug"
            });

            return PartialView("_SingleMetroTile", metroTileViewModel);
        }