<commit_before><!doctype html>
- load compress thumbnail smartmin i18n
%html{ dir:"{{ lang_direction }}", ng-app:"chat"}

  %head
    %meta{ charset:"utf-8"}
    %title
      - block title
        - if not org
          - trans "Chat"
        - else
          {{ org.name }}
      - block subtitle
        &nbsp;
    %meta{ name:"description", content:""}
    %meta{ name:"author", content:""}

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->

    <!-- Mobile viewport optimized: j.mp/bplateviewport -->
    %meta{ name:"viewport", content:"width=device-width, initial-scale=1.0"}

    <!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
    %link{ rel:"icon", type:"image/x-icon", href:"{{ STATIC_URL }}img/favicon.png"}

    :css
    - compress css
      - block styles
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/bootstrap.css"}
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/bootstrap-theme.css"}
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/smartmin_styles.css"}
        %link{ type:"text/less", rel:"stylesheet", href:"{{ STATIC_URL }}less/chat.less"}

    - block extra-less
    - block extra-style

    {% if lang_direction == 'ltr' %}
      %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/chat-ltr.css"}
    {% elif lang_direction == 'rtl' %}
      %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/chat-rtl.css"}
    {% endif %}

  %body.pattern-bg
    - block navbar
      %header#admin-navbar.navbar.navbar-static-top{ role:"banner"}
        .container
          .navbar-header
            %button.navbar-toggle{ type:"button", data-toggle:"collapse", data-target:"#admin-top-navbar-collapse"}
              %span.sr-only
                - trans "Toggle navigation"
              %span.icon-bar
              %span.icon-bar
              %span.icon-bar

          #admin-brand.navbar-brand
            - if not org
              - trans "ChatPro"
            - else
              {{ org.name }}

          %nav#admin-top-navbar-collapse.admin-top-navbar.collapse.navbar-collapse{ role:"navigation"}
            %ul.nav.navbar-nav
              -if request.user.is_superuser
                %li.dropdown
                  %a.dropdown-toggle{href:"#", data-toggle:"dropdown"}
                    - trans "Site Manage"
                    %b.caret
                  %ul.dropdown-menu
                    %li
                      %a{href:"{% url 'orgs_ext.org_list' %}"}
                        - trans "Orgs"
                    %li
                      %a{ href:"{% url 'profiles.admin_list' %}"}
                        - trans "Users"

              -if org_perms.orgs.org_home or org_perms.rooms.room_list or org_perms.profiles.profile_user_list
                %li.dropdown
                  %a.dropdown-toggle{href:"#", data-toggle:"dropdown"}
                    - trans "Administration"
                    %b.caret
                  %ul.dropdown-menu
                    - if org_perms.orgs.org_home
                      %li
                        %a{ href:"{% url 'orgs_ext.org_home' %}" }
                          - trans "Organization"

                    - if org_perms.rooms.room_list
                      %li
                        %a{ href:"{% url 'rooms.room_list' %}" }
                          - trans "Rooms"

                    - if org_perms.profiles.profile_user_list
                      %li
                        %a{ href:"{% url 'profiles.user_list' %}" }
                          - trans "Supervisors"

              - if org and request.user.is_authenticated
                %li
                  %a{ href:"/" }
                    - trans "Chat"

                - if org_perms.profiles.contact_list
                  %li
                    %a{ href:"{% url 'profiles.contact_list' %}" }
                      - trans "Contacts"

            %ul.nav.navbar-nav.navbar-right
              - block login
                - if request.user and request.user.is_authenticated
                  %li
                    - if request.user.profile
                      %a{ href:"{% url 'profiles.user_read' request.user.pk %}", style:"float: left;"}
                        {{ request.user.email }}
                    - else
                      %p.navbar-text{ style:"float: left;"}
                        {{ request.user.username }}
                    %a{ href:"{% url 'users.user_logout' %}?go=/", style:"float: right;"}
                      %span.glyphicon.glyphicon-log-out
                      - trans "Logout"
                - else
                  %li
                    %a{ href:"{% url 'users.user_login' %}"}
                      %span.glyphicon.glyphicon-log-in
                      - trans "Login"

    .container
      - block content-div
        .content
          - block messages
            - if messages
              - for message in messages
                .alert{ class:"alert-={ message.tags }"}
                  %a.close{ data-dismiss:"alert"}
                    ×
                  {{ message }}

          - block pre-content
          - block content

    .footer-container
      .container
        %footer
          {% include 'lang_switcher.haml' %}

    <!-- JavaScript at the bottom for fast page loading -->
    <script type="text/javascript" src="{{ STATIC_URL }}js/libs/jquery.1.11.1.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/angular.min.js"></script>
    <script type='text/javascript' src='{{ STATIC_URL }}js/ng-infinite-scroll.min.js'></script>

    {% compress js %}
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/chat.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/services.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/filters.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/controllers.coffee" }
    {% endcompress %}

    <script type="text/javascript">
      $(function(){
        /* TODO figure out conflict with Angular that's breaking all submit buttons */
        $('button[type="submit"]').on('click', function() {
          $(this).closest('form').submit();
        });
      });
    </script>

    {# media associated with any form we are displaying #}
    {% if form %}
    {{ form.media }}
    {% endif %}

    {% block extra-script %}{% endblock %}
    {% block script %}{% endblock %}<commit_msg>Workaround to fix forms in RTL mode<commit_after><!doctype html>
- load compress thumbnail smartmin i18n
%html{ dir:"{{ lang_direction }}", ng-app:"chat"}

  %head
    %meta{ charset:"utf-8"}
    %title
      - block title
        - if not org
          - trans "Chat"
        - else
          {{ org.name }}
      - block subtitle
        &nbsp;
    %meta{ name:"description", content:""}
    %meta{ name:"author", content:""}

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->

    <!-- Mobile viewport optimized: j.mp/bplateviewport -->
    %meta{ name:"viewport", content:"width=device-width, initial-scale=1.0"}

    <!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
    %link{ rel:"icon", type:"image/x-icon", href:"{{ STATIC_URL }}img/favicon.png"}

    :css
    - compress css
      - block styles
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/bootstrap.css"}
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/bootstrap-theme.css"}
        %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/smartmin_styles.css"}
        %link{ type:"text/less", rel:"stylesheet", href:"{{ STATIC_URL }}less/chat.less"}

    - block extra-less
    - block extra-style

    {% if lang_direction == 'ltr' %}
      %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/chat-ltr.css"}
    {% elif lang_direction == 'rtl' %}
      %link{ type:"text/css", rel:"stylesheet", href:"{{ STATIC_URL }}css/chat-rtl.css"}
    {% endif %}

  %body.pattern-bg
    - block navbar
      %header#admin-navbar.navbar.navbar-static-top{ role:"banner"}
        .container
          .navbar-header
            %button.navbar-toggle{ type:"button", data-toggle:"collapse", data-target:"#admin-top-navbar-collapse"}
              %span.sr-only
                - trans "Toggle navigation"
              %span.icon-bar
              %span.icon-bar
              %span.icon-bar

          #admin-brand.navbar-brand
            - if not org
              - trans "ChatPro"
            - else
              {{ org.name }}

          %nav#admin-top-navbar-collapse.admin-top-navbar.collapse.navbar-collapse{ role:"navigation"}
            %ul.nav.navbar-nav
              -if request.user.is_superuser
                %li.dropdown
                  %a.dropdown-toggle{href:"#", data-toggle:"dropdown"}
                    - trans "Site Manage"
                    %b.caret
                  %ul.dropdown-menu
                    %li
                      %a{href:"{% url 'orgs_ext.org_list' %}"}
                        - trans "Orgs"
                    %li
                      %a{ href:"{% url 'profiles.admin_list' %}"}
                        - trans "Users"

              -if org_perms.orgs.org_home or org_perms.rooms.room_list or org_perms.profiles.profile_user_list
                %li.dropdown
                  %a.dropdown-toggle{href:"#", data-toggle:"dropdown"}
                    - trans "Administration"
                    %b.caret
                  %ul.dropdown-menu
                    - if org_perms.orgs.org_home
                      %li
                        %a{ href:"{% url 'orgs_ext.org_home' %}" }
                          - trans "Organization"

                    - if org_perms.rooms.room_list
                      %li
                        %a{ href:"{% url 'rooms.room_list' %}" }
                          - trans "Rooms"

                    - if org_perms.profiles.profile_user_list
                      %li
                        %a{ href:"{% url 'profiles.user_list' %}" }
                          - trans "Supervisors"

              - if org and request.user.is_authenticated
                %li
                  %a{ href:"/" }
                    - trans "Chat"

                - if org_perms.profiles.contact_list
                  %li
                    %a{ href:"{% url 'profiles.contact_list' %}" }
                      - trans "Contacts"

            %ul.nav.navbar-nav.navbar-right
              - block login
                - if request.user and request.user.is_authenticated
                  %li
                    - if request.user.profile
                      %a{ href:"{% url 'profiles.user_read' request.user.pk %}", style:"float: left;"}
                        {{ request.user.email }}
                    - else
                      %p.navbar-text{ style:"float: left;"}
                        {{ request.user.username }}
                    %a{ href:"{% url 'users.user_logout' %}?go=/", style:"float: right;"}
                      %span.glyphicon.glyphicon-log-out
                      - trans "Logout"
                - else
                  %li
                    %a{ href:"{% url 'users.user_login' %}"}
                      %span.glyphicon.glyphicon-log-in
                      - trans "Login"

    .container
      - block content-div
        .content
          - block messages
            - if messages
              - for message in messages
                .alert{ class:"alert-={ message.tags }"}
                  %a.close{ data-dismiss:"alert"}
                    ×
                  {{ message }}

          - block pre-content
          - block content

    .footer-container
      .container
        %footer
          {% include 'lang_switcher.haml' %}

    <!-- JavaScript at the bottom for fast page loading -->
    <script type="text/javascript" src="{{ STATIC_URL }}js/libs/jquery.1.11.1.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/angular.min.js"></script>
    <script type='text/javascript' src='{{ STATIC_URL }}js/ng-infinite-scroll.min.js'></script>

    {% compress js %}
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/chat.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/services.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/filters.coffee" }
    %script{ type:"text/coffeescript", src:"{{ STATIC_URL }}coffee/controllers.coffee" }
    {% endcompress %}

    :javascript
      $(function(){
        /* TODO figure out conflict with Angular that's breaking all submit buttons */
        $('button[type="submit"]').on('click', function() {
          $(this).closest('form').submit();
        });
      });

    - if lang_direction == 'rtl'
      :javascript
        $(function() {
          // Smartmin forms use Bootstrap grids which don't change in RTL mode. This is a workaround to switch the order
          // of the control labels and fields if we're in RTL.
          $('.smartmin-form .form-group').each(function() {
            var label = $(this).find('label.control-label');
            var field = $(this).find('.smartmin-form-field');
            if (label && field) {
              field.after(label);
            }
          });
        });

    {# media associated with any form we are displaying #}
    {% if form %}
    {{ form.media }}
    {% endif %}

    {% block extra-script %}{% endblock %}
    {% block script %}{% endblock %}
{'fraction_non_alphanumeric': 0.1481007255655143, 'fraction_numerical': 0.002134016218523261, 'mean_word_length': 1.586752529898804, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '2931444', 'n_tokens_mistral': 4247, 'n_tokens_neox': 3917, 'n_words': 840}