<commit_before><% content_for :body_class do %>detail lgHeader<% end %>

<% content_for :title do %>
  <%= @source.title %>
<% end %>

<%= render 'tabs' %>

<div id="ltColumn">
  <%= show_flash_message %>  

  <p><%= @source.description %></p>
  <div class="module">
    <div id="dataDetails">
      <div id="metaDetails">
        <dl>
          
          <%= detail_field @source, :attribute => :organization_id, :label => "Organization",
                           :value => DataCatalog::Organization.get(@source.organization_id).name %>
          
          <%= detail_field @source, :attribute => :categories, :collection => true, :label => "Category",
                           :value => "", :url => "#"%>
                           
          <%= detail_field @source, :attribute => :url, :label => "Homepage",
                           :value => truncate(@source.url, :length => 30), :url => @source.url %>

          <%= detail_field @source, :attribute => :documentation_url, :label => "Official Docs",
                           :value => truncate(@source.documentation_url, :length => 30), :url => @source.documentation_url %>

          <%= detail_field @source, :attribute => :license, :label => "License",
                           :value => @source.license, :url => @source.license_url %>
          
          <%= detail_field @source, :attribute => :catalog_name, :label => "Original Catalog", 
                           :value => @source.catalog_name, :url => @source.catalog_url %>
                           
          <%= detail_field @source, :attribute => :released2, :label => "Released", 
                           :value => @source.released.to_s %>

          <%= detail_field @source, :attribute => :period_start, :label => "Period", 
                           :value => kronos_to_string_range(@source.period_start, @source.period_end) %>

          <%= detail_field @source, :attribute => :frequency, :label => "Frequency", 
                           :value => @source.frequency.to_s.titlecase %>
        </dl>
        
        <% unless @source.custom.empty? -%>
        <!--<a class="allLink" id="additionalData_information" href="#">View Additional Information</a>-->
        <% end -%>
      </div>

      <div id="ratingBox">
        <div class="stars" id="overallRating">
          <h3 class="textReplace withTip" id="header_overall">Overall Rating</h3>
          <%= render 'shared/star_rating', :rating => (@source.rating_stats.average ? @source.rating_stats.average.round : nil) %>
          <div class="tip">(averaged from <%= rating_count(@source.rating_stats.average, @source.rating_stats.total) %> votes)</div>
        </div>
        <div class="stars" id="yourRating">
          <h3 class="textReplace" id="header_your">Your Rating</h3>
          <ul class="you-star-rating star-ratingActive">
            <li title="Unusable" class="oneStar">
              <%= link_to 1, source_rating_path(@source.slug, 1) %>
            </li>
            <li title="Bad" class="twoStars">
              <%= link_to 2, source_rating_path(@source.slug, 2) %>
            </li>
            <li title="Fair" class="threeStars">
              <%= link_to 3, source_rating_path(@source.slug, 3) %>
            </li>
            <li title="Good" class="fourStars">
              <%= link_to 4, source_rating_path(@source.slug, 4) %>
            </li>
            <li title="Great" class="fiveStars">
              <%= link_to 5, source_rating_path(@source.slug, 5) %>
            </li>
          </ul>
        </div>
      </div> 

      <div class="clear"></div> 
    </div> 

    <% unless @source.downloads.empty? -%>
    <div id="downloadFormats">
      <h3>Available Formats for Download</h3>
      <ul>
        <% @source.downloads.each do |download| -%>
        <li>
          <a href="<%= download.url %>"><%= download.format.upcase %></a>
          <% unless download['size'].blank? %>
            <span>(<%= download['size'] %>)</span>
          <% end %>
        </li>
        <% end -%>
      </ul>   
      <div class="clear"></div> 
    </div>
    <% end -%>
  </div>
  
  <% unless @source.downloads.empty? || @source.downloads.first.nil? || @source.downloads.first.preview.nil?  -%>
  <div class="module">
    <h3>Preview of Data</h3>
    <div class="scroll mono code"><%= @source.downloads.first.preview %></div>
  </div>
  <% end -%>
</div> 
<div id="rtColumnWrapper">
  <div id="rtColumn" class="withBg">
    <%= render 'sidebar_favorites' %>
    <%= render 'sidebar_notes' %>
  </div> 
