<commit_before>module CommentHelper

  def article_title(article, args = {})
    title = article.title
    title = article.display_title if article.kind_of?(UploadedFile) && article.image?
    title = content_tag('h1', h(title), :class => 'title')
    if article.belongs_to_blog?
      unless args[:no_link]
        title = content_tag('h1', link_to(article.name, article.url), :class => 'title')
      end
      comments = ''
      unless args[:no_comments] || !article.accept_comments
        comments = (" - %s") % link_to_comments(article)
      end
      title << content_tag('span',
        content_tag('span', show_date(article.published_at), :class => 'date') +
        content_tag('span', [_(", by %s") % link_to(article.author_name, article.author_url)], :class => 'author') +
        content_tag('span', comments, :class => 'comments'),
        :class => 'created-at'
      )
    end
    title
  end

  def comment_actions(comment)
    url = url_for(:profile => profile.identifier, :controller => :comment, :action => :check_actions, :id => comment.id)
    links = links_for_comment_actions(comment)
    links_submenu = links.select{|link| link[:action_bar].nil? || !link[:action_bar]}
    links_action_bar = links - links_submenu
    links_submenu = links_submenu.collect {|link| link.slice(:link)}<commit_msg>Small refactoring of comment_actions method at comment_helper<commit_after>module CommentHelper

  def article_title(article, args = {})
    title = article.title
    title = article.display_title if article.kind_of?(UploadedFile) && article.image?
    title = content_tag('h1', h(title), :class => 'title')
    if article.belongs_to_blog?
      unless args[:no_link]
        title = content_tag('h1', link_to(article.name, article.url), :class => 'title')
      end
      comments = ''
      unless args[:no_comments] || !article.accept_comments
        comments = (" - %s") % link_to_comments(article)
      end
      title << content_tag('span',
        content_tag('span', show_date(article.published_at), :class => 'date') +
        content_tag('span', [_(", by %s") % link_to(article.author_name, article.author_url)], :class => 'author') +
        content_tag('span', comments, :class => 'comments'),
        :class => 'created-at'
      )
    end
    title
  end

  def comment_actions(comment)
    url = url_for(:profile => profile.identifier, :controller => :comment, :action => :check_actions, :id => comment.id)
    links = links_for_comment_actions(comment)
    links_submenu = links.select{|link| link[:action_bar].blank?}
    links_action_bar = links - links_submenu
    links_submenu = links_submenu.collect {|link| link.slice(:link)}
{'fraction_non_alphanumeric': 0.1467065868263473, 'fraction_numerical': 0.0014970059880239522, 'mean_word_length': 3.7309734513274337, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '4013077', 'n_tokens_mistral': 828, 'n_tokens_neox': 823, 'n_words': 168}