<commit_before>- attrs = {}
- attrs[:id] = modal_id if defined? modal_id
- document_name = document_label || nature.human_name
- attrs[:title] = :printing_document.tl(document: document_name)
= modal(attrs) do
  - if Document.of(nature.name, key).any?
    .modal-body.thumbs
      - Document.of(nature.name, key).each do |document|
        .thumb
          = link_to(backend_document_path(document, format: :pdf)) do
            = image_tag(backend_document_path(document, format: :jpg))
          = link_to(backend_document_path(document)) do
            .archived-at= document.updated_at.l
            .template-name= document_name
  - else
    .modal-body
      .placeholding-message= :no_archived_prints.tn
  .modal-footer
    - templates = DocumentTemplate.of_nature(nature.name.to_s)
    - if templates.any?
      = dropdown_menu_button(:print) do |menu|
        - templates.each do |template|
          - menu.item(template.name, params.merge(format: :pdf, template: template.id, key: key))
    = button_tag(:close.tl, class: 'btn btn-default', data: { dismiss: 'modal' })
<commit_msg>dropup instead of dropdown for list of document template when printing from modal<commit_after>- attrs = {}
- attrs[:id] = modal_id if defined? modal_id
- document_name = document_label || nature.human_name
- attrs[:title] = :printing_document.tl(document: document_name)
= modal(attrs) do
  - if Document.of(nature.name, key).any?
    .modal-body.thumbs
      - Document.of(nature.name, key).each do |document|
        .thumb
          = link_to(backend_document_path(document, format: :pdf)) do
            = image_tag(backend_document_path(document, format: :jpg))
          = link_to(backend_document_path(document)) do
            .archived-at= document.updated_at.l
            .template-name= document_name
  - else
    .modal-body
      .placeholding-message= :no_archived_prints.tn
  .modal-footer
    - templates = DocumentTemplate.of_nature(nature.name.to_s)
    - if templates.any?
      = dropdown_menu_button(:print, dropup: true) do |menu|
        - templates.each do |template|
          - menu.item(template.name, params.merge(format: :pdf, template: template.id, key: key))
    = button_tag(:close.tl, class: 'btn btn-default', data: { dismiss: 'modal' })

{'fraction_non_alphanumeric': 0.12797881729920565, 'fraction_numerical': 0.0, 'mean_word_length': 3.174953959484346, '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': '6876651', 'n_tokens_mistral': 722, 'n_tokens_neox': 712, 'n_words': 146}