<commit_before><div id="post-<%= @post.id %>" class="post">
  <div class="hd">
    <h1>
      <a href="<%= @post.url %>" rel="bookmark"
          title="Permalink for this article">
        <%= h(@post.title) %>
      </a>
    </h1>
    
    <span class="date robots-nocontent">
      <%= @post.created_at(Riposte::Config::TIMESTAMP_LONG) %>
    </span>
  </div>
  
  <div class="bd">
    <%= @post.body_rendered %>
  </div>
  
  <div class="ft">
    <% unless @post.tags.empty? %>
      <div class="tags">
        <span class="icon tag"></span>
        <ul>
          <% @post.tags.each do |tag| %>
            <li>
              <a href="<%= tag.url %>" rel="tag"><%= h(tag.name) %></a>
            </li>
          <% end %>
        </ul>
      </div>
    <% end %>
    
    <div class="meta robots-nocontent">
      <span class="icon comment-post"></span>
      <a href="#post-comment">Post a comment</a>
    </div>
  </div>
</div>

<div id="comments">
  <h3>Comments</h3>
  
  <% @post.comments.all.each do |comment| %>
      <div id="comment-<%= comment.id %>" class="comment">
        <div class="hd">
          <h4>
            <span class="icon comment"></span>
            <a href="<%= comment.url %>" rel="bookmark"
                title="Permalink for this comment"><%= h(comment.title) %></a>
          </h4>
        </div>

        <div class="bd">
          <%= comment.body_rendered %>
        </div>

        <div class="ft">
          <span class="date robots-nocontent">
            <%= comment.created_at(Riposte::Config::TIMESTAMP_LONG) %>
          </span>
          <span class="author">
            Posted by
            <% if comment.author_url.empty? %>
              <%= h(comment.author) %>
            <% else %>
              <a href="<%= h(comment.author_url) %>" rel="nofollow">
                <%= h(comment.author) %>
              </a>
            <% end %>
          </span>
        </div>
      </div>
  <% end %>
</div>

<form id="post-comment" class="robots-nocontent" method="post"
    action="<%= R(CommentController, :new, @post.id) %>#post-comment">

  <% if @preview && @preview.valid? %>
    <fieldset>
      <div class="comment">
        <div class="hd">
          <h4>
            <span class="icon comment"></span>
            <a href="<%= @post.url %>" rel="bookmark"
                title="Permalink for this comment"><%= h(@preview.title) %></a>
          </h4>
        </div>

        <div class="bd">
          <%= @preview.body_rendered %>
        </div>

        <div class="ft">
          <span class="date robots-nocontent">
            <%= Time.now.strftime(Riposte::Config::TIMESTAMP_LONG) %>
          </span>
          <span class="author">
            Posted by
            <% if @preview.author_url.empty? %>
              <%= h(@preview.author) %>
            <% else %>
              <a href="<%= h(@preview.author_url) %>" rel="nofollow">
                <%= h(@preview.author) %>
              </a>
            <% end %>
          </span>
        </div>
      </div>
    </fieldset>
  <% end %>
  
  <fieldset>
    <legend>Post a comment</legend>
  
    <p>
      <label for="author">Name</label>
      <input type="text" name="author" id="author" maxlength="32"
          title="Enter your name"
          value="<%= h(@author) %>" />
    </p>
    
    <% if @preview; @preview.errors.on(:author).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <label for="author_url">URL</label>
      <input type="text" name="author_url" id="author_url" maxlength="255"
          title="Enter the URL of your website (optional)"
          value="<%= h(@author_url) %>" />
    </p>
  
    <% if @preview; @preview.errors.on(:author_url).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <label for="title">Title</label>
      <input type="text" class="long" name="title" id="title" maxlength="255"
          title="Enter a title for this comment"
          value="<%= @preview && @preview.title ? h(@preview.title) : '' %>" />
    </p>
  
    <% if @preview; @preview.errors.on(:title).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <textarea name="body" rows="6" cols="60"><%= @preview && @preview.body ? h(@preview.body) : '' %></textarea>
    </p>
  
    <% if @preview; @preview.errors.on(:body).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p class="tip">
      Basic XHTML (including links) is allowed, just don't try anything fishy.
      Your comment will be auto-formatted unless you use your own
      <code>&lt;p&gt;</code> tags for formatting.
    </p>
  
    <p class="noseeum">
      Don't type anything here unless you're an evil robot:<br />
      <input type="text" id="captcha" name="captcha" maxlength="50" />
      
      <br /><br />
      And especially don't type anything here:<br />
      <textarea name="comment" rows="6" cols="60"></textarea>
    </p>
    
    <p>
      <input type="submit" name="action" value="Preview Comment" />
      <input type="submit" name="action" value="Post Comment" />
    </p>
  </fieldset>
