<commit_before><!-- the meta tag is for use with metamagic gem which generates
     title and meta tags in conjunction with the metamagic
     method in app/views/layouts/application.html.erb
     TODO: Create a view helper that works for all pages -->
<% meta title: "EBWiki tracking the case of #{@this_case.title}",
     description: "#{@this_case.blurb}",
     keywords: %w("@this_case.subjects.first.name police violence people color")
%>
<!-- Page Content -->
<div class="container">

<!-- Portfolio Item Heading -->
  <div class="row">
  </div>
  <!-- /.row -->

  <!-- Portfolio Item Row -->
  <div class="row">
    <div class="col-md-3">
      <% if @this_case.avatar? %>
        <%= image_tag(@this_case.avatar.large_avatar, :class => "img-responsive articleImage") %>
      <% else %>
        <%= image_tag('default-user-icon.png', :size => "250x250", :class => "img-responsive articleImage") %>
      <% end %>

      <div class="">
        <%= social_share_button_tag("Take a look at what I just found on EBWiki:") %>
      </div>
      <div class="row case-btns">
        <%= render 'button_group' %>
      </div>
      <%= render "comments/add_comment_form" %>
      <div class="commentList" >
        <%= render "comments/comments" %>
      </div>
    </div>

    <div class="col-md-9">
      <h1 class="page-header case-title"><%= @subjects.first.name %>, <%= @subjects.first.age ? "#{@subjects.first.age}" : "" %>
      <br>
          <small><%= @this_case.city %>, <%= @this_case.state.name %></small>
      <br/><small><%= @this_case.date.strftime("%B %d, %Y") %></small>
          <% if @this_case.agencies.present? %>
            <p>Agencies:
              <% @this_case.agencies.each_with_index do |agency, index| %>
                <%= link_to agency.name, agency_path(agency) %>
                <% unless index == @this_case.agencies.size - 1 %>
                  <%= "|" %>
                <% end %>
              <% end %>
            </p>
          <% end %>
          <div>
            <% if current_user %>
              <% if current_user.following?(@this_case) %>
              <% else %>
                <%= link_to 'Follow This Case', case_follows_path(@this_case), :method => :post, class: "btn-lg btn-primary text-center", data: {:toggle => 'popover', :container => 'body', :trigger => 'hover',:placement => "bottom",:content => "Click here to receive an email whenever this case is updated."} %>
              <% end %>
            <% else %>
              <%= link_to 'Follow This Case', case_follows_path(@this_case), :method => :post, class: "btn-lg btn-primary text-center", data: {:toggle => 'popover', :container => 'body', :trigger => 'hover',:placement => "bottom",:title => "Login to Follow this case!",:content => "Click here to receive an email whenever this case is updated."} %>
            <% end %>
          </div>
      </h1>
      <p class="timeAgo">Last updated: <%= time_ago_in_words(@this_case.updated_at) %> ago</p>
        <% if @this_case.followers.present? %>
          <p>
            <%= link_to 'People tracking this case', cases_followers_path(@this_case) %>: <span class="timeAgo"><%= @this_case.followers.count %></span>
              <% unless @this_case.followers.include?(current_user) %>
                -- Click here to <%= link_to 'Track this', case_follows_path(@this_case), :method => :post %>.
              <% end %>
          </p>
        <% end %>
        <%= render 'main_content' %>
      <div class="row">
        <div class="col-md-12">
          <% if @this_case.video_url? %>
            <div class="embed-container">
                <%= embed(@this_case.video_url) %>
            </div>
          <% end %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-12" >
          <% if @this_case.links.count > 0 %>
            <h4 class="article_subheader">Additional Resources:</h4>
            <ul class="background-links" id="link-list">
              <% @this_case.links.each do |link| %>
                <li>
                  <%= link_to link.url, "#{link.url}", target: '_blank' %> <span class="timeAgo">added <%= link.created_at.strftime("%b %d, %Y") %></span>
                </li>
              <% end %>
            </ul>
          <% end %>
        </div>
      </div>
      <% if @this_case.nearby_cases.present? %>
      <!-- Related Projects Row -->
        <div class="row">
          <div class="col-lg-12">
            <h3 class="page-header">EBWiki is tracking <%= pluralize(@this_case.nearby_cases.size, "case")%> near <%= @this_case.city %>, <%= @this_case.state.name %>:</h3>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            <% @this_case.nearby_cases.each do |this_case| %>
            <div class="col-lg-2 col-md-4 col-xs-12">
              <div class="view view-first">
                <% if this_case.avatar? %>
                  <%= link_to image_tag(this_case.avatar.large_avatar, :class => "img-responsive"), this_case %>
                <% else %>

                  <div class="thumbnail text-center">
                    <%= link_to image_tag("default-user-icon.png", :class => "img-responsive"), this_case %>
                    <div class="caption">
                      <h4><%= this_case.title %></h4>
                    </div>
                  </div>
                <% end %>
                <div class="mask">
                  <h2><%= link_to this_case.title, this_case, :class => "info2" %></h2>
                </div>
              </div>
            </div>
            <% end %>
          </div>
        </div>

        <!-- Map -->
        <div class="row">
          <div class="col-lg-12 articleMap">
          <div id='map'></div>
        </div>
      <% end %>
    </div>
  </div>