</div>
<div class="clear"></div> 
<div id="commentBox">
  <% if @comments.length > 0 -%>
  <h3 id="discussionTitle">Discussion</h3>
  <span id="numberComments"><%= @source.comments.length %></span>
  <div class="clear"></div>
  <!-- Render "Most Useful" here-->
  <div id="threadedComments">
    <%= render 'comments', :comments => @comments %>
  </div>
  <% end -%>
  <a name="comment_form" id="comment_form"></a>
  <% if current_user -%>
  
    <div id="signin_to_comment" class="<%= @reports_problem ? "reports_problem" : "" %>">
      <h3 class="withTip"><%= @reports_problem ? "Report a Problem" : "Your Thoughts" %></h3>  
      <p class="tip">Have some findings to share? Run across something that was missing or broken? Please leave us a comment below.</p>
  
      <% form_for @comment, :url => source_comment_path(@source.slug), :method => :post, :html => { :id => "comment" } do |f| %>
        <%= f.hidden_field :parent_id, :value => @parent_id %>
    
        <%= f.label :comment, "Comment", :id => "commentLabel" %>
        <%= f.text_area :text, :id => "commentTextarea", :class => "textarea full", :rows => 5, :cols => 32 %>
    
        <div id="commentReport">
          <label id="problemLabel">This Comment:</label>
          <label>
            <input id="comment_reports_problem" class="checkbox" type="checkbox" <%= "checked='checked'" if @reports_problem %> value="1" name="comment[reports_problem]"/>
            Reports a Problem in the Data
          </label>
        </div>
    
        <button title="post" class="postComment" type="submit">
          <span>Post Comment</span>
        </button>
      </div>

    <% end -%>
    
  <% else -%>
  <div id="signin_to_comment" class="<%= @reports_problem ? "reports_problem" : "" %>">
    <h3 class="withTip"><%= @reports_problem ? "Sign in to report a problem" : "Sign in to comment" %></h3>
    <p class="tip">To leave a comment or report a problem with this data, you must <%= link_to "sign in", signin_url %>. No account yet? <%= link_to "Sign up", signup_url %>.</p>
  </div>
  <% end -%>
