<commit_before><% if f.object.errors.count == 1 && f.object.already_posted_story %>
  <div class="flash-error">
  <h2>Error: This story was already submitted <%=
    time_ago_in_words(f.object.already_posted_story.created_at) %> ago</h2>
  <p>
  Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
  target="_blank">previous discussion</a> for this story.
  </p>
  </div>
<% elsif f.object.errors.any? %>
  <%= error_messages_for f.object %>
<% elsif !f.object.errors.any? && f.object.already_posted_story %>
  <div class="flash-notice">
  <h2>Note: This story was already submitted <%=
    time_ago_in_words(f.object.already_posted_story.created_at) %> ago, but may
    be submitted again.</h2>
  <p>
  Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
  target="_blank">previous discussion</a> for this story first.  If the content
  has changed or warrants new discussion, you may submit it again.
  </p>
  </div>

  <%= f.hidden_field :seen_previous %>
<% end %>

<div class="box">
  <div class="boxline">
  <% if f.object.url_is_editable_by_user?(@user) %>
    <%= f.label :url, "URL:", :class => "required" %>
    <%= f.text_field :url, :autocomplete => "off" %>
    <%= button_tag "Fetch Title", :id => "story_fetch_title",
      :type => "button" %>
  <% elsif !f.object.new_record? && !f.object.url.blank? %>
    <%= f.label :url, "URL:", :class => "required" %>
    <div class="d">
    <a href="<%= f.object.url %>"><%= f.object.url %></a>
    </div>
  <% end %>
  </div>

  <div class="boxline">
    <%= f.label :title, "Title:", :class => "required" %>
    <%= f.text_field :title, :maxlength => 100, :autocomplete => "off"  %>
  </div>

  <div class="boxline" style="margin-bottom: 2px;">
  <%= f.label :tags_a, "Tags:", :class => "required",
    :style => "line-height: 2.3em;" %>
  <%= f.select "tags_a", options_for_select(
    Tag.all_with_filtered_counts_for(@user).map{|t|
      html = "<strong>#{h(t.tag)}</strong> - #{h(t.description.to_s)}"

      if t.hotness_mod != 0
        html << " (hotness mod #{t.hotness_mod > 0 ? "+" : ""}#{t.hotness_mod})"
      end
      if t.filtered_count > 0
        html << " <em>#{t.filtered_count} user" <<
          (t.filtered_count == 1 ? "" : "s") << " filtering</em>"
      end

      [ "#{t.tag} - #{t.description}", t.tag, { "data-html" => raw(html) } ]},
    f.object.tags_a), {}, { :multiple => true } %>
  </div>

  <div class="boxline">
    <%= f.label :description, "Text:", :class => "required" %>
    <%= f.text_area :description, :rows => 5,
      :placeholder => "Optional when submitting a URL; please see guidelines",
      :autocomplete => "off" %>
  </div>

  <% if @user %>
    <div class="boxline">
      <%= f.label :anon, "Anonymous", :class => "required" %>
      <%= f.check_box :anon %>
    </div>
  <% end %>

  <div class="boxline markdown_help_toggler">
    <a href="#" id="story_guidelines_toggler">
      Story submission guidelines
    </a>
    <div id="story_guidelines" style="<%= show_guidelines?? "" :
    "display: none;" %>">
      <div style="float: right;">
      <a href="javascript:window.location=%22<%= Rails.application.root_url %>stories/new?url=%22+encodeURIComponent(document.location)+%22&title=%22+encodeURIComponent(document.title)"
      style="border: 1px solid #ddd; padding: 0.5em; background-color:
      #f8f8f8; line-height: 1.5em; margin-left: 1em;">Submit to
      <%= Rails.application.name %></a>
      </div>
      <ul>

        <li><p>
        To be able to easily submit a page you're viewing in your browser
        to <%= Rails.application.name %>, drag the bookmarklet to the right
        to your bookmark bar.  You'll be taken to this page with the viewed
        page's URL and title.
        </p></li>

        <li><p>
        When submitting a URL, the text field is optional and should only
        be used when additional context or explanation of the URL is
        needed.  Commentary or opinion should be reserved for a comment,
        so that it can be voted on separately from the story.
        </p></li>

        <li><p>
        Do not editorialize story titles, but when the original story's
        title has no context or is unclear, please change it.  <strong>Please
        remove extraneous components from titles such as the name of the
        site or section.</strong>
        </p></li>

        <li><p>
        If no tags clearly apply to the story you are submitting, chances
        are it does not belong here.  Do not overreach with tags if they
        are not the primary focus of the story.
        </p></li>

        <li><p>
        When the story being submitted is more than a year or so old,
        please add the year the story was written to the post title in
        parentheses.
        </p></li>

      </ul>
    </div>
  </div>
