<commit_before>{% extends 'base.html' %}

{% block title %}RAD Remedy - {{ provider.name }}{% endblock %}
{% block head_text %}Provider{% endblock %}
{% block og_desc %}View information and reviews for {{ provider.name }} on RAD Remedy.{% endblock %}

{% macro flag_field(desc, value) %}
{%- if value != None %}
<li class="clearfix">
  <p {% if not value %} class="text-muted"{% endif %}>
    {{ desc }}
    &nbsp;
    <span class="sr-only">
      {% if value %}Yes{% else %}No{% endif %}
    </span>
    <span class="glyphicon {% if value %}glyphicon-ok text-success{% else %}glyphicon-remove text-danger{% endif %}" aria-hidden="true"></span>
  </p>
</li>
{%- endif %}
{% endmacro %}

{% macro aggregate_block(name, agg) %}
<div class="rating-score-block aggregate-block">
<h5>
  {{ name }}
</h5>
<p>
{% if agg.num_ratings > 1 %}
  {{ agg.num_ratings }} reviews
  over {{ agg.first_reviewed.strftime('%m/%d/%Y') }}
  to {{ agg.last_reviewed.strftime('%m/%d/%Y') }}
{% else %}
  {{ agg.num_ratings }} review 
  on {{ agg.first_reviewed.strftime('%m/%d/%Y') }}
{% endif %}
</p>
{% if agg.rating_avg %}
{{ macros.rating_component("Provider", agg.rating_avg|round(1)) }}
{% endif %}
{% if agg.staff_rating_avg %}
{{ macros.rating_component("Staff", agg.staff_rating_avg|round(1)) }}
{% endif %}
{% if agg.intake_rating_avg %}
{{ macros.rating_component("Intake", agg.intake_rating_avg|round(1)) }}
{% endif %}
</div>
{% endmacro %}

