<commit_before>- user = link_to(h(activity.user.full_name), user_path(activity.user)) if activity.user

- subject = if (item = activity.related || activity.item)
  - if item.respond_to?(:full_name)
    - link_to item.full_name, polymorphic_url(item)

  - elsif [Account, Campaign, Contact, Lead, Opportunity, ContactGroup, Event, EventInstance].include?(item.class)
    - link_to item.name, polymorphic_url(item)

  - elsif item.respond_to?(:name)
    - content_tag :span, item.name, :style => "color:black;" # Individual tasks have no landing pages where we could link to.

- known_event = t('action_' + activity.event, :default => 0) != 0

- if (user.present? && subject.present?) || !known_event
  %li[activity]
    .tools
      %small
        = l(activity.created_at, :format => :short)
    %tt
      &nbsp;
      - if known_event
        - action = t('action_' + activity.event)
        - type = t('subject_' + activity.item_type.downcase)
        = link_to avatar_for(activity.user, :size => :thumb), user_path(activity.user)
        = t("activity_text", :user => user, :action => action, :type => type, :subject => subject, :default => "#{user} #{action} #{type} #{subject}").html_safe # locales optionally can change the word order for activities using 'activity_text'
        - if activity.item.class == Membership
          = "to #{link_to activity.item.contact_group.name, polymorphic_url(activity.item.contact_group)}".html_safe
        - if activity.item.class == AccountContact
          = "to #{link_to activity.item.account.name, polymorphic_url(activity.item.account)}".html_safe
        - if ((item = activity.item).class == Comment) and Setting.comments_visible_on_dashboard
          = t('action_create_comment', :comment => truncate(h(item.comment), :length => 90)).html_safe
      - else
        - type = t(activity.item_type.downcase)
        - if item.respond_to? :email
          = avatar_for(item, :size => "16x16")
        = "#{type} #{subject}:".html_safe
        = auto_link(t(activity.event)).html_safe<commit_msg>fix bug that would prevent home from showing after deleting a contact group<commit_after>- user = link_to(h(activity.user.full_name), user_path(activity.user)) if activity.user

- subject = if (item = activity.related || activity.item)
  - if item.respond_to?(:full_name)
    - link_to item.full_name, polymorphic_url(item)

  - elsif [Account, Campaign, Contact, Lead, Opportunity, ContactGroup, Event, EventInstance].include?(item.class)
    - link_to item.name, polymorphic_url(item)

  - elsif item.respond_to?(:name)
    - content_tag :span, item.name, :style => "color:black;" # Individual tasks have no landing pages where we could link to.

- known_event = t('action_' + activity.event, :default => 0) != 0

- if (user.present? && subject.present?) || !known_event
  %li[activity]
    .tools
      %small
        = l(activity.created_at, :format => :short)
    %tt
      &nbsp;
      - if known_event
        - action = t('action_' + activity.event)
        - type = t('subject_' + activity.item_type.downcase)
        = link_to avatar_for(activity.user, :size => :thumb), user_path(activity.user)
        = t("activity_text", :user => user, :action => action, :type => type, :subject => subject, :default => "#{user} #{action} #{type} #{subject}").html_safe # locales optionally can change the word order for activities using 'activity_text'
        - if activity.item.class == Membership
          - if activity.item.contact_group
            = "to #{link_to activity.item.contact_group.name, polymorphic_url(activity.item.contact_group)}".html_safe
          - else
            = "to (deleted group)"
        - if activity.item.class == AccountContact
          - if activity.item.account
            = "to #{link_to activity.item.account.name, polymorphic_url(activity.item.account)}".html_safe
          - else
            = "to (deleted account)"
        - if ((item = activity.item).class == Comment) and Setting.comments_visible_on_dashboard
          = t('action_create_comment', :comment => truncate(h(item.comment), :length => 90)).html_safe
      - else
        - type = t(activity.item_type.downcase)
        - if item.respond_to? :email
          = avatar_for(item, :size => "16x16")
        = "#{type} #{subject}:".html_safe
        = auto_link(t(activity.event)).html_safe
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.003686635944700461, 'mean_word_length': 3.2186588921282797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '6520210', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1318, 'n_words': 301}