Exemplo n.º 1
0
        public ActionResult PageTitle()
        {
            var pageData  = _scContext.GetCurrentItem <IPageTitle>();
            var viewModel = new PageTitleViewModel
            {
                Title   = _builder.BuildHtmlString(pageData, p => p.Title).ToString(),
                Summary = _builder.BuildHtmlString(pageData, p => p.Summary).ToString()
            };

            return(this.React("PageTitle", viewModel));
        }
        public ActionResult PageHeaderCarousel()
        {
            var pageData = _scContext.GetItem <ICarousel>(_context.DataSource);

            var viewModel = new CarouselViewModel
            {
                CarouselId = CreateShortId(),
                Slides     = pageData.MediaSelector.Select(slide => new CarouselSlideViewModel
                {
                    Title       = _builder.BuildHtmlString(slide, item => item.MediaTitle).ToString(),
                    Description = _builder.BuildHtmlString(slide, item => item.MediaDescription).ToString(),
                    ImageUrl    = slide.MediaImage.Src,
                    Active      = ""
                })
            };

            return(this.React("PageHeaderCarousel", viewModel));
        }
Exemplo n.º 3
0
        public ActionResult EnableFacialRecognition()
        {
            if (string.IsNullOrWhiteSpace(_contextWrapper.DataSource))
            {
                return(View());
            }

            var viewModel      = new EnableFacialRecognitionViewModel();
            var dataSourceItem = _sitecoreContext.GetItem <IEnableFacialRecognition>(Guid.Parse(_contextWrapper.DataSource));

            if (dataSourceItem == null)
            {
                return(View());
            }

            viewModel.EnableFacialRecognitionLabel = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.EnableFacialRecognitionLabel);
            viewModel.InformationText = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.InformationText);
            viewModel.SaveButtonText  = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.SaveButtonText);
            viewModel.TitleText       = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.TitleText);
            viewModel.WebcamLabel     = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.WebcamLabel);
            viewModel.EnableFacialRecognitionPlaceholderText = dataSourceItem.EnableFacialRecognitionPlaceholderText;
            viewModel.WebcamAccessWarningLabel = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.WebcamAccessWarning);
            viewModel.SaveErrorLabel           = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.SaveErrorText);
            viewModel.SaveSuccessLabel         = _propertyBuilder.BuildHtmlString(dataSourceItem, x => x.SaveSuccessText);

            return(View(viewModel));
        }