Пример #1
0
        public ActionResult Show(string galleryName, string filter, string sort)
        {
            var gallery  = GalleryService.GetGallery(galleryName, true, User, filter, sort);
            var settings = GalleryService.GetGallerySettings(galleryName);

            // add some data to view data dictionary
            ViewBag.Filter        = filter;
            ViewBag.SortOrder     = sort;
            ViewBag.AllowUpload   = settings.UploadEnabled;
            ViewBag.VotingEnabled = settings.VotingEnabled;
            ViewBag.StatsEnabled  = settings.StatsEnabled;
            ViewBag.IsAdminUser   = GalleryService.IsAdminUser(User);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_GalleryImages", gallery));
            }
            else
            {
                return(View("Show", gallery));
            }
        }