<commit_before><div class="main_header">
  <div class="inner_main_head clearfix">
    <div class="left">
      <div class="float_head">
        <div class="site_brand">
          <h3>DONOR</h3>
          <h1><%= @donor.name.html_safe %></h1>
        </div>
      </div>
    </div>

    <div class="right">
    </div>
  </div>
</div>

<%= render :partial => 'partials/map' %>


<div id="layout">
  <div id="left_column">

    <!-- LEFT PART -->
    <div class="left"></div>
    <div class="outer_float">
      <div class="float_left">

        <div class="head">
          <h2>OVERVIEW</h2>
        </div>

        <div class="block box_info donors">
          <div class="donors_account">
            <label>PROJECTS</label>
            <h2><%= @projects.total_entries %></h2>
          </div>
          <div class="donors_account">
            <label>
              <% if @site.navigate_by_country %>
                COUNTRIES
               <% else %>
                REGIONS
               <% end %>
            </label>
            <h2><%= @count %></h2>
          </div>
        </div>

        <div class="block statistics less">
          <h3>Affiliated Organizations</h3>
            <% if @organizations %>
            <ul class="chart chart-bars">
              <% @organizations.each do |o| %>
                <li><a href="/organizations/<%= o[1][:id] %>"><%= o[1][:name] %></a></li>
              <% end %>
            </ul>
            <% end %>
        </div>

        <div class="block statistics less">
          <h3>PROJECT LOCATIONS</h3>
          <%= raw(projects_by_location(@site, @donor_projects_by_location)) %>
        </div>

        <div class="block statistics">
          <h3>PROJECT <%= @site.word_for_cluster_sector.upcase %></h3>
          <ul class="statistics_list">
          <% @donor.projects_sectors_or_clusters(@site).each do |category, count| %>
            <% unless category.name.eql?('N/A') %>
              <li>
                <div class="tooltip">
                  <span class="body_tooltip">
                    <label><%= category.name %></label>
                  </span>
                  <span class="bottom_tooltip"></span>
                </div>
                <a class="<%= category.css_class %> icon_statistics" href="<%= category.is_a?(Cluster) ? cluster_path(category) : sector_path(category) %>"><span class="aller" style="width:<%= cluster_sector_width_donors(count, @site.projects_sectors_or_clusters.map{|e| e.last}.max) %>px"><%= count %></span></a>
              </li>
            <% end %>
          <% end %>
          </ul>
        </div>

        <% if @donor.contact_person_name != '' %>
          <div class="block">
            <h3>CONTACT INFORMATION</h3>

            <p><strong><%= @donor.contact_person_name %></strong><br/><%= @donor.contact_person_position %></p>
            <p><%= @donor.contact_phone_number %><br/><% unless (@donor.contact_email.nil?)||(@donor.contact_email.empty?) %><%= link_to(@donor.contact_email, "mailto:#{@donor.contact_email}") %><%end%></p>
          </div>
        <% end %>

        <% if !@donor.media_resources.empty? %>
          <div class="block resources">
            <h3>MEDIA RESOURCES</h3>
            <% @donor.media_resources.each do |media| %>
              <ul>
                <li><a href="<%= media.picture_file_name %>" target="_blank"><%= media.picture_file_name %></a></li>
              </ul>
            <%end%>
          </div>
        <% end %>

        <% if !@donor.resources.empty? %>
          <div class="block resources">
            <h3>ADDITIONAL RESOURCES</h3>
            <% @donor.resources.each do |resource| %>
              <ul>
                <li><a href="<%= resource.url %>" target="_blank"><%= resource.title %></a></li>
              </ul>
            <%end%>
          </div>
        <% end %>

      </div>
    </div>

    <!-- RIGHT PART -->
    <div class="right" id="projects_div">
      <h3>
        Funding <%= pluralize(@donor.donated_projects_count(@site), 'project', 'projects') %>

        <ul class="download">
          <li><%= link_to 'CSV', donor_path(@donor, @carry_on_filters.merge(:format => :csv)) %></li>
          <li>|</li>
          <li><%= link_to 'EXCEL',donor_path(@donor, @carry_on_filters.merge(:format => :xls)) %></li>
          <li>|</li>
          <li><%= link_to 'KML', donor_path(@donor, @carry_on_filters.merge(:format => :kml)) %></li>
          <li>·</li>
          <li><%= link_to 'Embed this map', '#', :id => 'embed_map' %></li>
        </ul>
      </h3>

      <div id="popup" class="embed_map">
          <a class="close top" href="#"></a>
          <h5>Embed this map</h5>
          <p>Copy this code and paste it in your HTML page for embedding the map.</p>
          <textarea><iframe src="<%= url_with_embed_param %>" frameborder="0" width="600" height="600"></iframe></textarea>
          <a href="#" class="close button">Close</a>
        </div>
      <div class="popup_background"></div>        

      <p class="disclaimer"><sup>*</sup>This projects show only a portion of activities supported by this donor globally.</p>

      <div id="projects">
        <%= render :partial => 'donors/projects' %>
      </div>
    </div>

  </div>
</div>

<script>

  <% if @site.overview_map_lat && @site.overview_map_lon %>
  var map_center = [<%= @site.overview_map_lat %>, <%= @site.overview_map_lon %>];
  <% else %>
  var map_center = [];
  <% end %>
  var map_zoom = <%= @site.overview_map_zoom %>;
  var chco = "<%=@overview_map_chco%>";
  var chf = "<%=@overview_map_chf%>";
  var chld = "<%=@chld%>";
  var chd = "<%=@chd%>";
  var map_data = <%= @map_data.to_s.html_safe %>;
  // var organization_data = <%= @organizations_data.to_s.html_safe %>;
  var map_type = '<%= @filter_by_location.present?? 'administrative_map' : 'overview_map' %>';
  var theme = "<%=@site.theme_id%>";
  var kind = 'donor';
  var stylez = <%=raw @site.map_styles  %>
</script>

<%=raw(javascript_include_merged(:organizations_show)) %>
<commit_msg>Hide donors contact information if empty<commit_after><div class="main_header">
  <div class="inner_main_head clearfix">
    <div class="left">
      <div class="float_head">
        <div class="site_brand">
          <h3>DONOR</h3>
          <h1><%= @donor.name.html_safe %></h1>
        </div>
      </div>
    </div>

    <div class="right">
    </div>
  </div>
</div>

<%= render :partial => 'partials/map' %>


