public ActionResult ChalangeManagement()
        {
            var chalanges   = _chalangeRepository.GetAllOrderedByDay();
            var chalangesVM = new List <DetailChalangeViewModel>();

            foreach (var chalange in chalanges)
            {
                chalangesVM.Add(ChalangeMappers.ChalangeToDetailChalangeVM(chalange));
            }
            return(View(chalangesVM));
        }
        public ActionResult Index()
        {
            var chalangesVM = new List <ChalangeOverViewViewModel>();

            foreach (var chalange in _chalangeRepository.GetAllOrderedByDay())
            {
                chalangesVM.Add(ChalangeMappers.ChalangeToOverViewMap(chalange));
            }
            ViewBag.OrderByOptions = GetOrderBySelections();

            return(View("Index", chalangesVM));
        }
        public ActionResult Index()
        {
            var user               = _userRepository.GetById(User.Identity.GetUserId());
            var rankedUsers        = _userRepository.GetRankedUser();
            var chalanges          = _chalangeRepository.GetAllOrderedByDay();
            var propousalChalanges = _chalangeRepository.GetActivePropousalChalanges();

            var homePageVM = new HomePageViewModel()
            {
                Chalanges = new List <ChalangeOverViewViewModel>(
                    chalanges.Select(
                        x => ChalangeMappers.ChalangeToOverViewMap(x))),
                UserRanks = new List <UserRankViewModel>(
                    rankedUsers.Select(
                        x => UserMappers.UserToUsersRankMap(x))),
                ProposalChalangesRanks = new List <ProposalChalangeRankViewModel>(
                    propousalChalanges.Select(
                        x => ChalangeMappers.ProposalChalangeToProposalRankMap(x)))
            };

            return(View(homePageVM));
        }