</form><commit_msg>display error when comment save fails<commit_after><div id="post-<%= @post.id %>" class="post">
  <div class="hd">
    <h1>
      <a href="<%= @post.url %>" rel="bookmark"
          title="Permalink for this article">
        <%= h(@post.title) %>
      </a>
    </h1>
    
    <span class="date robots-nocontent">
      <%= @post.created_at(Riposte::Config::TIMESTAMP_LONG) %>
    </span>
  </div>
  
  <div class="bd">
    <%= @post.body_rendered %>
  </div>
  
  <div class="ft">
    <% unless @post.tags.empty? %>
      <div class="tags">
        <span class="icon tag"></span>
        <ul>
          <% @post.tags.each do |tag| %>
            <li>
              <a href="<%= tag.url %>" rel="tag"><%= h(tag.name) %></a>
            </li>
          <% end %>
        </ul>
      </div>
    <% end %>
    
    <div class="meta robots-nocontent">
      <span class="icon comment-post"></span>
      <a href="#post-comment">Post a comment</a>
    </div>
  </div>
</div>

<div id="comments">
  <h3>Comments</h3>
  
  <% @post.comments.all.each do |comment| %>
      <div id="comment-<%= comment.id %>" class="comment">
        <div class="hd">
          <h4>
            <span class="icon comment"></span>
            <a href="<%= comment.url %>" rel="bookmark"
                title="Permalink for this comment"><%= h(comment.title) %></a>
          </h4>
        </div>

        <div class="bd">
          <%= comment.body_rendered %>
        </div>

        <div class="ft">
          <span class="date robots-nocontent">
            <%= comment.created_at(Riposte::Config::TIMESTAMP_LONG) %>
          </span>
          <span class="author">
            Posted by
            <% if comment.author_url.empty? %>
              <%= h(comment.author) %>
            <% else %>
              <a href="<%= h(comment.author_url) %>" rel="nofollow">
                <%= h(comment.author) %>
              </a>
            <% end %>
          </span>
        </div>
      </div>
  <% end %>
</div>

<form id="post-comment" class="robots-nocontent" method="post"
    action="<%= R(CommentController, :new, @post.id) %>#post-comment">

  <% if @preview && @preview.valid? %>
    <fieldset>
      <div class="comment">
        <div class="hd">
          <h4>
            <span class="icon comment"></span>
            <a href="<%= @post.url %>" rel="bookmark"
                title="Permalink for this comment"><%= h(@preview.title) %></a>
          </h4>
        </div>

        <div class="bd">
          <%= @preview.body_rendered %>
        </div>

        <div class="ft">
          <span class="date robots-nocontent">
            <%= Time.now.strftime(Riposte::Config::TIMESTAMP_LONG) %>
          </span>
          <span class="author">
            Posted by
            <% if @preview.author_url.empty? %>
              <%= h(@preview.author) %>
            <% else %>
              <a href="<%= h(@preview.author_url) %>" rel="nofollow">
                <%= h(@preview.author) %>
              </a>
            <% end %>
          </span>
        </div>
      </div>
    </fieldset>
  <% end %>
  
  <fieldset>
    <legend>Post a comment</legend>
  
    <p>
      <label for="author">Name</label>
      <input type="text" name="author" id="author" maxlength="32"
          title="Enter your name"
          value="<%= h(@author) %>" />
    </p>
    
    <% if @preview; @preview.errors.on(:author).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <label for="author_url">URL</label>
      <input type="text" name="author_url" id="author_url" maxlength="255"
          title="Enter the URL of your website (optional)"
          value="<%= h(@author_url) %>" />
    </p>
  
    <% if @preview; @preview.errors.on(:author_url).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <label for="title">Title</label>
      <input type="text" class="long" name="title" id="title" maxlength="255"
          title="Enter a title for this comment"
          value="<%= @preview && @preview.title ? h(@preview.title) : '' %>" />
    </p>
  
    <% if @preview; @preview.errors.on(:title).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p>
      <textarea name="body" rows="6" cols="60"><%= @preview && @preview.body ? h(@preview.body) : '' %></textarea>
    </p>
  
    <% if @preview; @preview.errors.on(:body).each do |error| %>
      <div class="error">
        <%= h(error) %>
      </div>
    <% end; end %>
  
    <p class="tip">
      Basic XHTML (including links) is allowed, just don't try anything fishy.
      Your comment will be auto-formatted unless you use your own
      <code>&lt;p&gt;</code> tags for formatting.
    </p>
  
    <p class="noseeum">
      Don't type anything here unless you're an evil robot:<br />
      <input type="text" id="captcha" name="captcha" maxlength="50" />
      
      <br /><br />
      And especially don't type anything here:<br />
      <textarea name="comment" rows="6" cols="60"></textarea>
    </p>
    
    <% if @comment_error %>
      <div class="error"><%= h(@comment_error) %></div>
    <% end %>

    <p>
      <input type="submit" name="action" value="Preview Comment" />
      <input type="submit" name="action" value="Post Comment" />
    </p>
  </fieldset>
</form>
{'fraction_non_alphanumeric': 0.20074731433909387, 'fraction_numerical': 0.004483886034563288, 'mean_word_length': 1.9387867142465, 'pattern_counts': {'":': 0, '<': 366, '<?xml version=': 0, '>': 366, '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': '882298', 'n_tokens_mistral': 3778, 'n_tokens_neox': 3511, 'n_words': 751}