Commit 8221e08a authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue26' into 'master'

Issue26  - Enable the download button and create a link to topcat

Closes #26

See merge request !23
parents da9164ad a4ffd70d
......@@ -57,9 +57,17 @@ body {
margin-bottom:auto;
}
.padding-top-15{
padding-top:15px;
}
.padding-bottom-15{
padding-bottom:15px;
}
/* ######################## For welcome page ############# */
.padding10{
margin:10px;
padding:10px;
}
.padding-0{
......
This diff is collapsed.
html{position:relative;min-height:100%}body{margin-bottom:60px}.footer{position:absolute;bottom:0;width:100%;height:60px;line-height:60px;background-color:#f4f4f4}.container{width:auto;max-width:680px;padding:0 15px}.flex{display:flex}.doiTitle{font-size:30px}.blueBackground{background-color:#132577!important}.lightRedBackground{background-color:#ffcaca!important}.grayBackground{background-color:#dcdee2}.whiteVCenteredFont{color:#fff;margin-top:auto;margin-bottom:auto}.padding10{margin:10px}.padding-0{padding-right:0;padding-left:0}.whiteBackground{background-color:#fff}.welcomeBanner{heigth:100px}.whiteFont{color:#fff}.flexCentered{display:flex;justify-content:center;align-items:center}.height100p{height:100%}.btn{white-space:normal}.btn-primary:hover{}.btn-primary{border-color:#132577;background-color:#132577}.btn-primary.disabled{background-color:#132577;border-color:#132577}.btn.disabled{opacity :.50}label{font-weight:700}#logo{height:50px}.card-header{background-color:#CFD1D2}.modal{display:none;position:absolute;z-index:1000;top:82px;bottom:60px;background:rgba(0,0,0,.05) url(../src/images/ajax-loader.gif) 50% 50% no-repeat}body.loading{overflow:hidden}body.loading .modal{display:block}
\ No newline at end of file
html{position:relative;min-height:100%}body{margin-bottom:60px}.footer{position:absolute;bottom:0;width:100%;height:60px;line-height:60px;background-color:#f4f4f4}.container{width:auto;max-width:680px;padding:0 15px}.flex{display:flex}.doiTitle{font-size:30px}.blueBackground{background-color:#132577!important}.lightRedBackground{background-color:#ffcaca!important}.grayBackground{background-color:#dcdee2}.whiteVCenteredFont{color:#fff;margin-top:auto;margin-bottom:auto}.padding-top-15{padding-top:15px}.padding-bottom-15{padding-bottom:15px}.padding10{padding:10px}.padding-0{padding-right:0;padding-left:0}.whiteBackground{background-color:#fff}.welcomeBanner{heigth:100px}.whiteFont{color:#fff}.flexCentered{display:flex;justify-content:center;align-items:center}.height100p{height:100%}.btn{white-space:normal}.btn-primary:hover{}.btn-primary{border-color:#132577;background-color:#132577}.btn-primary.disabled{background-color:#132577;border-color:#132577}.btn.disabled{opacity :.50}label{font-weight:700}#logo{height:50px}.card-header{background-color:#CFD1D2}.modal{display:none;position:absolute;z-index:1000;top:82px;bottom:60px;background:rgba(0,0,0,.05) url(../src/images/ajax-loader.gif) 50% 50% no-repeat}body.loading{overflow:hidden}body.loading .modal{display:block}
\ No newline at end of file
(function(dust){dust.register("doi-not-found-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid \" style=\"color:black;\"><div class=\"row\"><div class=\"col-3\"> </div><div class=\"col-6 lightRedBackground text-center rounded\"> <p> ").f(ctx.get(["message"], false),ctx,"h",["s"]).w(" </p> </div></div><div class=\"col-3\"> </div></div> ");}body_0.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("doi-not-found-page2",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["message"], false),ctx,"h",["s"]);}body_0.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("esrf-landing-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><br /><div class=\"row\"><div class=\"col-8\"><label>Title</label><div class=\"alert alert-dark\" role=\"alert\">").f(ctx.getPath(false, ["data","title"]),ctx,"h").w(" </div><label> Abstract </label><div class=\"alert alert-warning alert-dismissible fade show text-center align-middle\" role=\"alert\">There is no abstract for this DOI<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"> <span aria-hidden=\"true\">&times;</span></button></div><p class=\"grayBackground\"></p><p><label> Experimental report </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block disabled\">Download experimental report</button></p><p><label> Download data </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block disabled\">Download data</button></p></div><div class=\"col-4\"><div class=\"row\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header text-center\"><label>Authors </label></div><div class=\"card-body text-center\">").s(ctx.getPath(false, ["data","author"]),ctx,{"block":body_1},{}).w("</div></div></div></div><br/><div class=\"row\"> <div class=\"col-12\"><div class=\"card\"><div class=\"card-header text-center\"><label>Beamline </label></div>").h("eq",ctx,{"else":body_4,"block":body_5},{"key":ctx.getPath(false, ["data","beamlineUrl"]),"value":"noLink"},"h").w("</div></div></div><br/><div class=\"row\"><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Proposal number </label></div><div class=\"card-body text-center height100p\">").f(ctx.getPath(false, ["data","proposalNumber"]),ctx,"h").w("</div></div></div><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Proposal type </label></div><div class=\"card-body text-center height100p\">").f(ctx.getPath(false, ["data","proposalType"]),ctx,"h").w("</div></div></div></div><br/><div class=\"row\"><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Release year </label></div><div class=\"card-body text-center\" style=\"height: 100%;\">").f(ctx.getPath(false, ["data","issued","date-parts"]),ctx,"h").w("</div></div></div><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Publisher </label></div><div class=\"card-body text-center\">").f(ctx.getPath(false, ["data","publisher"]),ctx,"h").w("</div></div></div></div></div></div></div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(" ").x(ctx.getPath(true, ["given"]),ctx,{"else":body_2,"block":body_3},{}).w(" ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["literal"]),ctx,"h").w(" </br> ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["given"]),ctx,"h").w(" ").f(ctx.getPath(true, ["family"]),ctx,"h").w(" </br> ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(" <div class=\"card-body text-center\"><a href=\"").f(ctx.getPath(false, ["data","beamlineUrl"]),ctx,"h").w("\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </a> </div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("<div class=\"card-body text-center\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </div>");}body_5.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("esrf-landing-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><br /><div class=\"row\"><div class=\"col-8\"><label>Title</label><div class=\"alert alert-dark\" role=\"alert\">").f(ctx.getPath(false, ["data","title"]),ctx,"h").w(" </div><label> Abstract </label><div class=\"alert alert-warning alert-dismissible fade show text-center align-middle\" role=\"alert\">There is no abstract for this DOI<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"> <span aria-hidden=\"true\">&times;</span></button></div><label> Experimental report </label><div class=\"row padding10\"><div class=\"col-12 alert-warning padding-top-15 padding-bottom-15\"><button type=\"button\" class=\"btn btn-primary btn-lg btn-block disabled\">Download experimental report</button></div></div> <label> Download data </label><div class=\"row padding10\"><div class=\"col-12 alert-warning padding-top-15 padding-bottom-15\"><p> The data is currently only available to download if you are a member of the proposal team. </p><form action=\"https://icat.esrf.fr/#/browse/facility/ESRF/proposal/").f(ctx.getPath(false, ["data","proposalNumber"]),ctx,"h").w("/investigation/").f(ctx.getPath(false, ["data","investigationId"]),ctx,"h").w("/dataset\"><button type=\"submit\" class=\"btn btn-primary btn-lg btn-block\">Download data</button></form></div></div> </div><div class=\"col-4\"><div class=\"row\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header text-center\"><label>Authors </label></div><div class=\"card-body text-center\">").s(ctx.getPath(false, ["data","author"]),ctx,{"block":body_1},{}).w("</div></div></div></div><br/><div class=\"row\"> <div class=\"col-12\"><div class=\"card\"><div class=\"card-header text-center\"><label>Beamline </label></div>").h("eq",ctx,{"else":body_4,"block":body_5},{"key":ctx.getPath(false, ["data","beamlineUrl"]),"value":"noLink"},"h").w("</div></div></div><br/><div class=\"row\"><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Proposal number </label></div><div class=\"card-body text-center height100p\">").f(ctx.getPath(false, ["data","proposalNumber"]),ctx,"h").w("</div></div></div><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Proposal type </label></div><div class=\"card-body text-center height100p\">").f(ctx.getPath(false, ["data","proposalType"]),ctx,"h").w("</div></div></div></div><br/><div class=\"row\"><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Release year </label></div><div class=\"card-body text-center\" style=\"height: 100%;\">").f(ctx.getPath(false, ["data","issued","date-parts"]),ctx,"h").w("</div></div></div><div class=\"col-lg-6\"><div class=\"card\"><div class=\"card-header text-center\"><label>Publisher </label></div><div class=\"card-body text-center\">").f(ctx.getPath(false, ["data","publisher"]),ctx,"h").w("</div></div></div></div></div></div></div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(" ").x(ctx.getPath(true, ["given"]),ctx,{"else":body_2,"block":body_3},{}).w(" ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["literal"]),ctx,"h").w(" </br> ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["given"]),ctx,"h").w(" ").f(ctx.getPath(true, ["family"]),ctx,"h").w(" </br> ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(" <div class=\"card-body text-center\"><a href=\"").f(ctx.getPath(false, ["data","beamlineUrl"]),ctx,"h").w("\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </a> </div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("<div class=\"card-body text-center\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </div>");}body_5.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("welcome-page",body_0);function body_0(chk,ctx){return chk.w(" <div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 flexCentered whiteFont\" style=\"color:#132577; font-size: 4rem; height: 200px; margin-top: 10px; margin-bottom: 10px;\">ESRF Data Portal</div></div></div><div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center\"><h2>About the portal</h2></div><div class=\"card-body padding10\">This page centralizes the services offered by the ESRF to access data stored at the facility as part of its data policy.<ul><li>DOI search engine</li><li>Data catalogue <a href=\"https://icat.esrf.fr\"> icat.esrf.fr</a></li></ul></div></div></div><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center \"><h2>DOI resolver</h2></div><div class=\"card-body padding10\"><p>The search engine below only finds DOI which have been minted at ESRF. </br> Use <a href=\"https://doi.org\">doi.org </a> search engine for any other DOI.</p><div class=\"row\"><div class=\"col-xl-9 padding-0\"><input id=\"doiSearchBox\" class=\"form-control\" placeholder=\"10.5072/...\" type=\"text\" required/><div class=\"text-danger\" id=\"error\"> </div> </div><div class=\"col padding-0\"> <input class=\"btn btn-primary\" type=\"submit\" value=\"Search\" onclick=\"searchDOI()\" /> </div></div> </div> </div></div><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center\"><h2>About DOI</h2></div><div class=\"card-body padding10\">The Digital Object Identifier (<a href=\"https://www.doi.org/\">DOI</a>) is a code composed of digits and characters. It identifies data in aunique and perennial way thus referencing this data worldwide. The DOI has two parts namely the DOI prefixand the DOI suffix separated by a slash (\"/\") as depicted below :</p><pre>prefix/suffix </pre></div></div></div></div></div>");}body_0.__dustBody=!0;return body_0}(dust));
\ No newline at end of file
......@@ -25,10 +25,13 @@ DOIController.prototype.getData = function(doi) {
complete : function() {
_this.view.setLoading(false);
},
success : function(doiData) {
if (doiData) {
// extract fields from data.categories
// extract fields from doiData.categories
extractFieldsFromCategories(doiData);
//extractInvestigationId from doiData.doi
extractFieldsFromDoi(doiData);
// Retrieve the URL corresponding to the beamline name. Currently, the date of the
// experiment is calculated from the publicationYear.
var experimentalYear = doiData.issued["date-parts"] - 3 ;
......@@ -156,4 +159,13 @@ function extractFieldsFromCategories(data) {
data.proposalType = catArray[index];
}
}
}
\ No newline at end of file
}
//Extract investigationId from the data.doi field as received from the json response.
//Add the corresponding fields in the data object
//@data: the data object, it is a reference
function extractFieldsFromDoi(data) {
//extract the investigationId given doi starts with 10.5072 or 10.15151
var regExp = RegExp(/^10\.(5072|15151)\/esrf-es-(\d+)/);
data.investigationId = regExp.exec(data.DOI)[2];
}
......@@ -13,16 +13,25 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<p class="grayBackground"></p>
<p>
<label> Experimental report </label>
<button type="button" class="btn btn-primary btn-lg btn-block disabled">Download experimental report</button>
</p>
<p>
<label> Experimental report </label>
<div class="row padding10">
<div class="col-12 alert-warning padding-top-15 padding-bottom-15">
<button type="button" class="btn btn-primary btn-lg btn-block disabled">Download experimental report</button>
</div>
</div>
<label> Download data </label>
<button type="button" class="btn btn-primary btn-lg btn-block disabled">Download data</button>
</p>
<div class="row padding10">
<div class="col-12 alert-warning padding-top-15 padding-bottom-15">
<p> The data is currently only available to download if you are a member of the proposal team. </p>
<form action="https://icat.esrf.fr/#/browse/facility/ESRF/proposal/{data.proposalNumber}/investigation/{data.investigationId}/dataset">
<button type="submit" class="btn btn-primary btn-lg btn-block">Download data</button>
</form>
</div>
</div>
</div>
<div class="col-4">
<div class="row">
<div class="col-12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment