dashboard.j2 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. {% for r, plot_row in enumerate(plots) %}
  28. <div class="row">
  29. {% for c, plot in enumerate(plot_row) %}
  30. <div class="col-md-4">
  31. <div class="well">
  32. {% if plot.title %}
  33. <h3 class="text-center">{{ plot.title }}</h3>
  34. {% endif %}
  35. <div>
  36. <a href="#" title="{{ plot.name }}">
  37. <img src="data:img/png;base64,{{ plot.data }}" style="width:100%" class="thumbnail img-responsive">
  38. </a>
  39. </div>
  40. <div class="caption">
  41. <p class="text-center"> {{ plot.name }} </p>
  42. <div class="panel-group" id="accordion{{ r }}{{ c }}">
  43. {% for id, (i,j) in enumerate(plot.docs.keys()) %}
  44. <div class="panel-heading">
  45. <h4 class="panel-title">
  46. <button data-toggle="collapse" data-parent="#accordion{{ r }}{{ c }}" class="btn btn-info" href="#collapse{{r}}-{{c}}-{{id}}">
  47. Plot at ({{ i+1 }}, {{ j+1 }})</button>
  48. </h4>
  49. </div>
  50. <div id="collapse{{r}}-{{c}}-{{id}}" class="panel-collapse collapse">
  51. <div class="panel-body">
  52. {% for doc, argdict, txt in zip(plot.docs[(i,j)], plot.argdicts[(i,j)], plot.txts[(i,j)]) %}
  53. <div class="text-left">{{ doc|safe }}</div>
  54. <div class="text-left">{{ txt|safe }}</div>
  55. <hr>
  56. <p class="text-left"><strong>Plot Arguments</strong></p>
  57. <table class="table table-hover">
  58. <tbody>
  59. {% for key, val in argdict.items() %}
  60. <tr>
  61. <td>{{ key }}</td> <td>{{ val }}</td>
  62. </tr>
  63. {% endfor %}
  64. </tbody>
  65. </table>
  66. {% endfor %}
  67. </div>
  68. </div>
  69. {% endfor %}
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. {% endfor %}
  75. </div>
  76. {% endfor %}
  77. <div class="row">
  78. <div class="col-12-lg">
  79. <div class="panel-group" id="accordion">
  80. <div class="panel-heading">
  81. <h4 class="panel-title" style="text-align:center">
  82. {% if config %}
  83. <button data-toggle="collapse" data-parent="#accordion" class="btn btn-default" href="#collapseConfig">Analysis Configuration</button>
  84. {% endif %}
  85. {% if source %}
  86. <button data-toggle="collapse" data-parent="#accordion" class="btn btn-default" href="#collapseSrc">Figure Source Code</button>
  87. {% endif %}
  88. {% if ana_source %}
  89. <a class="btn btn-default" href="{{ ana_source }}" target="_blank">Analysis Source Code</a>
  90. {% endif %}
  91. </h4>
  92. </div>
  93. {% if config %}
  94. <div id="collapseConfig" class="panel-collapse collapse">
  95. <div class="panel-body">
  96. <script type="syntaxhighlighter" class="brush: plain"><![CDATA[ {{ config|safe}} ]]></script>
  97. </div>
  98. </div>
  99. {% endif %}
  100. {% if source %}
  101. <div id="collapseSrc" class="panel-collapse collapse">
  102. <div class="panel-body">
  103. <script type="syntaxhighlighter" class="brush: python"><![CDATA[ {{ source|safe}} ]]></script>
  104. </div>
  105. </div>
  106. {% endif %}
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
  112. <div class="modal-dialog modal-lg">
  113. <div class="modal-content">
  114. <div class="modal-header">
  115. <button type="button" class="close" data-dismiss="modal">×</button>
  116. <h3 class="modal-title">Heading</h3>
  117. </div>
  118. <div class="modal-body">
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </body>
  124. <style>
  125. .modal-dialog {width:900px;}
  126. .thumbnail {margin-bottom:6px;}
  127. .modal-title {text-align:center;}
  128. </style>
  129. <script>
  130. $('.thumbnail').click(function(){
  131. $('.modal-body').empty();
  132. var title = $(this).parent('a').attr("title");
  133. $('.modal-title').html(title);
  134. $($(this).parents('div').html()).appendTo('.modal-body');
  135. $('#myModal').modal({show:true});
  136. });
  137. SyntaxHighlighter.all()
  138. </script>
  139. </html>