It references #1

parent 5419c11d
......@@ -28,6 +28,13 @@ module.exports = function(grunt) {
src: 'index.html'
}
},
cssmin: {
my_target: {
src: 'css/*.css',
dest: 'min/output.min.css'
}
},
dustjs : {
compile : {
files : {
......@@ -42,6 +49,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-wiredep');
grunt.loadNpmTasks('grunt-dustjs');
grunt.registerTask('default', ['jshint', 'dustjs', 'uglify', 'wiredep']);
grunt.loadNpmTasks('grunt-css');
grunt.registerTask('default', ['jshint', 'dustjs', 'uglify', 'cssmin', 'wiredep']);
};
......@@ -5,7 +5,7 @@
/* sets the background color as esrf blue*/
.blueBackground{
background-color: #3b3a58;
background-color: #132577 !important;
}
.grayBackground{
......
......@@ -6,9 +6,11 @@
<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="src/doi.css">
<!-- bower:css -->
<!-- endbower -->
<link rel="stylesheet" href="min/output.min.css" >
</head>
<!-- bower:js -->
......@@ -26,9 +28,7 @@
<script type="text/javascript">
$(document).ready(function() {
var params = new URLSearchParams(document.location.search.substring(1));
var doi = params.get("DOI");
var client = new ICATClient();
client.connect(doi);
new ICATClient().connect(params.get("DOI"));
});
</script>
......@@ -36,4 +36,4 @@ $(document).ready(function() {
<body>
<div id='main'></div>
</body>
</html>
\ No newline at end of file
</html>
function ICATClient(){this.server="https://linfalcon.esrf.fr:8181",this.sessionId=null,this.connection={plugin:"simple",credentials:[{username:"root",password:"root"}]}}ICATClient.prototype.connect=function(n){var s=this;this.sessionId||$.ajax({url:this.server+"/icat/session",data:{json:JSON.stringify(this.connection)},type:"post",dataType:"json",success:function(e){s.sessionId=e.sessionId,s.getByDOI(n)},error:function(){alert("Sorry, there was a problem!")}})},ICATClient.prototype.getByDOI=function(n){var s="select inv from Investigation inv where inv.doi='"+n+"' 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:s},type:"GET",dataType:"json",success:function(s){console.log(s),void 0!==s[0]?dust.render("esrf-landing-page",{investigation:s[0].Investigation,investigationUsers:s[0].Investigation.investigationUsers},function(n,s){$("#main").html(s)}):alert("The DOI number "+n+" was not found !")},error:function(){alert("Sorry, error while processing the DOI request !")}})};
\ No newline at end of file
function ICATClient(){this.server="https://linfalcon.esrf.fr:8181",this.sessionId=null,this.connection={plugin:"simple",credentials:[{username:"root",password:"root"}]}}ICATClient.prototype.connect=function(n){var s=this;this.sessionId||$.ajax({url:this.server+"/icat/session",data:{json:JSON.stringify(this.connection)},type:"post",dataType:"json",success:function(e){s.sessionId=e.sessionId,s.getByDOI(n)},error:function(){alert("Sorry, there was a problem!")}})},ICATClient.prototype.getByDOI=function(n){var s="select inv from Investigation inv where inv.doi='"+n+"' 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:s},type:"GET",dataType:"json",success:function(s){void 0!==s[0]?dust.render("esrf-landing-page",{investigation:s[0].Investigation,investigationUsers:s[0].Investigation.investigationUsers},function(n,s){$("#main").html(s)}):alert("The DOI number "+n+" was not found !")},error:function(){alert("Sorry, error while processing the DOI request !")}})};
\ No newline at end of file
.flex{display:flex}.blueBackground{background-color:#132577}.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}
\ 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\">Download experimental report </button> </p><p><label> Download data </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block blueBackground\">Download experimental report </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));
\ No newline at end of file
......@@ -10,7 +10,6 @@ function ICATClient(){
password :'root'
}
]
};
}
......@@ -50,7 +49,7 @@ ICATClient.prototype.getByDOI = function(doi){
type: "GET",
dataType : "json",
success: function( data ) {
console.log(data);
if ( typeof data[0] !== "undefined" )
{
dust.render('esrf-landing-page',
......
......@@ -15,18 +15,18 @@
<p class="grayBackground"> </p>
<p>
<label> Experimental report </label>
<button type="button" class="btn btn-primary btn-lg btn-block blueBackground">Download experimental report </button>
<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">Download experimental report </button>
<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="row">
<div class="col-12" >
<label> Identifier </label>
<p> {investigation.id}</p>
......
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