Skip to content

Commit 1e55206

Browse files
committed
UI, Collections: show deleted and hidden warnings on collection list items
1 parent 0c79680 commit 1e55206

File tree

6 files changed

+43
-4
lines changed

6 files changed

+43
-4
lines changed

client/galaxy/scripts/mvc/collection/collection-li.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,32 @@ var DCListItemView = FoldoutListItemView.extend(
7474
/** underscore templates */
7575
DCListItemView.prototype.templates = (function(){
7676

77+
var warnings = _.extend( {}, FoldoutListItemView.prototype.templates.warnings, {
78+
error : BASE_MVC.wrapTemplate([
79+
// error during index fetch - show error on dataset
80+
'<% if( model.error ){ %>',
81+
'<div class="errormessagesmall">',
82+
_l( 'There was an error getting the data for this collection' ), ': <%- model.error %>',
83+
'</div>',
84+
'<% } %>'
85+
]),
86+
purged : BASE_MVC.wrapTemplate([
87+
'<% if( model.purged ){ %>',
88+
'<div class="purged-msg warningmessagesmall">',
89+
_l( 'This collection has been deleted and removed from disk' ),
90+
'</div>',
91+
'<% } %>'
92+
]),
93+
deleted : BASE_MVC.wrapTemplate([
94+
// deleted not purged
95+
'<% if( model.deleted && !model.purged ){ %>',
96+
'<div class="deleted-msg warningmessagesmall">',
97+
_l( 'This collection has been deleted' ),
98+
'</div>',
99+
'<% } %>'
100+
])
101+
});
102+
77103
// use element identifier
78104
var titleBarTemplate = BASE_MVC.wrapTemplate([
79105
'<div class="title-bar clear" tabindex="0">',
@@ -85,6 +111,7 @@ DCListItemView.prototype.templates = (function(){
85111
], 'collection' );
86112

87113
return _.extend( {}, FoldoutListItemView.prototype.templates, {
114+
warnings : warnings,
88115
titleBar : titleBarTemplate
89116
});
90117
}());

client/galaxy/scripts/mvc/history/hdca-li.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ var HDCAListItemView = _super.extend(
5353
/** underscore templates */
5454
HDCAListItemView.prototype.templates = (function(){
5555

56+
var warnings = _.extend( {}, _super.prototype.templates.warnings, {
57+
hidden : BASE_MVC.wrapTemplate([
58+
// add a warning when hidden
59+
'<% if( !collection.visible ){ %>',
60+
'<div class="hidden-msg warningmessagesmall">',
61+
_l( 'This collection has been hidden' ),
62+
'</div>',
63+
'<% } %>'
64+
], 'collection' )
65+
});
66+
5667
// could steal this from hda-base (or use mixed content)
5768
var titleBarTemplate = BASE_MVC.wrapTemplate([
5869
// adding the hid display to the title
@@ -68,6 +79,7 @@ HDCAListItemView.prototype.templates = (function(){
6879
], 'collection' );
6980

7081
return _.extend( {}, _super.prototype.templates, {
82+
warnings : warnings,
7183
titleBar : titleBarTemplate
7284
});
7385
}());

static/maps/mvc/collection/collection-li.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/maps/mvc/history/hdca-li.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/scripts/mvc/collection/collection-li.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)