<commit_before>module BannerHelper

  def gantt_chart(chart)

    unless chart.process(1,14)
      content_tag :div,
        chart.to_html(20,0),
        :class => 'gantt banner_item',
        :id => 'gantt_banner',
        :style => "#{'display: none' unless current_banner?(:gantt)}"
    else
      render :partial => 'shared/gantt_banner_primer'
    end
  end

  def upcoming_events(events)
    unless events.empty?
      render :partial => 'shared/upcoming_events',
        :locals => {
          :events => events }
    else
      render :partial => 'shared/upcoming_events_primer'
    end
  end

  def event_css(i)
    event_css = Date.today == (Date.today.monday + i.day) ? 'today' : ''
  end

  def event_task_link(task)
    link_name = truncate(task.name, 20)
    link_name << " (#{content_tag(:span,task.assigned.user.short_name)})" if task.open? && task.assigned
    link_to link_name,
      project_task_list_task_path(task.project,task.task_list,task),
      :class => "task_status_#{task.status_name}"
  end

  def calendar_banner_link
    link_to t('common.calendar'), "#", :id => 'show_calendar_link', :class => ('active' if current_banner?(:calendar))
  end

  def gantt_banner_link
    link_to t('common.gantt_chart'), "#", :id => 'show_gantt_chart_link', :class => ('active' if current_banner?(:gantt))
  end

  def banner(events,chart)
    render :partial => 'shared/banner', :locals => {
      :events => events,
      :chart => chart }
  end
end<commit_msg>update deprecated `truncate` call<commit_after>module BannerHelper

  def gantt_chart(chart)

    unless chart.process(1,14)
      content_tag :div,
        chart.to_html(20,0),
        :class => 'gantt banner_item',
        :id => 'gantt_banner',
        :style => "#{'display: none' unless current_banner?(:gantt)}"
    else
      render :partial => 'shared/gantt_banner_primer'
    end
  end

  def upcoming_events(events)
    unless events.empty?
      render :partial => 'shared/upcoming_events',
        :locals => {
          :events => events }
    else
      render :partial => 'shared/upcoming_events_primer'
    end
  end

  def event_css(i)
    event_css = Date.today == (Date.today.monday + i.day) ? 'today' : ''
  end

  def event_task_link(task)
    link_name = truncate(task.name, :length => 20)
    link_name << " (#{content_tag(:span,task.assigned.user.short_name)})" if task.open? && task.assigned
    link_to link_name,
      project_task_list_task_path(task.project,task.task_list,task),
      :class => "task_status_#{task.status_name}"
  end

  def calendar_banner_link
    link_to t('common.calendar'), "#", :id => 'show_calendar_link', :class => ('active' if current_banner?(:calendar))
  end

  def gantt_banner_link
    link_to t('common.gantt_chart'), "#", :id => 'show_gantt_chart_link', :class => ('active' if current_banner?(:gantt))
  end

  def banner(events,chart)
    render :partial => 'shared/banner', :locals => {
      :events => events,
      :chart => chart }
  end
end
{'fraction_non_alphanumeric': 0.14419538307126128, 'fraction_numerical': 0.005352960856473737, 'mean_word_length': 3.371345029239766, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 38, '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': '1333863', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1039, 'n_words': 201}