<commit_before>-extends "smartmin/list.html"
-load smartmin sms contacts
-load i18n humanize

-block page-top
  {% render as page_top %}
    {{block.super}}
  {% endrender %}
  -if has_contacts
    {{page_top}}

-block title-icon
  %span.title-icon
    .glyph.icon-users

-block above-bar
  -block top-form
    %form{'method':'get', 'action': "{% url 'contacts.contact_list' %}" }
      %input.input-medium.search-query{'type':'text', 'placeholder':'{% trans "Search" %}', 'name':"search", 'value':"{{search}}"}

-block content
  #pjax
    -block pjax
      .row-fluid
        .span3.sidebox
          %div{style:"margin-bottom: 10px"}
            - if org_perms.contacts.contact_import
              %a#id_import_contacts.btn.btn-primary.btn-block{href:"{% url 'contacts.contact_import' %}"}
                -trans "Import Contacts"

          #sidebar-nav
            %ul.nav.nav-list
              %li.nav-header
                -trans "Contacts"
              - for folder in folders
                %li{'class':'{% if request.path == folder.url %}active{% endif %}'}
                  %a{'href':'={folder.url}'}
                    ={folder.label} ({{ folder.count | intcomma }})

              %li.nav-header
                -trans "Groups"
              - for group in groups
                %li{'class':'{% if current_group.id == group.pk %}active{% endif %}'}
                  %a{'href':'{% url "contacts.contact_filter" group.pk %}'}
                    ={group.label} ({{ group.count | intcomma }})

          %div{style:"margin-top: 10px"}
            - if org_perms.contacts.contact_create
              %a#add-contact.btn.btn-block
                -trans "Create Contact"
            - if org_perms.contacts.contactgroup_create
              %a#id_add_group.btn.btn-block
                -trans "Create Group"

        - if has_contacts
          - block contacts-list
            .span9

              - block buttons

                .pull-right
                  -block buttons-right
                    -block gear-menu
                      -include "gear_links_include.haml"

                .search-details
                  -if search
                    -if compiled_query
                      -blocktrans count results_count=paginator.count
                        Found {{ results_count }} contact where <i>{{search}}</i>.
                        -plural
                          Found {{ results_count }} contacts where <i>{{search}}</i>.
                    -else
                      -blocktrans count results_count=paginator.count
                        Found {{ results_count }} contact where name or phone contains <i>{{search}}</i>.
                        -plural
                          Found {{ results_count }} contacts where name or phone contains <i>{{search}}</i>.

                - if org_perms.contacts.contact_update
                  .list-buttons-container
                    .list-buttons.hide
                      - if 'block' in actions
                        %span.btn-group
                          %a.object-btn-block{'href':'#'}
                            %button.btn
                              .glyph.icon-user-block
                              -trans "Block"

                      - if 'unblock' in actions
                        %span.btn-group
                          %a.object-btn-unblock{'href':'#'}
                            %button.btn
                              .glyph.icon-user
                              -trans "Unblock"

                      - if 'unstop' in actions
                        %span.btn-group
                          %a.object-btn-unstop{'href':'#'}
                            %button.btn
                              .glyph.icon-user
                              -trans "Unstop"

                      - if 'delete' in actions
                        %span.btn-group
                          %a.contacts-btn-delete{'href':'#'}
                            %button.btn
                              .glyph.icon-user-delete
                              -trans "Delete"

                      - if 'unlabel' in actions
                        %span.btn-group
                          %a{'href':'#', onclick:'unlabelObjectRows({{current_group.pk}})'}
                            %button.btn{data-toggle:'tooltip', data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Remove from Group" %}'}
                              .glyph.icon-user-remove

                      - if 'label' in actions
                        %span.btn-group
                          %button.btn.dropdown-toggle{'data-toggle':"dropdown", data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Contact Groups" %}'}
                            .glyph.icon-users-2
                            %span.caret
                          %ul.dropdown-menu.label-menu
                            - for group in groups
                              - if not group.is_dynamic
                                %li
                                  %a.lbl-menu{'href':'#', onclick:'addContactToGroup({{group.pk}})', data-id:'{{group.pk}}'}
                                    .glyph.label-checkbox
                                    = group.label
                            - if org_perms.contacts.contactgroup_create
                              - if groups
                                %li.divider
                              %li
                                %a.lbl-menu.add-group{ href:'#' }
                                  - trans "New Group..."

                      - if org_perms.msgs.broadcast_send 
                        %span.btn-group
                          %button.send-button.btn{data-toggle:'tooltip', data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Send Message" %}'}
                            .glyph.icon-bubble-replu

              %table.list-table.contact_list.table.object-list.table.table-condensed{style: '{% if not org_perms.contacts.contact_update %}margin-top:10px{% endif %}'}

                %tr.contacts
                  - if org_perms.contacts.contact_update
                    %th
                  %th
                  %th
                  -for field in contact_fields
                    -if field.show_in_table
                      %th
                        {{ field.label }}
                  %th
                    - if object_list
                      -trans "Created On"

                %tbody
                  - for object in contacts
                    %tr.contact.select-row.object-row{'class':'{% cycle row1 row2 %}', 'data-uuid': '{{object.uuid}}', 'data-object-id':'{{object.id}}'}

                      - if org_perms.contacts.contact_update or org_perms.msgs.broadcast_send
                        %td.contact.checkbox.object-row-checkbox
                          .glyph.icon-checkbox-unchecked.contact-checkbox.object-row-checkbox

                      %td.value-text.field_text
                        {{ object.name|default:"--" }}

                      %td.value-phone.field_phone
                        %nobr
                          {{ object|format_urn:user_org }}

                      -for field in contact_fields
                        -if field.show_in_table
                          %td.field
                            {{ object|contact_field:field.key }}

                      %td.value-received.field_received
                        %nobr
                          {{ object.created_on|gmail_time }}

                      // This is needed for action buttons
                      %td.hide
                        .value-labels
                          %nobr
                            - for group in object.groups.all
                              %span.label.label-info.lbl{ data-id: '{{group.id}}'}
                                %a{'href':'{% url "contacts.contact_filter" group.pk %}'}
                                  ={group.name}

                  -empty
                    %tr
                      %td{colspan:3}
                        -trans "No matching contacts."
                      -for field in contact_fields
                        -if field.show_in_table
                          %td.field
                      %td

<commit_msg>fix the contact groups hidden for dropdown checks<commit_after>-extends "smartmin/list.html"
-load smartmin sms contacts
-load i18n humanize

-block page-top
  {% render as page_top %}
    {{block.super}}
  {% endrender %}
  -if has_contacts
    {{page_top}}

-block title-icon
  %span.title-icon
    .glyph.icon-users

-block above-bar
  -block top-form
    %form{'method':'get', 'action': "{% url 'contacts.contact_list' %}" }
      %input.input-medium.search-query{'type':'text', 'placeholder':'{% trans "Search" %}', 'name':"search", 'value':"{{search}}"}

-block content
  #pjax
    -block pjax
      .row-fluid
        .span3.sidebox
          %div{style:"margin-bottom: 10px"}
            - if org_perms.contacts.contact_import
              %a#id_import_contacts.btn.btn-primary.btn-block{href:"{% url 'contacts.contact_import' %}"}
                -trans "Import Contacts"

          #sidebar-nav
            %ul.nav.nav-list
              %li.nav-header
                -trans "Contacts"
              - for folder in folders
                %li{'class':'{% if request.path == folder.url %}active{% endif %}'}
                  %a{'href':'={folder.url}'}
                    ={folder.label} ({{ folder.count | intcomma }})

              %li.nav-header
                -trans "Groups"
              - for group in groups
                %li{'class':'{% if current_group.id == group.pk %}active{% endif %}'}
                  %a{'href':'{% url "contacts.contact_filter" group.pk %}'}
                    ={group.label} ({{ group.count | intcomma }})

          %div{style:"margin-top: 10px"}
            - if org_perms.contacts.contact_create
              %a#add-contact.btn.btn-block
                -trans "Create Contact"
            - if org_perms.contacts.contactgroup_create
              %a#id_add_group.btn.btn-block
                -trans "Create Group"

        - if has_contacts
          - block contacts-list
            .span9

              - block buttons

                .pull-right
                  -block buttons-right
                    -block gear-menu
                      -include "gear_links_include.haml"

                .search-details
                  -if search
                    -if compiled_query
                      -blocktrans count results_count=paginator.count
                        Found {{ results_count }} contact where <i>{{search}}</i>.
                        -plural
                          Found {{ results_count }} contacts where <i>{{search}}</i>.
                    -else
                      -blocktrans count results_count=paginator.count
                        Found {{ results_count }} contact where name or phone contains <i>{{search}}</i>.
                        -plural
                          Found {{ results_count }} contacts where name or phone contains <i>{{search}}</i>.

                - if org_perms.contacts.contact_update
                  .list-buttons-container
                    .list-buttons.hide
                      - if 'block' in actions
                        %span.btn-group
                          %a.object-btn-block{'href':'#'}
                            %button.btn
                              .glyph.icon-user-block
                              -trans "Block"

                      - if 'unblock' in actions
                        %span.btn-group
                          %a.object-btn-unblock{'href':'#'}
                            %button.btn
                              .glyph.icon-user
                              -trans "Unblock"

                      - if 'unstop' in actions
                        %span.btn-group
                          %a.object-btn-unstop{'href':'#'}
                            %button.btn
                              .glyph.icon-user
                              -trans "Unstop"

                      - if 'delete' in actions
                        %span.btn-group
                          %a.contacts-btn-delete{'href':'#'}
                            %button.btn
                              .glyph.icon-user-delete
                              -trans "Delete"

                      - if 'unlabel' in actions
                        %span.btn-group
                          %a{'href':'#', onclick:'unlabelObjectRows({{current_group.pk}})'}
                            %button.btn{data-toggle:'tooltip', data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Remove from Group" %}'}
                              .glyph.icon-user-remove

                      - if 'label' in actions
                        %span.btn-group
                          %button.btn.dropdown-toggle{'data-toggle':"dropdown", data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Contact Groups" %}'}
                            .glyph.icon-users-2
                            %span.caret
                          %ul.dropdown-menu.label-menu
                            - for group in groups
                              - if not group.is_dynamic
                                %li
                                  %a.lbl-menu{'href':'#', onclick:'addContactToGroup({{group.pk}})', data-id:'{{group.pk}}'}
                                    .glyph.label-checkbox
                                    = group.label
                            - if org_perms.contacts.contactgroup_create
                              - if groups
                                %li.divider
                              %li
                                %a.lbl-menu.add-group{ href:'#' }
                                  - trans "New Group..."

                      - if org_perms.msgs.broadcast_send 
                        %span.btn-group
                          %button.send-button.btn{data-toggle:'tooltip', data-trigger:'hover', data-delay:"800", data-placement:'top', data-original-title:'{% trans "Send Message" %}'}
                            .glyph.icon-bubble-replu

              %table.list-table.contact_list.table.object-list.table.table-condensed{style: '{% if not org_perms.contacts.contact_update %}margin-top:10px{% endif %}'}

                %tr.contacts
                  - if org_perms.contacts.contact_update
                    %th
                  %th
                  %th
                  -for field in contact_fields
                    -if field.show_in_table
                      %th
                        {{ field.label }}
                  %th
                    - if object_list
                      -trans "Created On"

                %tbody
                  - for object in contacts
                    %tr.contact.select-row.object-row{'class':'{% cycle row1 row2 %}', 'data-uuid': '{{object.uuid}}', 'data-object-id':'{{object.id}}'}

                      - if org_perms.contacts.contact_update or org_perms.msgs.broadcast_send
                        %td.contact.checkbox.object-row-checkbox
                          .glyph.icon-checkbox-unchecked.contact-checkbox.object-row-checkbox

                      %td.value-text.field_text
                        {{ object.name|default:"--" }}

                      %td.value-phone.field_phone
                        %nobr
                          {{ object|format_urn:user_org }}

                      -for field in contact_fields
                        -if field.show_in_table
                          %td.field
                            {{ object|contact_field:field.key }}

                      %td.value-received.field_received
                        %nobr
                          {{ object.created_on|gmail_time }}

                      // This is needed for action buttons
                      %td.hide
                        .value-labels
                          %nobr
                            - for group in object.user_groups.all
                              %span.label.label-info.lbl{ data-id: '{{group.id}}'}
                                %a{'href':'{% url "contacts.contact_filter" group.pk %}'}
                                  ={group.name}

                  -empty
                    %tr
                      %td{colspan:3}
                        -trans "No matching contacts."
                      -for field in contact_fields
                        -if field.show_in_table
                          %td.field
                      %td


{'fraction_non_alphanumeric': 0.11243062600704183, 'fraction_numerical': 0.0027451214417855223, 'mean_word_length': 1.0224475018102823, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7042107', 'n_tokens_mistral': 4403, 'n_tokens_neox': 4006, 'n_words': 751}