{{inherit "base.html"}}
<!--  -->
{{def navbar}} {{enddef}}
<!--  -->
{{def report}}
<div class="pure-g">
  <div class="pure-u-1 pure-u-md-2-3">
    <div class="image">
      <div
        class="pure-g d-flex justify-content-center align-items-stretch mt-2"
      >
        <button
          class="btn pure-u-1-3 text-center rounded-2"
          id="prev-btn-{{unique_id}}"
          style="height: 70px"
        >
          Previous Sphere
        </button>
        <!-- the content of the h4 will be injected by javascript -->
        <h4 class="pure-u-1-4 py-3 text-center" style="margin: 0px">
          <span id="comp-{{unique_id}}"></span>
        </h4>
        <button
          class="btn pure-u-1-3 text-center rounded-2"
          id="next-btn-{{unique_id}}"
          style="height: 70px"
        >
          Next Sphere
        </button>
      </div>

      <!-- glass brain with all spheres -->
      <img
        id="carousel-obj-{{unique_id}}-0"
        class="pure-img"
        width="100%"
        style="display: block"
        alt="No image to display."
        src="data:image/svg+xml;base64,{{content[0]}}"
      />

      <!-- individual spheres -->
      {{for map in range(1, len(displayed_maps))}}
      <img
        id="carousel-obj-{{unique_id}}-{{map}}"
        class="pure-img"
        width="100%"
        style="display: none"
        alt="No image to display"
        src="data:image/svg+xml;base64,{{content[map]}}"
      />
      {{endfor}}
    </div>
  </div>
  <div class="pure-u-1 pure-u-md-1-3">
    {{if description}}
    <p>{{description}}</p>
    {{endif}} {{if number_of_seeds}}
    <p>
      The masker has <b>{{number_of_seeds}}</b> spheres in total (displayed
      together on the first image).
    </p>
    {{if len(displayed_maps) != number_of_seeds}}
    <p>
      Only <b>{{len(displayed_maps)}}</b> specific spheres can be browsed in
      this report with <b>Previous</b> and <b>Next</b> buttons.
    </p>
    {{else}}
    <p>
      They can be individually browsed using <b>Previous</b> and
      <b>Next</b> buttons.
    </p>
    {{endif}} {{endif}}
    <p></p>
  </div>
</div>
<div class="pure-g">
  <div class="pure-u-1 pure-u-md-3-3">
    <div class="d-flex flex-column">
      {{if summary_html}}
      <details>
        <summary class="pure-button">Regions summary</summary>
        <div class="table-container">{{summary_html|html}}</div>
      </details>
      {{endif}}
      <!--  -->
      {{if parameters}}
      <div class="table-container">{{ parameters|html }}</div>
      {{endif}}
    </div>
  </div>
</div>

<script>
    {{ js_carousel | html }}
    document.addEventListener("DOMContentLoaded", function () {
      new Carousel("{{unique_id}}", {{ displayed_maps }}, true);
  }
  );
</script>
{{enddef}}
