Merge pull request #5276 from nottalulah/wiki-locks
show locked/unlocked changes on wiki page histories
This commit is contained in:
@@ -37,6 +37,8 @@ class WikiPageVersion < ApplicationRecord
|
|||||||
title: "Renamed",
|
title: "Renamed",
|
||||||
was_deleted: "Deleted",
|
was_deleted: "Deleted",
|
||||||
was_undeleted: "Undeleted",
|
was_undeleted: "Undeleted",
|
||||||
|
was_locked: "Locked",
|
||||||
|
was_unlocked: "Unlocked",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -63,6 +65,24 @@ class WikiPageVersion < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def was_locked(type)
|
||||||
|
other = send(type)
|
||||||
|
if type == "previous"
|
||||||
|
is_locked && !other.is_locked
|
||||||
|
else
|
||||||
|
!is_locked && other.is_locked
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def was_unlocked(type)
|
||||||
|
other = send(type)
|
||||||
|
if type == "previous"
|
||||||
|
!is_locked && other.is_locked
|
||||||
|
else
|
||||||
|
is_locked && !other.is_locked
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.available_includes
|
def self.available_includes
|
||||||
[:updater, :wiki_page, :tag]
|
[:updater, :wiki_page, :tag]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user