-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functions that allow you to customize some elements of the appl…
…ication and UI such as colors, fonts, header elements, and footer contents.
- Loading branch information
1 parent
e48ed19
commit 154717b
Showing
110 changed files
with
1,787 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.DS_Store | ||
datasets/sensible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"themes" : [{ | ||
"active" : true, | ||
"name" : "default", | ||
"author" : "Alessandro De Luca, IZSAM G. Caporale", | ||
"logo" : "img/logo.svg", | ||
"title" : { | ||
"it" : "SPREAD", | ||
"en" : "SPREAD" | ||
}, | ||
"favicon" : "img/logo.ico", | ||
"vars" : "css/vars.css", | ||
"modules" : { | ||
"header" : { | ||
"css" : "css/header.css", | ||
"html" : "html/header.html" | ||
}, | ||
"footer" : { | ||
"css" : "css/footer.css", | ||
"html" : "html/footer.html" | ||
} | ||
}, | ||
"version" : "1.0.0" | ||
}, { | ||
"active" : false, | ||
"name" : "genpat", | ||
"author" : "Alessandro De Luca, IZSAM G. Caporale", | ||
"logo" : "img/logo.svg", | ||
"title" : { | ||
"it" : "Piattaforma GenPat, SPREAD", | ||
"en" : "GenPat Platform, SPREAD" | ||
}, | ||
"favicon" : "img/logo.ico", | ||
"vars" : "css/vars.css", | ||
"modules" : { | ||
"header" : { | ||
"css" : "css/header.css", | ||
"html" : "html/header.html" | ||
}, | ||
"footer" : { | ||
"css" : "css/footer.css", | ||
"html" : "html/footer.html" | ||
} | ||
}, | ||
"version" : "1.0.0" | ||
}, { | ||
"active" : false, | ||
"name" : "cohesive", | ||
"author" : "Alessandro De Luca, IZSAM G. Caporale", | ||
"logo" : "img/logo.svg", | ||
"title" : { | ||
"it" : "Sistema Informativo COHESIVE, SPREAD", | ||
"en" : "COHESIVE Information System, SPREAD" | ||
}, | ||
"favicon" : "img/logo.ico", | ||
"vars" : "css/vars.css", | ||
"modules" : { | ||
"header" : { | ||
"css" : "css/header.css", | ||
"html" : "html/header.html" | ||
}, | ||
"footer" : { | ||
"css" : "css/footer.css", | ||
"html" : "html/footer.html" | ||
} | ||
}, | ||
"version" : "1.0.0" | ||
}], | ||
"copyright" : "© {__YEAR__} IZSAM G. Caporale" | ||
} |
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,17 @@ | |
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>COHESIVE Information System - SPREAD</title> | ||
<title>SPREAD</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="shortcut icon" href="img/cohesive-theme/favicon.ico"> | ||
<link rel="shortcut icon" href="themes/default/img/logo.ico"> | ||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/skeleton.css"> | ||
<link rel="stylesheet" href="css/iconic.css"> | ||
<link rel="stylesheet" href="css/cohesive-vars.css"> | ||
<link rel="stylesheet" href="css/custompages-base.css"> | ||
<link rel="stylesheet" href="css/dashboard-grapetree-view.css"> | ||
<link rel="stylesheet" href="css/cohesive-header.css"> | ||
<link rel="stylesheet" href="css/cohesive-footer.css"> | ||
<link rel="stylesheet" href="themes/default/css/vars.css"> | ||
<link rel="stylesheet" href="css/base.css"> | ||
<link rel="stylesheet" href="css/dashboard.css"> | ||
<link rel="stylesheet" href="themes/default/css/header.css"> | ||
<link rel="stylesheet" href="themes/default/css/footer.css"> | ||
|
||
<!-- libraries --> | ||
<!-- jquery-ui --> | ||
|
@@ -30,21 +30,15 @@ | |
</head> | ||
|
||
<body class="dashboard dashboard-grapetree"> | ||
<header class="header"> | ||
|
||
<header class="header"> | ||
<div class="top-bar"> | ||
<div class="platform-heading"> | ||
<div class="platoform-logo"> | ||
<img src="img/cohesive-theme/platform-logo.svg" alt="Logo"> | ||
</div> | ||
<div class="platform-title"> | ||
<h1>COHESIVE Information System, SPREAD</h1> | ||
</div> | ||
<!-- here custom contents for header, you can define them in themes/theme-name/html/header.html --> | ||
</div> | ||
<div class="toolbar"> | ||
<div class="tool tool-lang"> | ||
<div class="tool-label"> | ||
It | ||
</div> | ||
<div class="tool-label"></div> | ||
<div class="tool-trigger"> | ||
<i class="iconic iconic-globe"></i> | ||
</div> | ||
|
@@ -58,7 +52,7 @@ <h1>COHESIVE Information System, SPREAD</h1> | |
</div> | ||
</div> | ||
</header> | ||
|
||
<main> | ||
<section class="quick-actions"> | ||
<div class="tools-wrapper"> | ||
|
@@ -301,40 +295,17 @@ <h3 class="card-title" data-i18n-key="legend">Legend</h3> | |
</div> | ||
</section> | ||
|
||
<footer> | ||
<footer> | ||
<div class="footer-contents"> | ||
<div class="footer-close" onclick="gtiz_layout.showFooter()"><i class="iconic iconic-close-circle"></i></div> | ||
<div class="logo genpat-logo"> | ||
<img src="img/cohesive-theme/eu-emblem.svg" alt="EU Emblem"> | ||
</div> | ||
<div class="useful useful-disclaimer"> | ||
<p> | ||
This project is part of the European Joint Programme One Health EJP. This project has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No 773830. | ||
</p> | ||
<div class="footer-content"> | ||
<!-- here custom contents for footer, you can define them in themes/theme-name/html/footer.html --> | ||
</div> | ||
<div class="useful useful-links"> | ||
<h6 data-i18n-key="useful_links">Useful links</h6> | ||
<ul> | ||
<li><a href="https://onehealthejp.eu/">One Heakth EJP</a></li> | ||
<li><a href="https://www.izs.it/IZS/Eccellenza/Centri_nazionali/CRN_-_Sequenze_Genomiche" target="_blank"><span data-i18n-key="crn_genome_sequencing">CRN Genome Sequencing</span></a></li> | ||
<li><a href="https://github.com/achtman-lab/GrapeTree" target="_blank">GrapeTree Github</a></li> | ||
<li><a href="https://www.izs.it/IZS/" target="_blank">IZSAM "G. Caporale"</a></li> | ||
</ul> | ||
<div class="useful useful-help"> | ||
<h6 data-i18n-key="support">Support</h6> | ||
<ul> | ||
<li><a href="https://cohesive.izs.it/wiki/user/Dashboards/SPREAD/SPREAD.html" target="_blank">Wiki</a></li> | ||
<li><a href="mailto:[email protected]" target="_blank">[email protected]</a></li> | ||
<li><a href="tel:+3908613321" target="_blank">+39 0861 3321</a></li> | ||
</ul> | ||
</div> | ||
<div class="info"> | ||
<img src="img/cohesive-theme/izsam-logo.svg"> | ||
</div> | ||
<div class="footer-info"> | ||
<div class="info"> | ||
<p><span data-i18n-key="cookies_notice">This application does not use cookies.</span></p> | ||
<p><span data-i18n-key="last_updated_on">Last updated on</span> <span class="last-update-date">2024-05-03</span></p> | ||
<p class="copyright">© <span class="copyright-year"></span> IZSAM "G. Caporale"</p> | ||
<p><span data-i18n-key="cookies_notice">Questa applicazione non utilizza cookies.</span></p> | ||
<p><span data-i18n-key="last_updated_on">Last updated on</span> <span class="last-update-date">__LAST_UPDATE__</span></p> | ||
<p class="copyright">© <span class="copyright-year"></span> IZSAM 'G. Caporale'</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -372,5 +343,6 @@ <h6 data-i18n-key="support">Support</h6> | |
<script src="js/help.js"></script> | ||
<script src="js/map.js"></script> | ||
<script src="js/zooms.js"></script> | ||
<script src="js/app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
let gtiz_app = {}; | ||
|
||
gtiz_app.loadFooter = function(path, target) { | ||
fetch(path) | ||
.then(response => response.text()) | ||
.then(data => { | ||
if (!data) return; | ||
let node = document.querySelector(target); | ||
node.innerHTML = data; | ||
|
||
gtiz_locales.translate(node); | ||
}); | ||
} | ||
|
||
gtiz_app.loadHeader = function(path, target, name, title, logo) { | ||
fetch(path) | ||
.then(response => response.text()) | ||
.then(data => { | ||
if (!data) return; | ||
let node = document.querySelector(target); | ||
if (title) { | ||
data = data.replace('{app title}', title); | ||
} | ||
if (logo) { | ||
let src = 'themes/' + name + '/' + logo; | ||
data = data.replace('{app logo}', src); | ||
} | ||
node.innerHTML = data; | ||
}); | ||
} | ||
|
||
gtiz_app.setCopyright = function(copyright) { | ||
let copyright_node = document.querySelector('.copyright'); | ||
let year = new Date().getFullYear(); | ||
copyright_node.innerHTML = copyright.replace('{__YEAR__}', '<span class="copyright-year">' + year + '</span>'); | ||
} | ||
|
||
/** | ||
* Set theme for the app based on the active theme in app.json | ||
* | ||
* @param {Object} theme Active theme object form app.json | ||
*/ | ||
gtiz_app.setTheme = function(theme) { | ||
let languages = gtiz_locales.languages; | ||
let language = languages.find(element => element.active); | ||
let code = language ? language.code : 'en'; | ||
let name = theme.name ? theme.name : 'default'; | ||
let logo = theme.logo; | ||
let title = theme.title ? theme.title[code] : undefined; | ||
let favicon = theme.favicon; | ||
let modules = theme.modules; | ||
let header = modules ? modules.header : undefined; | ||
let footer = modules ? modules.footer : undefined; | ||
let vars = theme.vars; | ||
|
||
if (title) { | ||
document.title = title; | ||
} else { | ||
document.title = 'SPREAD'; | ||
} | ||
|
||
if (favicon) { | ||
let favicon_node = document.querySelector('link[rel="shortcut icon"]'); | ||
favicon_node.href = 'themes/' + name + '/' + favicon; | ||
} | ||
|
||
if (vars) { | ||
let stylesheet = document.querySelector('link[rel="stylesheet"][href*="vars"]'); | ||
stylesheet.href = 'themes/' + name + '/' + vars; | ||
} | ||
|
||
if (header) { | ||
if (header.css) { | ||
let stylesheet = document.querySelector('link[rel="stylesheet"][href*="header"]'); | ||
stylesheet.href = 'themes/' + name + '/' + header.css; | ||
} | ||
if (header.html) { | ||
let path = 'themes/' + name + '/' + header.html; | ||
gtiz_app.loadHeader(path, '.platform-heading', name, title, logo); | ||
} | ||
} | ||
|
||
if (footer) { | ||
if (footer.css) { | ||
let stylesheet = document.querySelector('link[rel="stylesheet"][href*="footer"]'); | ||
stylesheet.href = 'themes/' + name + '/' + footer.css; | ||
} | ||
if (footer.html) { | ||
let path = 'themes/' + name + '/' + footer.html; | ||
gtiz_app.loadFooter(path, '.footer-content'); | ||
} | ||
} | ||
|
||
}; | ||
|
||
gtiz_app.init = function() { | ||
let path = 'app.json'; | ||
|
||
fetch(path) | ||
.then(response => response.text()) | ||
.then(data => { | ||
let json = JSON.parse(data); | ||
if (json && json.themes && json.themes.length > 0) { | ||
let theme = json.themes.find(element => element.active === true); | ||
if (theme && Object.keys(theme).length > 0 ) { | ||
gtiz_app.setTheme(theme); | ||
} | ||
let copyright = json.copyright; | ||
if (copyright) { | ||
gtiz_app.setCopyright(copyright); | ||
} | ||
} | ||
gtiz_app.cfg = JSON.parse(data); | ||
gtiz_file_handler.init(); | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
}); | ||
}; | ||
|
||
gtiz_app.init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.