<commit_before>= kujaku do |k|
  - k.text
  -# k.choice :all, :healthy, :illness
  - k.helper :journal_period_crit
  - k.helper do
    %label= Production.human_attribute_name(:variant)
    = select_tag(:variant_id, options_for_select([[]] + ProductNatureVariant.of_variety(:animal).order(:name).collect{|u| [u.name, u.id]}, params[:variant_id]))

- main_toolbar do |t|
  - t.export do |e|
    - e.animal_list Time.now.to_s, @animals

= janus do |j|
  - j.face :list do
    = main_list

  - j.face :column do
    - content_for :main_toolbar do

      = dropdown_button do |l|
        - l.link_to 'Intervention', '#'
        - l.link_to 'Intervention2', '#'

      = tool_to 'Vendre', '#'
      = tool_to 'Mettre en pension', '#'

    .container-fluid
      .row.animal-summary
        .col-md-3
          .alert.alert-success{:role => "alert"}
            18
          .alert.alert-warning{:role => "alert"}
            1
          .alert.alert-danger{:role => "alert"}
            1
          .alert.alert-info{:role => "alert"}
            1
      .row.animal-viewport{data: {animals_data: @animals_data.to_json, animals_groups: @animals_groups.to_json, animals_containers: @animals_containers.to_json  }}
        .animal-group-container{"data-bind" => "sortable: {template: 'animal-group-template', data: groups, options: {handle: '.animal-group-dragger', cursor: 'move', tolerance: 'pointer', placeholder: 'sorting-group-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 0.8, items: '> .animal-group'}}"}
        %script#animal-group-template{:type => "text/html"}
          .animal-group
            .panel.panel-default
              .panel-heading
                .row
                  .col-md-1.no-padding.xs-h-padding
                    %i.icon.icon-ellipsis-v.animal-group-dragger.text-muted
                  .col-md-9.no-padding.xs-h-padding
                    %span.animal-group-title
                      %i.icon.icon-square
                      %span{"data-bind" => "text: name"}
                  .col-md-2.pull-right.no-padding.xs-h-padding
                    .pull-right.btn-group.btn-group-xs{"aria-label" => "...", :role => "group"}
                      %button.btn.btn-default.btn-hover.animal-all-selector{"data-bind" => "checkbox: toggleItems", :type => "button"}
                        %i.icon.icon-check-square-o
              .panel-body.no-padding
                %ul.list-group.animal-list-group{"data-bind" => "sortable: {template: 'animal-container-template', data: $root.filteredContainers($data), options: {handle: '.animal-container-dragger', cursor: 'move', tolerance: 'pointer', placeholder: 'sorting-container-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 0.8}}"}
                .add-container
                  %button.btn.btn-link{"data-target" => "#new-container", "data-toggle" => "modal", :type => "button"}
                    %i.icon.icon-plus.text-muted
              .panel-footer
                %button.btn.btn-link{"data-target" => "#new-animal", "data-toggle" => "modal", :type => "button"}
                  %i.icon.icon-plus-circle
                  Nouvel animal
        %script#animal-container-template{:type => "text/html"}
          %li.list-group-item.animal-container
            .row.toggle.list-group-item-title.no-right-left-margin
              .col-md-1.no-padding.xs-h-padding
                %i.icon.icon-ellipsis-v.animal-container-dragger.text-muted
              .col-md-8.no-padding.xs-h-padding
                %span.animal-container-title{"data-bind" => "text: name"}
              .col-md-3.no-padding.xs-h-padding
                %span.badge.animal-container-badge{"data-bind" => "text: animalCount"}
                .pull-right.btn-group.btn-group-xs{"aria-label" => "...", :role => "group"}
                  / <button type="button" class="btn btn-default btn-hover btn-xs"><i class="fa icon-pencil"></i></button>
                  %button.btn.btn-default.btn-xs.btn-hover.animal-container-collapse-handler{"data-bind" => "click: toggle", :type => "button"}
                    %i.icon.icon-caret-down
            %div{"data-bind" => "css: {'hide':hidden}"}
              %div{"data-bind" => "sortable: {template: 'animal-element-template', data: $root.animals, dragged: $root.animalSortableHelper, options: {handle: '.animal-element-dragger', cursor: 'move', placeholder: 'sorting-animal-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 1, revert: true}}"}
        %script#animal-element-template{:type => "text/html"}
          /ko if: $parent.id == container_id()
          .animal-element.row.no-right-left-margin
            .animal-element-img.no-padding{"data-bind" => "css: animalStatusClass"}
              %img{"data-bind" => "attr: {src: img}"}
            .animal-element-infos
              %i.icon.icon-venus.text-muted{"data-bind" => "if: sex == 0"}
              %i.icon.icon-mars.text-muted{"data-bind" => "if: sex == 1"}
              / <button type="button" class="btn btn-link no-padding xs-h-padding animal-element-name" data-toggle="modal" data-target="#view-animal" data-bind="text: name"></button>
              %button.btn.btn-link.no-padding.xs-h-padding.animal-element-name{"data-bind" => "click: $root.toggleAnimalDetailsModal", :type => "button"}
                %span{"data-bind" => "text: name"}
            .animal-element-actions.no-padding
              .pull-right.animal-selector
                %button.btn.btn-default.btn-xs.btn-hover.checker{"data-bind" => "checkbox: checked", :type => "button"}
                  %span.icon.icon-check.check-icon
            .animal-element-dragger
              %i.icon.icon-ellipsis-v.animal-element-handler.text-muted
          / /ko

        .add-group-panel-container
          .panel.panel-default
            .panel-heading
              .add-group-btn
                %button.btn.btn-link{"data-target" => "#new-group", "data-toggle" => "modal", :type => "button"}
                  %i.icon.icon-5x.icon-plus.text-muted
    #new-animal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newAnimal", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newAnimalTitle.modal-title Nouvel animal
          .modal-body
            .btn-group-vertical{"aria-label" => "...", :role => "group"}
              %button.btn.btn-default{:type => "button"} Achat
              %button.btn.btn-default{:type => "button"} Pension
              %button.btn.btn-default{:type => "button"} Naissance
              %button.btn.btn-default{:type => "button"} D&eacute;claration
    #new-action-animal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newActionAnimal", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newAnimalTitle.modal-title Nouvelle action
          .modal-body
            .btn-group-vertical{"aria-label" => "...", :role => "group"}
              %button.btn.btn-default{:type => "button"} Vendre
              %button.btn.btn-default{:type => "button"} Vacciner
    #new-group.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newGroup", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newGroupTitle.modal-title Nouveau Troupeau
          .modal-body
            Ajouter un nouveau troupeau
    #new-container.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newContainer", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newContainerTitle.modal-title Nouvelle zone
          .modal-body
            Ajouter une nouvelle zone
    .modal.fade{"aria-hidden" => "true", "aria-labelledby" => "viewAnimal", "data-bind" => "modal: showAnimalDetailsModal(), with: animalDetailsModalOptions", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4.modal-title Détails de l'animal
          .modal-body
            .row
              .col-md-3
                %img.img-responsive{"data-bind" => "attr: {src: img}"}
              .col-md-9
                %p
                  Nom:
                  %span{"data-bind" => "text: name"}
                %p
                  Sexe:
                  %i.icon.icon-venus{"data-bind" => "if: sex == 0"}
                  %i.icon.icon-mars{"data-bind" => "if: sex == 1"}
                %p
                  Status:
                  %span{"data-bind" => "css: animalFlagClass"}
          .modal-footer
            %button.btn.btn-link{:type => "button"}
              %i.icon.icon-plus-circle
              Plus d'infos<commit_msg>Deactivates images in animals#index to prevent errors in test<commit_after>= kujaku do |k|
  - k.text
  -# k.choice :all, :healthy, :illness
  - k.helper :journal_period_crit
  - k.helper do
    %label= Production.human_attribute_name(:variant)
    = select_tag(:variant_id, options_for_select([[]] + ProductNatureVariant.of_variety(:animal).order(:name).collect{|u| [u.name, u.id]}, params[:variant_id]))

- main_toolbar do |t|
  - t.export do |e|
    - e.animal_list Time.now.to_s, @animals

= janus do |j|
  - j.face :list do
    = main_list

  - j.face :column do
    - content_for :main_toolbar do

      = dropdown_button do |l|
        - l.link_to 'Intervention 1', '#'
        - l.link_to 'Intervention 2', '#'

      = tool_to 'Vendre', '#'
      = tool_to 'Mettre en pension', '#'

    .container-fluid
      -# # TODO Implements this in filter system
      -# .row.animal-summary
        .col-md-3
          .alert.alert-success{:role => "alert"}
            18
          .alert.alert-warning{:role => "alert"}
            1
          .alert.alert-danger{:role => "alert"}
            1
          .alert.alert-info{:role => "alert"}
            1
      .row.animal-viewport{data: {animals_data: @animals_data.to_json, animals_groups: @animals_groups.to_json, animals_containers: @animals_containers.to_json  }}
        .animal-group-container{"data-bind" => "sortable: {template: 'animal-group-template', data: groups, options: {handle: '.animal-group-dragger', cursor: 'move', tolerance: 'pointer', placeholder: 'sorting-group-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 0.8, items: '> .animal-group'}}"}
        %script#animal-group-template{:type => "text/html"}
          .animal-group
            .panel.panel-default
              .panel-heading
                .row
                  .col-md-1.no-padding.xs-h-padding
                    %i.icon.icon-ellipsis-v.animal-group-dragger.text-muted
                  .col-md-9.no-padding.xs-h-padding
                    %span.animal-group-title
                      %i.icon.icon-square
                      %span{"data-bind" => "text: name"}
                  .col-md-2.pull-right.no-padding.xs-h-padding
                    .pull-right.btn-group.btn-group-xs{"aria-label" => "...", :role => "group"}
                      %button.btn.btn-default.btn-hover.animal-all-selector{"data-bind" => "checkbox: toggleItems", :type => "button"}
                        %i.icon.icon-check-square-o
              .panel-body.no-padding
                %ul.list-group.animal-list-group{"data-bind" => "sortable: {template: 'animal-container-template', data: $root.filteredContainers($data), options: {handle: '.animal-container-dragger', cursor: 'move', tolerance: 'pointer', placeholder: 'sorting-container-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 0.8}}"}
                .add-container
                  %button.btn.btn-link{"data-target" => "#new-container", "data-toggle" => "modal", :type => "button"}
                    %i.icon.icon-plus.text-muted
              .panel-footer
                %button.btn.btn-link{data: {target: "#new-animal", toggle: "modal"}, type: "button"}
                  %i.icon.icon-plus-circle
                  Nouvel animal
        %script#animal-container-template{type: "text/html"}
          %li.list-group-item.animal-container
            .row.toggle.list-group-item-title.no-right-left-margin
              .col-md-1.no-padding.xs-h-padding
                %i.icon.icon-ellipsis-v.animal-container-dragger.text-muted
              .col-md-8.no-padding.xs-h-padding
                %span.animal-container-title{"data-bind" => "text: name"}
              .col-md-3.no-padding.xs-h-padding
                %span.badge.animal-container-badge{"data-bind" => "text: animalCount"}
                .pull-right.btn-group.btn-group-xs{"aria-label" => "...", :role => "group"}
                  / <button type="button" class="btn btn-default btn-hover btn-xs"><i class="fa icon-pencil"></i></button>
                  %button.btn.btn-default.btn-xs.btn-hover.animal-container-collapse-handler{"data-bind" => "click: toggle", :type => "button"}
                    %i.icon.icon-caret-down
            %div{"data-bind" => "css: {'hide':hidden}"}
              %div{"data-bind" => "sortable: {template: 'animal-element-template', data: $root.animals, dragged: $root.animalSortableHelper, options: {handle: '.animal-element-dragger', cursor: 'move', placeholder: 'sorting-animal-placeholder', dropOnEmpty: false, forcePlaceholderSize: true, opacity: 1, revert: true}}"}
        %script#animal-element-template{:type => "text/html"}
          /ko if: $parent.id == container_id()
          .animal-element.row.no-right-left-margin
            .animal-element-img.no-padding{"data-bind" => "css: animalStatusClass"}
              -# %img{"data-bind" => "attr: {src: img}"}
            .animal-element-infos
              %i.icon.icon-venus.text-muted{"data-bind" => "if: sex == 0"}
              %i.icon.icon-mars.text-muted{"data-bind" => "if: sex == 1"}
              / <button type="button" class="btn btn-link no-padding xs-h-padding animal-element-name" data-toggle="modal" data-target="#view-animal" data-bind="text: name"></button>
              %button.btn.btn-link.no-padding.xs-h-padding.animal-element-name{"data-bind" => "click: $root.toggleAnimalDetailsModal", :type => "button"}
                %span{"data-bind" => "text: name"}
            .animal-element-actions.no-padding
              .pull-right.animal-selector
                %button.btn.btn-default.btn-xs.btn-hover.checker{"data-bind" => "checkbox: checked", :type => "button"}
                  %span.icon.icon-check.check-icon
            .animal-element-dragger
              %i.icon.icon-ellipsis-v.animal-element-handler.text-muted
          / /ko

        .add-group-panel-container
          .panel.panel-default
            .panel-heading
              .add-group-btn
                %button.btn.btn-link{"data-target" => "#new-group", "data-toggle" => "modal", :type => "button"}
                  %i.icon.icon-5x.icon-plus.text-muted
    #new-animal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newAnimal", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newAnimalTitle.modal-title Nouvel animal
          .modal-body
            .btn-group-vertical{"aria-label" => "...", :role => "group"}
              %button.btn.btn-default{:type => "button"} Achat
              %button.btn.btn-default{:type => "button"} Pension
              %button.btn.btn-default{:type => "button"} Naissance
              %button.btn.btn-default{:type => "button"} D&eacute;claration
    #new-action-animal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newActionAnimal", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newAnimalTitle.modal-title Nouvelle action
          .modal-body
            .btn-group-vertical{"aria-label" => "...", :role => "group"}
              %button.btn.btn-default{:type => "button"} Vendre
              %button.btn.btn-default{:type => "button"} Vacciner
    #new-group.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newGroup", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newGroupTitle.modal-title Nouveau Troupeau
          .modal-body
            Ajouter un nouveau troupeau
    #new-container.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "newContainer", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4#newContainerTitle.modal-title Nouvelle zone
          .modal-body
            Ajouter une nouvelle zone
    .modal.fade{"aria-hidden" => "true", "aria-labelledby" => "viewAnimal", "data-bind" => "modal: showAnimalDetailsModal(), with: animalDetailsModalOptions", :role => "dialog", :tabindex => "-1"}
      .modal-dialog
        .modal-content
          .modal-header
            %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
              %span{"aria-hidden" => "true"} &times;
            %h4.modal-title Détails de l'animal
          .modal-body
            .row
              .col-md-3
                -# %img.img-responsive{"data-bind" => "attr: {src: img}"}
              .col-md-9
                %p
                  Nom:
                  %span{"data-bind" => "text: name"}
                %p
                  Sexe:
                  %i.icon.icon-venus{"data-bind" => "if: sex == 0"}
                  %i.icon.icon-mars{"data-bind" => "if: sex == 1"}
                %p
                  Status:
                  %span{"data-bind" => "css: animalFlagClass"}
          .modal-footer
            %button.btn.btn-link{:type => "button"}
              %i.icon.icon-plus-circle
              Plus d'infos
{'fraction_non_alphanumeric': 0.17432820245238717, 'fraction_numerical': 0.003704669971301852, 'mean_word_length': 2.0553164355172964, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 207, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '119627', 'n_tokens_mistral': 6142, 'n_tokens_neox': 5881, 'n_words': 970}