dashboard.j2 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>{{ title }}</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=2">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  10. <script src="https://tttt.fangmeier.tech/hl/shCore.js" type="text/javascript"></script>
  11. <script src="https://tttt.fangmeier.tech/hl/shBrushPython.js" type="text/javascript"></script>
  12. <link href="https://tttt.fangmeier.tech/hl/shCore.css" rel="stylesheet" type="text/css" />
  13. <link href="https://tttt.fangmeier.tech/hl/shThemeDefault.css" rel="stylesheet" type="text/css" />
  14. <script src="https://tttt.fangmeier.tech/hl/shAutoloader.js" type="text/javascript"></script>
  15. <script type="text/x-mathjax-config">
  16. MathJax.Hub.Config({
  17. config: ["MMLorHTML.js"],
  18. jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  19. extensions: ["MathMenu.js", "MathZoom.js"]
  20. });
  21. </script>
  22. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML-full"> </script>
  23. </head>
  24. <body>
  25. <div class="container-fluid">
  26. {% for r, plot_row in enumerate(plots) %}
  27. <div class="row">
  28. {% for c, plot in enumerate(plot_row) %}
  29. <div class="col-md-4">
  30. <div class="well">
  31. {% if plot.title %}
  32. <h3 class="text-center">{{ plot.title }}</h3>
  33. {% endif %}
  34. <div>
  35. <a href="#" title="{{ plot.name }}">
  36. <img src="data:img/png;base64,{{ plot.data }}" style="width:100%" class="thumbnail img-responsive">
  37. </a>
  38. </div>
  39. <div class="caption">
  40. <p class="text-center"> {{ plot.name }} </p>
  41. <div class="panel-group" id="accordion{{ r }}{{ c }}">
  42. {% for id, (i,j) in enumerate(plot.docs.keys()) %}
  43. <div class="panel-heading">
  44. <h4 class="panel-title">
  45. <button data-toggle="collapse" data-parent="#accordion{{ r }}{{ c }}" class="btn btn-info" href="#collapse{{r}}-{{c}}-{{id}}">
  46. Plot at ({{ i+1 }}, {{ j+1 }})</button>
  47. </h4>
  48. </div>
  49. <div id="collapse{{r}}-{{c}}-{{id}}" class="panel-collapse collapse">
  50. <div class="panel-body">
  51. {% for doc, argdict, txt in zip(plot.docs[(i,j)], plot.argdicts[(i,j)], plot.txts[(i,j)]) %}
  52. <div class="text-left">{{ doc|safe }}</div>
  53. <div class="text-left">{{ txt|safe }}</div>
  54. <hr>
  55. <p class="text-left"><strong>Plot Arguments</strong></p>
  56. <table class="table table-hover">
  57. <tbody>
  58. {% for key, val in argdict.items() %}
  59. <tr>
  60. <td>{{ key }}</td> <td>{{ val }}</td>
  61. </tr>
  62. {% endfor %}
  63. </tbody>
  64. </table>
  65. {% endfor %}
  66. </div>
  67. </div>
  68. {% endfor %}
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. {% endfor %}
  74. </div>
  75. {% endfor %}
  76. <div class="row">
  77. <div class="col-12-lg">
  78. <div class="panel-group" id="accordion">
  79. <div class="panel-heading">
  80. <h4 class="panel-title" style="text-align:center">
  81. <button data-toggle="collapse" data-parent="#accordion" class="btn btn-default" href="#collapseSrc">Figure Source Code</button>
  82. {% if ana_source %}
  83. <a class="btn btn-default" href="{{ ana_source }}" target="_blank">Analysis Source Code</a>
  84. {% endif %}
  85. </h4>
  86. </div>
  87. <div id="collapseSrc" class="panel-collapse collapse">
  88. <div class="panel-body">
  89. <script type="syntaxhighlighter" class="brush: python"><![CDATA[ {{ source|safe}} ]]></script>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
  97. <div class="modal-dialog modal-lg">
  98. <div class="modal-content">
  99. <div class="modal-header">
  100. <button type="button" class="close" data-dismiss="modal">×</button>
  101. <h3 class="modal-title">Heading</h3>
  102. </div>
  103. <div class="modal-body">
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </body>
  109. <style>
  110. .modal-dialog {width:900px;}
  111. .thumbnail {margin-bottom:6px;}
  112. .modal-title {text-align:center;}
  113. </style>
  114. <script>
  115. $('.thumbnail').click(function(){
  116. $('.modal-body').empty();
  117. var title = $(this).parent('a').attr("title");
  118. $('.modal-title').html(title);
  119. $($(this).parents('div').html()).appendTo('.modal-body');
  120. $('#myModal').modal({show:true});
  121. });
  122. SyntaxHighlighter.all()
  123. </script>
  124. </html>