-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "save and continue" button to admin menu node and content type editors #17515
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,7 +23,15 @@ | |||||
</div> | ||||||
|
||||||
<div class="mb-3"> | ||||||
<button class="btn btn-success save" type="submit">@T["Save"]</button> | ||||||
<div class="btn-group mb-1"> | ||||||
<button class="btn btn-success save" type="submit" name="submit" value="save">@T["Save"]</button> | ||||||
<button type="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" data-reference="parent" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||||||
<span class="visually-hidden">@T["Toggle Dropdown"]</span> | ||||||
</button> | ||||||
<div class="dropdown-menu"> | ||||||
<button class="dropdown-item save-continue" type="submit" name="submit" value="saveAndContinue">@T["and continue"]</button> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it's in line with the other such features. Also do the same for the content type editor.
Suggested change
|
||||||
</div> | ||||||
</div> | ||||||
|
||||||
<a class="btn btn-danger delete" | ||||||
asp-action="Delete" | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -149,7 +149,7 @@ public async Task<ActionResult> CreatePOST(CreateTypeViewModel viewModel) | |||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
[Admin("ContentTypes/Edit/{id}", "EditType")] | ||||||||||||||||||||||||||||||||||||
public async Task<ActionResult> Edit(string id) | ||||||||||||||||||||||||||||||||||||
public async Task<ActionResult> Edit(string id, string submit) | ||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||
if (!await _authorizationService.AuthorizeAsync(User, ContentTypesPermissions.EditContentTypes)) | ||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||
|
@@ -164,7 +164,14 @@ public async Task<ActionResult> Edit(string id) | |||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
typeViewModel.Editor = await _contentDefinitionDisplayManager.BuildTypeEditorAsync(typeViewModel.TypeDefinition, _updateModelAccessor.ModelUpdater); | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
if (String.Equals(submit, "save", StringComparison.Ordinal)) | ||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||
return RedirectToAction(nameof(List)); | ||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
else if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | ||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
Comment on lines
+167
to
+174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||
return View(typeViewModel); | ||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the same in the other places.