Exemplo n.º 1
0
        /// <summary>
        /// Renders appropriate list view depending on the <see cref="ListTemplateName" />
        /// </summary>
        /// <returns>
        /// The <see cref="ActionResult" />.
        /// </returns>
        public ActionResult Index()
        {
            var viewModel = this.Model.CreateListViewModel(null, 1);

            var redirectPageUrlTemplate = UrlHelpers.GetRedirectPagingUrl();

            this.InitializeListViewBag(redirectPageUrlTemplate);

            var fullTemplateName = EventSchedulerController.ListTemplateNamePrefix + this.ListTemplateName;

            if (this.Model.ContentViewDisplayMode == ContentViewDisplayMode.Detail)
            {
                return(this.Details((Event)viewModel.Items.First().DataItem));
            }

            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                if (viewModel.ContentType != null)
                {
                    this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
                }
            }

            return(this.View(fullTemplateName, this.Model));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Renders appropriate list view depending on the <see cref="ListTemplateName" />
        /// </summary>
        /// <param name="page">The page.</param>
        /// <returns>
        /// The <see cref="ActionResult" />.
        /// </returns>
        public ActionResult Index(int?page)
        {
            var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;

            this.ViewBag.CurrentPageUrl          = this.GetPageUrl();
            this.ViewBag.RedirectPageUrlTemplate = this.ViewBag.CurrentPageUrl + UrlHelpers.GetRedirectPagingUrl();

            if (!this.IsEmpty)
            {
                ITaxon taxonFilter = TaxonUrlEvaluator.GetTaxonFromQuery(this.HttpContext, this.Model.UrlKeyPrefix);

                var viewModel = this.Model.CreateListViewModel(taxonFilter: taxonFilter, page: page ?? 1);
                if (SystemManager.CurrentHttpContext != null)
                {
                    this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                    if (viewModel.ContentType != null)
                    {
                        this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
                    }
                }

                return(this.View(fullTemplateName, viewModel));
            }

            return(new EmptyResult());
        }
        /// <summary>
        /// Renders appropriate list view depending on the <see cref="ListTemplateName" />
        /// </summary>
        /// <param name="taxonFilter">The taxonomy filter.</param>
        /// <param name="page">The page.</param>
        /// <returns>
        /// The <see cref="ActionResult" />.
        /// </returns>
        public virtual ActionResult ListByTaxon(ITaxon taxonFilter, int?page)
        {
            if (this.Model.HideListView(this.Request.RequestContext))
            {
                return(this.Content(string.Empty));
            }

            var redirectPageUrlTemplate = UrlHelpers.GetRedirectPagingUrl(taxonFilter, this.ViewBag.UrlParams, this.HttpContext.Request.QueryString.ToQueryString());

            this.InitializeListViewBag(redirectPageUrlTemplate);

            var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);

            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                if (viewModel.ContentType != null)
                {
                    this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
                }
            }

            var fullTemplateName = this.FullListTemplateName();

            return(this.View(fullTemplateName, viewModel));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Lists the by taxon.
        /// </summary>
        /// <param name="taxonFilter">The taxon filter.</param>
        /// <param name="page">The page.</param>
        /// <returns></returns>
        public ActionResult ListByTaxon(ITaxon taxonFilter, int? page)
        {
            var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;
            this.ViewBag.CurrentPageUrl = this.GetCurrentPageUrl();
            this.ViewBag.RedirectPageUrlTemplate = this.ViewBag.CurrentPageUrl + UrlHelpers.GetRedirectPagingUrl(taxonFilter, this.ViewBag.UrlParams, this.HttpContext.Request.QueryString.ToQueryString());

            var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);
            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                if (viewModel.ContentType != null)
                    this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
            }

            return this.View(fullTemplateName, viewModel);
        }
        /// <summary>
        /// Lists the by taxon.
        /// </summary>
        /// <param name="taxonFilter">The taxon filter.</param>
        /// <param name="page">The page.</param>
        /// <returns></returns>
        public ActionResult ListByTaxon(ITaxon taxonFilter, int?page)
        {
            var fullTemplateName = this.GetFullListTemplateName();

            this.ViewBag.CurrentPageUrl          = this.GetCurrentPageUrl();
            this.ViewBag.RedirectPageUrlTemplate = this.ViewBag.CurrentPageUrl + UrlHelpers.GetRedirectPagingUrl(taxonFilter, this.ViewBag.UrlParams, this.HttpContext.Request.QueryString.ToQueryString());
            this.ViewBag.DetailsPageId           = this.DetailsPageId;
            this.ViewBag.OpenInSamePage          = this.OpenInSamePage;

            var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);

            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
            }

            return(this.View(fullTemplateName, viewModel));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Renders appropriate list view depending on the <see cref="ListTemplateName" />
        /// </summary>
        /// <param name="taxonFilter">The taxonomy filter.</param>
        /// <param name="page">The page.</param>
        /// <returns>
        /// The <see cref="ActionResult" />.
        /// </returns>
        public ActionResult ListByTaxon(ITaxon taxonFilter, int?page)
        {
            var fullTemplateName        = EventController.ListTemplateNamePrefix + this.ListTemplateName;
            var redirectPageUrlTemplate = UrlHelpers.GetRedirectPagingUrl(taxonFilter);

            this.InitializeListViewBag(redirectPageUrlTemplate);

            var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);

            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                if (viewModel.ContentType != null)
                {
                    this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
                }
            }

            return(this.View(fullTemplateName, viewModel));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Renders appropriate list view depending on the <see cref="ListTemplateName" />
        /// </summary>
        /// <param name="taxonFilter">The taxonomy filter.</param>
        /// <param name="page">The page.</param>
        /// <returns>
        /// The <see cref="ActionResult" />.
        /// </returns>
        public ActionResult ListByTaxon(ITaxon taxonFilter, int?page)
        {
            var fullTemplateName = this.listTemplateNamePrefix + this.ListTemplateName;

            this.ViewBag.CurrentPageUrl          = this.GetCurrentPageUrl();
            this.ViewBag.RedirectPageUrlTemplate = this.ViewBag.CurrentPageUrl + UrlHelpers.GetRedirectPagingUrl(taxonFilter);
            this.ViewBag.DetailsPageId           = this.DetailsPageId;
            this.ViewBag.OpenInSamePage          = this.OpenInSamePage;

            var viewModel = this.Model.CreateListViewModel(taxonFilter, page ?? 1);

            if (SystemManager.CurrentHttpContext != null)
            {
                this.AddCacheDependencies(this.Model.GetKeysOfDependentObjects(viewModel));
                if (viewModel.ContentType != null)
                {
                    this.AddCacheVariations(viewModel.ContentType, viewModel.ProviderName);
                }
            }

            return(this.View(fullTemplateName, viewModel));
        }