Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StringBuilder().appendHTML().html {
- head {
- title { +"PHOSS: ${dataset.code.value}" }
- link {
- rel = "stylesheet"
- href = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
- integrity = "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
- attributes["crossorigin"] = "anonymous"
- }
- style {
- +".content {padding: 3rem 1.5rem;}"
- }
- }
- body {
- nav {
- classes = setOf("navbar", "navbar-expand-md", "navbar-dark", "bg-dark", "fixed-top")
- a("#") {
- classes = setOf("navbar-brand")
- +dataset.code.value
- }
- }
- main {
- role = "main"
- classes = setOf("container")
- div {
- classes = setOf("content")
- div(classes = "row") {
- dataset.molecules.map { molecule ->
- div(classes = "col-4") {
- div {
- classes = setOf("card", "molCard")
- div(classes = "card-body") {
- img(src = molecule.depiction,
- alt = "Molecule structure",
- classes = "card-img-top")
- h5 { +molecule.names.first() }
- table(classes = "table table-striped") {
- tbody {
- /*molecule.names.subList(1, molecule.names.size).let { list ->
- if (!list.isEmpty()) {
- tr {
- td { +"Other names" }
- td { +list.joinToString(" ") }
- }
- }
- }
- tr {
- td { +"InChI-Key" }
- td { +molecule.inchikey }
- }*/
- tr {
- td { +"InChI" }
- td { +molecule.inchi }
- }
- tr {
- td { +"Smiles" }
- td { +molecule.smiles }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- script {
- src = "https://code.jquery.com/jquery-3.4.1.slim.min.js"
- integrity = "sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
- attributes["crossorigin"] = "anonymous"
- }
- script {
- src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
- integrity = "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
- attributes["crossorigin"] = "anonymous"
- }
- script {
- src = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
- integrity = "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
- attributes["crossorigin"] = "anonymous"
- }
- }
- }.toString()
Advertisement
Add Comment
Please, Sign In to add comment