<div id="layout">
  <div id="left_column">

    <!-- LEFT PART -->
    <div class="left"></div>
    <div class="outer_float">
      <div class="float_left">

        <div class="head">
          <h2>OVERVIEW</h2>
        </div>

        <div class="block box_info donors">
          <div class="donors_account">
            <label>PROJECTS</label>
            <h2><%= @projects.total_entries %></h2>
          </div>
          <div class="donors_account">
            <label>
              <% if @site.navigate_by_country %>
                COUNTRIES
               <% else %>
                REGIONS
               <% end %>
            </label>
            <h2><%= @count %></h2>
          </div>
        </div>

        <div class="block statistics less">
          <h3>Affiliated Organizations</h3>
            <% if @organizations %>
            <ul class="chart chart-bars">
              <% @organizations.each do |o| %>
                <li><a href="/organizations/<%= o[1][:id] %>"><%= o[1][:name] %></a></li>
              <% end %>
            </ul>
            <% end %>
        </div>

        <div class="block statistics less">
          <h3>PROJECT LOCATIONS</h3>
          <%= raw(projects_by_location(@site, @donor_projects_by_location)) %>
        </div>

        <div class="block statistics">
          <h3>PROJECT <%= @site.word_for_cluster_sector.upcase %></h3>
          <ul class="statistics_list">
          <% @donor.projects_sectors_or_clusters(@site).each do |category, count| %>
            <% unless category.name.eql?('N/A') %>
              <li>
                <div class="tooltip">
                  <span class="body_tooltip">
                    <label><%= category.name %></label>
                  </span>
                  <span class="bottom_tooltip"></span>
                </div>
                <a class="<%= category.css_class %> icon_statistics" href="<%= category.is_a?(Cluster) ? cluster_path(category) : sector_path(category) %>"><span class="aller" style="width:<%= cluster_sector_width_donors(count, @site.projects_sectors_or_clusters.map{|e| e.last}.max) %>px"><%= count %></span></a>
              </li>
            <% end %>
          <% end %>
          </ul>
        </div>

        <% if @contact_data[:show] %>
          <div class="block">
            <h3>CONTACT INFORMATION</h3>

            <p><strong><%= @donor.contact_person_name %></strong><br/><%= @donor.contact_person_position %></p>
            <p><%= @donor.contact_phone_number %><br/><% unless (@donor.contact_email.nil?)||(@donor.contact_email.empty?) %><%= link_to(@donor.contact_email, "mailto:#{@donor.contact_email}") %><%end%></p>
          </div>
        <% end %>

        <% if !@donor.media_resources.empty? %>
          <div class="block resources">
            <h3>MEDIA RESOURCES</h3>
            <% @donor.media_resources.each do |media| %>
              <ul>
                <li><a href="<%= media.picture_file_name %>" target="_blank"><%= media.picture_file_name %></a></li>
              </ul>
            <%end%>
          </div>
        <% end %>

        <% if !@donor.resources.empty? %>
          <div class="block resources">
            <h3>ADDITIONAL RESOURCES</h3>
            <% @donor.resources.each do |resource| %>
              <ul>
                <li><a href="<%= resource.url %>" target="_blank"><%= resource.title %></a></li>
              </ul>
            <%end%>
          </div>
        <% end %>

      </div>
    </div>

    <!-- RIGHT PART -->
    <div class="right" id="projects_div">
      <h3>
        Funding <%= pluralize(@donor.donated_projects_count(@site), 'project', 'projects') %>

        <ul class="download">
          <li><%= link_to 'CSV', donor_path(@donor, @carry_on_filters.merge(:format => :csv)) %></li>
          <li>|</li>
          <li><%= link_to 'EXCEL',donor_path(@donor, @carry_on_filters.merge(:format => :xls)) %></li>
          <li>|</li>
          <li><%= link_to 'KML', donor_path(@donor, @carry_on_filters.merge(:format => :kml)) %></li>
          <li>·</li>
          <li><%= link_to 'Embed this map', '#', :id => 'embed_map' %></li>
        </ul>
      </h3>

      <div id="popup" class="embed_map">
          <a class="close top" href="#"></a>
          <h5>Embed this map</h5>
          <p>Copy this code and paste it in your HTML page for embedding the map.</p>
          <textarea><iframe src="<%= url_with_embed_param %>" frameborder="0" width="600" height="600"></iframe></textarea>
          <a href="#" class="close button">Close</a>
        </div>
      <div class="popup_background"></div>        

      <p class="disclaimer"><sup>*</sup>This projects show only a portion of activities supported by this donor globally.</p>

      <div id="projects">
        <%= render :partial => 'donors/projects' %>
      </div>
    </div>

  </div>
</div>

<script>

  <% if @site.overview_map_lat && @site.overview_map_lon %>
  var map_center = [<%= @site.overview_map_lat %>, <%= @site.overview_map_lon %>];
  <% else %>
  var map_center = [];
  <% end %>
  var map_zoom = <%= @site.overview_map_zoom %>;
  var chco = "<%=@overview_map_chco%>";
  var chf = "<%=@overview_map_chf%>";
  var chld = "<%=@chld%>";
  var chd = "<%=@chd%>";
  var map_data = <%= @map_data.to_s.html_safe %>;
  // var organization_data = <%= @organizations_data.to_s.html_safe %>;
  var map_type = '<%= @filter_by_location.present?? 'administrative_map' : 'overview_map' %>';
  var theme = "<%=@site.theme_id%>";
  var kind = 'donor';
  var stylez = <%=raw @site.map_styles  %>;
</script>

<%=raw(javascript_include_merged(:organizations_show)) %>

{'fraction_non_alphanumeric': 0.19583954914636167, 'fraction_numerical': 0.005801425493121167, 'mean_word_length': 2.1399947957325005, 'pattern_counts': {'":': 0, '<': 449, '<?xml version=': 0, '>': 461, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '792399', 'n_tokens_mistral': 4263, 'n_tokens_neox': 3911, 'n_words': 741}