Commit e46c2d60 authored by Maxime Chaillet's avatar Maxime Chaillet
Browse files

fix merge

parents 7ca9c0c1 ab6a881a
Pipeline #1609 failed with stages
This diff is collapsed.
.flex{display:flex}.blueBackground{background-color:#132577!important}.lightRedBackground{background-color:#ffcaca!important}.grayBackground{background-color:#dcdee2}.whiteVCenteredFont{color:#fff;margin-top:auto;margin-bottom:auto}.btn{white-space:normal}.btn-primary:hover{background-color:#5b5a78;border-color:#2b2a48}.btn-primary{border-color:#2b2a48}label{font-weight:700}#logo{height:50px}.modal{display:none;position:fixed;z-index:1000;top:20;left:20;height:100%;width:100%;background:rgba(255,255,255,.8) url(../src/ajax-loader.gif) 50% 50% no-repeat}body.loading{overflow:hidden}body.loading .modal{display:block}
\ No newline at end of file
<div class="container-fluid">
<div class="row">
<div class="col-3" > </div>
<div class="col-6 blueBackground text-center" > <img src="./src/esrfLogo.png"> </img> </div>
<div class="col-3"> </div>
</div>
<div class="row">
<div class="col-12 text-center" > <h2> Not found </h2> </div>
</div>
<div class="row">
<div class="col-3" > </div>
<div class="col-6 lightRedBackground text-center" > <p> {message} </p> </div>
<div class="col-3" > </div>
</div>
</div>
\ No newline at end of file
......@@ -12,7 +12,7 @@ module.exports = function(grunt) {
},
watch: {
files: ['<%= jshint.files %>', 'templates/**js'],
tasks: [ 'uglify','dustjs','wiredep']
tasks: [ 'uglify','dustjs','cssmin','wiredep']
},
uglify: {
options: {
......
This diff is collapsed.
......@@ -5,28 +5,35 @@
<title>details from DOI</title>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="/min/output.min.css" >
<link rel="stylesheet" href="min/output.min.css" >
</head>
<script src="/min/doi-landing-page.min.js"></script>
<script src="/min/precompiled.templates.min.js"></script>
<script src="min/doi-landing-page.min.js"></script>
<script src="min/precompiled.templates.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var params = new URLSearchParams(document.location.search.substring(1));
console.log(params);
new ICATClient().connect(params.get("DOI"));
});
$(document).on({
ajaxStart: function(){ $("body").addClass("loading");},
ajaxStop: function() { $("body").removeClass("loading"); }
});
</script>
</head>
<body>
<div id='main'></div>
<div id='main' ></div>
<div class="modal"> <!-- nothing to write here --></div>
</body>
</html>
(function(dust){dust.register("esrf-landing-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 col-sm-4 blueBackground\" > <img id=\"logo\" src=\"./src/esrfLogo.png\"> </img> </div><div class=\"col-12 col-sm-8 blueBackground flex\"> <div class=\"col-12 whiteVCenteredFont text-right\" > ").f(ctx.getPath(false, ["investigation","doi"]),ctx,"h").w(" </div></div></div><div class=\"row\"><div class=\"col-8\" > <label>Title</label><p class=\"grayBackground\"> ").f(ctx.getPath(false, ["investigation","summary"]),ctx,"h").w(" </p><label> Abstract </label><p class=\"grayBackground\"> </p><p><label> Experimental report </label> <button type=\"button\" class=\"btn btn-primary btn-lg btn-block blueBackground disabled\" style='background-color:#D7D7D7; border:1px solid #D7D7D7;'>Download experimental report </button> </p><p><label> Download data </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block blueBackground disabled\" style='background-color:#D7D7D7; border:1px solid #D7D7D7;'>Download data </button></p></div><div class=\"col-4\"><div class=\"row\"> <div class=\"col-12\" ><label> Identifier </label><p> ").f(ctx.getPath(false, ["investigation","id"]),ctx,"h").w("</p><label> Authors </label>").s(ctx.getPath(false, ["investigation","investigationUsers"]),ctx,{"block":body_1},{}).w("<label> Publisher </label><p> ESRF </p><label> Publication year </label><p> year </p><label> Proposal number </label><p> ").f(ctx.getPath(false, ["investigation","name"]),ctx,"h").w(" </p> \t</div></div></div></div></div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("eq",ctx,{"block":body_2},{"key":ctx.get(["role"], false),"value":"Principal investigator"},"h").h("eq",ctx,{"block":body_3},{"key":ctx.get(["role"], false),"value":"Proposal scientist"},"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w(" <p>").f(ctx.getPath(true, ["user","fullName"]),ctx,"h").w("</p> ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<p>").f(ctx.getPath(true, ["user","fullName"]),ctx,"h").w("</p>");}body_3.__dustBody=!0;return body_0}(dust));
\ No newline at end of file
(function(dust){dust.register("esrf-landing-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 col-sm-4 blueBackground\" > <img id=\"logo\" src=\"./src/esrfLogo.png\"> </img> </div><div class=\"col-12 col-sm-8 blueBackground flex\"> <div class=\"col-12 whiteVCenteredFont text-right\" > ").f(ctx.getPath(false, ["investigation","doi"]),ctx,"h").w(" </div></div></div><div class=\"row\"><div class=\"col-8\" > <label>Title</label><p class=\"grayBackground\"> ").f(ctx.getPath(false, ["investigation","summary"]),ctx,"h").w(" </p><label> Abstract </label><p class=\"grayBackground\"> </p><p><label> Experimental report </label> <button type=\"button\" class=\"btn btn-primary btn-lg btn-block blueBackground disabled\" style='background-color:#D7D7D7; border:1px solid #D7D7D7;'>Download experimental report </button> </p><p><label> Download data </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block blueBackground disabled\" style='background-color:#D7D7D7; border:1px solid #D7D7D7;'>Download data </button></p></div><div class=\"col-4\"><div class=\"row\"> <div class=\"col-12\" ><label> Identifier </label><p> ").f(ctx.getPath(false, ["investigation","id"]),ctx,"h").w("</p><label> Authors </label>").s(ctx.getPath(false, ["investigation","investigationUsers"]),ctx,{"block":body_1},{}).w("<label> Publisher </label><p> ESRF </p><label> Publication year </label><p> year </p><label> Proposal number </label><p> ").f(ctx.getPath(false, ["investigation","name"]),ctx,"h").w(" </p> \t</div></div></div></div></div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("eq",ctx,{"block":body_2},{"key":ctx.get(["role"], false),"value":"Principal investigator"},"h").h("eq",ctx,{"block":body_3},{"key":ctx.get(["role"], false),"value":"Proposal scientist"},"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w(" <p>").f(ctx.getPath(true, ["user","fullName"]),ctx,"h").w("</p> ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<p>").f(ctx.getPath(true, ["user","fullName"]),ctx,"h").w("</p>");}body_3.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("handling-error-page",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-3\" > </div><div class=\"col-6 blueBackground text-center\" > <img src=\"./src/esrfLogo.png\"> </img> </div><div class=\"col-3\"> </div></div><div class=\"row\"><div class=\"col-12 text-center\" > <h2> Not found </h2> </div></div><div class=\"row\"><div class=\"col-3\" > </div><div class=\"col-6 lightRedBackground text-center\" > <p> ").f(ctx.get(["message"], false),ctx,"h").w(" </p> </div><div class=\"col-3\" > </div></div></div>");}body_0.__dustBody=!0;return body_0}(dust));
\ No newline at end of file
function ICATClient(){
function ICATClient() {
this.server = "https://linfalcon.esrf.fr:8181";
this.sessionId = null;
this.connection = {
plugin : 'simple',
credentials : [
{
username : 'root',
password :'root'
}
]
};
plugin : 'simple',
credentials : [ {
username : 'root',
password : 'root'
} ]
};
}
ICATClient.prototype.connect = function(doi){
var _this = this;
if (!this.sessionId){
$.ajax({
url: this.server + "/icat/session",
data: { json : JSON.stringify(this.connection) },
type: "post",
dataType : "json",
success: function( data ) {
_this.sessionId = data.sessionId;
_this.getByDOI(doi);
ICATClient.prototype.connect = function (doi) {
var _this = this;
if (!this.sessionId) {
$.ajax({
url : this.server + "/icat/session",
data : {
json : JSON.stringify(this.connection)
},
type : "post",
dataType : "json",
success : function (data) {
_this.sessionId = data.sessionId;
_this.getByDOI(doi);
},
error: function() {
alert( "Sorry, there was a problem!" );
}
});
}
},
error : function () {
dust.render(
'handling-error-page',
{
message : "Sorry, there was a connexion problem with the server. Please contact the webmaster."
}, function (err, out) {
$("#main").html(out);
});
}
});
}
};
ICATClient.prototype.getByDOI = function(doi){
var _this = this;
var query = "select inv from Investigation inv where inv.doi='" + doi + "' INCLUDE inv.investigationInstruments invInstruments, inv.investigationUsers invUser, invUser.user, invInstruments.instrument" ;
$.ajax({
url: this.server + "/icat/entityManager",
data: {
sessionId: _this.sessionId,
ICATClient.prototype.getByDOI = function (doi) {
var _this = this;
var query = "select inv from Investigation inv where inv.doi='" +
doi +
"' INCLUDE inv.investigationInstruments invInstruments, inv.investigationUsers invUser, invUser.user, invInstruments.instrument";
$.ajax({
url : this.server + "/icat/entityManager",
data : {
sessionId : _this.sessionId,
server : this.server,
query : query
},
type: "GET",
dataType : "json",
success: function( data ) {
if ( typeof data[0] !== "undefined" )
{
dust.render('esrf-landing-page',
{
investigation : data[0].Investigation,
investigationUsers : data[0].Investigation.investigationUsers
},
function(err, out) {
query : query
},
type : "GET",
dataType : "json",
success : function (data) {
if (typeof data[0] !== "undefined") {
dust.render(
'esrf-landing-page',
{
investigation : data[0].Investigation,
investigationUsers : data[0].Investigation.investigationUsers
}, function (err, out) {
$("#main").html(out);
});
} else {
dust.render('handling-error-page', {
message : "Sorry, the requested DOI was not found."
}, function (err, out) {
$("#main").html(out);
});
}
else {
alert("The DOI number " + doi + " was not found !");
}
},
// Code to run if the request fails
error: function() {
alert( "Sorry, error while processing the DOI request !" );
}
});
};
}
},
// Code to run if the request fails
error : function () {
dust.render(
'handling-error-page',
{
message : "Sorry, error while processing the request. Please contact the webmaster."
}, function (err, out) {
$("#main").html(out);
});
}
});
};
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