Skip to content

Commit

Permalink
Fix the data package table headers
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenwalker committed Jan 26, 2017
1 parent cd70baa commit cd44a4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
3 changes: 3 additions & 0 deletions metacatui/src/main/webapp/js/themes/dataone/css/metacatui.css
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ tr.table-header{
tr.table-header th{
text-align: center;
}
.table-header a {
color: #FFF;
}
.table-header .subtle {
color: #D9E4EC;
font-weight: lighter;
Expand Down
15 changes: 10 additions & 5 deletions metacatui/src/main/webapp/js/views/MetadataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ define(['jquery',
});
}
else{
var title = packageModel.get("id") ? '<span class="subtle">Package: ' + packageModel.get("id") + '</span>' : "";
title = "Files in this dataset " + title;
viewRef.insertPackageTable(packageModel, {title: title});
// var title = packageModel.get("id") ? '<span class="subtle">Package: ' + packageModel.get("id") + '</span>' : "";
//title = "Files in this dataset " + title;
viewRef.insertPackageTable(packageModel);
}

//Remove the extra download button returned from the XSLT since the package table will have all the download links
Expand Down Expand Up @@ -638,7 +638,7 @@ define(['jquery',
//Parse text for older versions of Metacat (v2.4.3 and earlier)
if(parseText){
var labelEl = $(georegion).find('label:contains("' + direction + '")');
if(labelEl){
if(labelEl.length){
var coordinate = $(labelEl).next().html();
if(coordinate.indexOf("&nbsp;") > -1) coordinate = coordinate.substring(0, coordinate.indexOf("&nbsp;"));
}
Expand All @@ -648,14 +648,19 @@ define(['jquery',
}

//Save our coordinate value
coordinates.push(coordinate);
if(typeof coordinate != "undefined")
coordinates.push(coordinate);
});

//If there are no coordinates, we have no map to render, so exit.
if(!coordinates.length) return;

//Extract the coordinates
var n = coordinates[0];
var s = coordinates[1];
var e = coordinates[2];
var w = coordinates[3];

}

//Create Google Map LatLng objects out of our coordinates
Expand Down
12 changes: 11 additions & 1 deletion metacatui/src/main/webapp/js/views/PackageTableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define(['jquery', 'underscore', 'backbone', 'models/PackageModel', 'text!templat
this.currentlyViewing = options.currentlyViewing || null;
this.numVisible = options.numVisible || 4;
this.parentView = options.parentView || null;
this.title = options.title || "Files in this dataset";
this.title = options.title || "";
this.nested = (typeof options.nested === "undefined")? false : options.nested;

//Set up the Package model
Expand Down Expand Up @@ -134,6 +134,16 @@ define(['jquery', 'underscore', 'backbone', 'models/PackageModel', 'text!templat
}
}

if(!this.title){
this.title = '<a href="#view/' + metadata.get("id") +
'">Files in this dataset';

if(this.model.get("id"))
this.title += '<span class="subtle"> Package: ' + this.model.get("id") + '</span>';

this.title += '</a>';
}

this.$el.html(this.template({
downloadButton : downloadButtonHTML,
readsEnabled : this.readsEnabled,
Expand Down

0 comments on commit cd44a4e

Please sign in to comment.