{% extends "base.html" %} {% from "_ui.html" import page_head, empty %} {% block title %}Search KT{% endblock %} {% block content %} {{ page_head('search', 'Search KT', 'Find a college to see its stored KT.') }}
{% if not searched %} {# default view: table of colleges #}

{{ icon('list') }} List of Colleges

{{ colleges|length }} total
{% for c in colleges %} {% else %} {% endfor %}
S.NoCollege NameNo. of KTAdded ByAction
{{ loop.index }} {{ icon('cap') }}{{ c.name }} {{ c.kt_count }} {% if c.added_by %}{{ icon('user') }}{{ c.added_by }}{% else %}-{% endif %} {{ icon('eye') }} View KT
{{ empty('inbox', 'No colleges added yet.') }}
{% else %} {# result view: one table of KT per college #} {% for c in colleges %}

{{ icon('cap') }} {{ c.name }}

{% if user.role in ('admin', 'lead') %}{% endif %}
{% if user.role in ('admin', 'lead') %}{% endif %} {% for k in kts.get(c.id, []) %} {% if user.role in ('admin', 'lead') %} {% endif %} {% else %} {% endfor %}
S.NoKT TitleKT DescriptionFacultyAdded ByAction
{{ loop.index }} {{ k.title or '-' }} {% if k.kind in ('multiple_choice', 'checkboxes') and k.choices %}
    {% for o, on in k.choices %}
  • {% if k.kind == 'multiple_choice' %}{{ '◉'|safe if on else '○'|safe }}{% else %}{{ '☑'|safe if on else '☐'|safe }}{% endif %} {{ o }}
  • {% endfor %}
{% elif k.kind == 'dropdown' and k.choices %} {{ k.text }}
▾ Options: {{ k.choices|map(attribute=0)|join(', ') }}
{% else %} {{ k.text }} {% endif %}
{{ k.kind_label }}
{% if k.f_first %}{{ icon('user') }}{{ k.f_title }} {{ k.f_first }} {{ k.f_last }}{% else %}-{% endif %} {% if k.added_by %}{{ icon('user') }}{{ k.added_by }}{% else %}-{% endif %} {{ icon('edit') }}
{{ empty('file-text', 'No KT added yet.') }}
{% else %}
{{ empty('search', 'No matching college found.') }}
{% endfor %} {% endif %} {% endblock %}