</div>


<!-- /.row -->

<script type="text/javascript">
  $(document).ready(function(){
      $('[data-toggle="popover"]').popover();
  });
</script>
<script type="">
  handler = Gmaps.build('Google');
  handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
    markers = handler.addMarkers(<%= raw marker_locations_for(
      @this_case.nearby_cases.map { |that_case|
        [that_case.id, that_case.latitude, that_case.longitude,
        that_case.default_avatar_url, that_case.title, that_case.blurb]
      }
    ).to_json %>);
    handler.bounds.extendWith(markers);
    handler.fitMapToBounds();
  });
</script>

<script type="text/javascript">
  if($('ul#link-list').children().length > 10) {
    $(document).ready(function(){
      var more = $('<li class="more btn btn-xs btn-default"><a href="">Show more</a></li>');
      var less = $('<li class="less btn btn-xs btn-default" ><a href="">Show less</a></li>');

      $('ul#link-list').children('li:gt(10)').hide();
      $('ul#link-list').append(more);

      $('body').on('click','.more',function(e){
          e.preventDefault();
          $(this).remove();
          $('ul#link-list').children().show();
          $('ul#link-list').append(less);
          return false;
      });

      $('body').on('click','.less',function(e){
          e.preventDefault();
          $(this).remove();
          $('ul#link-list').children('li:gt(10)').hide();
          $('ul#link-list').append(more);
          return false;
      });
    });
  }
</script>

<commit_msg>Fixed - metatags keywords not rendering correctly on show page<commit_after><!-- the meta tag is for use with metamagic gem which generates
     title and meta tags in conjunction with the metamagic
     method in app/views/layouts/application.html.erb
     TODO: Create a view helper that works for all pages -->
<% meta title: "#{@this_case.title} - #{@this_case.city} on EBWiki",
     description: "#{@this_case.blurb}",
     keywords: %w("#{@this_case.subjects.first.name} police violence people color")
%>
<!-- Page Content -->
<div class="container">

