public ActionResult PostEntryConfig(EntryConfigModel m) { if (m.SelectedId == null) ModelState.AddModelError("selectedId", "You must select an entry from the list."); if (ModelState.IsValid) { var appSvc = AppServiceRepository.GetService(); var include = appSvc.GetInclude<IdInclude>(m.IncludePath); include.Id = m.SelectedId; AppServiceRepository.UpdateService(appSvc); return Json(new { success = true, includePath = m.IncludePath }); } LoadEntryConfig(m); return PartialView("WidgetEntryConfig", m); }
private void LoadEntryConfig(EntryConfigModel m) { if (m.SelectedId != null) { var entry = AtomPubService.GetEntry(m.SelectedId); m.SelectedTitle = entry.Title.ToString(); } m.Scopes = AuthorizeService.GetScopes(this.User.Identity as User); var scope = new Scope() { Workspace = m.CurrentWorkspace, Collection = m.CurrentCollection }; if (m.CurrentWorkspace == null) { scope = m.Scopes.First(); m.CurrentWorkspace = scope.Workspace; m.CurrentCollection = scope.Collection; } m.Entries = AtomPubService.GetEntries(new EntryCriteria() { WorkspaceName = scope.Workspace, CollectionName = scope.Collection, Authorized = false, Published = true }, (m.Page ?? 1) - 1, 50); }
public ActionResult EntryConfig(EntryConfigModel m) { if (m.IncludePath != null) { var include = AppService.GetInclude<IdInclude>(m.IncludePath); if (include.Id != null) m.SelectedId = include.Id.ToString(); } LoadEntryConfig(m); return PartialView("WidgetEntryConfig", m); }