dashboard.j2 5.5 KB

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