Ejemplo n.º 1
0
        public ActionResult Resources(int languageId)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageLanguages))
            {
                return(AccessDeniedView());
            }

            ViewBag.AllLanguages = _languageService.GetAllLanguages(true)
                                   .Select(x => new DropDownItem
            {
                Selected = (x.Id.Equals(languageId)),
                Text     = x.Name,
                Value    = x.Id.ToString()
            }).ToList();
            var language = _languageService.GetLanguageById(languageId);

            ViewBag.LanguageId   = languageId;
            ViewBag.LanguageName = language.Name;

            var resources = _localizationService.GetAllResourcesByLanguageId(languageId);
            var gridModel = new GridModel <LanguageResourceModel>
            {
                Data  = resources.Take(_adminAreaSettings.GridPageSize).Select(x => x.Value.ToModel()),
                Total = resources.Count
            };

            return(View(gridModel));
        }