<commit_before>{% extends 'FrontendBundle::layout.html.twig' %}

{% block callout %}
    {% include 'SearchBundle:Frontend/Widgets:base.resultsCallout.html.twig' %}
{% endblock %}

{% block content %}
    <div id="details" class="row">
        <div id="main_content" class="span8">
            <header class="filters">
                <h2 class="total">
                    {% if searchResults.getTotalResults %}
                    We have found the following matches:
                    {% else %}
                    No results found.
                    {% endif %}
                </h2>
            </header>
            {% if relatedTreatments %}
            <div class="media search-matches">
                <div class="matches">
                    <ul class="match">
                        {% set sId = 0 %}
                        {% set ssId = 0 %}
                        {% for specialization in relatedTreatments %}
                            {% if sId != specialization.id %}
                                <li><h5><a href="{{ path('frontend_search_results_specializations', {specialization: specialization.slug}) }}">{{ specialization.name }}</a></h5></li>
                                {% set sId = specialization.id %}
                            {% endif %}
                            <li>
                                <ul class="match">
                                    {% for subCategory in specialization.subCategories %}
                                        {% if subCategory.subSpecializationId is defined %}
                                            {% if ssId != subCategory.subSpecializationId %}
                                                <li><h5><a href="{{ path('frontend_search_results_subSpecializations', {specialization: specialization.slug, subSpecialization: subCategory.subSpecializationSlug}) }}">{{ subCategory.subSpecializationName }}</a></h5></li>
                                                <li><a href="{{ path('frontend_search_results_treatments', {specialization: specialization.slug, treatment: subCategory.treatmentSlug}) }}">{{ subCategory.treatmentName }}</a></li>
                                                {% set ssId = subCategory.subSpecializationId %}
                                            {% endif %}
                                        {% elseif subCategory.treatmentId is defined %}
                                            <li><a href="{{ path('frontend_search_results_treatments', {specialization: specialization.slug, treatment: subCategory.treatmentSlug}) }}">{{ subCategory.treatmentName }}</a></li>
                                        {% endif %}
                                    {% endfor %}
                                </ul>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
            {% endif %}

            {% for searchResultVo in searchResults %}
                {# BC for old search results whose result item is a medical center #}
                {% set center = searchResultVo.institutionMedicalCenter is defined ? searchResultVo.institutionMedicalCenter : searchResultVo %}
                {# do this to save query #}

                {% include 'SearchBundle:Frontend/Widgets:base.resultItem.html.twig' with {
                       'searchResultItem' : {
                              url: get_institution_medical_center_frontend_url(center),
                              logo: render_institution_medical_center_logo(center, {attr: {class: 'search-entry-thumb', alt: 'clinic logo'}}),
                              name: center.name,
                              institutionName: center.institution.name,
                              description: center.descriptionHighlight,
                              mainAddress: medical_center_complete_address_to_array(center, ['city', 'state', 'country']) | join(', '),
                              streetAddress: medical_center_complete_address_to_array(center, ['address', 'zipCode']) | join(', ')
                       }
                   }
               %}

            {% endfor %}

            {% if searchResults.isPaginable %}<commit_msg>changed markup in related search. Partial fix for #377<commit_after>{% extends 'FrontendBundle::layout.html.twig' %}

{% block callout %}
    {% include 'SearchBundle:Frontend/Widgets:base.resultsCallout.html.twig' %}
{% endblock %}

{% block content %}
    <div id="details" class="row">
        <div id="main_content" class="span8">
            <header class="filters">
                <h2 class="total">
                    {% if searchResults.getTotalResults %}
                    We have found the following matches:
                    {% else %}
                    No results found.
                    {% endif %}
                </h2>
            </header>
            {% if relatedTreatments %}
            <div class="media search-matches">
                <div class="matches">
                    
                        {% set sId = 0 %}
                        {% set ssId = 0 %}
                        {% for specialization in relatedTreatments %}
                        <ul class="match">
                            {% if sId != specialization.id %}
                                <li><h5 class="sp"><a href="{{ path('frontend_search_results_specializations', {specialization: specialization.slug}) }}">{{ specialization.name }}</a></h5></li>
                                {% set sId = specialization.id %}
                            {% endif %}
                            <li>
                                <ul class="match">
                                    {% for subCategory in specialization.subCategories %}
                                        {% if subCategory.subSpecializationId is defined %}
                                            {% if ssId != subCategory.subSpecializationId %}
                                                <li><h5><a href="{{ path('frontend_search_results_subSpecializations', {specialization: specialization.slug, subSpecialization: subCategory.subSpecializationSlug}) }}">{{ subCategory.subSpecializationName }}</a></h5></li>
                                                <li><a href="{{ path('frontend_search_results_treatments', {specialization: specialization.slug, treatment: subCategory.treatmentSlug}) }}">{{ subCategory.treatmentName }}</a></li>
                                                {% set ssId = subCategory.subSpecializationId %}
                                            {% endif %}
                                        {% elseif subCategory.treatmentId is defined %}
                                            <li><a href="{{ path('frontend_search_results_treatments', {specialization: specialization.slug, treatment: subCategory.treatmentSlug}) }}">{{ subCategory.treatmentName }}</a></li>
                                        {% endif %}
                                    {% endfor %}
                                </ul>
                            </li>
                        </ul>
                        {% endfor %}
                    
                </div>
            </div>
            {% endif %}

            {% for searchResultVo in searchResults %}
                {# BC for old search results whose result item is a medical center #}
                {% set center = searchResultVo.institutionMedicalCenter is defined ? searchResultVo.institutionMedicalCenter : searchResultVo %}
                {# do this to save query #}

                {% include 'SearchBundle:Frontend/Widgets:base.resultItem.html.twig' with {
                       'searchResultItem' : {
                              url: get_institution_medical_center_frontend_url(center),
                              logo: render_institution_medical_center_logo(center, {attr: {class: 'search-entry-thumb', alt: 'clinic logo'}}),
                              name: center.name,
                              institutionName: center.institution.name,
                              description: center.descriptionHighlight,
                              mainAddress: medical_center_complete_address_to_array(center, ['city', 'state', 'country']) | join(', '),
                              streetAddress: medical_center_complete_address_to_array(center, ['address', 'zipCode']) | join(', ')
                       }
                   }
               %}

            {% endfor %}

            {% if searchResults.isPaginable %}
{'fraction_non_alphanumeric': 0.11018735362997659, 'fraction_numerical': 0.002459016393442623, 'mean_word_length': 1.3065082365649474, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4336728', 'n_tokens_mistral': 2051, 'n_tokens_neox': 1803, 'n_words': 385}