</div>

<script>
  $(document).ready(function() {
    $("#story_fetch_title").click(function() {
      Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
      return false;
    });
  });
</script><commit_msg>finishing up<commit_after><% if f.object.errors.count == 1 && f.object.already_posted_story %>
  <div class="flash-error">
  <h2>Error: This story was already submitted <%=
    time_ago_in_words(f.object.already_posted_story.created_at) %> ago</h2>
  <p>
  Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
  target="_blank">previous discussion</a> for this story.
  </p>
  </div>
<% elsif f.object.errors.any? %>
  <%= error_messages_for f.object %>
<% elsif !f.object.errors.any? && f.object.already_posted_story %>
  <div class="flash-notice">
  <h2>Note: This story was already submitted <%=
    time_ago_in_words(f.object.already_posted_story.created_at) %> ago, but may
    be submitted again.</h2>
  <p>
  Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
  target="_blank">previous discussion</a> for this story first.  If the content
  has changed or warrants new discussion, you may submit it again.
  </p>
  </div>

  <%= f.hidden_field :seen_previous %>
<% end %>

<div class="box">
  <div class="boxline">
  <% if f.object.url_is_editable_by_user?(@user) %>
    <%= f.label :url, "URL:", :class => "required" %>
    <%= f.text_field :url, :autocomplete => "off" %>
    <%= button_tag "Fetch Title", :id => "story_fetch_title",
      :type => "button" %>
  <% elsif !f.object.new_record? && !f.object.url.blank? %>
    <%= f.label :url, "URL:", :class => "required" %>
    <div class="d">
    <a href="<%= f.object.url %>"><%= f.object.url %></a>
    </div>
  <% end %>
  </div>

  <div class="boxline">
    <%= f.label :title, "Title:", :class => "required" %>
    <%= f.text_field :title, :maxlength => 100, :autocomplete => "off"  %>
  </div>

  <div class="boxline" style="margin-bottom: 2px;">
  <%= f.label :tags_a, "Tags:", :class => "required",
    :style => "line-height: 2.3em;" %>
  <%= f.select "tags_a", options_for_select(
    Tag.all_with_filtered_counts_for(@user).map{|t|
      html = "<strong>#{h(t.tag)}</strong> - #{h(t.description.to_s)}"

      if t.hotness_mod != 0
        html << " (hotness mod #{t.hotness_mod > 0 ? "+" : ""}#{t.hotness_mod})"
      end
      if t.filtered_count > 0
        html << " <em>#{t.filtered_count} user" <<
          (t.filtered_count == 1 ? "" : "s") << " filtering</em>"
      end

      [ "#{t.tag} - #{t.description}", t.tag, { "data-html" => raw(html) } ]},
    f.object.tags_a), {}, { :multiple => true } %>
  </div>

  <div class="boxline">
    <%= f.label :description, "Text:", :class => "required" %>
    <%= f.text_area :description, :rows => 5,
      :placeholder => "Optional when submitting a URL",
      :autocomplete => "off" %>
  </div>

  <% if @user %>
    <div class="boxline">
      <%= f.label :anon, "Anonymous", :class => "required" %>
      <%= f.check_box :anon %>
    </div>
  <% end %>

  <div class="boxline markdown_help_toggler">
    <a href="#" id="story_guidelines_toggler">
      Story submission guidelines
    </a>
    <div id="story_guidelines" style="<%= show_guidelines?? "" :
    "display: none;" %>">
      <div style="float: right;">
      <a href="javascript:window.location=%22<%= Rails.application.root_url %>stories/new?url=%22+encodeURIComponent(document.location)+%22&title=%22+encodeURIComponent(document.title)"
      style="border: 1px solid #ddd; padding: 0.5em; background-color:
      #f8f8f8; line-height: 1.5em; margin-left: 1em;">-> <%= Rails.application.name %></a>
      </div>
      <ul>

        <li><p>
        To submit a page you're viewing in your browser to <%= Rails.application.name %>, drag the bookmarklet to the right
        to your bookmark bar.
        </p></li>
        
        <li><p>
        Rules: <strong>I don't know. Use good judgement for now</strong>
        </p></li>

      </ul>
    </div>
  </div>
</div>

<script>
  $(document).ready(function() {
    $("#story_fetch_title").click(function() {
      Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
      return false;
    });
  });
</script>
{'fraction_non_alphanumeric': 0.1852258986479059, 'fraction_numerical': 0.007255139056831923, 'mean_word_length': 3.057983942908118, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 240, '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': '4801033', 'n_tokens_mistral': 3323, 'n_tokens_neox': 3084, 'n_words': 767}