<commit_before>-# This file is part of Thinks.

-# Thinks is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.

-# Thinks is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero Public License for more details.

-# You should have received a copy of the GNU Affero Public License
-# along with Thinks.  If not, see <http://www.gnu.org/licenses/>.

-# Copyright (c) 2015, <NAME>

#filterrific_results
  .row
    .col-xs-4
      %h4
        = @local_thinker.name
    .col-xs-4.text-center
      %h4
        = @project.title
    .col-xs-4.text-right
      %h4
        = DateTime.now.to_s(:long)
  %hr
  - if @first_section
    %h3
      Section 1: Summary sprint
    .row
      .col-xs-3
        - if @local_thinker.avatar
          = cl_image_tag(@local_thinker.avatar.path, { size: '150x150', class: 'team-member-img pull-left' })
      .col-xs-9
        .row
          %label.control-label.text-right.col-xs-2
            Name:
          %label.control-label.col-xs-10.label-normal
            = @local_thinker.name
        - if @local_thinker.sex.present?
          .row
            %label.control-label.text-right.col-xs-2
              Age:
            %label.control-label.col-xs-10.label-normal
              = @local_thinker.born_at.to_s(:long)
        - if @local_thinker.sex.present?
          .row
            %label.control-label.text-right.col-xs-2
              Gender:
            %label.control-label.col-xs-10.label-normal
              = t "sex.#{@local_thinker.sex.t_name}"
        .row
          %label.control-label.text-right.col-xs-2
            Joined at:
          %label.control-label.col-xs-10.label-normal
            = @local_thinker.created_at.to_s(:long)
    %hr
    .row
      - last_sprint     = @statistic.sprints.last
      - previous_sprint = last_sprint.previous
      - previous_previous_sprint = nil
      - if previous_sprint.present?
        - previous_previous_sprint = previous_sprint.previous
      - tasks_done      = @statistic.tasks.done

      - tasks_done_last_sprint = tasks_done.where('end_at < ?', last_sprint.created_at).where('end_at >= ?', previous_sprint.try(:created_at))

      - tasks_in_progress = @statistic.tasks.in_progress
      - tasks_in_progress_last_sprint = tasks_in_progress.where('end_at < ?', last_sprint.created_at).where('end_at >= ?', previous_sprint.try(:created_at))

      .col-xs-4.text-center
        %h4 Last sprint
        = render partial: 'numeric_summary', locals: { tasks_done: tasks_done_last_sprint, tasks_in_progress: tasks_in_progress_last_sprint }
      .col-xs-4.text-center
        %h4 Previous sprint
        - if previous_previous_sprint.present?
          - tasks_done_previous_sprint = tasks_done.where('end_at < ?', previous_sprint.created_at).where('end_at >= ?', previous_previous_sprint.try(:created_at))
          - tasks_in_progress_previous_sprint = tasks_in_progress.where('end_at < ?', previous_sprint.created_at).where('end_at >= ?', previous_previous_sprint.try(:created_at))
          = render partial: 'numeric_summary', locals: { tasks_done: tasks_done_previous_sprint, tasks_in_progress: tasks_in_progress_previous_sprint }
        - else
          %ul.list-group
            %li.list-group-item.list-group-item-warning
              = t ".related_info_limited"
      .col-xs-4.text-center
        %h4 Average
        .row
          %label.control-label.col-xs-6
            Tasks done:
          %label.control-label.col-xs-6.label-normal
            - numbers_of_tasks = @statistic.sprints.collect { |sprint| sprint.project.tasks.where('end_at < ?', sprint.created_at).where('end_at >= ?', sprint.previous.try(:created_at)).count }
            = numbers_of_tasks.inject{ |sum, el| sum + el }.to_f / numbers_of_tasks.size
        .row
          %label.control-label.col-xs-6
            Workload:
          %label.control-label.col-xs-6.label-normal
            = @statistic.sprints.average(:obtained)
    %hr
    %h4
      Last sprint 'Burn up'
    - total_workload = 0
    - burn_up_data   = tasks_done_last_sprint.group_by_period(:day, :end_at).where('end_at >= ?', last_sprint.created_at).order('max(end_at)').sum(:workload)
    - if burn_up_data.empty?
      - burn_up_data = { last_sprint.created_at => 0 }
    - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
    = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '90%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }
    %hr
    %h4
      Previous sprint 'Burn up'
    - if previous_previous_sprint.present?
      - total_workload = 0
      - burn_up_data   = tasks_done_previous_sprint.group_by_period(:day, :end_at).where('end_at >= ?', previous_sprint.created_at).order('max(end_at)').sum(:workload)
      - if burn_up_data.empty?
        - burn_up_data = { previous_sprint.created_at => 0 }
      - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
      = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '90%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }
    - else
      %ul.list-group<commit_msg>Update for Section 1<commit_after>-# This file is part of Thinks.

-# Thinks is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.

-# Thinks is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero Public License for more details.

-# You should have received a copy of the GNU Affero Public License
-# along with Thinks.  If not, see <http://www.gnu.org/licenses/>.

-# Copyright (c) 2015, <NAME>

