<commit_before>-extends "smartmin/form.html"

-load smartmin
-load i18n

- block pjax
  #pjax
    .row{style:"height:250px;"}
      .span3
        #big-help.glyph.icon-address-book

      .span9
        %p
          -trans "You can import your contacts from an XLS file you create in Excel."

        %p
          -trans "Each row should have the phone number (including country code) and the name of the contact if available."

        %table#example.table
          %tr
            %th
              -trans "Phone"
            %th
              -trans "Name"
          %tr
            %td 
              -trans "+250788123123"
            %td 
              -trans "<NAME>"
          %tr
            %td
              -trans "+250788111222"
            %td
              -trans "<NAME>"

        - block import-status
          #import-status
            #import-message
              - if task
                - if task.status == "PENDING" or task.status == "RUNNING" or task.status == "STARTED"
                  %p
                    Importing..
                    %img{src:"{{ STATIC_URL }}images/loader-circles.gif"}
                

                - else 
                  - if task.status == "SUCCESS" and group.contacts.all
                    - if results.creates
                      .import-result
                        .glyph.icon-checkmark.success
                        -blocktrans count results.creates as create_count
                          Created {{ create_count }} new contact
                          -plural
                            Created {{ create_count }} new contacts

                    - if results.updates
                      .import-result
                        .glyph.icon-checkmark.success
                        -blocktrans count results.updates as update_count
                          Updated {{ update_count }} contact with an existing phone number
                          -plural
                            Updated {{ update_count }} contacts with existing phone numbers

                    .import-result
                      .glyph.icon-checkmark.success
                      -blocktrans with contacts_count=results.records
                        Added all contacts to the new
                      %a{href:"{% url 'contacts.contact_filter' group.pk %}"}= group.name
                      group<commit_msg>Keep showing the loader image if contact group for import is not yet created<commit_after>-extends "smartmin/form.html"

-load smartmin
-load i18n

- block pjax
  #pjax
    .row{style:"height:250px;"}
      .span3
        #big-help.glyph.icon-address-book

      .span9
        %p
          -trans "You can import your contacts from an XLS file you create in Excel."

        %p
          -trans "Each row should have the phone number (including country code) and the name of the contact if available."

        %table#example.table
          %tr
            %th
              -trans "Phone"
            %th
              -trans "Name"
          %tr
            %td 
              -trans "+250788123123"
            %td 
              -trans "<NAME>"
          %tr
            %td
              -trans "+250788111222"
            %td
              -trans "<NAME>"

        - block import-status
          #import-status
            #import-message
              - if task
                - if task.status == "PENDING" or task.status == "RUNNING" or task.status == "STARTED"
                  %p
                    Importing..
                    %img{src:"{{ STATIC_URL }}images/loader-circles.gif"}
                

                - else 
                  - if task.status == "SUCCESS"
                    -if not group.contact.all
                      %p
                        Import processed..
                        %img{src:"{{ STATIC_URL }}images/loader-circles.gif"}

                    -else
                      - if results.creates
                        .import-result
                          .glyph.icon-checkmark.success
                          -blocktrans count results.creates as create_count
                            Created {{ create_count }} new contact
                            -plural
                              Created {{ create_count }} new contacts

                      - if results.updates
                        .import-result
                          .glyph.icon-checkmark.success
                          -blocktrans count results.updates as update_count
                            Updated {{ update_count }} contact with an existing phone number
                            -plural
                              Updated {{ update_count }} contacts with existing phone numbers

                      .import-result
                        .glyph.icon-checkmark.success
                        -blocktrans with contacts_count=results.records
                          Added all contacts to the new
                        %a{href:"{% url 'contacts.contact_filter' group.pk %}"}= group.name
                        group
{'fraction_non_alphanumeric': 0.0775776766277459, 'fraction_numerical': 0.012269938650306749, 'mean_word_length': 1.018370607028754, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5093350', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1148, 'n_words': 332}