<commit_before>-long_view = false if local_assigns[:long_view].nil?
-mailer = local_assigns[:mailer] ? true : false
-prerender = local_assigns[:prerender] ? true : false

-user_name = deed.user.display_name if deed.user

-user = link_to user_name, user_profile_url(deed.user), only_path: !mailer
-page = deed.page.nil? ? '' : link_to(deed.page.title, collection_transcribe_page_url(deed.page.collection.owner, deed.page.collection, deed.page.work, deed.page), only_path: !mailer)
-article = deed.article.nil? ? '' : link_to(deed.article.title, collection_article_show_url(deed.article.collection.owner, deed.article.collection, deed.article), only_path: !mailer)
-if(!deed.work.nil? && !deed.work.collection.nil? )
  -work = link_to(deed.work.title, collection_read_work_url(deed.work.collection.owner, deed.work.collection, deed.work), only_path: !mailer)

-output = "#{user} "

-case deed.deed_type
-when DeedType::PAGE_TRANSCRIPTION
  -output += "transcribed page #{page}"

-when DeedType::PAGE_EDIT
  -output += "edited page #{page}"

-when DeedType::PAGE_INDEXED
  -output += "indexed page #{page}"
  
-when DeedType::PAGE_MARKED_BLANK
  -output += "marked page #{page} as blank"

-when DeedType::ARTICLE_EDIT
  -output += "edited #{article} article"

-when DeedType::NOTE_ADDED
  -output += "added a note to page #{page}"

-when DeedType::PAGE_TRANSLATED
  -output += "translated page #{page}"

-when DeedType::PAGE_TRANSLATION_EDIT
  -output += "edited the translation of page #{page}"

-when DeedType::OCR_CORRECTED
  -output += "corrected page #{page}"

-when DeedType::NEEDS_REVIEW
  -output += "marked page #{page} as needing review"

-when DeedType::TRANSLATION_INDEXED
  -output += "indexed the translation of page #{page}"

-when DeedType::TRANSLATION_REVIEW
  -output += "marked translation page #{page} as needing review"

-when DeedType::WORK_ADDED
  -output += "added #{work}"

-if(long_view && !deed.work.nil?)
  -if deed.work.collection
    -work = link_to(deed.work.title, collection_read_work_url(deed.work.collection.owner, deed.work.collection, deed.work), only_path: !mailer )
  -else
    -work = deed.work.title      
  -output += " in the work #{work}"

-if(@collection.nil? && !deed.collection.nil?)
  -collection = link_to(deed.collection.title, collection_url(deed.collection.owner, deed.collection), only_path: !mailer )
  -if(deed.deed_type == DeedType::COLLECTION_JOINED)
    -output += "joined #{collection}"
  -else
    -output += " in #{collection} collection"

-if(long_view && deed.deed_type == DeedType::NOTE_ADDED && !deed.note.nil?)
  -output += ", saying &ldquo;#{deed.note.title}&rdquo;"

==output
<commit_msg>Fix display of deed on collaborator collection view<commit_after>-long_view = false if local_assigns[:long_view].nil?
-mailer = local_assigns[:mailer] ? true : false
-prerender = local_assigns[:prerender] ? true : false

-user_name = deed.user.display_name if deed.user

-user = link_to user_name, user_profile_url(deed.user), only_path: !mailer
-page = deed.page.nil? ? '' : link_to(deed.page.title, collection_transcribe_page_url(deed.page.collection.owner, deed.page.collection, deed.page.work, deed.page), only_path: !mailer)
-article = deed.article.nil? ? '' : link_to(deed.article.title, collection_article_show_url(deed.article.collection.owner, deed.article.collection, deed.article), only_path: !mailer)
-if(!deed.work.nil? && !deed.work.collection.nil? )
  -work = link_to(deed.work.title, collection_read_work_url(deed.work.collection.owner, deed.work.collection, deed.work), only_path: !mailer)
-unless(deed.collection.nil?)
  -collection = link_to(deed.collection.title, collection_url(deed.collection.owner, deed.collection), only_path: !mailer )

-output = "#{user} "

-case deed.deed_type
-when DeedType::PAGE_TRANSCRIPTION
  -output += "transcribed page #{page}"

-when DeedType::PAGE_EDIT
  -output += "edited page #{page}"

-when DeedType::PAGE_INDEXED
  -output += "indexed page #{page}"
  
-when DeedType::PAGE_MARKED_BLANK
  -output += "marked page #{page} as blank"

-when DeedType::ARTICLE_EDIT
  -output += "edited #{article} article"

-when DeedType::NOTE_ADDED
  -output += "added a note to page #{page}"

-when DeedType::PAGE_TRANSLATED
  -output += "translated page #{page}"

-when DeedType::PAGE_TRANSLATION_EDIT
  -output += "edited the translation of page #{page}"

-when DeedType::OCR_CORRECTED
  -output += "corrected page #{page}"

-when DeedType::NEEDS_REVIEW
  -output += "marked page #{page} as needing review"

-when DeedType::TRANSLATION_INDEXED
  -output += "indexed the translation of page #{page}"

-when DeedType::TRANSLATION_REVIEW
  -output += "marked translation page #{page} as needing review"

-when DeedType::WORK_ADDED
  -output += "added #{work}"

-when DeedType::COLLECTION_JOINED
    -output += "joined "
    
    -if deed.collection.nil?
      -output += "this collection"
    -else
      -output += collection

-if(long_view && !deed.work.nil?)
  -if deed.work.collection
    -work = link_to(deed.work.title, collection_read_work_url(deed.work.collection.owner, deed.work.collection, deed.work), only_path: !mailer )
  -else
    -work = deed.work.title      
  -output += " in the work #{work}"
-if(!collection.nil? && deed.deed_type != DeedType::COLLECTION_JOINED)
  -output += " in #{collection} collection"

-if(long_view && deed.deed_type == DeedType::NOTE_ADDED && !deed.note.nil?)
  -output += ", saying &ldquo;#{deed.note.title}&rdquo;"

==output

{'fraction_non_alphanumeric': 0.15284642138019403, 'fraction_numerical': 0.0, 'mean_word_length': 4.775898520084566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3804670', 'n_tokens_mistral': 2001, 'n_tokens_neox': 1881, 'n_words': 399}