{% block content %}
<div class="provider fluid-container">
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <h5 style="color:#3c204d; font-size:2em; ">{{ provider.name }}</h5>
    </div>
  </div>

  {% if provider.organization %}
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <h4>
      	{{ provider.organization }}
      </h4>
    </div>
  </div>
  {% endif %}

  {% if provider.categories %}
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <div title="Categories" class="tags">
        <span class="glyphicon glyphicon-tags" aria-hidden="true"></span>
        <span class="sr-only">Categories:</span>
        &nbsp;
  	    {{ provider.categories|join(', ', attribute='name') }}
      </div>
    </div>
  </div>
  {% endif %}

  <div class="row">
    <div class="col-xs-12 col-sm-6 col-md-8 col-lg-8">
      {% if provider.is_icath != None or provider.is_wpath != None
        or provider.is_accessible != None or provider.has_sliding_scale != None %}
      <div>
        <h4>
          Summary
        </h4>
        <ul class="list-unstyled">
          {{ flag_field('Informed Consent/ICATH Provider', provider.is_icath) }}
          {{ flag_field('WPATH Standards of Care', provider.is_wpath) }}
          {{ flag_field('ADA/Wheelchair Accessible', provider.is_accessible) }}
          {{ flag_field('Sliding Fee Scale', provider.has_sliding_scale) }}
        </ul>
      </div>
      {% endif %}
      <div>
        <h4>
          Description
        </h4>
        {% if provider.description %}
        {# Normally we wrap nl2br'ed items in a text-block, but we want the
           paragraph styling here. #}
        {{ provider.description|nl2br }}
        {% else %}
        <p>
          We don't have a description for this provider yet.
          <a href="{{ url_for('remedy.submit_error', resource_id=provider.id) }}">Can you help?</a>
        </p>
        {% endif %}
      </div>
      {% if provider.hospital_affiliation %}
      <div>
        <h4>
          Hospital Affiliation(s)
        </h4>
        {{ provider.hospital_affiliation|nl2br }}
      </div>
      {% endif %}
      {% if provider.populations %}
      <div class="row"> 
        <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
          <h4>
            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
            Populations Served
          </h4>
          <ul class="list-unstyled tags">
            {% for population in provider.populations|sort(attribute='name') %}
            <li>{{ population.name }}</li>
            {% endfor %}
          </ul>
        </div>
      </div>
      {% endif %}
    </div>
  
    <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> 
      <div class="contact-box container">
        {% if provider.address %}
        <div class="row">
          <div class="col-xs-2">
          <span class="glyphicon glyphicon-road" aria-hidden="true"></span>
          <span class="sr-only">Address:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="https://maps.google.com?q={{ provider.address|urlencode }}" target="_blank">
                {{ provider.address }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.hours %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
            <span class="sr-only">Hours:</span>
          </div>
          <div class="col-xs-10 text-block">
            {{ provider.hours|nl2br }}
          </div>
        </div>
        {% endif %}

        {% if provider.email %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
            <span class="sr-only">Email Address:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="mailto:{{ provider.email }}">{{ provider.email }}</a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.phone %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
            <span class="sr-only">Phone number:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="tel:{{ provider.phone|phoneintl|urlencode }}">
                {{ provider.phone }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.fax %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-print" aria-hidden="true"></span>
            <span class="sr-only">Fax:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="tel:{{ provider.fax|phoneintl|urlencode }}">
                {{ provider.fax }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.url %}
        <div class="row">
          <div class="col-xs-2">
              <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
              <span class="sr-only">Website:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="{% if not provider.url.startswith(('http://', 'https://')) %}http://{% endif %}{{ provider.url }}" target="_blank">Find out More</a>
            </span>
          </div>
        </div>
        {% endif %}

      </div>
      <hr>
      <p>
        <span class="glyphicon glyphicon-certificate" aria-hidden="true"></span>
        &nbsp;
        Visited this provider? 
        <a href="{{ url_for('remedy.new_review', resource_id=provider.id) }}">Tell us about your experience.</a>
      </p>
      <p>
        <span class="glyphicon glyphicon-warning-sign text-danger" aria-hidden="true"></span>
        &nbsp;
        Notice something wrong with this reference? <commit_msg>adding sorting to category display<commit_after>{% extends 'base.html' %}

{% block title %}RAD Remedy - {{ provider.name }}{% endblock %}
{% block head_text %}Provider{% endblock %}
{% block og_desc %}View information and reviews for {{ provider.name }} on RAD Remedy.{% endblock %}

{% macro flag_field(desc, value) %}
{%- if value != None %}
<li class="clearfix">
  <p {% if not value %} class="text-muted"{% endif %}>
    {{ desc }}
    &nbsp;
    <span class="sr-only">
      {% if value %}Yes{% else %}No{% endif %}
    </span>
    <span class="glyphicon {% if value %}glyphicon-ok text-success{% else %}glyphicon-remove text-danger{% endif %}" aria-hidden="true"></span>
  </p>
</li>
{%- endif %}
{% endmacro %}

{% macro aggregate_block(name, agg) %}
<div class="rating-score-block aggregate-block">
<h5>
  {{ name }}
</h5>
<p>
{% if agg.num_ratings > 1 %}
  {{ agg.num_ratings }} reviews
  over {{ agg.first_reviewed.strftime('%m/%d/%Y') }}
  to {{ agg.last_reviewed.strftime('%m/%d/%Y') }}
{% else %}
  {{ agg.num_ratings }} review 
  on {{ agg.first_reviewed.strftime('%m/%d/%Y') }}
{% endif %}
</p>
{% if agg.rating_avg %}
{{ macros.rating_component("Provider", agg.rating_avg|round(1)) }}
{% endif %}
{% if agg.staff_rating_avg %}
{{ macros.rating_component("Staff", agg.staff_rating_avg|round(1)) }}
{% endif %}
{% if agg.intake_rating_avg %}
{{ macros.rating_component("Intake", agg.intake_rating_avg|round(1)) }}
{% endif %}
</div>
{% endmacro %}

{% block content %}
<div class="provider fluid-container">
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <h5 style="color:#3c204d; font-size:2em; ">{{ provider.name }}</h5>
    </div>
  </div>

  {% if provider.organization %}
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <h4>
      	{{ provider.organization }}
      </h4>
    </div>
  </div>
  {% endif %}

  {% if provider.categories %}
  <div class="row"> 
    <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
      <div title="Categories" class="tags">
        <span class="glyphicon glyphicon-tags" aria-hidden="true"></span>
        <span class="sr-only">Categories:</span>
        &nbsp;
  	    {{ provider.categories|sort(attribute='name')|join(', ', attribute='name') }}
      </div>
    </div>
  </div>
  {% endif %}

  <div class="row">
    <div class="col-xs-12 col-sm-6 col-md-8 col-lg-8">
      {% if provider.is_icath != None or provider.is_wpath != None
        or provider.is_accessible != None or provider.has_sliding_scale != None %}
      <div>
        <h4>
          Summary
        </h4>
        <ul class="list-unstyled">
          {{ flag_field('Informed Consent/ICATH Provider', provider.is_icath) }}
          {{ flag_field('WPATH Standards of Care', provider.is_wpath) }}
          {{ flag_field('ADA/Wheelchair Accessible', provider.is_accessible) }}
          {{ flag_field('Sliding Fee Scale', provider.has_sliding_scale) }}
        </ul>
      </div>
      {% endif %}
      <div>
        <h4>
          Description
        </h4>
        {% if provider.description %}
        {# Normally we wrap nl2br'ed items in a text-block, but we want the
           paragraph styling here. #}
        {{ provider.description|nl2br }}
        {% else %}
        <p>
          We don't have a description for this provider yet.
          <a href="{{ url_for('remedy.submit_error', resource_id=provider.id) }}">Can you help?</a>
        </p>
        {% endif %}
      </div>
      {% if provider.hospital_affiliation %}
      <div>
        <h4>
          Hospital Affiliation(s)
        </h4>
        {{ provider.hospital_affiliation|nl2br }}
      </div>
      {% endif %}
      {% if provider.populations %}
      <div class="row"> 
        <div class="col-xs-12 col-sm-10 col-md-8 col-lg-8">
          <h4>
            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
            Populations Served
          </h4>
          <ul class="list-unstyled tags">
            {% for population in provider.populations|sort(attribute='name') %}
            <li>{{ population.name }}</li>
            {% endfor %}
          </ul>
        </div>
      </div>
      {% endif %}
    </div>
  
    <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> 
      <div class="contact-box container">
        {% if provider.address %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-road" aria-hidden="true"></span>
            <span class="sr-only">Address:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="https://maps.google.com?q={{ provider.address|urlencode }}" target="_blank">
                {{ provider.address }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.hours %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
            <span class="sr-only">Hours:</span>
          </div>
          <div class="col-xs-10 text-block">
            {{ provider.hours|nl2br }}
          </div>
        </div>
        {% endif %}

        {% if provider.email %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
            <span class="sr-only">Email Address:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="mailto:{{ provider.email }}">{{ provider.email }}</a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.phone %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
            <span class="sr-only">Phone number:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="tel:{{ provider.phone|phoneintl|urlencode }}">
                {{ provider.phone }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.fax %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-print" aria-hidden="true"></span>
            <span class="sr-only">Fax:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="tel:{{ provider.fax|phoneintl|urlencode }}">
                {{ provider.fax }}
              </a>
            </span>
          </div>
        </div>
        {% endif %}

        {% if provider.url %}
        <div class="row">
          <div class="col-xs-2">
            <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
            <span class="sr-only">Website:</span>
          </div>
          <div class="col-xs-10">
            <span>
              <a href="{% if not provider.url.startswith(('http://', 'https://')) %}http://{% endif %}{{ provider.url }}" target="_blank">Find out More</a>
            </span>
          </div>
        </div>
        {% endif %}

      </div>
      <hr>
      <p>
        <span class="glyphicon glyphicon-certificate" aria-hidden="true"></span>
        &nbsp;
        Visited this provider? 
        <a href="{{ url_for('remedy.new_review', resource_id=provider.id) }}">Tell us about your experience.</a>
      </p>
      <p>
        <span class="glyphicon glyphicon-warning-sign text-danger" aria-hidden="true"></span>
        &nbsp;
        Notice something wrong with this reference? 
{'fraction_non_alphanumeric': 0.18432510885341075, 'fraction_numerical': 0.010423538725425518, 'mean_word_length': 1.9905306766620636, 'pattern_counts': {'":': 0, '<': 329, '<?xml version=': 0, '>': 331, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7196419', 'n_tokens_mistral': 5254, 'n_tokens_neox': 4754, 'n_words': 992}