files lock_at/unlock_at data weren't showing correctly

first of all they were backwards, so if you set unlock_at
it would act like you'd set lock_at.  second of all,
it wasn't actually setting the display date correctly
so it would say "will be unlocked at " with no date.

fixes #3714

Change-Id: I4346247d83a3cf132b8483a2f8c8220f70e7ab11
Reviewed-on: https://gerrit.instructure.com/2206
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
This commit is contained in:
Brian Whitmer 2011-02-08 12:39:42 -07:00
parent f70fb147c2
commit 0e9120e8b1
1 changed files with 8 additions and 8 deletions

View File

@ -1308,10 +1308,10 @@ var files = {};
var download_folder_url = $.replaceTags($("." + data.context_string + "_folder_url").attr('href') + "/download", 'id', data.id);
$(".download_zip_link").attr('href', download_folder_url);
$(".upload_zip_link").attr('href', $("." + data.context_string + "_import_url").attr('href') + "?return_to=" + encodeURIComponent(location.href) + "&folder_id=" + data.id);
data.unlock_at_string = $.parseFromISO(data.unlock_at).datetime_string;
data.lock_at_string = $.parseFromISO(data.lock_at).datetime_string;
$panel.find(".lock_until").showIf(data.lock_at);
$panel.find(".lock_after").showIf(data.unlock_at);
data.unlock_at_string = $.parseFromISO(data.unlock_at).datetime_formatted;
data.lock_at_string = $.parseFromISO(data.lock_at).datetime_formatted;
$panel.find(".lock_after").showIf(data.lock_at);
$panel.find(".lock_until").showIf(data.unlock_at);
$panel.find(".currently_locked_box").showIf(data.currently_locked);
$panel.find(".lock_item_link").showIf(data.parent_folder_id && !data.currently_locked);
$panel.find(".unlock_item_link").showIf(data.parent_folder_id && data.currently_locked);
@ -1409,10 +1409,10 @@ var files = {};
// show a file control panel with file size, download link, etc.
var $panel = $("#file_panel");
var $preview = null;
data.unlock_at_string = $.parseFromISO(data.unlock_at).datetime_string;
data.lock_at_string = $.parseFromISO(data.lock_at).datetime_string;
$panel.find(".lock_until").showIf(data.lock_at);
$panel.find(".lock_after").showIf(data.unlock_at);
data.unlock_at_string = $.parseFromISO(data.unlock_at).datetime_formatted;
data.lock_at_string = $.parseFromISO(data.lock_at).datetime_formatted;
$panel.find(".lock_after").showIf(data.lock_at);
$panel.find(".lock_until").showIf(data.unlock_at);
$panel.find(".currently_locked_box").showIf(data.currently_locked);
$panel.find(".lock_item_link").showIf(!data.currently_locked);
$panel.find(".unlock_item_link").showIf(data.currently_locked);