mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Indicate capped history revisions only when they're actually capped (#14000)
We've recently added a limit to the posts history modal so it displays the last 100 revisions only for performance reasons. However, the title of the modal now always says `History, last 100 revisions` even when the post has fewer than 100 revisions which can be a bit noisy. This PR amends the history modal so the title of the modal says `History` when the post's revisions count is ≤100, and `History, last 100 revisions` when it has more >100 revisions.
This commit is contained in:
@@ -46,6 +46,15 @@ export default Controller.extend(ModalFunctionality, {
|
||||
previousTagChanges: customTagArray("model.tags_changes.previous"),
|
||||
currentTagChanges: customTagArray("model.tags_changes.current"),
|
||||
|
||||
@discourseComputed("post.version")
|
||||
modalTitleKey(version) {
|
||||
if (version > 100) {
|
||||
return "history_capped_revisions";
|
||||
} else {
|
||||
return "history";
|
||||
}
|
||||
},
|
||||
|
||||
@discourseComputed(
|
||||
"previousVersion",
|
||||
"model.current_version",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{#d-modal-body title="history" maxHeight="70%"}}
|
||||
{{#d-modal-body title=modalTitleKey maxHeight="70%"}}
|
||||
<div id="revision">
|
||||
<div id="revision-details">
|
||||
{{d-icon "pencil-alt"}}
|
||||
|
||||
@@ -3402,7 +3402,8 @@ en:
|
||||
one: "user"
|
||||
other: "users"
|
||||
category_title: "Category"
|
||||
history: "History, last 100 revisions"
|
||||
history_capped_revisions: "History, last 100 revisions"
|
||||
history: "History"
|
||||
changed_by: "by %{author}"
|
||||
|
||||
raw_email:
|
||||
|
||||
Reference in New Issue
Block a user