<!-- Portfolio Item Heading -->
  <div class="row">
  </div>
  <!-- /.row -->

  <!-- Portfolio Item Row -->
  <div class="row">
    <div class="col-md-3">
      <% if @this_case.avatar? %>
        <%= image_tag(@this_case.avatar.large_avatar, :class => "img-responsive articleImage") %>
      <% else %>
        <%= image_tag('default-user-icon.png', :size => "250x250", :class => "img-responsive articleImage") %>
      <% end %>

      <div class="">
        <%= social_share_button_tag("Take a look at what I just found on EBWiki:") %>
      </div>
      <div class="row case-btns">
        <%= render 'button_group' %>
      </div>
      <%= render "comments/add_comment_form" %>
      <div class="commentList" >
        <%= render "comments/comments" %>
      </div>
    </div>

    <div class="col-md-9">
      <h1 class="page-header case-title"><%= @subjects.first.name %>, <%= @subjects.first.age ? "#{@subjects.first.age}" : "" %>
      <br>
          <small><%= @this_case.city %>, <%= @this_case.state.name %></small>
      <br/><small><%= @this_case.date.strftime("%B %d, %Y") %></small>
          <% if @this_case.agencies.present? %>
            <p>Agencies:
              <% @this_case.agencies.each_with_index do |agency, index| %>
                <%= link_to agency.name, agency_path(agency) %>
                <% unless index == @this_case.agencies.size - 1 %>
                  <%= "|" %>
                <% end %>
              <% end %>
            </p>
          <% end %>
          <div>
            <% if current_user %>
              <% if current_user.following?(@this_case) %>
              <% else %>
                <%= link_to 'Follow This Case', case_follows_path(@this_case), :method => :post, class: "btn-lg btn-primary text-center", data: {:toggle => 'popover', :container => 'body', :trigger => 'hover',:placement => "bottom",:content => "Click here to receive an email whenever this case is updated."} %>
              <% end %>
            <% else %>
              <%= link_to 'Follow This Case', case_follows_path(@this_case), :method => :post, class: "btn-lg btn-primary text-center", data: {:toggle => 'popover', :container => 'body', :trigger => 'hover',:placement => "bottom",:title => "Login to Follow this case!",:content => "Click here to receive an email whenever this case is updated."} %>
            <% end %>
          </div>
      </h1>
      <p class="timeAgo">Last updated: <%= time_ago_in_words(@this_case.updated_at) %> ago</p>
        <% if @this_case.followers.present? %>
          <p>
            <%= link_to 'People tracking this case', cases_followers_path(@this_case) %>: <span class="timeAgo"><%= @this_case.followers.count %></span>
              <% unless @this_case.followers.include?(current_user) %>
                -- Click here to <%= link_to 'Track this', case_follows_path(@this_case), :method => :post %>.
              <% end %>
          </p>
        <% end %>
        <%= render 'main_content' %>
      <div class="row">
        <div class="col-md-12">
          <% if @this_case.video_url? %>
            <div class="embed-container">
                <%= embed(@this_case.video_url) %>
            </div>
          <% end %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-12" >
          <% if @this_case.links.count > 0 %>
            <h4 class="article_subheader">Additional Resources:</h4>
            <ul class="background-links" id="link-list">
              <% @this_case.links.each do |link| %>
                <li>
                  <%= link_to link.url, "#{link.url}", target: '_blank' %> <span class="timeAgo">added <%= link.created_at.strftime("%b %d, %Y") %></span>
                </li>
              <% end %>
            </ul>
          <% end %>
        </div>
      </div>
      <% if @this_case.nearby_cases.present? %>
      <!-- Related Projects Row -->
        <div class="row">
          <div class="col-lg-12">
            <h3 class="page-header">EBWiki is tracking <%= pluralize(@this_case.nearby_cases.size, "case")%> near <%= @this_case.city %>, <%= @this_case.state.name %>:</h3>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            <% @this_case.nearby_cases.each do |this_case| %>
            <div class="col-lg-2 col-md-4 col-xs-12">
              <div class="view view-first">
                <% if this_case.avatar? %>
                  <%= link_to image_tag(this_case.avatar.large_avatar, :class => "img-responsive"), this_case %>
                <% else %>

                  <div class="thumbnail text-center">
                    <%= link_to image_tag("default-user-icon.png", :class => "img-responsive"), this_case %>
                    <div class="caption">
                      <h4><%= this_case.title %></h4>
                    </div>
                  </div>
                <% end %>
                <div class="mask">
                  <h2><%= link_to this_case.title, this_case, :class => "info2" %></h2>
                </div>
              </div>
            </div>
            <% end %>
          </div>
        </div>

        <!-- Map -->
        <div class="row">
          <div class="col-lg-12 articleMap">
          <div id='map'></div>
        </div>
      <% end %>
    </div>
  </div>
</div>


<!-- /.row -->

<script type="text/javascript">
  $(document).ready(function(){
      $('[data-toggle="popover"]').popover();
  });
</script>
<script type="">
  handler = Gmaps.build('Google');
  handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
    markers = handler.addMarkers(<%= raw marker_locations_for(
      @this_case.nearby_cases.map { |that_case|
        [that_case.id, that_case.latitude, that_case.longitude,
        that_case.default_avatar_url, that_case.title, that_case.blurb]
      }
    ).to_json %>);
    handler.bounds.extendWith(markers);
    handler.fitMapToBounds();
  });
</script>

<script type="text/javascript">
  if($('ul#link-list').children().length > 10) {
    $(document).ready(function(){
      var more = $('<li class="more btn btn-xs btn-default"><a href="">Show more</a></li>');
      var less = $('<li class="less btn btn-xs btn-default" ><a href="">Show less</a></li>');

      $('ul#link-list').children('li:gt(10)').hide();
      $('ul#link-list').append(more);

      $('body').on('click','.more',function(e){
          e.preventDefault();
          $(this).remove();
          $('ul#link-list').children().show();
          $('ul#link-list').append(less);
          return false;
      });

      $('body').on('click','.less',function(e){
          e.preventDefault();
          $(this).remove();
          $('ul#link-list').children('li:gt(10)').hide();
          $('ul#link-list').append(more);
          return false;
      });
    });
  }
</script>


{'fraction_non_alphanumeric': 0.19403492085060126, 'fraction_numerical': 0.005571030640668524, 'mean_word_length': 2.079497907949791, 'pattern_counts': {'":': 0, '<': 337, '<?xml version=': 0, '>': 381, 'https://': 0, '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': '3194783', 'n_tokens_mistral': 4932, 'n_tokens_neox': 4537, 'n_words': 930}