show unlock date for files and pages in locked modules
test plan: * create a module * add a wiki page and an attachment as module items * set the module to unlock on a future date * try to visit the page or file as a student * should show the unlock date in the message closes #CNVS-6681 Change-Id: Id311b029bc8bfe7c087550ca233a40b4f6d3c543 Reviewed-on: https://gerrit.instructure.com/22190 Reviewed-by: Bracken Mosbacker <bracken@instructure.com> Product-Review: Bracken Mosbacker <bracken@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: August Thornton <august@instructure.com>
This commit is contained in:
parent
c18188a670
commit
2df5b5b7e9
|
@ -1201,6 +1201,7 @@ class Attachment < ActiveRecord::Base
|
|||
locked = {:asset_string => self.asset_string, :lock_at => self.lock_at}
|
||||
elsif self.could_be_locked && item = locked_by_module_item?(user, opts[:deep_check_if_needed])
|
||||
locked = {:asset_string => self.asset_string, :context_module => item.context_module.attributes}
|
||||
locked[:unlock_at] = locked[:context_module]["unlock_at"] if locked[:context_module]["unlock_at"]
|
||||
end
|
||||
locked
|
||||
end
|
||||
|
|
|
@ -198,6 +198,7 @@ class WikiPage < ActiveRecord::Base
|
|||
locked = false
|
||||
if (m && !m.available_for?(user))
|
||||
locked = {:asset_string => self.asset_string, :context_module => m.attributes}
|
||||
locked[:unlock_at] = locked[:context_module]["unlock_at"] if locked[:context_module]["unlock_at"]
|
||||
end
|
||||
locked
|
||||
end
|
||||
|
|
|
@ -43,7 +43,7 @@ module HasContentTags
|
|||
end
|
||||
|
||||
def locked_cache_key(user)
|
||||
['_locked_for', self, user].cache_key
|
||||
['_locked_for2', self, user].cache_key
|
||||
end
|
||||
|
||||
def clear_locked_cache(user)
|
||||
|
|
Loading…
Reference in New Issue