</div>        
<commit_msg>link to org from source detail page [#4087391]<commit_after><% content_for :body_class do %>detail lgHeader<% end %>

<% content_for :title do %>
  <%= @source.title %>
<% end %>

<%= render 'tabs' %>

<div id="ltColumn">
  <%= show_flash_message %>  

  <p><%= @source.description %></p>
  <div class="module">
    <div id="dataDetails">
      <div id="metaDetails">
        <dl>
          
          <%= detail_field @source,
            :attribute => :organization_id,
            :label     => "Organization",
            :value     => DataCatalog::Organization.get(@source.organization_id).name,
            :url       => org_path(@source.organization.slug) %>
          
          <%= detail_field @source, :attribute => :categories, :collection => true, :label => "Category",
                           :value => "", :url => "#"%>
                           
          <%= detail_field @source, :attribute => :url, :label => "Homepage",
                           :value => truncate(@source.url, :length => 30), :url => @source.url %>

          <%= detail_field @source, :attribute => :documentation_url, :label => "Official Docs",
                           :value => truncate(@source.documentation_url, :length => 30), :url => @source.documentation_url %>

          <%= detail_field @source, :attribute => :license, :label => "License",
                           :value => @source.license, :url => @source.license_url %>
          
          <%= detail_field @source, :attribute => :catalog_name, :label => "Original Catalog", 
                           :value => @source.catalog_name, :url => @source.catalog_url %>
                           
          <%= detail_field @source, :attribute => :released2, :label => "Released", 
                           :value => @source.released.to_s %>

          <%= detail_field @source, :attribute => :period_start, :label => "Period", 
                           :value => kronos_to_string_range(@source.period_start, @source.period_end) %>

          <%= detail_field @source, :attribute => :frequency, :label => "Frequency", 
                           :value => @source.frequency.to_s.titlecase %>
        </dl>
        
        <% unless @source.custom.empty? -%>
        <!--<a class="allLink" id="additionalData_information" href="#">View Additional Information</a>-->
        <% end -%>
      </div>

      <div id="ratingBox">
        <div class="stars" id="overallRating">
          <h3 class="textReplace withTip" id="header_overall">Overall Rating</h3>
          <%= render 'shared/star_rating', :rating => (@source.rating_stats.average ? @source.rating_stats.average.round : nil) %>
          <div class="tip">(averaged from <%= rating_count(@source.rating_stats.average, @source.rating_stats.total) %> votes)</div>
        </div>
        <div class="stars" id="yourRating">
          <h3 class="textReplace" id="header_your">Your Rating</h3>
          <ul class="you-star-rating star-ratingActive">
            <li title="Unusable" class="oneStar">
              <%= link_to 1, source_rating_path(@source.slug, 1) %>
            </li>
            <li title="Bad" class="twoStars">
              <%= link_to 2, source_rating_path(@source.slug, 2) %>
            </li>
            <li title="Fair" class="threeStars">
              <%= link_to 3, source_rating_path(@source.slug, 3) %>
            </li>
            <li title="Good" class="fourStars">
              <%= link_to 4, source_rating_path(@source.slug, 4) %>
            </li>
            <li title="Great" class="fiveStars">
              <%= link_to 5, source_rating_path(@source.slug, 5) %>
            </li>
          </ul>
        </div>
      </div> 

      <div class="clear"></div> 
    </div> 

    <% unless @source.downloads.empty? -%>
    <div id="downloadFormats">
      <h3>Available Formats for Download</h3>
      <ul>
        <% @source.downloads.each do |download| -%>
        <li>
          <a href="<%= download.url %>"><%= download.format.upcase %></a>
          <% unless download['size'].blank? %>
            <span>(<%= download['size'] %>)</span>
          <% end %>
        </li>
        <% end -%>
      </ul>   
      <div class="clear"></div> 
    </div>
    <% end -%>
  </div>
  
  <% unless @source.downloads.empty? || @source.downloads.first.nil? || @source.downloads.first.preview.nil?  -%>
  <div class="module">
    <h3>Preview of Data</h3>
    <div class="scroll mono code"><%= @source.downloads.first.preview %></div>
  </div>
  <% end -%>
</div> 
<div id="rtColumnWrapper">
  <div id="rtColumn" class="withBg">
    <%= render 'sidebar_favorites' %>
    <%= render 'sidebar_notes' %>
  </div> 
</div>
<div class="clear"></div> 
<div id="commentBox">
  <% if @comments.length > 0 -%>
  <h3 id="discussionTitle">Discussion</h3>
  <span id="numberComments"><%= @source.comments.length %></span>
  <div class="clear"></div>
  <!-- Render "Most Useful" here-->
  <div id="threadedComments">
    <%= render 'comments', :comments => @comments %>
  </div>
  <% end -%>
  <a name="comment_form" id="comment_form"></a>
  <% if current_user -%>
  
    <div id="signin_to_comment" class="<%= @reports_problem ? "reports_problem" : "" %>">
      <h3 class="withTip"><%= @reports_problem ? "Report a Problem" : "Your Thoughts" %></h3>  
      <p class="tip">Have some findings to share? Run across something that was missing or broken? Please leave us a comment below.</p>
  
      <% form_for @comment, :url => source_comment_path(@source.slug), :method => :post, :html => { :id => "comment" } do |f| %>
        <%= f.hidden_field :parent_id, :value => @parent_id %>
    
        <%= f.label :comment, "Comment", :id => "commentLabel" %>
        <%= f.text_area :text, :id => "commentTextarea", :class => "textarea full", :rows => 5, :cols => 32 %>
    
        <div id="commentReport">
          <label id="problemLabel">This Comment:</label>
          <label>
            <input id="comment_reports_problem" class="checkbox" type="checkbox" <%= "checked='checked'" if @reports_problem %> value="1" name="comment[reports_problem]"/>
            Reports a Problem in the Data
          </label>
        </div>
    
        <button title="post" class="postComment" type="submit">
          <span>Post Comment</span>
        </button>
      </div>

    <% end -%>
    
  <% else -%>
  <div id="signin_to_comment" class="<%= @reports_problem ? "reports_problem" : "" %>">
    <h3 class="withTip"><%= @reports_problem ? "Sign in to report a problem" : "Sign in to comment" %></h3>
    <p class="tip">To leave a comment or report a problem with this data, you must <%= link_to "sign in", signin_url %>. No account yet? <%= link_to "Sign up", signup_url %>.</p>
  </div>
  <% end -%>
</div>        

{'fraction_non_alphanumeric': 0.18446819642723672, 'fraction_numerical': 0.005605800134539203, 'mean_word_length': 2.3822042467138522, 'pattern_counts': {'":': 0, '<': 327, '<?xml version=': 0, '>': 424, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2333389', 'n_tokens_mistral': 4443, 'n_tokens_neox': 4093, 'n_words': 899}