<commit_before><div class="panel">

  <div class="article-header-area panel-heading clearfix">
    <div class="pull-right clearfix">
      <% is_owner = @article.user_id == current_user.id %>
      <% if is_owner || @article.is_public_editable %>
        <%= link_to tco('edit'), edit_article_path(@article) %>
      <% end %>
      <% if @article.update_histories.size > 0 %>
        <% histories_title = ! is_owner && ! @article.is_public_editable ? tc(:update_histories) : '' %>
        <%= link_to "#{histories_title}(#{@article.update_histories.size})", article_update_histories_path(@article) %>
      <% end %>
      <% if is_owner %>
        |
        <%= link_to tco('destroy'), @article, method: :delete, data: { confirm: tco(:are_you_sure)} %>
      <% end %>
    </div>
  
    <h1>
      <% if @article.draft? %><i class="glyphicon glyphicon-pencil"></i><% end %>
      <%= @article.title %>
    </h1>
    <hr class='article-title-underline' />
  </div>

  
  <div class="article-detail-area panel-body">
    <div class="text-right">
      <%= tco :created_at  %>:
      <span class="dropdown created-by">
        <%= render partial: "users/info_dropdown", locals: {user: @article.user} %> -
      </span>
      <%= @article.created_at %>
      <% if @article.update_histories.size > 0 %>
        |
        <%= tco :updated_at  %>:
        <span class="dropdown updated-by">
          <%= render partial: "users/info_dropdown", locals: { user: @article.last_updated_user } %> -
        </span>
        <%= @article.updated_at %>
      <% end %>
    </div>
    <div class="pull-right text-right">
      <% @article.tags.each do |tag| %>
        <%= link_to tag.name, tagged_articles_path(tag.name), class: ["label", "label-default"] %>
      <% end %>
      <%= render partial: "articles/stock_users", locals: {article: @article} %>
      <%= render partial: "articles/stock_text", locals: {article: @article} %>
      <%= render partial: "articles/stock_count", locals: {article: @article} %>
      <%= render partial: "articles/comment_count", locals: {article: @article} %>
    </div>
  </div>

  <div class="panel-body markdown codehilite">
    <%= markdown_toc(@article.body).html_safe %>
    <%= markdown(@article.body).html_safe %>
  </div>
</div>

<h2 id="comment-list-title" class="lead"><%= tc :comments_title %></h2>

<ul class="list-group">
  <% if @article.comments.blank? %>
    <li class="list-group-item">Nothing...</li>
  <% else %>
    <% @article.comments.each do |comment| %>
      <li class="list-group-item">
        <div class="comment-info list-group-item-heading">
          <div class="comment-info dropdown"><%= render partial: "users/info_dropdown", locals: {user: comment.user} %></div>
          <div class="comment-info date-time">
            <%= comment.updated_at %>
            <% if comment.user == current_user %> 
              |
              <%= content_tag :a, tco('edit'), class: "comment-edit-link", "data-toggle" => "collapse", "data-target" => "[action='#{comment_path(comment)}']" %>
              |
              <%= link_to tco('destroy'), comment, method: :delete, data: { confirm: tco(:are_you_sure)} %>
            <% end %>
          </div>
        </div>
        <div class="list-group-body markdown codehilite">
          <%= markdown(comment.body).html_safe %>
        </div>
        <% if comment.user == current_user %> 
          <%= render 'comments/form', hide: true, comment: comment %>
        <% end %>
      </li>
    <% end %>
  <% end %>
</ul>

<h2 class="lead"><%= tc :comment_form_title %></h2>
<%= render 'comments/form', hide: false, comment: Comment.new %>

<p>
  <%= link_to tco(:back), @pre_accessable_url %>
