<commit_before><div id="homepage">
  <div class="container clearfix">

      <div class="homepage_content clearfix">
        <%= raw(@settings.homepage_content) %>
      </div>

    <div class="campaigns">

      <% if @campaigns.count > 0 %>
        <% @campaigns.each do |campaign| %>
          <% if campaign.published_flag %>
          <a href="<%= url_for campaign_home_path(campaign) %>" class="campaign clearfix">

            <% if campaign.media_type == 'video' && !campaign.video_embed_id.blank?%>

              <% if campaign.video_placeholder.file? %>
                <%= image_tag campaign.video_placeholder.url(:main), alt: "main_image" %>
              <% else %>
                <%= image_tag "https://img.youtube.com/vi/#{campaign.video_embed_id}/hqdefault.jpg", alt: "main_image" %>
              <% end %>

            <% else %>

              <% if campaign.main_image.file? %>
                <%= image_tag campaign.main_image.url(:small), alt: "main_image" %>
              <% else %>
                <div class="placeholder"></div>
              <% end %>

            <% end %>

            <p class="info">
              <%= truncate(campaign.name, length: 50) %>
            </p>

            <% if campaign.raised_amount.to_f/100 < campaign.goal_dollars.to_f %>
              <div id='progress_bg'>
                <div id='progress' class='' style='width: <%= campaign.tilt_percent.nil? ? 0 : campaign.tilt_percent.ceil %>%;'>
                </div>
              </div>
            <% else %>
              <div id="progress_bg">
                <div id="progress">
                </div>
                </div>
            <% end %>

            <p class="numbers pull-left">
              <% if campaign.goal_type == 'dollars' %>
              <strong>$<%= campaign.raised_amount.ceil %></strong><br/>
              <%= campaign.progress_text %>
              <% else %>
               <strong><%= campaign.orders %></strong><br/>
              <%= campaign.contributor_reference.pluralize(campaign.orders) %>
              <% end %>
            </p>

            <p class="numbers pull-right" style="text-align:right">
            <% if campaign.expired? %>
              <strong>No</strong><br/>days left!
            <% else %>
              <strong><%= distance_of_time_in_words_to_now(campaign.expiration_date).gsub(/\D/, "") %></strong>
              <span style="display: block; width: 100px;">
                <%= distance_of_time_in_words_to_now(campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left
              </span>
            <% end %>
            </p>

          </a>
          <% end %>
        <% end %>
      <% else %>

      <div class="center" style="padding-left:0px"><h4>No campaigns yet!</h4></div>

      <% end %>
    </div>
  </div>
</div><commit_msg>make it easier to start a user's first campaign<commit_after><div id="homepage">
  <div class="container clearfix">

      <div class="homepage_content clearfix">
        <%= raw(@settings.homepage_content) %>
      </div>

    <div class="campaigns">

      <% if @campaigns.count > 0 %>
        <% @campaigns.each do |campaign| %>
          <% if campaign.published_flag %>
          <a href="<%= url_for campaign_home_path(campaign) %>" class="campaign clearfix">

            <% if campaign.media_type == 'video' && !campaign.video_embed_id.blank?%>

              <% if campaign.video_placeholder.file? %>
                <%= image_tag campaign.video_placeholder.url(:main), alt: "main_image" %>
              <% else %>
                <%= image_tag "https://img.youtube.com/vi/#{campaign.video_embed_id}/hqdefault.jpg", alt: "main_image" %>
              <% end %>

            <% else %>

              <% if campaign.main_image.file? %>
                <%= image_tag campaign.main_image.url(:small), alt: "main_image" %>
              <% else %>
                <div class="placeholder"></div>
              <% end %>

            <% end %>

            <p class="info">
              <%= truncate(campaign.name, length: 50) %>
            </p>

            <% if campaign.raised_amount.to_f/100 < campaign.goal_dollars.to_f %>
              <div id='progress_bg'>
                <div id='progress' class='' style='width: <%= campaign.tilt_percent.nil? ? 0 : campaign.tilt_percent.ceil %>%;'>
                </div>
              </div>
            <% else %>
              <div id="progress_bg">
                <div id="progress">
                </div>
                </div>
            <% end %>

            <p class="numbers pull-left">
              <% if campaign.goal_type == 'dollars' %>
              <strong>$<%= campaign.raised_amount.ceil %></strong><br/>
              <%= campaign.progress_text %>
              <% else %>
               <strong><%= campaign.orders %></strong><br/>
              <%= campaign.contributor_reference.pluralize(campaign.orders) %>
              <% end %>
            </p>

            <p class="numbers pull-right" style="text-align:right">
            <% if campaign.expired? %>
              <strong>No</strong><br/>days left!
            <% else %>
              <strong><%= distance_of_time_in_words_to_now(campaign.expiration_date).gsub(/\D/, "") %></strong>
              <span style="display: block; width: 100px;">
                <%= distance_of_time_in_words_to_now(campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left
              </span>
            <% end %>
            </p>

          </a>
          <% end %>
        <% end %>
      <% else %>

      <div class="center" style="padding-left:0px"><h4>No campaigns yet. <% if user_signed_in? && current_user.admin? %><%= link_to 'Start one now!', new_admin_campaign_path %><% end %></h4></div>

      <% end %>
    </div>
  </div>
</div>
{'fraction_non_alphanumeric': 0.17186691949663851, 'fraction_numerical': 0.004481985864506119, 'mean_word_length': 1.720112517580872, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 0, '>': 170, 'https://': 2, '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': '7234876', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1640, 'n_words': 287}