<commit_before>
<% if logged_in? %>
  <div class='row'>
  <div class="col-md-12">
  <br>
  <h2 class='center'>New Badge</h2>
  <br>
  <% if current_user.provider == 'github'%>
     <h4>You may select from one of your GitHub repos <i>OR</i>
           provide information about some other project.</h4>
     <br>
     <%= form_for(@project) do |f| %>
       <%= f.collection_select :repo_url, github_select, :last, :first, { prompt: 'Select one of your Github repos', disabled: lambda{ |repo| repo.last == 'none' }} %>
       <%= f.submit 'Submit GitHub Repository', class:"btn btn-primary" %>
     <% end %>

     <br><h2 class='center'>OR</h2>
  <% end %>
  <br>
  <%= form_for(@project) do |f| %>
      <span>What is the URL for the project home page (the URL for the project as a whole)? Start with http(s):// (many characters are not allowed, including "?")</span>
      <%= f.text_field :project_homepage_url, class:"form-control",
            type: 'url', hide_label: true,
            pattern: '(|https?:\/\/[A-Za-z0-9][-A-Za-z0-9_.\/]*(\/[-A-Za-z0-9_.\/\+,#]*)?)',
            placeholder:'http(s)://... for project home page URL' %>
      <span>What is the URL for the version control repository
            (it may the same as the project home page)? Start with http(s):// (many characters are not allowed, including "?")</span>
      <%= f.text_field :repo_url, class:"form-control",
            type: 'url', hide_label: true,
            pattern: '(|https?:\/\/[A-Za-z0-9][-A-Za-z0-9_.\/]*(\/[-A-Za-z0-9_.\/\+,#]*)?)',
            placeholder:'http(s)://... for project repo URL' %>
     <%= f.submit 'Submit URL', class:"btn btn-primary" %>
  <% end %>
  </div>
  </div>
<% else %>
  <% flash.now[:danger] = "Please sign in to add a project!"%>
  <%= render :template => "sessions/new" %>
<% end %><commit_msg>Show error messages for new projects, closes #135<commit_after>
<% if logged_in? %>
  <div class='row'>
  <div class="col-md-12">
  <br>
  <h2 class='center'>New Badge</h2>
  <br>
  <% if current_user.provider == 'github'%>
     <h4>You may select from one of your GitHub repos <i>OR</i>
           provide information about some other project.</h4>
     <br>
     <%= form_for(@project) do |f| %>
       <%= f.collection_select :repo_url, github_select, :last, :first, { prompt: 'Select one of your Github repos', disabled: lambda{ |repo| repo.last == 'none' }} %>
       <%= f.submit 'Submit GitHub Repository', class:"btn btn-primary" %>
     <% end %>

     <br><h2 class='center'>OR</h2>
  <% end %>
  <br>
  <%= form_for(@project) do |f| %>
      <%= render 'shared/error_messages', object: f.object %>
      <span>What is the URL for the project home page (the URL for the project as a whole)? Start with http(s):// (many characters are not allowed, including "?")</span>
      <%= f.text_field :project_homepage_url, class:"form-control",
            type: 'url', hide_label: true,
            pattern: '(|https?:\/\/[A-Za-z0-9][-A-Za-z0-9_.\/]*(\/[-A-Za-z0-9_.\/\+,#]*)?)',
            placeholder:'http(s)://... for project home page URL' %>
      <span>What is the URL for the version control repository
            (it may the same as the project home page)? Start with http(s):// (many characters are not allowed, including "?")</span>
      <%= f.text_field :repo_url, class:"form-control",
            type: 'url', hide_label: true,
            pattern: '(|https?:\/\/[A-Za-z0-9][-A-Za-z0-9_.\/]*(\/[-A-Za-z0-9_.\/\+,#]*)?)',
            placeholder:'http(s)://... for project repo URL' %>
     <%= f.submit 'Submit URL', class:"btn btn-primary" %>
  <% end %>
  </div>
  </div>
<% else %>
  <% flash.now[:danger] = "Please sign in to add a project!"%>
  <%= render :template => "sessions/new" %>
<% end %>
{'fraction_non_alphanumeric': 0.2075320512820513, 'fraction_numerical': 0.011485042735042736, 'mean_word_length': 2.782828282828283, 'pattern_counts': {'":': 0, '<': 78, '<?xml version=': 0, '>': 80, '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': '497442', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1277, 'n_words': 353}