</p><commit_msg>- reas_ony 属性が True のユーザーで、記事の編集、コメントの投稿ボタンを無効化した。<commit_after><div class="panel">

  <div class="article-header-area panel-heading clearfix">
    <div class="pull-right clearfix">
      <% is_owner = @article.user_id == current_user.id %>
      <% if (is_owner || @article.is_public_editable) && current_user.read_only != "t" %>
        <%= link_to tco('edit'), edit_article_path(@article) %>
      <% end %>
      <% if @article.update_histories.size > 0 %>
        <% histories_title = ! is_owner && ! @article.is_public_editable ? tc(:update_histories) : '' %>
        <%= link_to "#{histories_title}(#{@article.update_histories.size})", article_update_histories_path(@article) %>
      <% end %>
      <% if is_owner %>
        |
        <%= link_to tco('destroy'), @article, method: :delete, data: { confirm: tco(:are_you_sure)} %>
      <% end %>
    </div>
  
    <h1>
      <% if @article.draft? %><i class="glyphicon glyphicon-pencil"></i><% end %>
      <%= @article.title %>
    </h1>
    <hr class='article-title-underline' />
  </div>

  
  <div class="article-detail-area panel-body">
    <div class="text-right">
      <%= tco :created_at  %>:
      <span class="dropdown created-by">
        <%= render partial: "users/info_dropdown", locals: {user: @article.user} %> -
      </span>
      <%= @article.created_at %>
      <% if @article.update_histories.size > 0 %>
        |
        <%= tco :updated_at  %>:
        <span class="dropdown updated-by">
          <%= render partial: "users/info_dropdown", locals: { user: @article.last_updated_user } %> -
        </span>
        <%= @article.updated_at %>
      <% end %>
    </div>
    <div class="pull-right text-right">
      <% @article.tags.each do |tag| %>
        <%= link_to tag.name, tagged_articles_path(tag.name), class: ["label", "label-default"] %>
      <% end %>
      <%= render partial: "articles/stock_users", locals: {article: @article} %>
      <%= render partial: "articles/stock_text", locals: {article: @article} %>
      <%= render partial: "articles/stock_count", locals: {article: @article} %>
      <%= render partial: "articles/comment_count", locals: {article: @article} %>
    </div>
  </div>

  <div class="panel-body markdown codehilite">
    <%= markdown_toc(@article.body).html_safe %>
    <%= markdown(@article.body).html_safe %>
  </div>
</div>

<h2 id="comment-list-title" class="lead"><%= tc :comments_title %></h2>

<ul class="list-group">
  <% if @article.comments.blank? %>
    <li class="list-group-item">Nothing...</li>
  <% else %>
    <% @article.comments.each do |comment| %>
      <li class="list-group-item">
        <div class="comment-info list-group-item-heading">
          <div class="comment-info dropdown"><%= render partial: "users/info_dropdown", locals: {user: comment.user} %></div>
          <div class="comment-info date-time">
            <%= comment.updated_at %>
            <% if comment.user == current_user %> 
              |
              <%= content_tag :a, tco('edit'), class: "comment-edit-link", "data-toggle" => "collapse", "data-target" => "[action='#{comment_path(comment)}']" %>
              |
              <%= link_to tco('destroy'), comment, method: :delete, data: { confirm: tco(:are_you_sure)} %>
            <% end %>
          </div>
        </div>
        <div class="list-group-body markdown codehilite">
          <%= markdown(comment.body).html_safe %>
        </div>
        <% if comment.user == current_user %> 
          <%= render 'comments/form', hide: true, comment: comment %>
        <% end %>
      </li>
    <% end %>
  <% end %>
</ul>

<% if current_user.read_only != "t" then %>
  <h2 class="lead"><%= tc :comment_form_title %></h2>
  <%= render 'comments/form', hide: false, comment: Comment.new %>
<% end %>

<p>
  <%= link_to tco(:back), @pre_accessable_url %>
</p>
{'fraction_non_alphanumeric': 0.19607843137254902, 'fraction_numerical': 0.0021197668256491787, 'mean_word_length': 2.7858575727181543, 'pattern_counts': {'":': 0, '<': 191, '<?xml version=': 0, '>': 199, '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': '3845354', 'n_tokens_mistral': 2686, 'n_tokens_neox': 2472, 'n_words': 472}