{%- set colour_subset = "C" -%}
{%- macro coloured_sequence(sequence) -%}
    {{coloured_ripp_sequence(sequence, colour_subset=colour_subset)}}
{%- endmacro -%}
<div class="details">
    <div class="heading">
      <span>Lasso peptide predictions</span>
      {{ help_tooltip(tooltip, "lasso-body") }}
    </div>
    <div class="details-text ripp-body">
    {% if not motifs_by_locus %}
      Lassopeptides - No core peptides found.
    {% else %}
     {% for locus in motifs_by_locus | sort %}
      <h4>Lassopeptide(s) for {{ locus }}</h4>
      <hr>
       {% for core, motifs in motifs_by_locus[locus].items() %}
        <div class="ripp-motif">
         {% for motif in motifs %}
          {% set motif_name = motif.get_name().rsplit("_", 1)[0] %}
           <div class="ripp-name">
            <span class="serif">{{ motif_name }}</span>
           </div>
           <div class="ripp-segment-type">Leader:</div>
           <div class="ripp-segment-sequence">{{ motif.leader }}</div>
         {% endfor %}
           <div class="ripp-segment-type">{% if motifs | length > 1%}Shared full core{% else %}Full core{% endif %}:</div>
           <div class="ripp-segment-sequence">{{ coloured_sequence(motifs[0].core) }}</div>
           <div class="ripp-segment-type">Putative macrolactam:</div>
           <div class="ripp-segment-sequence">{{ coloured_sequence(motifs[0].detailed_information.macrolactam) }}</div>
         {% for motif in motifs %}
          {% if motif.tail %}
           {% set motif_name = motif.get_name().rsplit("_", 1)[0] %}
           <div class="ripp-name">
            <span class="serif">{{ motif_name }}</span>
           </div>
           <div class="ripp-segment-type">Cleaved off residues:</div>
           <div class="ripp-segment-sequence"><span class="cut">{{ motif.tail }}</span></div>
          {% endif %}
         {% endfor %}
         {{ comparippson_results.get_html_for_query(motifs[0].get_name().rsplit("_", 1)[0], colour_subset=colour_subset) }}
        </div>
       {% endfor %}
    {% endfor %}
    <div class="ripp-legend">
      <h4> Legend: </h4>
      <div>
        <span class="dha">Dha</span>: Didehydroalanine<br>
        <span class="dhb">Dhb</span>: Didehydrobutyrine<br>
      </div>
    </div>
  {% endif %}
   </div>
</div>
