From 913febc11b751ba77fbff10f06c8b33846a20812 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Apr 2019 14:33:30 +0100 Subject: [PATCH] Bug 21626: Use teams.yaml for teams section --- about.pl | 66 ++++++--- .../prog/en/includes/about-team.inc | 134 ++++++++++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 123 +++------------- 3 files changed, 195 insertions(+), 128 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc diff --git a/about.pl b/about.pl index 62d15edf16..4216c3793d 100755 --- a/about.pl +++ b/about.pl @@ -530,32 +530,50 @@ if ( defined C4::Context->config('docdir') ) { $docdir = C4::Context->config('intranetdir') . '/docs'; } +## Release teams +my $teams = LoadFile("$docdir"."/teams.yaml"); +my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0]; +my $short_version = substr($versions{'kohaVersion'},0,5); +my $minor = substr($versions{'kohaVersion'},3,2); +my $development_version = ( $minor eq '05' || $minor eq '11' ) ? 0 : 1; +$template->param( short_version => $short_version ); +$template->param( development_version => $development_version ); + ## Contributors my $contributors = LoadFile("$docdir"."/contributors.yaml"); -my @people = map { - { - name => $_, - ( - exists( $contributors->{$_}->{openhub} ) - ? ( openhub => $contributors->{$_}->{openhub} ) - : () - ), - ( - exists( $contributors->{$_}->{roles} ) - ? ( roles => $contributors->{$_}->{roles} ) - : () - ), - ( - exists( $contributors->{$_}->{commits} ) - ? ( commits => $contributors->{$_}->{commits} ) - : () - ), - ( - exists( $contributors->{$_}->{notes} ) - ? ( notes => $contributors->{$_}->{notes} ) - : () - ) +for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) { + for my $role ( keys %{ $teams->{team}->{$version} } ) { + my $normalized_role = "$role"; + $normalized_role =~ s/s$//; + if ( ref( $teams->{team}->{$version}->{$role} ) eq 'ARRAY' ) { + for my $contributor ( @{ $teams->{team}->{$version}->{$role} } ) { + my $name = $contributor->{name}; + # Add role to contributors + push @{ $contributors->{$name}->{roles}->{$normalized_role} }, + $version; + # Add openhub to teams + if ( exists( $contributors->{$name}->{openhub} ) ) { + $contributor->{openhub} = $contributors->{$name}->{openhub}; + } + } + } + else { + my $name = $teams->{team}->{$version}->{$role}->{name}; + # Add role to contributors + push @{ $contributors->{$name}->{roles}->{$normalized_role} }, + $version; + # Add openhub to teams + if ( exists( $contributors->{$name}->{openhub} ) ) { + $teams->{team}->{$version}->{$role}->{openhub} = + $contributors->{$name}->{openhub}; + } + } } +} + +## Create last name ordered array of people from contributors +my @people = map { + { name => $_, ( $contributors->{$_} ? %{ $contributors->{$_} } : () ) } } sort { my ($alast) = $a =~ /(\S+)$/; my ($blast) = $b =~ /(\S+)$/; @@ -563,6 +581,8 @@ my @people = map { } keys %{$contributors}; $template->param( contributors => \@people ); +$template->param( maintenance_team => $teams->{team}->{$dev_team} ); +$template->param( release_team => $teams->{team}->{$short_version} ); ## Timeline if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc new file mode 100644 index 0000000000..a2d709064e --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc @@ -0,0 +1,134 @@ +[%- BLOCK role -%] + [%- SWITCH role.key -%] + [%- CASE 'manager' -%]Release manager + [%- CASE 'manager_assistant' -%]Release manager assistant + [%- CASE 'manager_assistants' -%]Release manager assistant + [%- CASE 'qa_manager' -%]Quality assurance manager + [%- CASE 'qa' -%]Quality assurance team + [%- CASE 'documentation' -%]Documentation manager + [%- CASE 'documentation_team' -%]Documentation team + [%- CASE 'translation' -%]Translation manager + [%- CASE 'translations' -%]Translation manager + [%- CASE 'translation_assistant' -%]Translation manager assistant + [%- CASE 'te' -%]Topic expert + [%- CASE 'bugwrangler' -%]Bug wrangler + [%- CASE 'maintainer' -%]Release maintainer + [%- CASE 'maintainer_assistant' -%]Release maintainer assistant + [%- CASE 'maintainer_assistants' -%]Release maintainer assistant + [%- CASE 'wiki' -%]Wiki curator + [%- CASE 'ci' -%]Continious integration manager + [%- CASE 'packaging' -%]Packaging manager + [%- CASE 'packaging_assistant' -%]Packaging manager assistant + [%- CASE 'chairperson' -%]Meetings chairperson + [%- CASE 'newsletter' -%]Newsletter editor + [%- CASE 'mm' -%]Module maintainer + [%- CASE 'vm' -%]Virtual machine maintainer + [%- CASE 'database' -%]Documentation specialist + [%- CASE 'live_cd' -%]Live CD maintainer + [%- END -%] +[%- END -%] + +[%- BLOCK person -%] +[% IF p.openhub %][% p.name | html %][% ELSE %][% p.name | html %][% END %] +[%- END -%] + +[%- BLOCK contributions -%] +[%- IF p.roles || p.notes -%] + +[%- END -%] +[%- END -%] + +[%- BLOCK team -%] + +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 7d73345dbb..981bd57fb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -8,6 +8,7 @@ [% INCLUDE 'header.inc' %] +[% PROCESS 'about-team.inc' %] @@ -403,70 +404,23 @@
  • Albany Senior High School, Auckland, New Zealand (OPAC 'star-ratings' sponsorship)
  • -

    Koha 18.11 release team

    - +

    Koha release teams

    +
    +
    +

    Koha [% short_version %] release team

    + [% IF development_version %] +

    You are running a development version of Koha

    + [% ELSE %] + [% INCLUDE team t=release_team %] + [% END %] +
    + +
    +

    Current maintainence team

    + + [% INCLUDE team t=maintenance_team %] +
    +

    Koha development team