Commit c13c4fc0 authored by Maxime Chaillet's avatar Maxime Chaillet

improve landing page layout for several authors, new logo and use esrf color

parent cffad822
......@@ -27,6 +27,7 @@
"dependencies": {
"jquery": "^3.2.1",
"dustjs-linkedin": "^2.7.5",
"bootstrap": "^3.3.7"
"bootstrap": "^3.3.7",
"dustjs-helpers": "^1.7.3"
}
}
......@@ -15,6 +15,7 @@
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/dustjs-linkedin/dist/dust-full.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/dustjs-helpers/dist/dust-helpers.min.js"></script>
<!-- endbower -->
<script src="min/doi-landing-page.min.js"></script>
......@@ -26,7 +27,7 @@
$(document).ready(function() {
var client = new ICATClient();
client.connect("id010100");
client.connect("myDoiNumberForTest");
});
......
function ICATClient(){this.server="https://icat.esrf.fr",this.sessionId=null,this.connection={plugin:"db",credentials:[{username:"reader",password:"reader"}]}}ICATClient.prototype.connect=function(e){var s=this;this.sessionId||$.ajax({url:this.server+"/icat/session",data:{json:JSON.stringify(this.connection)},type:"post",dataType:"json",success:function(n){s.sessionId=n.sessionId,s.getByDOI(e)},error:function(){alert("Sorry, there was a problem!")}})},ICATClient.prototype.getByDOI=function(e){var s="select inv from Investigation inv where inv.name='"+e+"' 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(e){console.log(e),dust.render("esrf-landing-page",{investigation:e[0].Investigation,investigationUsers:e[0].Investigation.investigationUsers},function(e,s){$("#main").html(s)})},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(s){var n=this;this.sessionId||$.ajax({url:this.server+"/icat/session",data:{json:JSON.stringify(this.connection)},type:"post",dataType:"json",success:function(e){n.sessionId=e.sessionId,n.getByDOI(s)},error:function(){alert("Sorry, there was a problem!")}})},ICATClient.prototype.getByDOI=function(s){var n="select inv from Investigation inv where inv.doi='"+s+"' 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:n},type:"GET",dataType:"json",success:function(s){console.log(s),dust.render("esrf-landing-page",{investigation:s[0].Investigation,investigationUsers:s[0].Investigation.investigationUsers},function(s,n){$("#main").html(n)})},error:function(){alert("Sorry, error while processing the DOI request !")}})};
\ 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-2 blueBackground\" > <img id=\"logo\" src=\"./src/esrfLogo.jpeg\"> </img> </div><div class=\"col-12 col-sm-10 blueBackground whiteVCenteredFont text-right align-middle\" > doi </div></div><div class=\"row\"><div class=\"col-8\" style=\"background-color:pink;\" > <label>Title</label><p>title of the DOI</p><label> Abstract </label><p>This is the abstract</p><label> Experimental report </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block\">Download experimental report </button> <label> Download data </label><button type=\"button\" class=\"btn btn-primary btn-lg btn-block\">Download experimental report </button></div><div class=\"col-4\" style=\"background-color:gray;\" ><div class=\"row\"><div class=\"col-12\" style=\"background-color:blue;\" ><label> Identifier </label><p> id</p><label> Authors </label><p> author 1</p><p> author 2</p><p> author 3</p><p> author 4</p><label> Publisher </label><p> esrf </p><label> Publication year </label><p> year </p><label> Proposal number </label><p> 007bond </p> \t</div></div></div></div></div>");}body_0.__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\">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
/* sets the backgrounds color the same as the buttons */
/* sets the display of the element to flex */
.flex{
display:flex;
}
/* sets the background color as esrf blue*/
.blueBackground{
background-color: #0275D8;
background-color: #3b3a58;
}
.grayBackground{
background-color: #dcdee2;
}
/* vertically center the font and sets its color to white */
.whiteVCenteredFont{
color: white;
margin-top: auto;
margin-bottom:auto;
}
/* make all button's text to wrap to a new line */
......@@ -16,7 +27,7 @@
/*sets all labels to bold */
label{
font-weight: bold;
font-weight: bold;
}
/* esrf logo */
......
function ICATClient(){
this.server = "https://icat.esrf.fr";
this.server = "https://linfalcon.esrf.fr:8181";
this.sessionId = null;
this.connection = {
plugin : 'db',
plugin : 'simple',
credentials : [
{
username : 'reader',
password :'reader'
username : 'root',
password :'root'
}
]
......@@ -39,7 +39,7 @@ ICATClient.prototype.connect = function(doi){
ICATClient.prototype.getByDOI = function(doi){
var _this = this;
var query = "select inv from Investigation inv where inv.name='" + doi + "' INCLUDE inv.investigationInstruments invInstruments, inv.investigationUsers invUser, invUser.user, invInstruments.instrument" ;
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: {
......
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-2 blueBackground" > <img id="logo" src="./src/esrfLogo.jpeg"> </img> </div>
<div class="col-12 col-sm-10 blueBackground whiteVCenteredFont text-right align-middle" > doi </div>
</div>
<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" > {investigation.doi} </div>
</div>
</div>
<div class="row">
<div class="col-8" style="background-color:pink;" >
<div class="col-8" >
<label>Title</label>
<p class="grayBackground"> {investigation.summary} </p>
<p>title of the DOI</p>
<label> Abstract </label>
<p>This is the abstract</p>
<p class="grayBackground"> </p>
<p>
<label> Experimental report </label>
<button type="button" class="btn btn-primary btn-lg btn-block">Download experimental report </button>
<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">Download experimental report </button>
<button type="button" class="btn btn-primary btn-lg btn-block blueBackground">Download experimental report </button>
</p>
</div>
<div class="col-4" style="background-color:gray;" >
<div class="col-4">
<div class="row">
<div class="col-12" style="background-color:blue;" >
<div class="col-12" >
<label> Identifier </label>
<p> id</p>
<p> {investigation.id}</p>
<label> Authors </label>
<p> author 1</p>
<p> author 2</p>
<p> author 3</p>
<p> author 4</p>
{#investigation.investigationUsers}
{@eq key=role value="Principal investigator"}
<p>{.user.fullName}</p>
{/eq}
{@eq key=role value="Proposal scientist"}
<p>{.user.fullName}</p>
{/eq}
{/investigation.investigationUsers}
<label> Publisher </label>
<p> esrf </p>
<p> ESRF </p>
<label> Publication year </label>
<p> year </p>
<label> Proposal number </label>
<p> 007bond </p>
<p> {investigation.name} </p>
</div>
</div>
</div>
</div>
</div>
{!
<div class="row">
<div class="col-sm-4" style="background-color:lavender;">{.investigation.name}</div>
<div class="col-sm-4" style="background-color:lavenderblush;">.col-sm-4</div>
<div class="col-sm-4" style="background-color:lavender;">.col-sm-4</div>
</div>
{#.investigationUsers}
<div class="row">
<div class="col-sm-12" style="background-color:lavender;">{.user.name}</div>
</div>nghfghfgty
{/.investigationUsers}
<div class="col-sm-12" style="background-color:lavender;">{.investigation.summary}</div>
<button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>
</div>
!}
\ No newline at end of file
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