#filterrific_results
  .row
    .col-xs-4
      %h4
        = @local_thinker.name
    .col-xs-4.text-center
      %h4
        = @project.title
    .col-xs-4.text-right
      %h4
        = DateTime.now.to_s(:long)
  %hr
  - if @first_section
    %h3
      Section 1: Summary sprint
    .row
      .col-xs-3
        - if @local_thinker.avatar
          = cl_image_tag(@local_thinker.avatar.path, { size: '150x150', class: 'team-member-img pull-left' })
      .col-xs-9
        .row
          %label.control-label.text-right.col-xs-2
            Name:
          %label.control-label.col-xs-10.label-normal
            = @local_thinker.name
        - if @local_thinker.sex.present?
          .row
            %label.control-label.text-right.col-xs-2
              Age:
            %label.control-label.col-xs-10.label-normal
              = @local_thinker.born_at.to_s(:long)
        - if @local_thinker.sex.present?
          .row
            %label.control-label.text-right.col-xs-2
              Gender:
            %label.control-label.col-xs-10.label-normal
              = t "sex.#{@local_thinker.sex.t_name}"
        .row
          %label.control-label.text-right.col-xs-2
            Joined at:
          %label.control-label.col-xs-10.label-normal
            = @local_thinker.created_at.to_s(:long)
    %hr
    .row
      - last_sprint     = @statistic.sprints.last
      - previous_sprint = last_sprint.previous
      - previous_previous_sprint = nil
      - if previous_sprint.present?
        - previous_previous_sprint = previous_sprint.previous
      - tasks_done      = @statistic.tasks.done

      - tasks_done_last_sprint = tasks_done.where('end_at < ?', last_sprint.created_at).where('end_at >= ?', previous_sprint.try(:created_at))

      - tasks_in_progress = @statistic.tasks.in_progress
      - tasks_in_progress_last_sprint = tasks_in_progress.where('end_at < ?', last_sprint.created_at).where('end_at >= ?', previous_sprint.try(:created_at))

      .col-xs-4.text-center
        %h4 Last sprint
        = render partial: 'numeric_summary', locals: { tasks_done: tasks_done_last_sprint, tasks_in_progress: tasks_in_progress_last_sprint }
      .col-xs-4.text-center
        %h4 Previous sprint
        - if previous_previous_sprint.present?
          - tasks_done_previous_sprint = tasks_done.where('end_at < ?', previous_sprint.created_at).where('end_at >= ?', previous_previous_sprint.try(:created_at))
          - tasks_in_progress_previous_sprint = tasks_in_progress.where('end_at < ?', previous_sprint.created_at).where('end_at >= ?', previous_previous_sprint.try(:created_at))
          = render partial: 'numeric_summary', locals: { tasks_done: tasks_done_previous_sprint, tasks_in_progress: tasks_in_progress_previous_sprint }
        - else
          %ul.list-group
            %li.list-group-item.list-group-item-warning
              = t ".related_info_limited"
      .col-xs-4.text-center
        %h4 Average
        .row
          %label.control-label.col-xs-6
            Tasks done:
          %label.control-label.col-xs-6.label-normal
            - numbers_of_tasks = @statistic.sprints.collect { |sprint| sprint.project.tasks.where('end_at < ?', sprint.created_at).where('end_at >= ?', sprint.previous.try(:created_at)).count }
            = (numbers_of_tasks.inject{ |sum, el| sum + el }.to_f / numbers_of_tasks.size).round(1)
        .row
          %label.control-label.col-xs-6
            Workload:
          %label.control-label.col-xs-6.label-normal
            = @statistic.sprints.average(:obtained).round(2)
    %hr
    %h4
      Last sprint 'Burn up'
    - total_workload = 0
    - burn_up_data   = tasks_done_last_sprint.group_by_period(:day, :end_at).where('end_at >= ?', last_sprint.created_at).order('max(end_at)').sum(:workload)
    - if burn_up_data.empty?
      - burn_up_data = { last_sprint.created_at => 0 }
    - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
    = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '90%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }
    %hr
    %h4
      Previous sprint 'Burn up'
    - if previous_previous_sprint.present?
      - total_workload = 0
      - burn_up_data   = tasks_done_previous_sprint.group_by_period(:day, :end_at).where('end_at >= ?', previous_sprint.created_at).order('max(end_at)').sum(:workload)
      - if burn_up_data.empty?
        - burn_up_data = { previous_sprint.created_at => 0 }
      - burn_up_data = burn_up_data.transform_keys { |key| key.strftime('%B %d') }
      = area_chart burn_up_data.each { |key, value| burn_up_data[key] = total_workload += value }, discrete: true, library: { chartArea: { width: '90%', height: '90%' }, hAxis: { textPosition: 'none' }, pointSize: 8 }
    - else
      %ul.list-group
{'fraction_non_alphanumeric': 0.12619879896029398, 'fraction_numerical': 0.010845209285650264, 'mean_word_length': 2.6110032362459545, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1206079', 'n_tokens_mistral': 3800, 'n_tokens_neox': 3721, 'n_words': 682}