From 723d6244e01e99fc0de386066fc3d62f784ccfdd 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 Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer --- about.pl | 66 ++++++--- .../prog/en/includes/about-team.inc | 131 ++++++++++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 120 +++------------- 3 files changed, 192 insertions(+), 125 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc diff --git a/about.pl b/about.pl index 0a7300ce4d..1020490899 100755 --- a/about.pl +++ b/about.pl @@ -530,35 +530,53 @@ 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 = -e "$docdir" . "/contributors.yaml" ? 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+)$/; @@ -566,6 +584,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..e61d334ef8 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/about-team.inc @@ -0,0 +1,131 @@ +[%- BLOCK role -%] + [%- SWITCH role.key -%] + [%- CASE 'manager' -%]Release manager + [%- CASE 'manager_assistant' -%]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 'translation_assistant' -%]Translation manager assistant + [%- CASE 'te' -%]Topic expert + [%- CASE 'bugwrangler' -%]Bug wrangler + [%- CASE 'maintainer' -%]Release maintainer + [%- CASE 'maintainer_assistant' -%]Release maintainer assistant + [%- CASE 'wiki' -%]Wiki curator + [%- CASE 'ci' -%]Continuous 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 -%] +
    + [% FOREACH r IN p.roles %]
  • [% INCLUDE role role=r %] ([% r.value.join(', ') | html %])
  • [% END %] + [% IF p.notes %]
  • [% p.notes | html %]
  • [% END %] +
+[%- END -%] +[%- END -%] + +[%- BLOCK team -%] +
    + +
  • Release manager: + [% INCLUDE person p=t.manager %] +
  • + + [% IF t.manager_assistants %] +
  • Release manager assistants: +
      + [% FOREACH a IN t.assistants %] +
    • [% INCLUDE person p=a %]
    • + [% END %] +
    +
  • + [% ELSIF t.manager_assistant %] +
  • Release manager assistant: + [% INCLUDE person p=t.manager_assistant %] +
  • + [% END %] + + [% IF t.qa_manager %] +
  • Quality assurance manager: + [% INCLUDE person p=t.qa_manager %] +
  • + [% END %] + + [% IF t.qa %] +
  • Quality assurance team: +
      + [% FOREACH qa IN t.qa %] +
    • [% INCLUDE person p=qa %]
    • + [% END %] +
    +
  • + [% END %] + + [% IF t.documentation %] +
  • Documentation Manager: + [% INCLUDE person p=t.documentation %] +
  • + [% END %] + + [% IF t.documentation_team %] +
  • Documentation Team: +
      + [% FOREACH doc_member IN t.documentation_team %] +
    • [% INCLUDE person p=doc_member %]
    • + [% END %] +
    +
  • + [% END %] + + [% IF t.translation %] +
  • Translation manager: + [% INCLUDE person p=t.translation %] +
  • + [% END %] + + [% IF t.packaging %] +
  • Packaging manager: + [% INCLUDE person p=t.packaging %] +
  • + [% END %] + + [% IF t.ci %] +
  • Jenkins maintainer: + [% INCLUDE person p=t.ci %] +
  • + [% END %] + + [% IF t.bugwrangler %] +
  • Bug wranglers: +
      + [% FOREACH bugwrangler IN t.bugwrangler %] +
    • [% INCLUDE person p=bugwrangler %]
    • + [% END %] +
    +
  • + [% END %] + +
  • Release maintainers: +
      + [% FOREACH m IN t.maintainer %] +
    • [% m.version | html %] - [% INCLUDE person p=m %]
    • + [% END %] +
    +
  • + +
+[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 39216984bc..abc01b3f16 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 | html %] 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

    [% IF contributors.size %] @@ -803,41 +757,3 @@ [% END %] [% INCLUDE 'intranet-bottom.inc' %] - -[%- BLOCK role -%] - [%- SWITCH role.key -%] - [%- CASE 'manager' -%]Release manager - [%- CASE 'manager_assistant' -%]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 'translation_assistant' -%]Translation manager assistant - [%- CASE 'te' -%]Topic expert - [%- CASE 'bugwrangler' -%]Bug wrangler - [%- CASE 'maintainer' -%]Release maintainer - [%- CASE 'maintainer_assistant' -%]Release maintainer assistant - [%- CASE 'wiki' -%]Wiki curator - [%- CASE 'ci' -%]Continuous 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 -%] -
      - [% FOREACH r IN p.roles %]
    • [% INCLUDE role role=r %] ([% r.value.join(', ') | html %])
    • [% END %] - [% IF p.notes %]
    • [% p.notes | html %]
    • [% END %] -
    -[%- END -%] -[%- END -%] -- 2.20.1