Guest User

Untitled

a guest
Apr 21st, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. StringBuilder().appendHTML().html {
  2. head {
  3. title { +"PHOSS: ${dataset.code.value}" }
  4. link {
  5. rel = "stylesheet"
  6. href = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
  7. integrity = "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
  8. attributes["crossorigin"] = "anonymous"
  9. }
  10. style {
  11. +".content {padding: 3rem 1.5rem;}"
  12.  
  13. }
  14. }
  15. body {
  16. nav {
  17. classes = setOf("navbar", "navbar-expand-md", "navbar-dark", "bg-dark", "fixed-top")
  18. a("#") {
  19. classes = setOf("navbar-brand")
  20. +dataset.code.value
  21. }
  22. }
  23.  
  24. main {
  25. role = "main"
  26. classes = setOf("container")
  27. div {
  28. classes = setOf("content")
  29. div(classes = "row") {
  30. dataset.molecules.map { molecule ->
  31. div(classes = "col-4") {
  32. div {
  33. classes = setOf("card", "molCard")
  34. div(classes = "card-body") {
  35. img(src = molecule.depiction,
  36. alt = "Molecule structure",
  37. classes = "card-img-top")
  38. h5 { +molecule.names.first() }
  39. table(classes = "table table-striped") {
  40. tbody {
  41. /*molecule.names.subList(1, molecule.names.size).let { list ->
  42. if (!list.isEmpty()) {
  43. tr {
  44. td { +"Other names" }
  45. td { +list.joinToString(" ") }
  46. }
  47. }
  48. }
  49. tr {
  50. td { +"InChI-Key" }
  51. td { +molecule.inchikey }
  52. }*/
  53. tr {
  54. td { +"InChI" }
  55. td { +molecule.inchi }
  56. }
  57. tr {
  58. td { +"Smiles" }
  59. td { +molecule.smiles }
  60. }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70.  
  71. script {
  72. src = "https://code.jquery.com/jquery-3.4.1.slim.min.js"
  73. integrity = "sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
  74. attributes["crossorigin"] = "anonymous"
  75. }
  76. script {
  77. src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
  78. integrity = "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
  79. attributes["crossorigin"] = "anonymous"
  80. }
  81. script {
  82. src = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
  83. integrity = "sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
  84. attributes["crossorigin"] = "anonymous"
  85. }
  86. }
  87.  
  88. }.toString()
Advertisement
Add Comment
Please, Sign In to add comment