Displays update_time throughout library view

This commit is contained in:
Brad Langhorst
2019-07-07 11:15:39 -04:00
parent 72f3d25d09
commit f8d75a7c2c
3 changed files with 19 additions and 1 deletions
@@ -703,6 +703,12 @@ var LibraryDatasetView = Backbone.View.extend({
<td><%= _.escape(item.get("file_size")) %></td>
</tr>
<% } %>
<% if (item.get("update_time")) { %>
<tr>
<th scope="row">Date last updated (UTC)</th>
<td><%= _.escape(item.get("update_time")) %></td>
</tr>
<% } %>
<% if (item.get("date_uploaded")) { %>
<tr>
<th scope="row">Date uploaded (UTC)</th>
@@ -880,6 +886,12 @@ var LibraryDatasetView = Backbone.View.extend({
<td><%= _.escape(ldda.get("file_size")) %></td>
</tr>
<% } %>
<% if (ldda.get("update_time")) { %>
<tr>
<th scope="row">Date last updated (UTC)</th>
<td><%= _.escape(ldda.get("update_time")) %></td>
</tr>
<% } %>
<% if (ldda.get("date_uploaded")) { %>
<tr>
<th scope="row">Date uploaded (UTC)</th>
@@ -1006,6 +1018,10 @@ var LibraryDatasetView = Backbone.View.extend({
<th scope="row">Size</th>
<td><%= _.escape(item.get("file_size")) %></td>
</tr>
<tr>
<th scope="row">Date last updated (UTC)</th>
<td><%= _.escape(item.get("update_time")) %></td>
</tr>
<tr>
<th scope="row">Date uploaded (UTC)</th>
<td><%= _.escape(item.get("date_uploaded")) %></td>
@@ -517,7 +517,7 @@ var FolderListView = Backbone.View.extend({
<span title="Sorted by Size" class="sort-icon-raw_size fa"></span>
</th>
<th style="width:160px;">
<a class="sort-folder-update_time" title="Click to reverse order" href='#'>Time Updated (UTC)</a>
<a class="sort-folder-update_time" title="Click to reverse order" href='#'>Date Updated (UTC)</a>
<span title="Sorted by Date" class="sort-icon-update_time fa"></span>
</th>
<th style="width:5%;">
+2
View File
@@ -101,6 +101,7 @@ class LibraryDatasetsManager(datasets.DatasetAssociationManager):
ldda.dbkey = new_genome_build
changed = True
if changed:
ldda.updateParentFolderUpdateTimes()
trans.sa_session.add(ldda)
trans.sa_session.flush()
return changed
@@ -223,6 +224,7 @@ class LibraryDatasetsManager(datasets.DatasetAssociationManager):
rval['full_path'] = full_path
rval['file_size'] = util.nice_size(int(ldda.get_size()))
rval['date_uploaded'] = ldda.create_time.strftime("%Y-%m-%d %I:%M %p")
rval['update_time'] = ldda.update_time.strftime("%Y-%m-%d %I:%M %p")
rval['can_user_modify'] = trans.user_is_admin or trans.app.security_agent.can_modify_library_item(current_user_roles, ld)
rval['is_unrestricted'] = trans.app.security_agent.dataset_is_public(ldda.dataset)
rval['tags'] = self.tag_handler.get_tags_str(ldda.tags)