示例#1
0
        public ActionResult Edit(PagePath id)
        {
            var path = id ?? new WikiRoot();
            var page = _repository.Get(path);
            var revision = page.GetLatestRevision();

            var model = new EditViewModel {Path = path, Title = page.Title, Content = revision.RawBody};
            return View(model);
        }
示例#2
0
        public ActionResult Edit(EditViewModel model)
        {
            _pageService.UpdatePage(model.Path, model.Title, model.Content, model.Comment);

            return !User.IsInRole(WikiRole.User)
                       ? RedirectToAction("ReviewRequired", new {id = model.Path})
                       : this.RedirectToWikiPage(model.Path);
        }